Skip to content

Commit f09bff7

Browse files
wongkclaude
andcommitted
feat(code-review): add deterministic prefix golden harness (PLN-1229 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>
1 parent bb41a01 commit f09bff7

132 files changed

Lines changed: 4989 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plugins/code-review/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-review",
33
"description": "Code review plugin",
4-
"version": "3.1.0",
4+
"version": "3.1.1",
55
"author": {
66
"name": "ClosedLoop",
77
"email": "support@closedloop.ai"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"findings": [
3+
{
4+
"category": "Correctness",
5+
"code_snippet": "C0 = 0",
6+
"confidence": 0.8,
7+
"emitted_at": "<TS>",
8+
"explanation": "Prior review flagged an unnamed constant here.",
9+
"file": "src/constants.py",
10+
"finding_scope": "diff",
11+
"issue": "Cached: magic constant should be named.",
12+
"line": 1,
13+
"recommendation": "Extract the literal into a named constant.",
14+
"reviewer": "bha_p0",
15+
"severity": "MEDIUM",
16+
"source": "agent"
17+
}
18+
]
19+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"diff_scope": null,
3+
"review_mode_line": "Review mode: Auto incremental skipped: reason=no previous review, using full diff"
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"cache_dir": "<HOME>/.claude/cr-cache-repo-fixture_repo"
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"cached_files": [
3+
"src/constants.py"
4+
],
5+
"stats": {
6+
"cached": 1,
7+
"hit_rate_pct": 50.0,
8+
"total_files": 2,
9+
"uncached": 1
10+
},
11+
"status_kind": "hits",
12+
"status_message": "BHA Cache: 1/2 files cached (50.0% hit rate) -- 1 files skip BHA review",
13+
"uncached_files": [
14+
"src/app.py"
15+
]
16+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"critic": {
3+
"coverage_state": "<CR_DIR>/coverage.json",
4+
"model": "sonnet",
5+
"reason": "no-roster",
6+
"status": "skipped"
7+
},
8+
"final": {
9+
"best_effort": [],
10+
"budget": {
11+
"best_effort_count": 0,
12+
"bha_partitions": 1,
13+
"domain_critic_cap": 3,
14+
"domain_critic_cap_fired": false,
15+
"required_count": 4,
16+
"total_cap": 20
17+
},
18+
"deferred_for_budget": [],
19+
"deprecation_warnings": [],
20+
"dropped_required": [],
21+
"required": [
22+
{
23+
"reviewer": "bug_hunter_a",
24+
"source": "core",
25+
"trigger": {
26+
"type": "always"
27+
}
28+
},
29+
{
30+
"reviewer": "bug_hunter_b",
31+
"source": "core",
32+
"trigger": {
33+
"type": "always"
34+
}
35+
},
36+
{
37+
"reviewer": "unified_auditor",
38+
"source": "core",
39+
"trigger": {
40+
"type": "always"
41+
}
42+
},
43+
{
44+
"reviewer": "test_quality",
45+
"source": "core",
46+
"trigger": {
47+
"type": "always"
48+
}
49+
}
50+
]
51+
},
52+
"initial": {
53+
"best_effort": [],
54+
"generated_at": "<TS>",
55+
"required": [
56+
{
57+
"reviewer": "bug_hunter_a",
58+
"source": "core",
59+
"trigger": {
60+
"type": "always"
61+
}
62+
},
63+
{
64+
"reviewer": "bug_hunter_b",
65+
"source": "core",
66+
"trigger": {
67+
"type": "always"
68+
}
69+
},
70+
{
71+
"reviewer": "unified_auditor",
72+
"source": "core",
73+
"trigger": {
74+
"type": "always"
75+
}
76+
},
77+
{
78+
"reviewer": "test_quality",
79+
"source": "core",
80+
"trigger": {
81+
"type": "always"
82+
}
83+
}
84+
],
85+
"scope": "code-review",
86+
"stats": {
87+
"best_effort_count": 0,
88+
"detected_change_classes": [],
89+
"required_count": 4,
90+
"rules_evaluated": 0,
91+
"rules_matched": 0,
92+
"signal_count": 1
93+
},
94+
"warnings": []
95+
},
96+
"verify": {
97+
"checked_at": "<TS>",
98+
"verdict": "PASS",
99+
"violations": []
100+
}
101+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"findings": []
3+
}

0 commit comments

Comments
 (0)