<!-- informative -->

# Reviewer Brief: MEASUREMENT-Gate Adversarial Review

## Mandate

Independently attempt to falsify the MEASUREMENT-gate guarantees on the current revision. The automated suite is green
and is not a verdict; the SPEND-gate, EXECUTION-gate, and R08 reviews each found reachable falsifications the delivered
mechanisms missed. Assume the happy path is covered and attack the measurement core: isolation, repair, grade
persistence, and recovery.

**Independence:** you must not be the author of the reviewed commits (`8ba7530`, `74d519c`, `a9e6ba9`, `3e63e3a`) or of
the corresponding tests. Read the source and the normative documents before the implementer's tests.

## Target

- Repo: `/home/ruben/Projectos/meta-project/orchestrator`
- Revision reviewed: `3e63e3a` (R13). The gate spans `18ad723`/`300325e` (R08), `8ba7530`/`74d519c` (R10),
  `a9e6ba9` (R14), and `3e63e3a` (R13).
- Work on a frozen revision, not a moving tree:
  `git worktree add --detach /tmp/kilo/measurement-review-3e63e3a 3e63e3a`
- Primary reference: `docs/report-milestone8-readiness.md`, findings **R08, R10, R13, R14** (their "Required" and
  "Regression" clauses are the acceptance criteria).
- Normative documents: `docs/experiment.md` (independent-oracle and verified-progress sections),
  `docs/control-plane.md` (attempt lifecycle, repeated-failure rule, crash recovery, run termination),
  `docs/tables/limits.yaml`, `docs/tables/node-lifecycle.yaml`, `docs/tables/attempt-lifecycle.yaml`.
- Baseline: `.venv/bin/python -m pytest -q` (expect 517 passed). A green suite is not a verdict.
- Run probes under `/tmp/kilo/`; do not edit source; no network, no paid calls, synthetic fixtures only.

## The guarantees under review

1. **R08 — evaluator isolation.** A hidden check is a trusted collector whose driver runs candidate code in a child
   process; expected values are controller-side only; a candidate cannot reach expected values, suppress or forge an
   observation without solving the task, or escape the boundary to influence grading.
2. **R10 — repair and terminal outcomes.** Retry eligibility is a derived policy decision taken while the node is
   still READY; validation/acceptance identities are cycle-specific so a repaired node re-validates; a repeatedly
   failing action is driven by a bounded repair loop to a recorded terminal outcome (INFEASIBLE) before the trial is
   graded, without consuming extra reasoning budget or redispatching paid work.
3. **R13 — grade persistence and reconstruction.** The grading record is durable with its outcome categories
   (infrastructure and timeout not collapsed to booleans), bound to the oracle/manifest/candidate identity, and the
   exact grade and trial classification are reconstructable from a reopened store; grading is separate from acceptance
   mutation.
4. **R14 — derived-effect reconciliation.** Controller-owned consequences (derived cancellation, derived artefact
   rejection) are reconciled idempotently at recovery when a crash falls between an originating event and its derived
   event, and recovery never redispatches paid work.

## In scope

- `experiment.py`: `_HIDDEN_DRIVERS`, `_HIDDEN_EXPECTED`, `_collector_script`, `hidden_runner`, `_execute_leaf`,
  `_execute_leaf_batch`, `_accept`, `_advance_repair`, `run_trial`, and the grading-evidence admission.
- `controller.py`: `authorise_acceptance`, `_validation_cycle`, `record_validation_failure`,
  `record_failure`, `evaluate_repeated_failure`, `recover`, `_recover_decompositions`, `_recover_accounting`,
  `_reconcile_derived_effects`, `_cancel_attempt`, `_execute_derived_effects`.
- `observability.py`: `oracle_grades`, `reconstruct_grade`, `reconstruct_classification`, `evidence`.
- `oracle.py`: `OracleGrade`, `classify_trial`, `grade_manifest`, `rerun_non_gradeable`.
- The interactions between these: R10 terminal outcomes feeding R13 grading, and R14 recovery applying R10's policy.

## Out of scope

- SPEND and EXECUTION gates (already reviewed and fixed).
- R17 output admission, R18 scheduling equivalence, R20 readiness metrics, R22 timer service, R11 resume-by
  inspection, R12 alias recording — owned by the remainder of Batch 6.
- Incidental interactions are welcome, but keep the verdict scoped to R08/R10/R13/R14.

