<!-- mixed -->
# Phase 2 Remediation — Re-Review

Reviewer: adversarial re-review executed 2026-09-28 of remediation commit `07dbce6` ("Close the Phase 2 review
findings F1-F14"), against my prior review (`2f3f521`, report `phase2-patch-boundary-adversarial-review.md`). Fix
worktree detached at `/tmp/kilo/phase2-fix`, left unmodified; probes and reproducers under `/tmp/kilo/p2f/`. Same
discipline as the first pass: no source edits, no test weakening; whole-trial reproducers for every verdict-changing
hit.

Baseline at `07dbce6`: **728 passed** (718 + 10 new pins) in 183s; `scripts/check-docs` 202 links OK (exit 0);
`tests/test_static_gates.py` + new pins 51 passed; `scripts/check-static` gated rules clean. No test assertion was
weakened (the only deletions in `tests/` are the two lines of the retired raw `_calc_probe` body, replaced by the
sanctioned shape). The prior review's P0 (F1) is genuinely closed.

---

## Verdict

**Not accepted as-is.** The remediation is substantial and mostly sound — **11 of 14 findings are closed exactly as
claimed, and the probe-oracle ruling was adopted in the right shape** — but one P0-class boundary hole survives
(**N2**: the F3 fix verifies the no-newline end state only when the marker is *present*, so a reply `git apply`
refuses is still accepted and graded `CORRECT_ACCEPTANCE`), and a second boundary defect flips a held-out verdict
(**N1**: pure-insertion hunks are applied one line early). Both are in `patch.py`, both are byte-fidelity failures
against `git apply`, and both have whole-trial reproducers. Four residual gaps (N3-N7) sit in the new probe/batch
code, one of which (N3) re-opens the guarantee-5 clause "never a mislabelled `INFRASTRUCTURE_ERROR`".

| Finding | Severity | Status |
|---|---|---|
| **N2** absent no-newline marker on an unterminated last line is not verified → fail-open, `CORRECT_ACCEPTANCE` | **P0** | open |
| **N1** `old_count=0` insertion hunks applied one line early → working reply graded worse | **P1** | open (pre-existing) |
| **N3** harness-deadline overrun inside `sandboxed_probe` graded `ORACLE_INFRASTRUCTURE_ERROR` | P2 | open (in the fix) |
| **N4** `probe_identity` does not bind the probe's module globals | P2 | open (F6 residual) |
| **N5** `RAW` probes are freezable; the ruling's "must" is disclosure-only | P2 | accepted deviation |
| **N6** `_run_probe` raises `FileNotFoundError` on a missing tree instead of `INFRASTRUCTURE_ERROR` | P2 | open (in the fix) |
| **N7** patch mode + batched concurrent dispatch installs no patch (all batched attempts fail closed) | P2 | open (pre-existing) + addendum misstatement |

---

## Per-finding re-verification (F1-F14)

| # | Claim in the remediation addendum | Re-verified |
|---|---|---|
| F1 | byte-exact line model, `newline=""`, `str.splitlines` forbidden | **closed.** CRLF content preserved byte-for-byte; LF-context diff against CRLF refused at preimage; NEL/form-feed/U+2028/`\v`/bare-`\r` all survive. Census `crlf_file` now **REJECT**; `no_trailing_newline` (marker form) now **content-equal**. Whole-trial: CRLF base + LF-context reply → `CORRECTLY_UNRESOLVED`; CRLF-context reply → `CORRECT_ACCEPTANCE`. |
| F2 | sanctioned `sandboxed_probe(driver, compare)`; expected values controller-side | **closed for the sanctioned shape.** `test_expected_values_never_reach_the_candidate_process` passes and I re-confirmed the leak class is gone: the candidate's process sees the inputs-only driver and never the `compare` closure. Caveats: N4 (identity), N5 (RAW still allowed). |
| F3 | marker truthful-or-refused; reproduces the end state | **half-closed.** The marker-present cases all agree with `git apply` (truthful markers apply; a lying old marker is refused; content whose text *is* the marker survives; `marker_mid_hunk` now rejected). But the **absent**-marker case is not verified → **N2**. The addendum's "also closes the previously acknowledged `no_trailing_newline` residual" is therefore overclaimed. |
| F4 | delete-missing refused | **closed.** `delete_missing` now **REJECT**. |
| F5 | harness deadline, `BaseException` containment, bounded capture | **mostly closed** (`SystemExit`/`KeyboardInterrupt` contained → `INFRASTRUCTURE_ERROR`; a probe with no budget cannot hang grading; the sandbox bounds capture). **N3**: a deadline overrun raised *inside* `run_sandboxed_probe` is swallowed by its `except Exception` and returned as `ORACLE_INFRASTRUCTURE_ERROR`. |
| F6 | `probe_identity` = source/bytecode + closure + defaults, in binding and freeze hash | **mostly closed.** Factory-produced probes with different parameters now get distinct identities (re-verified), and both `oracle_target_binding` and `hidden_suite_manifest_hash` carry it. **N4**: module globals are not in the descriptor. |
| F7 | `calibrate_oracle` takes a `CalibrationCases` corpus | **functionally closed, pin overclaimed.** I ran `calibrate_oracle(target, manifest, workdir, cases=CalibrationCases(...))` on the calc target → the five cases classify `CORRECT_ACCEPTANCE / CORRECTLY_UNRESOLVED / CORRECTLY_UNRESOLVED / FALSE_SUCCESS / INDETERMINATE`, exactly as the fixed target does. But **no shipped test exercises `CalibrationCases`** (the addendum says the exit gate "now calibrates through the public API shape"; `test_phase2_general_target.py::_calibration` still calls `_calibrate_case` directly five times). The path is unpinned. |
| F8 | inject into the manifest's first check; trial-script contract documented | **closed.** `_grade_trial(calc_manifest, tree, "ORACLE_INFRASTRUCTURE")` → `{'calc-held-out': 'ORACLE_INFRASTRUCTURE_ERROR'}`, `is_indeterminate True`. `TRIAL_SCRIPTS` documents `BUILD_FAILURE` as inert in the patch path (which resolves my F8 second half as an explicit contract). |
| F9 | ids/obligations/`criterion_ids` validation | **closed.** empty criterion id, empty `child_id`, non-mapping obligation, bare-string `criterion_ids` all refused with `ExperimentError`. |
| F10 | budgets validated; `snapshot_hash` binds live kernel content | **closed.** `-5.0`, `nan`, `inf` refused; in-place `project_kernel` mutation now changes `snapshot_hash`. |
| F11 | commands parse-checked at the builder | **closed** (crash half). `"echo 'unterminated"` now fails `build_target`. The no-shell/argv-only caveat stands but is now a documented contract. |
| F12 | patch bound to its planned attempt; stale patch fails the next attempt closed | **closed.** My prior reproducer now returns `self_reported_status: FAILED`, `changed_paths: []`, `PATCH_REJECTED`. The plan→patch→dispatch split (`plan_attempt`/`dispatch_attempt`/`admit_observation_and_result`) is wired correctly in `_execute_leaf`. |
| F13 | `freeze_manifest` recomputes the binding; binding in `content_hash` | **closed.** Tampered and foreign manifests are refused at freeze; `ExperimentManifest.oracle_binding` is part of `content_hash`. |
| F14 | façade exports + docs wording | **closed.** `verify_commands_for`, `NodeCommands`, `probe_identity`, `sandboxed_probe` re-exported; `docs/self-host.md` links the review. |

---

## Open findings

### N2 (P0, boundary) — an absent no-newline marker on an unterminated last line is never verified

**Where:** `src/orchestrator/patch.py:189-196`. The end-state check is one-directional:
`if hunk.old_no_newline and not (covers_end and not ends_with_newline): raise`. When the marker is **absent** the
patch's claim ("the old side's last line is newline-terminated") is never checked against the file, and
`result_ends` (`patch.py:212-219`) is then derived from the *new* side alone. The old fail-open survives the fix:
the boundary accepts a patch `git apply` refuses and silently rewrites the end-of-file newline state. This is the
most common real case — a model omitting `\ No newline at end of file` — so it is not an exotic marker grammar.

**Guarantee violated:** G1 (an accepted patch must apply with `git apply` semantics) and G2 (exactly base + admitted
changes). By the brief's P0 rule this is a silent false acceptance on a reply a correct boundary refuses.

**Whole-trial reproducer** (`/tmp/kilo/p2f/attack4.py`): `calc/core.py` is five lines with **no trailing newline**;
the reply patches line 5 with no markers:

```
--- a/calc/core.py
+++ b/calc/core.py
@@ -5 +5 @@
-    raise NotImplementedError('mul')
+    return a * b
```

```
git apply --check -> refuses: error: patch failed: calc/core.py:5
run_trial(...)    -> outcome=ACCEPTANCE_CLAIMED classification=CORRECT_ACCEPTANCE hidden={'calc-held-out': 'PASS'}
```

A second row (`two_hunks_second_touches_eof`, `/tmp/kilo/p2f/attack2b.py`) shows the same hole when a later hunk
touches EOF: git refuses, the boundary accepts.

**Fix:** make the end-state claim symmetric. When a hunk's old side covers the file end, require
`hunk.old_no_newline == (not ends_with_newline)`; likewise the new side's marker must be present exactly when the
result will be unterminated. Pin both directions (marker present, marker absent) against `git apply`, on an
unterminated file, whole-trial.

### N1 (P1, boundary) — `old_count=0` insertion hunks are applied one line early

**Where:** `src/orchestrator/patch.py` `apply_patch`, `start_index = hunk.old_start - 1 if hunk.old_start > 0 else 0`.
That formula is correct for `old_count > 0` (it is the index of the first preimage line) but wrong for
`old_count == 0`, where unified-diff semantics (and `git diff -U0`) make `old_start` the line **before** the
insertion point, so the insert index is `old_start`, not `old_start - 1`. Pre-existing (same formula at `2f3f521`);
not introduced by the remediation, but it is in-scope boundary fidelity and it flips held-out verdicts.

**Canonical headers and observed placement** (`git diff -U0` emits `@@ -2,0 +3 @@` to insert after line 2):

```
@@ -2,0 +3 @@   on 'a\nb\nc\nd\n'  -> boundary: 'a\nNEW\nb\nc\nd\n'   git: 'a\nb\nNEW\nc\nd\n'
@@ -4,0 +5 @@   on 'a\nb\nc\nd\n'  -> boundary: 'a\nb\nc\nNEW\nd\n'   git: 'a\nb\nc\nd\nNEW\n'
```

**Guarantee violated:** G1 ("accepted by both, content differs" — the worst fidelity class).

**Whole-trial reproducer** (`/tmp/kilo/p2f/attack4.py`): base `calc/core.py` with `add` returning `0` and `mul`
correct; the reply is a one-line canonical insertion (`@@ -1,0 +2 @@ def add(a, b):` + `+    return a + b`) which
`git apply --unidiff-zero` accepts and applies to a **passing** tree (`git-applied tree: 'def add…\n    return a +
b\n    return 0\n…'`). The boundary inserts one line early, producing a leading indented statement
(`IndentationError`), so:

```
trial -> outcome=INFEASIBLE classification=CORRECTLY_UNRESOLVED hidden={'calc-held-out': 'FAIL'}
```

A reply the correct boundary grades `CORRECT_ACCEPTANCE` is graded `CORRECTLY_UNRESOLVED` — the exit gates'
"working reply graded worse than broken" class. I did **not** construct the converse (false acceptance), so I rate
this P1 rather than P0 by the brief's letter; the applied content differs from `git apply`, so the converse is
constructible in principle.

**Fix:** `start_index = hunk.old_start if hunk.old_count == 0 and hunk.old_start > 0 else max(hunk.old_start - 1, 0)`
(equivalently track `old_count` and treat a zero-length range as a cursor). Pin against `git diff -U0` output for
mid-file insert, EOF append, and insert-at-start.

### N3 (P2, probe) — a harness-deadline overrun inside `sandboxed_probe` is mislabelled infrastructure

**Where:** `oracle._run_probe` defines `_Deadline(Exception)` and expects it to surface as
`GRADE_CANDIDATE_TIMEOUT`; but `hidden_oracle.run_sandboxed_probe` wraps `SandboxRunner().run(plan)` in
`except Exception: return GRADE_INFRASTRUCTURE_ERROR`, which **swallows `_Deadline`** and returns it as a value.

**Guarantee violated:** G5 "never a mislabelled `INFRASTRUCTURE_ERROR`" — and the addendum's own claim that hangs map
to the timeout. Deterministic whenever `check.timeout_seconds <` the probe's sandbox `wall_seconds`:

```
sandboxed_probe(driver=<sleep 30>, timeout_seconds=5.0); check.timeout_seconds = 0.5
-> ORACLE_INFRASTRUCTURE_ERROR   (honest grade: CANDIDATE_TIMEOUT)
```

Observed at `/tmp/kilo/p2f/attack3.py`. The shipped exit gate is *not* affected only by accident: its hanging
calibration case runs with `check.timeout_seconds=30` and a 5s sandbox budget, so the sandbox fires first. The pins
in `tests/test_probe_oracle.py` use a RAW probe for the hang row, so the sanctioned shape's deadline path is
untested. Impact: the check becomes `ORACLE_INFRASTRUCTURE_ERROR` → `INDETERMINATE` → rerun-eligible, so a hanging
candidate can get an extra attempt.

**Fix:** make `_Deadline` subclass `BaseException`, or have `run_sandboxed_probe` re-raise it; pin a hanging
candidate under `sandboxed_probe` with `check.timeout_seconds < sandbox wall`.

### N4 (P2, integrity) — `probe_identity` does not bind the probe's module globals

`oracle._callable_descriptor` hashes source, code-object bytes, closure cells and defaults. A probe that reads a
module-level value keeps one identity while its behaviour flips:

```
mod.MODE = PASS ; probe returns MODE ; identity X ; grade PASS
mod.MODE = FAIL ; same function object          ; identity X ; grade FAIL
```

Observed (`/tmp/kilo/p2f/attack3.py`). Reachable under supported usage (a probe reading a config/constant global,
including `compare`-style helpers). The binding/freeze hash therefore cannot detect a behaviour change of this
shape. **Fix:** include the module's referenced globals in the descriptor (or require probes to be closed over
their parameters and assert `__closure__` completeness), and document the residual.

