REPORT — phase5-run-entry-fixes-5-implementer
STEP: phase5-run-entry-fixes-5 (Phase 5: the loader face — F34 and the F33 clause restate)
REV: 8adc6c544277e002e7c555df395582043920f098   FINAL: 8af58e8f86359e33dafbae74d2ceee94da0e7cfe
CHANGED: src/orchestrator/run_entry.py — `load_run_spec`'s except widens past `OSError` to the decoder errors: `(yaml.YAMLError, UnicodeDecodeError)` are wrapped as `RunSpecError(f"cannot parse run-spec {path!r}: {error}")`, raised `from` the decode error; the `OSError` refusal is byte-for-byte as it was. `validate_run_spec` and everything downstream are untouched.
VERIFIED: scripts/check-tests --fast — 961 passed, 97 deselected, 65.80s, exit 0
VERIFIED: .venv/bin/python -m pytest tests/test_phase5_run_entry_fixes_4_review.py tests/test_run_entry.py tests/test_phase5_run_entry_fixes_2_review.py — 52 passed, 19.89s, exit 0
VERIFIED: scripts/check-static — exit 0 (104 advisory lint rows printed without gating; no new row)
VERIFIED: scripts/check-docs — table verification passed, links 359/359 OK, 0 errors, exit 0
VERIFIED: scripts/check-scope 8adc6c544277e002e7c555df395582043920f098 8af58e8f86359e33dafbae74d2ceee94da0e7cfe docs/research/phase5-run-entry-fixes-5-brief.md — tripped: none; scope: ok (2 path(s)), exit 0
VERIFIED: Red evidence at REV 8adc6c5 — `.venv/bin/python -m pytest tests/test_phase5_run_entry_fixes_4_review.py -k f34 -q` → 1 failed, 4 deselected, 0.20s. Named failing assertion: the probe's `pytest.fail` translation at tests/test_phase5_run_entry_fixes_4_review.py:313 — `Failed: F34: an unparseable spec file is refused as ParserError, not the documented named `RunSpecError`: ParserError('while parsing a flow sequence', …, "expected ',' or ']', but got '<stream end>'", …)`. Green at FINAL in the 52-passed battery above.
VERIFIED: Malformed-class hand probes at FINAL (`.venv/bin/python`, `load_run_spec` on written tmp files) — unparseable YAML, tab-scanned indent, NUL byte → `RunSpecError("cannot parse run-spec …")`; invalid UTF-8 bytes → `RunSpecError("cannot parse run-spec …: 'utf-8' codec …")`; empty file, wrong top-level type (a sequence), missing keys → `RunSpecError`; missing path → `RunSpecError("cannot read run-spec …")`; the refusal creates no store file (the tmp dir holds only the bad spec). Hand measurement, named in SHAPES — not a test.
NOT VERIFIED: the full unfiltered `scripts/check-tests` — per the brief, a full run is never put in ACCEPTANCE and the reviewer runs it. None otherwise.
FINDINGS:
  F34 | SEVERITY: P2 | ORIGIN: CODE | STATE: fixed
  `load_run_spec` caught only `OSError`, so `yaml.safe_load`'s decode errors escaped raw and docs/run-entry.md's fail-closed sentence, the module docstring's "Loading is fail-closed", and `RunSpecError`'s "one named failure" docstring were falsified for a spec file the YAML decoder itself cannot parse.
  FIXED: tests/test_phase5_run_entry_fixes_4_review.py::test_review_f34_unparseable_spec_file_refused_as_a_named_run_spec_error — at REV the named assertion failed at tests/test_phase5_run_entry_fixes_4_review.py:313: `Failed: F34: an unparseable spec file is refused as ParserError, not the documented named `RunSpecError`: ParserError('while parsing a flow sequence', …)` (`.venv/bin/python -m pytest tests/test_phase5_run_entry_fixes_4_review.py -k f34 -q`, 1 failed). Green at FINAL with no test edit; the `except` clause it exercises is src/orchestrator/run_entry.py:270-273.
  F35 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: fixed
  The fix order "widen `load_run_spec`'s except to catch the YAML decode errors" does not name the file-decode class that also surfaces through `yaml.safe_load`: a spec file whose bytes are not valid UTF-8 raises `UnicodeDecodeError` (not a `yaml.YAMLError`), which the literal `yaml.YAMLError`-only reading would leave escaping raw — the same documented sentence falsified one class over.
  FIXED: no regression test — the reading taken is the one consistent with the brief's GOAL that "the sentence holds as written with nothing to reword": every decoder failure the loader's read+decode can produce is the named refusal, so the except catches `(yaml.YAMLError, UnicodeDecodeError)` and wraps both (src/orchestrator/run_entry.py:270-273). No brief text correction is needed because no other reading keeps the GOAL's sentence true. The `UnicodeDecodeError` face has no committed pin; it is named in SHAPES and hand-probed at FINAL.
SHAPES: the `UnicodeDecodeError` (non-UTF-8 bytes) face of the Loader-decode refusal shape — probed at FINAL as a named `RunSpecError`, no committed pin (the absorbed probe drives the `ParserError` face only). The `OSError` face — unchanged behaviour, kept as-is, no new pin owed; hand-probed at FINAL (missing path → `RunSpecError("cannot read run-spec …")`). The Clause-restate shape is not a probe I built: its two faces are the already-committed pins `tests/test_phase5_run_entry_fixes_4_review.py::test_review_f33_residual_crafted_terminal_owned_artefact_retained` (crafted `{terminal_attempt}-artefact` id retained) and `tests/test_run_entry.py::test_stale_admission_race_log_replays`'s unknown-id assertion (an id no terminal attempt owns still raises `ReducerError`), both green in the 52-passed battery; no code or text on that surface changed.
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: none
INHERITED:
none — the received INHERITED carried exactly one open item, F34 (the fixes-4 review's carried P2, moved into this brief's body). It is fixed in this step (FINDINGS, F34); nothing is carried forward and nothing new is left open.