## Known residuals — acknowledge, do not re-report as novel

- **Unforgeability.** A candidate that already knows the expected values could forge the child's JSON; the claim is
  reachability of expected values from the sandbox, not unforgeability.
- **Fixed-input special-casing.** The driver's inputs and call sequence are visible to candidate code; hardcoding
  responses for the specific hidden inputs is inherent to fixed-input behavioural checks.
- **Frozen calibration.** The five-case calibration is unchanged; early exit and interference are pinned by dedicated
  tests, not calibration cases.
- **Stderr capture.** Candidate stderr flows to the sandbox capture, bounded by `RLIMIT_FSIZE` and the bounded drain,
  not by the collector cap.
- **Controller death.** Teardown runs only if the controller survives; an independent supervisor is out of scope.

## Attacks to attempt (minimum)

**R08**
- Re-run the expected-value reachability sweep (tree, `/work`, `/tmp`, argv, `/proc/<pid>/cmdline`, `environ`) and
  confirm no expected value, check id, or sentinel is present, including in any file R13 now persists.
- Re-run the forge/suppress/early-exit/flood and shadow-module probes against this revision.
- Confirm the R13 persisted grade cannot be read by candidate code (the trial store is controller-side; verify it is
  not inside the sandbox view).

**R10**
- Drive a node through failure, repair, and success: confirm the cycle identities differ per cycle, the repaired
  validation is admitted, and the node reaches ACCEPTED.
- Drive a permanently failing action: confirm the loop is bounded by the frozen policy, the node reaches a recorded
  terminal INFEASIBLE, the run outcome matches (root INFEASIBLE; child terminal with the root blocked), and the
  classification is consistent with the recorded outcome rather than the pre-repair state.
- Confirm no completed or paid work is redispatched by the retry loop; confirm the model review runs once per leaf so
  retries do not invalidate the calibrated limits; look for a retry path that consumes budget or tokens.
- Try to defeat the cycle identity (repeat a cycle, reset history, concurrent cycles for one node) and confirm no
  collision silently drops a repair.
- Check the batch fallback: a failed member falling back to the single-leaf repair must not corrupt integration or
  double-count.

**R13**
- Mutate the persisted grade (change an effective outcome, the classification, the manifest hash) and confirm the
  reconstruction reflects the durable record exactly, and that classification derives from the recorded outcome.
- Confirm infrastructure and timeout categories survive reconstruction and are not collapsed.
- Confirm grading does not mutate acceptance state, and that a trial's classification in the comparison equals the
  reconstructed classification from its reopened store.
- Confirm the expected values persisted as HIDDEN evidence are classified RESTRICTED and not exposed through any
  non-restricted projection.

**R14**
- Crash between an originating event and each derived consequence (cancellation, artefact rejection) and confirm
  recovery re-applies it idempotently, that replay and recovery agree, and that no paid work is redispatched.
- Crash twice in the same workflow and confirm idempotent double application.
- Confirm reconciliation does not resurrect work for a terminal run.

## Method

- Read first: `experiment.py` (the symbols above), `controller.py` (the symbols above), `observability.py`,
  `oracle.py`, `reducer.py` (derived-effect emission), `store.py` (admission, crash hooks, replay).
- Build minimal reproducers that isolate one claim each. Prefer a failing reproducer to an argument.
- For each attack record: exact commands, observed result, expected result, and whether the claim is violated.
- Do not weaken or edit tests; report a failing reproducer instead.

## Deliverable

1. **Verdict:** GO / NO-GO for the MEASUREMENT gate, one sentence.
2. **Findings**, each with severity (P0/P1/P2), the claim violated, a minimal reproducer (commands and code),
   observed versus expected, and a proposed permanent regression test.
3. **Claims verified:** for each in-scope claim, how you attempted falsification and what you observed. "Verified"
   means attacked, not that tests pass.
4. **Residual unknowns:** anything you could not test and why.
5. **Reachability audit:** every path by which candidate code could observe expected values, influence grading, or
   induce redispatch, and why each is closed or not.

## Exit criteria

- Every in-scope claim is either falsified with a reproducer or explicitly "attacked, not falsified" with the method.
- No source edits, no network, no paid calls; host state left clean (no orphaned processes, cgroups, or temp trees).
- Findings are reproducible from the report alone, against `3e63e3a`.
- The review states what it did not cover.

## Reproduce everything

List every probe command here so the verdict can be re-run against the corrective revision.
