Orchestrata Ultimate › Plans › briefs › hotfix-batch-child-stamp
HOTFIX — batch children lack the SANCTIONED_RUNNER stamp: every push gate dies (P-CAP wiring gap)
Source: plans/briefs/hotfix-batch-child-stamp.md at 8a2cb42ad · last changed 2026-10-20 · first committed 2026-10-20 · 74 lines.
Prose pending.
Plan text
HOTFIX — batch children lack the SANCTIONED_RUNNER stamp: every push gate dies (P-CAP wiring gap)
Priority: URGENT — blocks every git push on this repo (the pre-push affected-gate's batch
executor children are all guard-killed). Coordinator-diagnosed with full evidence; this packet is
the minimal wiring fix + the owed end-to-end pin.
The defect (measured 2026-10-20, three failed pushes)
- The RUL-038 guard (
pytest_live_observer.py::pytest_collection_finish, ~:850): a session selecting >1 file EXITS at collection unlessSANCTIONED_RUNNER_ENVis set in its env (Mohamed verbatim 2026-10-19: "any more than 1 test file, detect it and stop immediately"). scripts/run_tests.pycounting path (:1648):env={**os.environ, **_child_run_env(deadline)}— STAMPED (this is why collect-only counting worked and printed "Selected: 38786").scripts/run_tests.pybatch EXECUTION path (:882-884):child_env = dict(os.environ)+child_env[TEST_DEADLINE_ENV] = str(deadline)— hand-rolled, NO STAMP → every ~60-file batch child guard-killed at collection → push #3 log: 1,946 guard kills = 1,946 "batch error: module did not run" = the entire FAILED count (guard-message distribution: 732×61-file, 424×60-file, 240×59-file, 186×62-file, 175×58-file, 67×67-file, 65×65-file, 57×56-file). Pushes #1/#2 died the same way (their "budget exhausted" message is the executor's generic dead-batch text; the guard Exit is the real cause).- Solo-retry path (:931,
run_tests_in_parallel(..., batch_multiplier=1)): passes NO env at all — children get neither the stamp norTEST_DEADLINE_ENV→ uncapped retry rounds (latent cap hole; single-file children pass the guard, so it never surfaced). - Why P-CAP's 146/146 missed it: the contract tests pin
_child_run_env's shape (correct — it DOES stamp) but nothing pinned that the execution path CALLS it. The handoff's named second-pass gap "capped-exit end-to-end test pin" is exactly this hole.
Fence
scripts/run_tests.py
tests/scripts/test_run_tests_cap.py
Do not touch pytest_live_observer.py / pytest_live_reader.py (the guard is correct as ruled)
or test_executor.py (its env param plumbing at :188/:196-198 already forwards correctly).
The fix
- Batch execution path (:882-884): build the child env through
_child_run_env— the same shape as the counting path:{**os.environ, **_child_run_env(deadline)}. Preserve the existingdeadline is Nonesemantics: if None is a real state there, extend_child_run_envto acceptdeadline: float | None(None → omit the TEST_DEADLINE key, STILL stamp SANCTIONED_RUNNER_ENV and ORCH_RUN_ID) — the 13 existing cap contract pins must stay green unchanged; if you must adjust a pin's call shape, report why (semantics may not weaken). - Solo-retry path (:931): pass the same stamped env (cap consistency for retry rounds).
- E2E WIRING PIN (the owed "capped-exit end-to-end test pin", behavior-shaped, no mocks):
drive the real
run_tests.pybatch path over TWO tmp fixture test modules (a 2-file selection is multi-file → the guard kills it iff unstamped) and assert the run COMPLETES with both modules' results (no RUL-038 refusal in the output/exit path). Proof-by-behavior: the pin fails if the stamp wiring regresses, which is exactly the defect class that shipped. If a full run_tests.py invocation is too heavy for the test, pin the next-best real seam (the child-env construction the execution path actually uses, asserted to carry SANCTIONED_RUNNER_ENV + TEST_DEADLINE) AND name the residual gap in your report — do not fake end-to-endness.
VERIFY (report verbatim)
.venv/bin/pytest tests/scripts/test_run_tests_cap.py -o addopts="" -q # 13 pins + your new pin(s), all green
.venv/bin/python scripts/run_tests.py tests/scripts/test_flake_report.py tests/scripts/test_slot_lease.py --skip-gates # 2-module batch run: completes, NO guard refusal (this exact shape died pre-fix)
.venv/bin/ruff check scripts/run_tests.py tests/scripts/test_run_tests_cap.py
.venv/bin/black --check scripts/run_tests.py tests/scripts/test_run_tests_cap.py
.venv/bin/python scripts/test-review.py tests/scripts/test_run_tests_cap.py --stdout # 0 findings
(The 2-module run_tests.py invocation is the sanctioned runner — allowed and required here; it is the regression proof. Never bare multi-file pytest.)
Report
The diff summary (both call sites + any _child_run_env signature change), the pin's mechanism and
what it proves, all VERIFY outputs verbatim, anything unfaithful named. Do not commit — the
coordinator verifies, commits, and re-runs the push. RUL-037. Another coordinator session owns the
PI-* fences (pyproject/uv.lock/codetools) — do not touch them.