REPORT — phase5-run-entry-fixes-7-review
STEP: phase5-run-entry-fixes-7 (the loader's refusal envelope — F38–F42)
REV: b7a010a1cbc984493033d9bd4872d7aeacfe9b48   FINAL: 00577a4e14fcb03e61f5868d9a8cbef7e195e1e2
CHANGED: docs/research/phase5-run-entry-fixes-7-review.md — this report (reviewer creates no test files; the evidence below is hand-driven runners on scratch copies diff-verified against git show, per the brief).
VERIFIED: scripts/check-scope b7a010a1cbc984493033d9bd4872d7aeacfe9b48 00577a4e14fcb03e61f5868d9a8cbef7e195e1e2 docs/research/phase5-run-entry-fixes-7-brief.md — exit 1, NOT green: prints `scope: src/orchestrator/run_entry.py is in the diff and not in IN SCOPE`, `scope: tests/test_run_entry_loader_envelope.py is in the diff and not in IN SCOPE`, then `tripped: none`. The two gate-named paths are exactly the diff's only two paths (`git diff --stat` names only `docs/research/phase5-run-entry-fixes-7-brief.md`, `src/orchestrator/run_entry.py`, `tests/test_run_entry_loader_envelope.py`) and both are the brief's intended files (the IN SCOPE prose names both paths, backticked); the residual half prints `tripped: none`. Substance discharged, prose defective — FFR-1.
VERIFIED: scripts/check-tests --fast — 961 passed, 104 deselected in 72.18s, exit 0 (passed unchanged from REV's 961; deselected grew from 102 by the new module's two cases).
VERIFIED: .venv/bin/python -m pytest tests/test_run_entry_loader_envelope.py tests/test_phase5_run_entry_fixes_6_review.py -v — 5 passed in 4.52s, exit 0 (2 new cases + the three absorbed F38/F39/F40 probes, green with no test edit; `git diff 76a37a5 00577a4e14fcb03e61f5868d9a8cbef7e195e1e2 -- tests/` names only the new module; `git show b7a010a:tests/test_phase5_run_entry_fixes_6_review.py` is byte-identical to the tree file).
VERIFIED: .venv/bin/python -m pytest tests/test_phase5_run_entry_fixes_5_review.py tests/test_phase5_run_entry_fixes_4_review.py tests/test_run_entry.py tests/test_phase5_run_entry_fixes_2_review.py — 54 passed in 22.34s, exit 0 (2 + 5 + 40 + 7; the loader's whole committed battery, no regression).
VERIFIED: .venv/bin/python -m pytest tests/test_phase3_project_oracle.py — 5 passed in 220.45s, exit 0.
VERIFIED: scripts/check-tests — 1065 passed in 446.31s, exit 0 (full suite, reviewer's falsification ground; no failure).
VERIFIED: scripts/check-static — exit 0. Gated `ruff check --select BLE001,S110 src/orchestrator` clean; advisory `B,SIM --exit-zero` prints `Found 104 errors` (104 rows, unchanged from the fixes-6 step).
VERIFIED: scripts/check-docs — exit 0. Prints `366 Total 170 Unique 366 OK 0 Errors` (the gate's own line; +2 over the brief's predicted 361 is FFR-2's named cause — the brief's own two `[record.md](../record.md)` links, lychee scanning `**/*.md`).
VERIFIED: Question 1 verdict corpus at FINAL (`.venv/bin/python`, `load_run_spec` on written tmp files, one run): all seventeen named classes refuse as `RunSpecError` — unparseable (`ParserError`), tab-indent (`ScannerError`), NUL byte (`ReaderError`), invalid UTF-8 / truncated multi-byte / truncated tail / UTF-16 BOM (each `UnicodeDecodeError`), empty / wrong-type / missing-keys / alias-cyclic / billion-laughs / cyclic-root (each `__cause__ is None`, `validate_run_spec` refusals), missing (`FileNotFoundError`), directory (`IsADirectoryError`), symlink loop (`OSError`), deep-flow-2000 (`RecursionError`); fixes-6 new classes: 2000-deep block nesting / over-deep indent / 5MB scalar land named (validate or `RecursionError`), multi-doc (`ComposerError`), unhashable / `!!python/object` / bad-explicit-tag / `!!seq`-bad / `!!map`-bad (`ConstructorError`), invalid `!!binary` padding lands named via validate, merge-from-null named (`ConstructorError`), typed scalars now named (`ValueError`/`AttributeError`/`ValueError`/`KeyError` as `__cause__`); typed-scalar extras (dup keys, bool key, null top, `!!set`/`!!omap`/`!!str`/`!!null`/merge-key/anchor-undef) all named. Depth sweep: depths 10–200 land named via validate, 500–2500 named from `RecursionError`. Adversarial paths: NUL-in-path named from `ValueError`, surrogate-escaped named from `FileNotFoundError`, empty path named from `FileNotFoundError`, int path named from `TypeError`. Zero raw escapes: attacked-and-not-falsified for every class except the ruling's three named raws (no live `MemoryError` input exists at this host scale; `KeyboardInterrupt`/`SystemExit` are not `Exception` subclasses by construction).
VERIFIED: Question 3 mutants (each on a scratch copy diff-verified against `git show 00577a4:src/orchestrator/run_entry.py`): (a) delete `except MemoryError: raise` — simulated-`MemoryError` WRAPS into `RunSpecError` (ruling violation confirmed; probes/read-pin stay green, so only the host-resource face distinguishes it); (b) delete `except Exception` — F38/F39/F40 probes go raw (`ValueError`/`AttributeError`/`KeyError`) and the read pin goes raw (`FileNotFoundError`/`IsADirectoryError`/`OSError`); (c) narrow to the old tuple — all three probes go raw while the read pin stays green (the pin set alone is not the seam's proof); (d) drop `{path!r}` — the committed read-refusal pin PASSES anyway (1 passed), because each `OSError`'s own text embeds the tmp path, so `str(path) in str(error)` holds without the prefix; the path is lost only for non-`OSError` refusals (typed-scalar message names no path) — the brief's `(d)` prediction as written is falsified (FFR-3).
VERIFIED: Question 5 validation-outside-seam: `validate_run_spec` is byte-identical REV..FINAL (range diff touches only the `RunSpecError` docstring hunk and the `load_run_spec` hunk; `return validate_run_spec(document)` sits outside the try). Planted `raise ValueError("planted")` as `validate_run_spec`'s first statement on a scratch copy: `load_run_spec` on a valid spec exits RAW `ValueError(planted)` (never wrapped); a delivered-code validate refusal (`run_id` deleted) passes through with `__cause__ is None` — the envelope does not wrap what it does not enclose, exactly the ruling's "test failures, never wrapped operator errors".
VERIFIED: Question 10 exit gate (`python3 scripts/orchestrate.py start …` as written): typed-scalar / over-deep / missing-path classes each exit 1 with terminal line `orchestrator.run_entry.RunSpecError: cannot load run-spec '<path>': …`, empty stdout (0 bytes), store file ABSENT; `inspect --run-id RUN-DEMO` exits 0 clean JSON (null fields); `stop --run-id RUN-DEMO` exits 1 `RunSpecError: run 'RUN-DEMO' has no root node to cancel`. Attacked-and-not-falsified for all three classes plus both unchanged heads.
VERIFIED: Question 7 F42 citation: `git rev-parse 76a37a5` equals `76a37a50431c04eb4d1c3a343b4710bb0ee5e678` (the commit holding the brief); the brief's CONTEXT names the corpus as seventeen, never nineteen; the committed `19-class`/`18 of 19` texts stand as filed in the fixes-6 review brief and fixes-5 banner (grep confirms) and are corrected by rule-8 close form, not by editing them.
NOT VERIFIED: none — every ACCEPTANCE line was run as written (the check-scope line's expected exit is 1 per FFR-1, measured and recorded above); no full-run substitution was made (`scripts/check-tests` ran whole).
FINDINGS:
  F38 | SEVERITY: P1 | ORIGIN: CODE | STATE: fixed
  A malformed typed scalar (`!!int`/`!!float`) failed the safe constructor's conversion and raised raw `ValueError`, escaping the old `(yaml.YAMLError, UnicodeDecodeError, RecursionError)` tuple.
  FIXED: tests/test_phase5_run_entry_fixes_6_review.py::test_review_f38_int_float_typed_scalar_refused_as_a_named_run_spec_error — at REV `.venv/bin/python -m pytest tests/test_phase5_run_entry_fixes_6_review.py -v` failed at tests/test_phase5_run_entry_fixes_6_review.py:35 with `Failed: F38: an ill-typed int scalar is refused as ValueError, not the documented named \`RunSpecError\`: ValueError("invalid literal for int() with base 10: 'garbage'")`; at FINAL the 5-node line is green with no test edit — the seam catches it (`__cause__` is the `ValueError`).
  F39 | SEVERITY: P1 | ORIGIN: CODE | STATE: fixed
  A malformed `!!timestamp` scalar raised raw `AttributeError` (`'NoneType' object has no attribute 'groupdict'`) or `ValueError`, escaping the old tuple raw.
  FIXED: tests/test_phase5_run_entry_fixes_6_review.py::test_review_f39_timestamp_typed_scalar_refused_as_a_named_run_spec_error — at REV the same command failed at tests/test_phase5_run_entry_fixes_6_review.py:55 with `Failed: F39: an ill-typed timestamp scalar (nope) is refused as AttributeError, not the documented named \`RunSpecError\`: AttributeError("'NoneType' object has no attribute 'groupdict'")`; green at FINAL with no test edit.
  F40 | SEVERITY: P1 | ORIGIN: CODE | STATE: fixed
  A malformed `!!bool` scalar raised raw `KeyError`, escaping the old tuple raw.
  FIXED: tests/test_phase5_run_entry_fixes_6_review.py::test_review_f40_boolean_typed_scalar_refused_as_a_named_run_spec_error — at REV the same command failed at tests/test_phase5_run_entry_fixes_6_review.py:71 with `Failed: F40: an ill-typed bool scalar is refused as KeyError, not the documented named \`RunSpecError\`: KeyError('garbage')`; green at FINAL with no test edit.
  F41 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  The fixes-6 implementer report's `VERIFIED` figure "links 364/364 OK" matches no gate line in the measured neighbourhood (REV and FINAL scratch trees print 366/366; the brief's own figure history shows 361/363/366 drift as `docs/research/` grows) — a copied-or-guessed J-class figure in an already-committed report.
  FIXED: no regression test — a prose figure in a committed report has none; the close form is fixed: recorded in the review that filed it (this report's VERIFIED), and at closeout a record.md Observations line for the count-figure class. Nobody edits a committed report; carried verbatim, no implementer action.
  F42 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: fixed
  The corpus-count number (nineteen in the fixes-6 review brief's QUESTIONS line and the fixes-5 banner) is a claim not checked against the artifact it cites (the fixes-5 review's VERIFIED line names exactly seventeen; the two extras are named nowhere).
  FIXED: no regression test — the correcting text is this brief's own CONTEXT paragraph (commit 76a37a50431c04eb4d1c3a343b4710bb0ee5e678), which names the corpus size from the artifact's list as seventeen named classes and never as nineteen.
  FFR-1 | SEVERITY: P1 | ORIGIN: BRIEF | STATE: carried
  The brief's `IN SCOPE:` line wraps both intended paths in backticks inside one prose line; `scripts/check-scope`'s awk extractor does not strip backticks, so the patterns match no path and the gate exits 1 naming both intended files "not in IN SCOPE" — the ACCEPTANCE green cannot be satisfied by any in-scope action (editing the brief is OUT OF SCOPE).
  FIXED: no regression test — a committed brief's prose has none; per rule 8's ORIGIN: BRIEF close form a later committed brief corrects the IN SCOPE text to plain, un-backticked paths on their own lines as the fixes-6 brief does, after which `scripts/check-scope` is green. The residual half already prints `tripped: none`.
  FFR-2 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief's ACCEPTANCE sentence predicts the docs gate holds at 361 total; at FINAL `scripts/check-docs` prints 366 total / 366 OK / 0 errors (363 at the implementer's run, 366 now — the count drifts as `docs/research/` grows; the +2 over 361 at work time is the brief's own two `[record.md](../record.md)` links, lychee scanning `**/*.md`). Green with 0 errors; only the predicted figure is stale.
  FIXED: no regression test — a count figure in a committed brief's prose has none; a later committed brief corrects or drops the predicted figure, naming the gate's own printed line (the F41 class).
  FFR-3 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The review brief's mutant (d) prediction — "drop `{path!r}` from the format string: the read-refusal pin reds (its `assert str(path) in str(error)`)" — is falsified as written: on a scratch copy with the prefix dropped the committed pin passes (1 passed), because each `OSError`'s own text embeds the tmp path, so `str(path) in str(error)` holds via `{error}` alone; the path is lost only for non-`OSError` refusals (typed-scalar message `cannot load run-spec: invalid literal…` names no path), which the pin does not drive.
  FIXED: no regression test — a mutant prediction in a committed review brief's prose has none; a later committed brief corrects the prediction to the measured spacing (the pin covers the `OSError` faces' wrap, not the message prefix; a non-`OSError` refusal is the prefix's true mutant).
  FRK-1 | SEVERITY: P1 | ORIGIN: CODE | STATE: carried
  The owner-directed `project_kernel.kernel_id` question confirms: a dict-typed (likewise list/int) `kernel_id` passes `validate_run_spec` (it checks only that `project_kernel` is a non-empty mapping, `src/orchestrator/run_entry.py:202-204`) and is `str()`-coerced in `run_configuration` (`src/orchestrator/run_entry.py:353`) into the admitted contract — a mapping admits as `kernel_id="{'a': 1}"`, which the admin schema's `_non_empty_str` (`src/orchestrator/schemas.py:162`) accepts, so a configuration the controller's schema intent would reject is admitted at load, falsifying `run_configuration`'s docstring sentence ("Schema admission is checked here so a configuration the controller would reject is a load-time refusal, not a run-time surprise"). The `or target.snapshot_id` fallback is intended only for a missing/empty value; the coercion of a present-but-wrong-typed value is the class-B "looks close enough" face.
  FIXED: no regression test here — `run_configuration` is OUT OF SCOPE of this brief; a later OWNER-directed brief owns the fix (a type check on `kernel_id` in `validate_run_spec` or a refusal of non-string `kernel_id` before coercion). Carried, not fixed here.
SHAPES: none — every named shape has a test (`Loader-refusal envelope` and `Read-refusal pin` are the new module's two cases; `Absorbed typed-scalar probes` are the three committed probes, green at FINAL with no test edit; F34/F37/F36 maintained green in the battery line). Hand-driven runners above (corpus sweeps, mutants, plant, CLI heads) are measurements of committed tests' faces, not unbuilt shapes; the two deliberately-unbuilt faces and their reasons: (1) the live-`MemoryError` pin — no host-scale input raises it here (the RLIMIT_AS reproducer class was adjudicated by the fixes-6 review and the simulated-raise mutant above is a harness artefact, not a loader input); (2) the `{path!r}` prefix for non-`OSError` refusals — FFR-3 shows the committed pin does not cover it and no new pin rides (OUT OF SCOPE: no test file but this report may be created).
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: none
INHERITED:
From `docs/research/phase5-run-entry-fixes-6-implementer.md`, its `INHERITED` block verbatim:
  INHERITED:
  none — the received INHERITED carried exactly one open item, F36 (the fixes-5 review's carried P2, moved into this brief's body). It is fixed in this step (FINDINGS, F36); nothing is carried forward and nothing new is left open.
From `docs/research/phase5-run-entry-fixes-6-review.md`, its `INHERITED` block verbatim:
  INHERITED:
  F38, F39, F40, F41, F42 are filed carried by this review and live in its FINDINGS above. Nothing else is still open: what this review received is fully disposed — F36 (the only item carried by the fixes-5 review's INHERITED) is fixed by the step under review (its red probe green in both full runs with no test edit), F37 is fixed at the fixes-5 step and green as a maintained pin, the fixes-5 implementer's INHERITED block reads none with nothing open, and the brief's two copied blocks resolve to those same two findings.
Still open and carried forward by this step:
  F41 (STATE: carried) — the fixes-6 implementer report's "links 364/364 OK" figure; a defect in an already-committed report, closed by the planner at this step's closeout as fixed: recorded in the review that filed it (no implementer action).
  FFR-1 (STATE: carried) — the brief's backticked IN SCOPE line defeats `scripts/check-scope`; a later committed brief corrects the IN SCOPE text.
  FFR-2 (STATE: carried) — the brief's predicted docs total is stale at FINAL; a later committed brief corrects the figure.
  FFR-3 (STATE: carried) — the review brief's mutant-(d) prediction is falsified as written (the committed read pin passes without the prefix for `OSError` faces); a later committed brief corrects the prediction.
  FRK-1 (STATE: carried) — the owner-directed `project_kernel.kernel_id` dict-acceptance question confirms (dict/list/int `kernel_id` loads and admits `str()`-coerced past `_non_empty_str`); `run_configuration` is OUT OF SCOPE here, so a later OWNER-directed brief owns its fix.

CLOSEOUT
DECLINED: none
DIVERGENCES CLOSED: none
