Commit 7ebca4e
feat(code-review): in-process run-prefix segment runner + subprocess A/B parity oracle (PLN-1229 Phase 1)
Collapse the deterministic prefix (stages 01→cache_check) from one
orchestrator turn per stage into a single resumable process.
Production (code_review_helpers.py):
- cmd_run_prefix: reads run_plan.json + setup.json, resolves each stage's
<ANGLE_BRACKET> tokens from prior-stage artifacts, dispatches cmd_* in-process
with the stage's stdout redirect, honors on_failure + validation gates, and
pauses at the genuine decision points — Gate A (hygiene_only), a PLN-725
singleton needs_agent, or the Phase-1 boundary (stage_17_partition →
ready_for_route). Resumable: the depends_on completed set is reconstructed
from artifacts on disk, so each --resume-from segment is a fresh process.
- _execute_stage_inprocess mirrors the start.md Walker Contract steps 1-5;
continue_with_coverage_gap emits a canonical agent-failure system finding.
- Registered run-prefix in config/cli.json (46th subparser).
Parity oracle (prefix_golden_harness.py + test_prefix_golden.py):
- Subprocess A-side (one python3 helpers.py <stage> per stage, real > redirect)
vs B-side (python3 helpers.py run-prefix per segment). A and B implement the
walk wrapper independently, so a shared wrapper bug cannot hide. Byte-equal
(normalized) artifacts through cache_check across all 7 P0-B fixtures, plus a
pause-sequence test pinning the resumable 3-segment contract.
- A failing gh stub shadows PATH so subprocess stages take the deterministic
no-PR branch; env is snapshotted inside the hermetic HOME redirect.
P0-C contract tests (test_code_review_helpers.py, 31 tests): token resolution,
completed-set reconstruction, singleton needs_agent detection, on_failure
abort/continue incl. coverage-gap emission, and cmd_run_prefix error/boundary
returns.
SCHEMA.md §7b documents the run-prefix result contract. Zero orchestrator
changes (start.md untouched) — validated purely by the parity oracle. Route +
partition (Segment 3) fold in at Phase 2.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 341c9be commit 7ebca4e
8 files changed
Lines changed: 1554 additions & 23 deletions
File tree
- plugins/code-review
- .claude-plugin
- tools/python
- config
- fixtures/run_plan_snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
496 | 539 | | |
497 | 540 | | |
498 | 541 | | |
| |||
0 commit comments