### N5 (P2, ruling deviation) — `RAW` probes remain freezable

The ruling required the sandboxed data-only shape ("must"). `freeze_manifest` accepts a manifest whose `probe` is a
raw callable; only the hashed `expected_values_policy` discloses
`"UNVERIFIED for RAW probes: the probe body executes with the candidate"`. Under a RAW probe the F2 class (expected
values in the candidate's process) is still reachable. The addendum states this honestly ("remains possible but is
disclosed as unverified"), so I treat it as a **declared deviation** rather than an overclaim — but the ruling's
containment guarantee is then conditional on the probe author. **Fix:** refuse `RAW` at `freeze_manifest` (or gate
it behind an explicit `allow_unverified_probes` that enters the content hash).

### N6 (P2, probe) — an oracle-side I/O failure escapes grading as a raw exception

`oracle._run_probe` calls `shutil.copytree(tree_path, copy)` outside its `try`; a missing/unreadable graded tree
raises `FileNotFoundError` out of `grade_manifest`, and `run_trial`'s `except` clause covers only
`WorkflowError`/`ProtocolViolation`/`CredentialRefused`. Observed. The same applies to any `copytree` failure.
**Fix:** wrap the copy/digest block and map failures to `GRADE_INFRASTRUCTURE_ERROR` (never a trial crash).

### N7 (P2, patch mode) — batched concurrent dispatch installs no patch, and the addendum misstates it

`_process_children` (`trial_driver.py:972`) batches whenever `concurrent and … == "EXECUTE"` and
`_batch_disjoint(...)`; `_execute_leaf_batch` then calls `controller.schedule_child_attempts` with **no**
`_model_patch` call (only `_execute_leaf` at `trial_driver.py:1103-1110` handles patch mode). A patch-profile
target with two or more ready disjoint executable leaves in a concurrent arm therefore dispatches attempts with no
pending patch → each fails closed with "no patch was produced for this attempt". Reachable: general target with
≥2 obligations + patch profile + concurrent arm (the shipped gates never batch: the calc target has one obligation,
the fixed-target gate uses `ARM_DIRECT`). Fail-closed, so not a P0, but it silently zeroes the differential for
that arm.

The remediation addendum's residual note (2) says "In patch mode a batched concurrent attempt degrades to the
bounded per-leaf path (one model patch per leaf)". That is inaccurate: the per-leaf degradation happens only when
`schedule_child_attempts` **raises `ExecutorFailed`**; in the normal case the batch is dispatched patch-less and
every member fails. **Fix:** disable batching under `patch_mode` (or produce and bind one patch per batched leaf),
 and correct the residual note.

---

## Probe-oracle ruling: adopted, with the gaps above

The implemented hybrid matches the ruling's five constraints in shape: inputs-only driver in the `NAMESPACE_V1`
sandbox with `COLLECT:` observations and a controller-side `compare` (constraint 1-2); a per-check disposable copy
with a before/after tamper digest and a harness deadline (`oracle._run_probe`) (constraints 1, 4); bare
`BaseException` containment (constraint 5); and a content identity in the binding/freeze hash (constraint 3). The
containment matrix rows that were `Tolerate` under the raw shape are now Prevent/Detect: host writes and surviving
children (sandbox + teardown), self-mutation and cross-check contamination (per-check copy + digest → `GRADE_FAIL`),
flooding (bounded capture; a payload drowned by a flood fails closed), controller env (`_HIDDEN_ENV` allowlist with
`HOME` on tmpfs), and expected values (controller-side `compare`). Constraints 3 and 4 are each incomplete (N4,
N3), and constraint 1-2 is not *enforced* (N5).

---

## Accuracy of the appended remediation addendum

Three statements in the addendum appended to the first report are not supported:

1. **F3** — "…which also closes the previously acknowledged `no_trailing_newline` residual": only the
   marker-present half is closed; the absent-marker half is a fail-open (**N2**).
2. **F5 / ruling matrix** — "hangs — the harness deadline and the sandbox wall budget": a harness-deadline overrun
   inside the sanctioned probe is graded `ORACLE_INFRASTRUCTURE_ERROR`, not `CANDIDATE_TIMEOUT` (**N3**).
3. **Residual note (2)** — "In patch mode a batched concurrent attempt degrades to the bounded per-leaf path":
   batched attempts in patch mode are dispatched with no patch and fail closed (**N7**).
4. **F7 pin** — "The exit gate now calibrates through the public API shape rather than `_calibrate_case` directly":
   the exit gate still calls `_calibrate_case` directly; `CalibrationCases` has no test coverage (feature works,
   unpinned).

Everything else in the addendum matched what I measured.

---

## Guarantees re-check

| # | Guarantee | Status after remediation |
|---|---|---|
| 1 | patch boundary admitted-then-faithful, fail-closed, git-apply semantics, bounded | **Falsified** — **N2** (fail-open), **N1** (accepted by both, content differs). Otherwise improved: census fail-opens 3 → **0**, content mismatches 1 → **0** on the 33-scenario corpus. |
| 2 | candidate tree = base + admitted changes | **Falsified** by N2 (the admitted change includes an undeclared end-state rewrite). Structurally sound otherwise. |
| 3 | differential honesty (reply is the only variable) | **Holds** (re-verified whole-trial: working→`CORRECT_ACCEPTANCE`, visible-only→`FALSE_SUCCESS`, noop→`CORRECTLY_UNRESOLVED`), with the N1 caveat that the *grade* can be wrong for a zero-context insertion. |
| 4 | builder fail-closed + hash identity | **Holds** now (F9/F10/F11 closed; kernel mutation detected). |
| 5 | probe-oracle containment, honest outcome mapping | **Mostly holds** (F2/F5/F6 shape adopted) with **N3** (mislabelled infrastructure) and **N4** (identity hole) open, and **N5** conditional on the probe author. |
| 6 | five-case calibration + freeze refuses foreign/tampered | **Holds** (F7 works through the public shape — unpinned; F13 closed). |
| 7 | verification-only commands; settled refusal | **Holds** (unchanged; `BUILD_FAILURE` inert-in-patch is now an explicit contract). |
| 8 | command lookup: no escalation, no vacuous pass | **Holds** (F11 closed at the builder). |

---

## `git apply` fidelity census (delta)

Same 33-scenario corpus (`/tmp/kilo/p2f/census.py`), `git apply` with `--unidiff-zero` as the oracle for
zero-context patches:

| Metric | at `2f3f521` | at `07dbce6` |
|---|---|---|
| Accept/reject agreement | 17/33 | 20/33 |
| Fail-open (git rejects both modes, boundary accepts) | 3 | **0** |
| Accepted by both, content differs | 1 | **0** |
| Boundary stricter (fail-closed) | 13 | 13 |

The two new rows added this round (`/tmp/kilo/p2f/attack2.py`, `attack2b.py`, 14 scenarios) are where N1 and N2
live: `insert_at_end_-4,0`, `append_eof_*`, `no_marker_on_nonewline_lastline`, `two_hunks_second_touches_eof`
(diverge), versus `new_marker_only…`, `old_marker_only…`, `both_markers`, `delete_nonewline_file`,
`empty_to_one_line`, `bare_cr_content`, `crlf_patch_on_lf_file`, `marker_line_ending_crlf`, `content_is_marker_text`
(agree). One row (`insert_then_marker_midfile`) is boundary-stricter than git: fail-closed.

---

## Residual unknowns

- I did not fuzz the full malformed-hunk grammar against `git apply`; N1/N2 came from targeted EOF/insertion cases,
  so further differentials may exist (especially where `old_count == 0` interacts with the no-newline markers).
- The false-acceptance direction of N1 is argued, not demonstrated; I rate it P1 on that basis.
- I did not force a real `MemoryError` in the sandboxed probe capture; the flood bound is asserted at 5 MB in the
  shipped pin.
- Batched patch-mode dispatch (N7) was verified by code reading and the absence of a patch install; I did not drive
  a multi-obligation general target end-to-end to watch the arm zero out.
- Real-model measurement remains unclaimed.

---

## Reproduce

From a worktree at `07dbce6`, with
`/home/ruben/Projectos/meta-project/orchestrator/.venv/bin/python`; probe scripts live under `/tmp/kilo/p2f/`
(`attack2.py` boundary matrix, `attack2b.py` EOF/marker matrix, `attack3.py` probe holes, `attack4.py` whole-trial
N1/N2, `census.py` corpus, `honesty2.py` sanctioned-shape differential + F7 calibration).

```bash
.venv/bin/python -m pytest -q                       # 728 passed
scripts/check-docs                                  # 202 links OK
.venv/bin/python /tmp/kilo/p2f/census.py            # 0 fail-open, 0 content mismatch (33 rows)
.venv/bin/python /tmp/kilo/p2f/attack2b.py          # N2 rows + N1-adjacent EOF rows
.venv/bin/python /tmp/kilo/p2f/attack4.py           # N2 whole-trial CORRECT_ACCEPTANCE; N1 whole-trial flip
.venv/bin/python /tmp/kilo/p2f/attack3.py           # N3 mislabel; N4 globals; N5 RAW freeze; N6 raises
.venv/bin/python /tmp/kilo/p2f/honesty2.py          # sanctioned-shape honesty + calibrate_oracle(cases=…)
```

Minimal N2 (the P0), from `src/` and `tests/` on the path:

```python
from orchestrator import patch as p
base = "a\nb"                                   # file with no trailing newline
text = "--- a/x\n+++ b/x\n@@ -2 +2 @@\n-b\n+B\n"  # marker omitted
n = p.parse_patch(text, owned_scope_include=["**"])
print(p.apply_patch("x", n.files["x"], base))   # -> 'a\nB\n'  (git apply refuses this patch)
```

Minimal N1 (the P1):

```python
from orchestrator import patch as p
base = "a\nb\nc\nd\n"
text = "--- a/x\n+++ b/x\n@@ -2,0 +3 @@ b\n+NEW\n"   # git diff -U0 form: insert after line 2
n = p.parse_patch(text, owned_scope_include=["**"])
print(p.apply_patch("x", n.files["x"], base))   # -> 'a\nNEW\nb\nc\nd\n'  (git: 'a\nb\nNEW\nc\nd\n')
```

Minimal N3 (the P2):

```python
from orchestrator import oracle
from orchestrator.hidden_oracle import sandboxed_probe
probe = sandboxed_probe(driver="import time; time.sleep(30)\n", compare=lambda p: "PASS", timeout_seconds=5.0)
check = oracle.OracleCheck("hang", ("AC",), 1.0, "PASS", 0.5, True, probe=probe)
print(oracle._run_check(check, <tree>, runner=None))  # -> ORACLE_INFRASTRUCTURE_ERROR (should be CANDIDATE_TIMEOUT)
```

---

## Verification addendum (re-review remediation, 2026-09-28)

All seven open findings (N1-N7) are closed and the F7 pin gap is filled.
Suite after remediation: **736 passed** (728 + 8 new pins); `scripts/check-docs`
202 links OK; `tests/test_static_gates.py` 5 passed; gated lint clean.

### Per finding

| Finding | Fix landed | Pin |
|---|---|---|
| **N2** (P0) | The end-of-file newline claim is **symmetric** (`patch.py`): whenever a hunk covers the file's end, `hunk.old_no_newline` must equal the file's actual `not ends_with_newline` — an *absent* marker asserts newline-termination and a mismatch is refused exactly as `git apply` refuses it. The check covers single-EOF hunks, later hunks touching EOF, and zero-count EOF insertions. | `test_no_newline_claim_is_symmetric_review_n2` (all three positions, both directions) plus the whole-trial reproducer pinned as `test_unterminated_file_refuses_the_markerless_eof_reply_review_n2` (every arm must not classify `CORRECT_ACCEPTANCE`). |
| **N1** (P1) | `_hunk_start_index`: for an insertion (`old_count == 0`, `old_start > 0`) the insert index is `old_start` itself (unified-diff's "the line before the insertion point", `git diff -U0` form), not `old_start - 1`. The same helper drives the EOF-coverage test. | `test_insertion_hunk_placement_matches_git_diff_u0` — mid-file insert (`@@ -2,0 +3 @@`), EOF append (`@@ -4,0 +5 @@`), insert-at-start (`@@ -0,0 +1 @@`), pinned against `git apply --unidiff-zero` semantics. |
| **N3** (P2) | `_Deadline` is a **`BaseException`** subclass: a probe's own `except Exception` (the sanctioned shape wraps its sandbox call that way) can no longer swallow the harness deadline into a returned `INFRASTRUCTURE_ERROR`. | `test_harness_deadline_beats_the_probe_budget_review_n3` — a hanging candidate under `sandboxed_probe` with `check.timeout_seconds` deliberately *below* the probe's sandbox wall grades `CANDIDATE_TIMEOUT`. |
| **N4** (P2) | `_callable_descriptor` binds the **referenced module globals**: every name in the probe's code objects (nested included) that resolves in `__globals__` is hashed by value (modules by name, callables recursively). A behaviour flip through a global changes the identity. | `test_probe_identity_binds_referenced_globals_review_n4`. |
| **N5** (P2) | `freeze_manifest` **refuses** a RAW probe unless `allow_unverified_probes=True`; the allowance is recorded as `ExperimentManifest.unverified_probes_allowed` and **enters the content hash**, so the deviation is part of the experiment's identity. The sanctioned `sandboxed_probe` shape freezes with no allowance. | `test_freeze_refuses_raw_probes_unless_hashed_opt_in`. |
| **N6** (P2) | `_run_probe` wraps the copy/digest block and the after-digest computation; any oracle-side I/O failure maps to `GRADE_INFRASTRUCTURE_ERROR`, never a raw exception out of `grade_manifest`. | `test_missing_graded_tree_is_infrastructure_review_n6`. |
| **N7** (P2) | `_process_children` never batches under patch mode: one model reply produces one patch for one planned attempt, so batched members would be dispatched without patches. The bounded per-leaf path produces and binds each leaf's own patch. | `test_patch_mode_never_batches_review_n7` — a two-obligation disjoint-scope target under `RECURSIVE_CONCURRENT` reaches `CORRECT_ACCEPTANCE` through per-leaf patches. **Mutation-checked:** re-enabling batching under patch mode fails the pin (the batched members are dispatched patch-less and the differential zeroes). |
| **F7 pin gap** | The exit gate's `_calibration` now goes through the public `calibrate_oracle(..., cases=CalibrationCases(...))` path (exported via the façade) instead of `_calibrate_case` directly. | exercised by the full phase-2 suite (`calibrate_oracle` on a general target now has shipped coverage). |

### Corrections to the first remediation addendum

The re-review's "Accuracy of the appended remediation addendum" section is
accepted in full; the corrected positions are:

1. **F3 claim** ("also closes the previously acknowledged `no_trailing_newline`
   residual") — overclaimed at the time: only the marker-present half was
   closed. With N2's symmetric claim, the residual is now closed in **both**
   directions (marker present and absent), and the pins cover both.
2. **F5 / ruling matrix** ("hangs — the harness deadline and the sandbox wall
   budget") — false for the sanctioned shape as shipped: a harness-deadline
   overrun inside `run_sandboxed_probe` graded `INFRASTRUCTURE_ERROR` (N3).
   With `_Deadline` a `BaseException`, the row is now accurate: hangs map to
   `CANDIDATE_TIMEOUT` from either budget.
3. **Residual note (2)** ("a batched concurrent attempt degrades to the
   bounded per-leaf path") — inaccurate: the normal case dispatched batched
   members patch-less and every member failed closed (N7). Corrected position:
   patch mode **never batches**; every leaf runs its own plan→patch→dispatch
   cycle.
4. **F7 pin claim** ("the exit gate now calibrates through the public API
   shape") — unpinned at the time; now true and covered (see above).

### Residual notes (unchanged or narrowed)

- The harness deadline binds the main thread (SIGALRM); a probe run from
  another thread enforces its own budget, with the sandbox deadline still
  applying to the sanctioned shape. N3's containment is unaffected in shape
  but the thread caveat stands.
- `RAW` probes are now freeze-refused by default (N5) rather than merely
  disclosed; the `allow_unverified_probes` escape hatch is explicit and
  hash-recorded.
- The N7 fixture's visible gate is write-free (`python3 -B` import smoke) and
  the held-out probe is the behavioural grader: per-component visible commands
  are a later target-schema concern, noted at the fixture.
