feat(code-review): deterministic prefix golden harness (PLN-1229 Phase 0) - #172
Merged
Merged
Conversation
…Phase 0) Build the deferred end-to-end prefix parity oracle for the run-prefix refactor: a harness that walks the whole deterministic prefix (stages 01→19b) in-process against real pinned-date git fixtures, with the two PLN-725 singletons stubbed and Gate A/B reproduced, snapshotting every intermediate artifact for byte-level drift detection. - prefix_golden_harness.py: fixture repo builder, hermetic env (HOME + gitconfig isolation), in-process stage executor via the real CLI parser, start.md angle-bracket token resolution, per-artifact normalization, PLN-725 singleton stubs, Gate A/B. - 7 P0-B fixtures + committed goldens: standard, fast-path, hygiene-only, empty-diff, cache-hit, since-last-review, coverage-critic. - test_prefix_golden.py: determinism oracle + golden compare + structural branch guards. - P0-D: targeted branch tests close prefix cmd coverage gaps (cmd_cache_check / cmd_resolve_scope / cmd_auto_incremental / cmd_finalize_cache now 0 missing lines). Full code-review suite: 1254 passed / 3 skipped. ruff + pyright clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the v3.1.1 CHANGELOG entry and list the new prefix harness / test / fixtures in the README repository-layout section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Phase 0 of PLN-1229 (FEA-2385) — the artifact-parity oracle that must exist before the
run-prefixrefactor (which collapses the orchestrator's stage-by-stage walk of the deterministic prefix into one in-process batch runner). Builds the front-half golden harness thatgolden_fixture_harness.pydeferred to "Phase 4b" and never shipped.The harness walks the whole deterministic prefix (stages
01→19b, stopping at the reviewer fleet) in-process, reusing production machinery rather than forking it, and snapshots every intermediate artifact for byte-level drift detection.How it stays faithful & deterministic
HOMEredirected to tmp (sofinalize-cachenever touches the real~/.claude) +GIT_CONFIG_GLOBAL/SYSTEM=/dev/nullisolation +_detect_open_prneutralized (nogh)._register_subparsers) builds each stage'sNamespaceexactly asmain()does.start.mdangle-bracket token resolution replicated, incl. thestage_07<DIFF_SCOPE>override.pln725_*.json), Gate A (hygiene-only exit), Gate B (route → fast-path → skip/augment partition).review_id, timestamps, prompt/cache hashes.What's included
prefix_golden_harness.py+test_prefix_golden.py(determinism oracle + golden diff + branch guards).cmd_cache_check/cmd_resolve_scope/cmd_auto_incremental/cmd_finalize_cachenow at 0 missing lines.Scope / risk
Additive, test-only — no runtime/orchestration behavior changes.
code-reviewbumped3.1.0→3.1.1(PATCH). The subprocess A/B parity oracle and therun-prefixrunner are Phase 1 (next PR).Verification
code-reviewsuite: 1254 passed, 3 skipped.uv run ruff check .+uv run pyright: clean.🤖 Generated with Claude Code