Repository navigation
test-proof: local test runs as verifiable review evidence (CI at merge unchanged) - #997
Conversation
…n cite The owner approved (2026-12-04) that local test runs by agents may count toward review, with proof, never replacing the CI check at merge. `devteam.mjs test-proof [--ticket id] [--gate name] -- <test command>` runs the command as `gate` does (gentle priority, exit status passed through, logged as a gate line) and writes, under tickets/<id>/reviews/proofs/: - <stamp>-<sha12>.tap: the command's stdout whole; - <stamp>-<sha12>.json: the command, the commit and tree it ran at (or the sha256 of the uncommitted change when the tree was dirty), Node's version, start and end, exit code, pass/fail/skip/todo/cancelled counts read from the TAP (node's summary lines, else top-level test points), the output's sha256, and the id of the gate line, which carries the same hash in a new optional `proof` field (log schema). `test-proof verify [<id>] [--sha s] [--json]` reads each proof committed at the head and says current (it tested this head's code: same commit, or a tree that differs only under the ticket's reviews/), stale (the code changed), dirty (no commit names what ran) or broken (output hash, recount, file name or log line don't match: edited or hand-written). Exit 0 only when a current proof passed and none is broken. verdictHolds counts an added proof file (proofs/<stamp>-<sha12>.json|.tap) like an added review record, so committing a proof after a final verdict keeps it holding; editing one voids it. worker.md §6 says how to make and cite one; §8 asks for a current proof before the final review. CI and merge's gates are unchanged. Tests: test/test-proof.test.mjs (fixture ticket). Mutation-proved: 12 mutants (counts, hash check, recount, log presence, log match, stale and current judgement, dirty judgement, dirty hashing, exit status, the verdictHolds proof allowance, a failed run counted as passing), all killed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inal reviewer may cite one Two additions to §3 "At an exact head", nothing else: - a test proof under reviews/proofs/ counts as a newly added review-record file for whether a verdict holds (what verdictHolds now does); - a final reviewer may cite a current, passing test proof (test-proof verify, worker.md §6) instead of rerunning that test command, naming it in the record; CI and the merge gates still run at merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR #997 review B: test-proof works as described on the happy paths, but verify blesses two cases it should not
What I ran vs only readRan (scratch clone,
Only read: the What held up in the probe: a proof goes Findings
Notes
Opened by the box operator. Verdict: CHANGES cf2ec3e |
PR #997 review A: a "current, passing" proof can be had at a head whose tests fail
What I ran vs only readI ran everything in a scratch clone at the head, with
Findings
Notes
Opened by the box operator. Verdict: CHANGES cf2ec3e |
… gate, every field bound, records in home Fixes PR #997's finals A and B and devteam-dev's supervisor's points: - passed needs exit 0, TAP, no failed or cancelled test and at least one pass; else failed or inconclusive (A1) - with no command test-proof runs the settings' gate on main as sh -c <cmd>: a full proof; a named command is partial; only a full one is citable, and it turns partial when the gate's command on main changes (A2, F3) - HEAD and the tree are read again after the run: a change makes it dirty (A3) - the newest current proof of a command decides: a pass under a newer failure is superseded (F1) - the gate line's proof is the sha256 of the whole record (keys sorted, all but log); the file's stamp must match started (F2) - verdictHolds: an added proof keeps a verdict only when well formed; a proof is never filled in, so any edit voids - a final record cites a proof by file and sha256 (the line verify prints); check-ticket holds the cite to verify's rule at the verdict's commit - records-in-home tickets: run in the link's checkout of ticket/<id>, the link's commit recorded, the files written to home's records checkout; refused from home; verify reads the link's ticket branch - the command recorded as run; the dirty check leaves out reviews/, as verify does; an unknown ticket is refused - worker.md §6/§8: full vs partial, citing, the reviewer still runs one test command, how a reviewer's proof reaches the branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reviewer still runs one test command A test proof added after a verdict is a review-record file only when test-proof verify finds it well formed, and editing any byte of one voids it. A final reviewer may cite a current, full, passing proof instead of rerunning the full suite, by the cite line verify prints (file and sha256); it still runs at least one test command itself and the mutations it owes, as the spec reviewer re-runs a red seen cell. A proof the record doesn't name is no evidence the reviewer relied on. Owner-only text: waits on the owner's answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes for finals A and B and devteam-dev's supervisor's points, head 3d198d3The new commits are
Mutations25 mutants: 22 killed, 3 equivalent survivors. The survivors are A1's Not done (Minor)
Local runsAll pass, run with
CI at this head is still running. Opened by the box operator. |
PR #997 review B2: the proof rules are sound, but a cite fails closed in two ordinary cases, and the owner's text overstates what a proof proves
What I ran vs only readRan, in a scratch clone at the head, with
Only read: the whole engine diff, What held up: every fix claimed for A1 to A4 and F1 to F5 is in the code as described. No existing gate is weakened that I could find: Findings
Notes
Opened by the box operator. Verdict: CHANGES 3d198d3 |
PR #997 final review A2: a "full" proof can still be a subset run, or sit beside a failure verify ignores
What I ran vs only readEverything ran in a scratch clone at the head with
Findings
Notes
Opened by the box operator. Verdict: CHANGES 3d198d3 |
… the log's runs count, agreeing runs keep a cite, CI's unlanded log - A-I1: a gate runs at the checkout's root with gateEnv for the ticket (DEVTEAM_GATE_TICKET), from any folder; the record keeps the folder (cwd), and a full proof needs '.'. - A-I2 / B-F1: a current proof is superseded only by a newer run of the same command and folder at the same code that disagrees. Runs are the committed proofs and every proof-bearing gate line in the log (proof_cmd, proof_passed), so a thrown-away or deleted failing run still counts; an agreeing pass (a second reviewer's, a worker's rerun) supersedes nothing; a dirty run counts for nothing. - A-I3: only the test gate's run is full; --gate <other> records partial and verify judges it so. - B-F2: check-pr (forge) treats a proof whose run isn't in the landed log as unverifiable on CI: a warning, never a failure, and never a voided verdict; merge still holds it to its line. The missing-line message no longer says "by hand". - B-F3 / B-F4: worker.md §6 says what a proof is not, and that the reviewer's own run is stated, not checked. - B-F5: a test that the cite is judged at the verdict's commit (main merged in after it). - Minor: TAP counts come from summary blocks (tests and pass together), so a lone "# pass N" a test prints adds nothing. - New tests in test/test-proof.runs.test.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test gate is full; a newer failing run supersedes; the reviewer's own run is stated, not checked Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes for re-finals A2 and B2, head f9942f7The new commits are
Final governance text (quality.md §3), word for word"At an exact head" keeps only its proof clause ("… (a test proof under
It still needs the owner's answer ( Mutations15 new mutants, each in a copy of the worktree with the relevant test file run, all 15 killed:
I checked that each was killed by the assertion meant for it, not by a timeout. Running the whole file caught one real bug: a folded log object keeps Local runsAll pass, run with
The new tests are in their own file, because CI at this head is still running; I'll follow it. Opened by the box operator. |
…nd 20 pass what follows a file to the test) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Head 2778272: CI greenAt The Node 22 chrome shard also failed once, in CI at The governance text is unchanged from my previous comment. Opened by the box operator. |
PR #997 review b3: the earlier fixes hold under a worker's and a second reviewer's hands, but verify and check-ticket now pay for every proof run the log has ever held
What I ran vs only readEverything ran in a scratch clone at the head,
Every fix claimed for A-I1, A-I2, A-I3, B-F1, B-F2, B-F3, B-F4 and B-F5 is in the code and behaved as described when I drove it. I found no authority widened beyond what the body states: both doc changes are named owner-only, the body says nothing merges on reviewer approval, and merge's gates, Findings
Notes
Opened by the box operator. Verdict: CHANGES 2778272 |
PR #997 review a3: the claimed fixes hold under probe; no Critical or Important found, five Minor items
What I ran vs only readEverything ran in a scratch clone at the head with
FindingsFindings: none (no Critical or Important). Notes
Opened by the box operator. Verdict: APPROVE 2778272 |
…it; an index-flagged file makes a run dirty proofVerdict asked git (cat-file -e, diff --quiet) about every proof-bearing gate line in the log, of every ticket, at any date (round-3 B-F1). Now a log line is skipped unless its command is one a current proof ran and it is newer than the oldest such proof's end; only then is its commit asked about, through codeSince, memoized per process for each head and commit and shared with judgeProof, so check-ticket judging several cites asks once a commit. A test appends 400 old lines and counts git probes through a test-only stderr trace (DEVTEAM_TEST_PROOF_TRACE); two newer failing runs at other code leave the pass citable (kills the same-code mutant, B-N4/A-m3). dirtyHash reads git ls-files -v: a tracked file marked skip-worktree or assume-unchanged hides its changes from status and diff, so its being marked makes the run dirty (B-N1). check-pr's unlanded warning says check-ticket and merge fail a missing line on the box (B-N3/A-m2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s; by as written; index flags; the warning as printed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…supersedes; both directions; check-pr warns where check-ticket fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 fixes at 1aef264Replies to b3 (issuecomment-7423405659, CHANGES) and a3 (issuecomment-7423574959, APPROVE with minors). Three commits on top of 2778272, no rebase:
Mutations this round: 4, all killed. The fourth, Local runs at the final code ( Final governance text (quality.md §3), word for word
Opened by the box operator. |
PR #997 review b4: the round-3 cost fix removes the old-line cost and the filter drops no run that should supersede; one cost path is left (newer full-gate runs of other tickets), Minor
What I ran vs only readEverything ran in a scratch clone at the head,
Governance: the delta widens nothing. The quality.md change is alone in FindingsFindings: none (no Critical or Important). Notes
Opened by the box operator. Verdict: APPROVE 1aef264 |
PR #997 review a4: delta final after round 3 (B-F1 git cost, index-flag dirtiness, doc sync)
What I ran vs only readScope: Tests, scratch clone, one file at a time through
Mutations: each was applied to
Probes, by reading the code:
CI at head: FindingsFindings: none. Notes
Opened by the box operator. Verdict: APPROVE 1aef264 |
…er many (b4 N1); proofVerdict's comment brought up to date (b4 N5) Every ticket's full proof runs the same command, so other tickets' runs made after a ticket's proof pass the cheap filter. Their commits are now asked about together: one cat-file --batch-check for which are in the clone, one diff-tree --stdin for which differ from the head under the same pathspec. Nothing is filtered by ticket: another ticket's run at the same code still supersedes, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in what a proof is not; by also names responder and plan-<feature> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orge's CI, and only warns wherever it runs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b4 N1 (residual cost: other tickets' newer full runs), fixed in
|
b4 N2 (quality.md §3,
|
b4 N3 + N4 / a4 (stat-cache hide, sparse checkout), fixed in
|
a4 suggestion (
|
b4 N5 (stale comment above
|
PR #997 review d5: delta since APPROVE at 1aef264
Scope: What I ran vs only read
Findings: none. Notes
Opened by the box operator. Verdict: APPROVE 642d55b |
|
Delta confirm review: 642d55b (approved) to 4234759 (merge of origin/main d0a0608) What I checked:
Verdict: APPROVE at 4234759 Opened by the box operator. |
PR #997 review d6: delta since APPROVE at 4234759
Delta from review d5's comment 7435990869 (APPROVE 4234759). What I ran vs only read
FindingsFindings: none. Notes
Opened by the box operator. Verdict: APPROVE 0fdde42 |
Cause
The owner asked the operator (2026-12-04, in the operator's terminal; not a recorded owner answer) for agents' local test runs to count toward review, but only with proof, and never in place of the CI check at merge. Until now a review record could only say "I ran the tests". Nothing showed which command ran, at which commit, on which Node, or with what result, so a reviewer had to run the tests again or take the claim on trust. A stale or edited claim couldn't be caught either.
Owner's yes needed: both commits' text, nothing merges on reviewer approval
process/worker.md(§6 "Test proofs", "What a proof is not" and "Citing a proof", §8 step 3, in commitsea360aa5,cb28330c,f378e1ae,39eae4c6andc18cd69c) andgovernance/quality.md§3 (commitscf2ec3e3,3d198d3d,f9942f78,1aef2644and642d55ba). Both change what counts as review evidence:process/andgovernance/change only with the owner's answer (constitution.md,process-editandgovernance-edit).verdictHoldsandcheck-ticketchanges enforce the §3 rule the text states.q-…id. It doesn't merge on reviewer approval alone.Governance text (quality.md §3), final, word for word
The changed passage in "At an exact head":
A new bullet after it (the cite sentences moved out of "At an exact head" into a line of their own):
The governance edit is in its own commits (
cf2ec3e3,3d198d3d,f9942f78,1aef2644, then642d55baon top, which makes thecheck-prclause exact on the box and on CI: on the boxcheck-prreads the live log, only on a forge's CI is it the landed log alone, and the warning, not a failure, is the same wherever it runs). None touches code.For the owner's question, both directions of supersession: after a newer failing (or inconclusive)
test-proofrun at the same code, a cite of the earlier pass is dead for good and the ticket needs a new final review, so a flaky failure by a second reviewer costs the first reviewer's approval; a still newer pass is citable again, so a flaky suite rerun until it is green yields a citable proof. That is intended: CI and the merge gates still run the suite at merge.Design
devteam.mjs test-proof [--ticket id] [--gate name] [-- <command>]testgate asmergeruns it:sh -c <the gate's command>, read from main's committed settings (home's gates, or the link's), at the checkout's root whatever folder it is called from, with merge's gate env (gateEnvwith the ticket, soDEVTEAM_GATE_TICKETis set). The record keeps the folder (cwd). This makes a full proof.--gate <other>runs another gate the same way but makes a partial proof: merge runs only thetestgate as the full suite.-- <command>runs a command you name in the caller's folder and makes a partial proof. That is evidence of that command alone, never of the suite. Only a full proof can be cited instead of rerunning the suite.<stamp>-<sha12>.jsonand<stamp>-<sha12>.tapto the ticket'sreviews/proofs/. The.jsonholds the gate, scope, the command as run, the commit and tree, Node, start and end, exit, the TAP counts and the output's sha256. The.tapis the stdout, whole.prooffield is the sha256 of the whole record: keys sorted, every field butlog, the output's sha256 among them. The file's stamp must matchstartedand its sha12 must matchsha. The line also carriesproof_cmd(the sha256 of the command and folder) andproof_passed, so the run counts whether or not its files are ever committed.skip-worktreeorassume-unchanged(read fromgit ls-files -v; git hides its changes from status and diff), or a change while it ran, make the proofdirty. The dirty check leaves out the ticket'sreviews/, as verify does.ticket/<id>and records the link's commit, tree andrepo..worktrees/records-<id>, or a review worktree's-recordsbeside it.devteam.mjs test-proof verify [<id>] [--sha s] [--records s] [--json]judges each proof committed at the records head against the code head. The code head is--sha, else this checkout's HEAD when it is the code's, else the code repo'sticket/<id>. Each proof gets three labels:current,stale,dirtyorbroken. Broken means the name, output, recount, ticket or log line doesn't match, or the record was edited.passed,failedorinconclusive.passedneeds exit 0, TAP present,fail0,cancelled0 andpass> 0. Exit 0 with no TAP or nothing passing isinconclusive.fullorpartial. Full needs thetestgate, run at the root (cwd.), with the gate's command on main now. Another gate, another folder, or a gate command changed on main since is partial.Supersession. A current proof is superseded by a newer
test-proofrun of the same command and folder at the same code that disagrees with it: a pass by a newer run that did not pass (failed or inconclusive), one that did not pass by a newer pass. A plaingaterun carries no proof and supersedes nothing. The runs are the committed proofs and every proof-bearing gate line in the log, so a failing run whose files were thrown away orgit rmed still supersedes the pass before it. A newer run that agrees (a second reviewer's pass, a worker's rerun) supersedes nothing. A dirty run counts for nothing.Cost (round-3 B-F1). The log keeps every proof run of every ticket. verify asks git (
cat-file -e,diff --quiet) only about log runs of a command some current proof ran, newer than the oldest such proof'sended, and only once per commit per process (codeSince, shared withjudgeProof, socheck-ticketjudging several cites asks once per commit). An old line, or another command's, costs a string compare. Every ticket's full proof runs the same command, so other tickets' newer full runs do pass that filter (b4 N1); their commits are asked about together, in two git calls however many there are (codeSinceAll: onecat-file --batch-checkfor which are in the clone, onediff-tree --stdinfor which differ from the head under the same pathspec). They are not filtered out by ticket, because another ticket's run at the same code (a dependent ticket built on this one's head, say) is a real run of that code and still supersedes, as before. A test appends 400 old failing proof lines (half this command, half others, each at its own commit) and asserts, from a test-only stderr trace (DEVTEAM_TEST_PROOF_TRACE), that git is asked about none of them. verify exits 0 only when a current, full proof passed, is not superseded, and none is broken. It then prints the cite line:- Test proof: <file> sha256:<json sha256> (gate test: \`) current at `.Verdicts.
verdictHolds: an added proof keeps a verdict only when it is well formed at the head. A proof is never "filled in", so any edit voids the verdict. As for every record, an edit and its exact revert count as no change.check-ticketholds each- Test proof:cite in a latest final APPROVE to verify's rule at the verdict's commit. The named file must be committed with that sha256, current there, full, passed and not superseded. A malformed cite line fails too. Judged at the verdict's commit, a cite still stands after main is merged in, as the verdict does.byis the log's writer: the ticket in the worker's session and in a reviewer session that inherits itsDEVTEAM_TICKET,supervisorfor a run in a review worktree with--ticketfrom the supervisor's session,responderorplan-<feature>for one with--ticketfrom the responder's or a planner's session, never the reviewer. Socheck-ticketcan't tell the reviewer's run from the worker's. quality.md §3 and worker.md §6 say so.check-pr), only the landed log is read, andlog-synclands it about once a day. A cited proof whose run isn't there yet is a warning ("unverifiable there until the log lands"), never a failure.check-pris in that mode wherever it runs, also on the box; the warning now sayscheck-ticketand merge, on the box, read the live log and fail it if it is missing there. A proof added after a verdict doesn't void it for that reason either. Merge, on the box, reads the live log and still holds every proof to its line. On the box a missing line reads "not in the log this checkout reads", not "written or edited by hand".Docs (
process/worker.md):NODE_OPTIONS, say) aren't bound. An edit git's stat cache doesn't see (same size, mtime put back, undercore.checkStat=minimalandcore.trustctime=false) isn't caught. A sparse checkout makes every run dirty, so nothing proven there is citable. The forge CI view. This is why CI and the merge gates still run everything at merge.reviews/proofs/, becausereview-worktree --removedeletes the review worktree.This is evidence, not attestation. A session that appends a matching gate line to its own log can still forge a proof (a test shows a forged record reads as
current, and is still judged partial when it claims another gate or folder). CI and the merge gates are unchanged and still required.Tests
test/test-proof.test.mjs(9 tests),test/test-proof.runs.test.mjs(6 tests, new inf378e1ae;2778272dmoves the smoke gate's--test-name-patternbefore the file, since Node 18 and 20 pass whatever follows a file to the test) andtest/test-proof.home.test.mjs(2 tests, records in home), on fixture fleets. They cover:cwd,proof_cmdandproof_passed), with an uncommitted review record beside the run not counting as dirty# pass 5a test prints adds nothingtest-prooffromsrc/still runs the gate at the root (the suite namessrc/a.test.mjs); a gate that checksDEVTEAM_GATE_TICKETandpwdpasses; a named command records its folder--gate smokepass is recorded and judged partial, never citable; with the test gate failing at the same code, verify is not okgit rmed; a newer pass restores; a dirty failing run counts for nothingfinal-3b.md) and a worker's rerun, both passing, leave the cite standing incheck-ticket; a failing rerun voids it, and still does once its proof is dropped (the log holds the run)check-ticket, while verify at the merged head says stalecheck-prwith the worker's live log set aside (CI's view): the verdict holds, no failure, and a warning says the run is unverifiable until the log lands; on the box (live log present) there is no warning; verify with the log set aside says "not in the log this checkout reads" and not "by hand"srcfolderskip-worktreeand anassume-unchangedfile with a lasting edit make the run dirty thoughgit statusis empty (B-N1)Mutation-proved. In the earlier round, 25 mutants: 22 killed, 3 equivalent survivors (A1's
from === 'none'clause, thecreated_bycross-check, therepocheck; kept as defence in depth). In this round, 15 new mutants, each in a copy of the worktree with the relevant test file run, and all 15 killed:cwdon the spawn;gateEnv(null)in place of the tickettest-gate check dropped; the judge's root-folder check dropped; the run's recorded scope full for any gatelandedOnlyignored in proofProblem; not passed by verdictHolds; not passed by judgeProof; check-pr not passingforgeto check-ticket; the warning branch removedpassRound 3, 4 new mutants, all killed (each with the named test run): the log loop without the same-code check (a failing run at other code supersedes: killed, "a failing run at other code supersedes nothing"); without the command/time filter (killed, 400 probes of old lines);
codeSincewithout its memo (killed, the commit asked about twice);dirtyHashwithout the index-flag check (killed, "skip-worktree: a marked file makes the run dirty").Round 4, 3 new mutants, all killed (
test-proof.runs.test.mjsrun each time): the batch call removed, back to git one by one per commit (killed, test 6: "415 single probes for 14 earlier proof commits"); the batch answering every present commitchanged(killed, tests 2, 3 and 6); answering every onesame(killed, tests 5 and 6).origin/mainwas merged in (05fd3966, no rebase) for kit-1243's project-hosts C3 fix.Run with
DEVTEAM_HUB_PORT=<unused> DEVTEAM_BOX=off node test/run.mjs --file-timeout 1200 …. All three proof files pass. These neighbouring files pass locally too: check-ticket, devteam-mjs-regions, kit.validate, gate-add, landing, multirepo-home.left, multirepo-home.records, review-dates, split-dist-docs.Limits and what I couldn't test
core.checkStat=minimal,core.trustctime=false) leaves the run clean; worker.md §6 says so (b4 N3). A sparse checkout makes every run dirty (b4 N4, a4).check-pron CI.proof_passed, which applies the same rule as verify, so it counts as a failure.# tests nand# pass ntogether) can still add to the counts. It can't hide a failure, since counts only add.testby default), like full ones.inconclusiveand can't be cited. Its project needs a TAP reporter in the gate's command.test/run.mjsand.github/workflowsare untouched.Opened by the box operator.
🤖 Generated with Claude Code