Skip to content

Latest commit

 

History

History
72 lines (65 loc) · 20.6 KB

ROADMAP.md

File metadata and controls

72 lines (65 loc) · 20.6 KB

crucible 1.0 checklist

Target: about 2027-01-04. 1.0 means a maintainer or a first-time contributor can install it, run it on a real PR and trust what it says.

Precision, measured on real PRs

  • crucible stats: kept vs dropped-by-verification vs later fixed/deferred/refuted (from answers), per project and overall, deduped across rounds (2026-11-05: 59 upstream reviews, 195 unique model findings, 96 kept, 16 of 21 answered held up, 75 kept still unanswered). Next: count findings a maintainer later raised that crucible missed (recall on real PRs)
  • A labelled fixture eval (crucible eval, 16 cases) with recall / false-blocking / cost in the README (v0.3)
  • Reviewer model chosen on our own upstream rounds, not only the fixture eval: crucible model-replay (2026-11-10) replays stored full rounds per reviewer model, scored by answers. 10 pairs (2026-11-10): Opus 10/11 held-up kept by hand (Wilson 62–98%), Sonnet 6/11 (28–79%), $0.63 vs $0.99 per held-up finding; no change. The report breaks arms down by change shape (kind, production lines); on the 5 pairs every held-up finding was multi-file, all cells too few. Since d19a283 every finished arm is kept and reused by the same review pipeline, so growing the sample pays only for new rounds. Next: ≥20 pairs, and label findings only the second arm raised (today they're listed, unscored)
  • A labelled set of at least 20 real merged upstream PRs replayed through crucible review, with precision and recall reported in the README
  • Grow the fixture eval to 30+ cases, including multi-file changes and severity calibration (the refcount case is found but rated medium)
  • A rerun on a reviewed commit re-judges an edited draft or a moved base instead of reusing the verdict (real-use bug i, 2026-11-04)
  • (2026-11-05: absence findings carry an anchor and are re-verified when it changes, with the bug-l falsifier test; incremental summaries no longer repeat the earlier round) A carried finding is re-checked when the later changes touch the same file, not only its cited lines (2026-11-04: a "no test for X" finding carried with stale evidence after the test landed lower in the same file). Seen again 2026-11-04 21:xx: 3 fixed findings (one in README.md:34, edited twice) were carried through 3 rounds and had to be answered by hand. Seen a third time 2026-11-05 (bug l self-review): a "no test for the re-check guard" finding carried for 2 rounds after its test landed. Seen a fifth time 2026-11-06 (CI-matrix self-review): CR-638ece8b was fixed in round 2 but carried through rounds 3-5 with its round-1 verification text, which cites code (a scoped-suffix match) that no longer exists; the edit was in the same function, 15 lines from the cited line. Seen a fourth time 2026-11-05 (bug j self-review): an incremental round's summary repeated the previous round's "no CHANGELOG entry" and "strict decoding" text after both were fixed (findings were re-checked correctly; only the summary was stale) · BLAZE lesson 2026-11-05 (exchange): key the re-check on "has the code it points at changed since the round that raised it", not on round count; and judge a check by its latest run on the head only (a cancelled run with nothing newer is "not finished", not "failed"). · BLAZE 2026-11-05 note: an answered finding keeps its answer only while its anchor holds (FIXED: the whole enclosing block unchanged; REFUTED/ACCEPTED/DEFERRED: the flagged line unchanged and no new copy in the block). An absence finding ("no test for X") has no line to hash, so give it an explicit anchor: the file where the missing thing should live plus the code it is about, and re-check when either changes. Ship it with a falsifier test: the 11-05 bug-l case (test landed, finding must not carry).
  • (2026-11-11, DRG-63) An incremental pass says its diff is the inter-diff since the reviewed commit, carries the whole base..HEAD change to its files, and the verifier's re-checks judge causation against the whole PR (colyseus #1000 round 2 replayed: misreading gone, a true carried finding no longer dropped; eval/NOTES.md)
  • Incremental re-review measured, not just spot-checked: crucible eval builds only full reviews and model-replay skips incremental rounds, so replay ≥5 stored amended rounds before/after any change to the re-review or re-check prompts (the 2026-11-11 check was 1 round)
  • Every new gate or heuristic ships with its falsifiers next to it: the inputs it must still refuse (stays NOT_GREEN) and the old inputs it must still accept, plus the first three real inputs it would reject, checked by hand (BLAZE exchange 2026-11-05; same lesson as the 11-05 \b regression).
  • A verifier that answers in prose (rejected StructuredOutput) is transcribed, not left unverified; a transcription never drops a finding (real-use bug l, 2026-11-05)
  • A finding left unverified by a failed verifier call (usage limit) is verified again by the next plain re-run, same commit or later, instead of being carried as unverified (supavisor #1142, 2026-11-07)
  • Each false-positive class seen in real reports gets a regression test (started: author notes counted as the PR body; template headings flagged as unusual; a check failing on an untracked scratch file, bug h; template comment/checklist/title counted as body length, bug g; a backticked build command not accepted as testing evidence, bug m; an owner-run repo's one-line self-merged PRs used as the length baseline for a contributor's body, 2026-11-06; description findings verified against a leftover PR_DRAFT.md when --draft points outside the clone, gamescope #2516, 2026-11-06; the reviewer model judging PR-body length on its own, 45 findings with 36 dropped by verification, and a folded <details> benchmark counted as body length, three-mesh-bvh #958, 2026-11-08; a PR's test lines counted against a size norm taken over whole PRs, waived on umu/colyseus/three-mesh-bvh/gamescope rounds, 2026-11-08)
  • [~] (2026-11-07: the "0 sections" half is done; the denied-command half is open) (quickstart run, itsdangerous, 2026-11-06) readiness printed "PR description follows template: … all 0 sections present" for a template with no ## sections; say "template has no sections to check" instead. Also: the verifier reported "the Bash call was blocked pending approval" when trying to run pytest, so the allowlist missed the exact form it used; log the denied command and widen the pattern (with a test).
  • (2026-11-09, c5f6a01..003b1a2: per-model usage on every call, review.json tokens_review/tokens_verify with unmetered and cached call counts, stats tokens per review and per held-up finding over metered reviews only; first figure on crucible's own 3 rounds: 1.16M tokens per held-up finding, n=5, 89% of tokens cache reads. Next: once n ≥ 60 upstream, consider quoting non-cache tokens alongside, since cache reads dominate the raw count) Token metering (BLAZE exchange 2026-11-09: the shared headline is tokens per held-up finding). util.claude() keeps only total_cost_usd; also keep usage (input, output, cache_read, cache_creation) per call and per model, sum it into review.json (tokens_review, tokens_verify, by tier), and have crucible stats print tokens per review and tokens per held-up finding (with n + Wilson CI on the precision part) next to $. Old reviews have no tokens: print "not recorded" for them, never 0. Test: a fake claude JSON with usage → summed correctly; a review without usage → "not recorded".
  • (2026-11-10, 4e578c2: shipped for all 3 tool-less call sites; probe + 5-input salvage A/B in eval/NOTES.md, verdicts identical, cold call −42%, review $ unchanged since salvage ran in 0/304 stored reviews; the saving is on learn) (2026-11-09: per-kind metering shipped, tokens_by_kind + stats "By call kind"; $0 baseline in eval/NOTES.md) Caching off for one-turn no-tools calls (BLAZE 2026-11-10 technique, their -47% on a lens call): once metered reviews carry salvage's own cache write/read, A/B DISABLE_PROMPT_CACHING=1 on the no-tools calls only (salvage, learn, style) on 5 paired inputs; ship only where nothing re-reads and $ drops. Tool-loop calls stay cached (the upstream review pass reads 8x what it writes).
  • (2026-11-10: --no-exec / CRUCIBLE_NO_EXEC=1 implies --skip-checks and gives the verifier TOOLS_READ plus a read-only prompt; a stored read-only verdict isn't reused by a later executing run; --skip-checks alone is documented as not stopping probes. 4 tests, all fail on the old code; a read-only review is never the incremental base of an executing run) (independent bench, 2026-11-09) --skip-checks still lets the verifier run node/pytest/python probes; in a sandbox that refuses them, all 59 attempts were blocked and the run had no execution. Add --no-exec (and make --skip-checks imply it, or document the difference), with a test that no runner is in the verifier's allowlist when set.
  • (done 2026-11-09: on a detached HEAD only reviews in HEAD's own history count, for incremental review and answer carry-over, and waivers are keyed by the commit) (independent bench, 2026-11-09) incremental history is keyed by branch, so reviewing several detached heads in one checkout shares history across them; the bench had to make a branch per head. Key incremental state by (base, head SHA) or refuse detached HEAD without --full. Test with two detached heads.
  • Verifier probes run in the developer's checkout with no network isolation and only a 1500 s per-call timeout (told BLAZE so, 2026-11-06). Run probes in a scratch copy with no network (container --network none or unshare -n where available) and a per-probe wall clock (~60 s), with a test that a probe trying the network fails.
  • (2026-11-06: done; the cause was a sparse checkout, not case: .github/ was tracked but never on disk. Lookup now lists disk + HEAD and matches any case; 33 clones swept, only supabase-docs changes) (supabase/supabase #53101, 2026-11-06) readiness said "no PR template in repo" although .github/pull_request_template.md exists: template lookup is case-sensitive. GitHub accepts any case and also docs/ and root locations; match case-insensitively. Test with a lowercase template.
  • [~] (2026-11-06 21:15: the path half is done. Findings cite the real draft path, and the verifier is shown the draft instead of "(file not present at this commit)". The keyword half is still open: gamescope's learned issue_ref_forms is ['closes: #N'] from merged PR bodies, so the suggestion followed learned data. Decide whether commit trailers (Fixes #N, aa289ea) should outrank bodies before changing anything.) (gamescope #2516, 2026-11-06) PR-body findings cite PR_DRAFT.md:1 even when --draft <path> points elsewhere; cite the real draft path. Same finding told us to use closes: #2516 although this repo's merged outside PRs use Fixes #N (aa289ea): learn the closing-keyword form from merged commits/bodies and don't suggest another. Test: a repo whose history uses Fixes #N gets no keyword suggestion.
  • (2026-11-06, three-mesh-bvh #959: GREEN locally on three 0.185, CI failed on 0.159.0) Readiness names CI matrix versions of a declared dependency that the local install doesn't match. Next: runtime axes (python-version/node-version) only when the change uses syntax or APIs newer than the matrix minimum, so it isn't a warning on every Python PR
  • (2026-11-07: added as held-out case py-fix-reintroduces-hang with a clean twin; crucible eval reports held-out recall separately; first run caught it, 0 false blocking on the twin) (gamescope #2516, worth keeping as a positive case) round 2 caught that the round-1 fix reintroduced the hang it was meant to remove (an added clear() whose destructor does an unbounded waitIdle, called before the new bounded wait). Add it to the fixture eval as a "fix re-introduces the defect via a callee" case.
  • (2026-11-06: python3 -m unittest|pytest and python3 -c probes allowed for the verifier, no bytecode written; it was 5/149 Python findings executed vs 14/64 JS. Next: measure the executed share on the next week of real reviews) The verifier could only run pytest on Python repos (no python3 -c probes), so Python findings are verified by reading far more often than JS ones (seen in crucible's own reviews, 2026-11-04). Decide on a safe probe runner. Seen again 2026-11-05: in crucible's self-review of bug l, 4 verifiers tried python3 -m unittest (or a mutant copy) and were blocked by the approval gate, so every Python finding came back by read. Next: allow the project's own test runner (python3 -m unittest) and throwaway scripts in a temp dir
  • Prefer Closes/Fixes #N over a bare #N for "issue linked", and reject template placeholders (v0.3)
  • (found 2026-11-10 by the self-review of the base-moved item) diff.parse keeps git's C-quoting for a path with a space or non-ASCII character ("b/caf\303\251.py" stays quoted, with its b/ prefix), so findings, coverage and the open-PR overlap check see a path that matches no file. Parse with -c core.quotePath=false or unquote the header; test with café.py and a b.py — DONE 2026-11-10 (de472ed..): headers, Binary files lines and the diff --git fallback decode to the real path; tests with café.py, a b.py, q"t.py, 新.py, "p and q.png"
  • (2026-11-10, BLAZE's 11-08 "stale base" class) Readiness reads the base branch's live tip (git ls-remote, $0) and warns when commits landed upstream since the merge-base in files the change touches; the local tracking ref was all crucible saw. Next: count how often it fires on the week's real reviews, and re-run project checks on the merged result when it does
  • Surface an open PR that changes the same lines even when it links a different issue (real-use bug k, Heroic #5776; 2026-11-05). Next: measure how often it warns on real PRs (busy files in Heroic: 12 line-overlapping PRs, #5776 ranked first)
  • (2026-11-07) Learned data is versioned: learn stamps meta.json/style.json with learn_version, and readiness warns on an older file, naming the fixes it misses (umu kept a Dependabot-polluted median for a day after bug j was fixed)
  • (2026-11-07) A description finding is verified against the judged draft only, and readiness warns when a newer PR body file next to it says something else (Lutris #7004: the verifier read PR_BODY.v2.md and dropped a true finding about the stale PR_DRAFT.md that was reviewed). Next: measure how often it warns on the week's real reviews
  • (2026-11-07) Withholding the reviewer's argument from the verifier is measured, not assumed: crucible anchor-replay on 20 answered findings gave 5/10 refuted kept and 1/10 real dropped without it, vs 6/10 and 1/10 with it (noise). Next: the same replay found that a plain re-verification drops half the findings authors later refuted, all kept the first time. Test whether 2 independent verifier votes (keep only if both keep) cut false alarms without losing the real ones, on the full 56, before changing anything
  • Baseline, 2026-11-04 (5 reports, 3 projects): 18 kept, 12 dropped by verification, 1 kept finding later refuted by the author
  • (2026-11-07) Spend and precision numbers count real work only: learn meters both of its model calls, and routing-replay counts a finding in the round that judged it, not again in every incremental round that carried it (raw refuted share 63% → 50%, the deduped stats figure is 44%)
  • (2026-11-08) crucible stats --since gives the window a daily note needs. An empty window prints "No data", not zeros (BLAZE 2 exchange 11-07), and held up comes with its Wilson 95% interval and an n ≥ 60 quote bar (as of 2026-11-08, since 11-07 05:15: 29/35, 67–92%, too few to quote; all time 61/73, 73–90%). Next: the exchange note quotes the weekly held-up share from stats --since once its window reaches n = 60
  • (2026-11-12) Budget-capped --nits reviews keep their nits: medium/low finding verification leaves a reserve (min(nit cap, 15% of the budget, $0.20/batch)), blocking findings go first on the whole budget (ReviewBench run 2: PRs 1 and 13 kept 0 nits at the $5 cap). Next: count PRs 1/13's kept nits and unverified findings on the next ReviewBench run
  • (2026-11-08) Big .po/.pot changes are reviewed as an entry digest, not a raw diff (Lutris #6952 round 1: $19.45 / 41 min / 33 chunks → $2.36 / 7.2 min / 4 chunks, the real catch kept). Next: the same treatment for other generated files a PR legitimately carries (lockfiles, snapshots, linguist-generated paths), each gated on a replay that loses no finding the author fixed
  • Cost routing by change type behind --route, gated by an offline replay of stored reviews (crucible routing-replay; 2026-11-05). Docs-only rounds get one cheaper pass. Lows-on-the-cheap-tier failed the bar (4 real lows lost on 57 upstream reviews, one fixed by the author), so it wasn't built
  • (2026-11-06: done; the old commit must still exist and share a changed file with HEAD; stubbed amend two-round test; on the real clones 16 of 40 past amend re-reviews were eligible, with deltas of 254 changed lines vs 1,045 in full. Next: measure the saving on the next week of real reviews with routing-replay) Incremental re-review across amended commits: 38 of 57 upstream reviews (67% of spend) were full re-reviews because the previous reviewed commit isn't an ancestor after git commit --amend. With the same merge-base, git diff prev..HEAD is still the change between rounds; require the old commit to exist, and prove it on a stubbed two-round amend test plus a replayed real pair

Quickstart and docs

  • pip install-able package with a crucible entry point (no hand-written shim): pipx install git+https://github.com/JROtto5/crucible (2026-11-05). Tagged v0.4.0 (2026-11-06); the quickstart now pins the commit its numbers come from (57f110f, 2026-11-11)
  • Quickstart on a public repo, timed for real: docs/quickstart.md. 2026-11-11: replaced the 2026-11-06 planted-bug run on pallets/itsdangerous (Pallets bans AI contributions) with a real catch on pyinfra-dev/pyinfra (merged #1587 replayed on its base; the crash #1730 fixed found in 139 s / $0.54), pinned to 57f110f. Next: time a full run to GREEN on it
  • (2026-11-08) docs/case-studies.md: 5 cases with public links (supavisor #1273, umu #740, Lutris #7004 and #7006, plus the three-mesh-bvh #959 miss), each checked against the merged diff. Next: add cases as more PRs merge; GitHub Discussions is johnr's repo setting
  • CONTRIBUTING.md (setup, what a change needs, safe defaults) and issue templates for a wrong finding, a missed issue and a bug (2026-11-05)
  • (2026-11-09: docs/commands.md, every flag has --help text; the PR_DRAFT.md layout stays in the README and is linked) Docs page for each command, including the PR_DRAFT.md layout
  • A worked example report from a public PR

Demo

  • Recorded terminal demo (review → answer → GREEN) on a public repo

Clean code

  • Tests for review.run_review with a stubbed model (no network): two-round incremental test (v0.3)
  • Stubbed tests for evalrun.write_results (NOTES.md splice, history columns)
  • Stubbed incremental test for the carried-finding re-check under a nit hold (blocking ones re-check on the whole budget, medium/low on the held view; self-review CR-725d67cf, 2026-11-12)
  • Lint (ruff) clean and run in CI: pyflakes + syntax rules, config in pyproject.toml (2026-11-05)
  • CI on GitHub Actions for the unit tests (v0.3)

Safe defaults

  • Never posts, never pushes upstream, never approves (drafts only)
  • Model calls isolated from the project's .claude/ settings and the user's MCP servers
  • Budget cap that leaves the review incomplete rather than GREEN
  • A test asserting that no command path calls gh with a write verb

Overlap check and the GitHub REST quota (found 2026-11-06, gamescope; done 2026-11-06)

  • Reported: six review rounds on gamescope (151 open PRs) in ~1 h, REST quota at 0 by 09:06 EST. Measured: the check makes at most OVERLAP_CANDIDATES (20) REST calls a round (6 rounds ≤ 120 of 5,000), so it was not the main consumer. The real bugs: every round refetched the same 20 patches, and in 3 of the 6 stored rounds the failed fetches were reported as "no readable patch" (in the other 3 the same PRs were "elsewhere").
  • Fix: GraphQL also returns each PR's headRefOid; its hunks are cached under ~/.crucible/cache/pr-hunks/ keyed by that SHA (7-day TTL), so only a moved head is refetched. A failed API call is reported as "couldn't be fetched … re-run later" and never cached. Live on gamescope: round 1 20 REST calls, round 2 0, same evidence. Tests: cache hit, moved head refetched (falsifier), failure not cached, per-repo cache.
  • Open: who did burn the quota (lane, pr-watch, queue-pos) is outside crucible; a gh api rate_limit reading in each shift log would show it.