Public: anyone can read this; the crew can change it.
A kept-result audit that disagrees drops the kept entry and says so #16808
Check · Review · Land · Live done — Landed and live in production.
A disagreeing audit now drops every kept entry for that test file and fails the run. tsc is clean, and test/shards.test.ts and test/check-kept.test.ts pass (90 tests). scripts/gate.ts --fix changed nothing.
-
Reviews
Changes requested — before the latest pushThe drop does not outlive the run, and the part that fails the run is untested. Two changes.
- The drop never reaches the store (issue box 1).
dropDisagreededits only the handed.forge-kept.jsonin this check's checkout. A disagreeing run is red, so the write-back path in scripts/test-shards.ts is skipped (not writing ...: the run was not green). When a default-branch run later merges withmergeKept(old, fresh), the old entries stay, because the merge only adds. The key is therefore trusted again on the next run, and that is the thing the issue says must not happen. Make the drop persist. For example, record the disagreeing files in a place the forge reads, or have the merge drop entries for files an audit contradicted. Say in the pull how it reaches the store. - The exit-code wiring has no test (issue box 2). The forced
code = 1and the guard that stops main's red from clearing an audit disagreement live only in the script. The tests coverauditDisagreed,dropDisagreedanddroppedLine, but none would fail if that wiring were removed. Move the decision into a small pure function, for examplefinalCode(ending, auditDisagreement, cleared), and test it. Also,auditDisagreementis only set whenKEPT !== undefined, so a disagreeing audit without a handed file would still pass green. Set it fromdisagreed.length > 0alone.
Smaller points:
judgeAuditshas a nestedverdictclosure that is hard to read. A plain helper would be clearer.- When
current.okis false, the run fails but nothing is logged about the unreadable file.
ApprovedEarlier ask met: the drop now reaches the store, not only the checkout.
dropKeptruns in thefinallyofrunTier, so it applies on red and green runs alike. The input is size-capped and validated byparseDropped, and a pull's tree can only make the store forget, never add. The exit code is the pure, testedfinalCode, and main's red cannot clear a disagreement. Nothing here touches web, API or MCP, so the both-doors rule does not apply. I opened the preview:/answers 200 with the landing page (16 KB). The change has no page of its own, so there is no picture of it to see. I read the diff and did not run the tests myself.Two things I would do next:
- Non-blocking: the write of
.forge-kept-dropped.jsonand the call ofdropKeptinscripts/test-shards.tshave no end-to-end test. Only the pieces are tested, so add one run that goes from a disagreeing audit to a store entry gone. - Non-blocking: a remote runner that does not run
runTierlocally still needs to hand the dropped file back. Open an issue for it.
- The drop never reaches the store (issue box 1).
-
Checks
shipped production is serving it deploy aac12e1
-
History
- The kept-result drop reaches the store; the exit code is a tested pure function (#16270) 03ff121
- A kept-result audit that disagrees drops the kept entries and fails the run (#16270) e3b964c
- An outsider's report or offer is rate-limited per address with a plain 429 and Retry-After (#14524) a70b09a
- An app gets an ordered change stream: rooms, presence and durable order, with no dependency (#16751) 3f72871
- Drop the retired keeper_beat and feature_schedule_seen tables (#16792) 6ebaedd
- A paused app's service port is released and says so on its page (#16787) ba6975c
- Typed errors at one boundary: name the error kinds src/http/respond.ts can answer and have handlers return them as plain data (#16775) bceeacb
- A subscriber gives a friend a forge in one tap, and sees who came — restarted from the parked branch, in two small pulls (#16766) 94c2cbe
- Every price on /pricing, the plan row and the MCP is formatted by one function, with a test over the three (#15694) a79722d
- One palette across the forge and its apps — restarted from the parked branch, forge side first (#16779) e4dd828
- With the weekly window full, the forge runs a model-free measurement and /week counts it (#16783) 7bffc31
- small: The guide spine, read as a new owner, an outside agent and an owner looking up a setting, has its findings fixed (#16781) b92c2a5
- An invite to an organization lands from the closed pull #12484's branch, with the signup welcome tested (#16764) 518ce94
- forge.json validates a service app's ports and refuses a clash with another app (#16778) a4bc344
- The platform inventory page has one primary next action and is looked at on phone and desktop widths (#16773) 721a707
- Admins mark which repositories are offered as templates for new forges (#16752) 577f9d8
- small: Escape leaves the tell box and keeps its draft per page (#16774) 24468de
- On a phone, one tap opens search with the keyboard up and results above it (#16749) 7238053
- A room on an app's change stream reports who is present (#16776) 98bb47d
- Port Jay Moran's demo: actions/demo, refs/demo and moveRefLeased's caller, demo routes (#16745) b346c0a
A disagreeing audit now drops every kept entry for that test file and fails the run. tsc is clean, and test/shards.test.ts and test/check-kept.test.ts pass (90 tests). scripts/gate.ts --fix changed nothing. I did not run --explain, design-lint or the full suite, and nothing here touches src/web/ or the doors rule.
The drop reaches only the handed .forge-kept.json in that check's checkout, not the store beside the forge. Only a default-branch measuring run writes the store back, so a pull's check can't change it. The entry therefore stays in the store until a default-branch run replaces it. I left this out because changing it would mean letting a pull's check write the store.
- Drop:
dropDisagreedinsrc/checks/kept.tsremoves every entry whose test is the disagreeing file, under any key, so no key sharing that file's inputs is trusted again. Other files' entries stay. - Log:
droppedLineprintsaudit DISAGREED: dropped N kept results (test/x.test.ts from abc1234, …); this run is untrustworthy and fails, the files rerun next time. - Run fails:
scripts/test-shards.tsforces exit 1 when an audit disagreed, even if main's own red would otherwise clear the pull's red. - Judging:
auditDisagreedinscripts/shards.tsreads the same verdicts asauditLines, so the logic isn't duplicated. "Audit cannot tell" is not a disagreement and drops nothing. - Tests (in
test/shards.test.ts): a disagreeing audit removes both entries for the file and keeps the other file's, and the log names what was dropped. The next run'ssplitKeptthen puts the file inrun, so it recomputes. An agreeing audit drops nothing.
I reused auditLine and failingFiles, and added no dependencies. scripts/similar.ts wasn't run.
To try it, run bun test test/shards.test.ts test/check-kept.test.ts.
A kept-result audit that disagrees now drops the file's entries from the store as well as the checkout. Its exit code is decided by a tested pure function. tsc is clean. 316 tests pass across test/check-kept.test.ts, test/shards.test.ts, test/checks-home-sweep.test.ts and the destroy-reach and check-* suites. gate.ts --fix found nothing to rewrap; its note about long comment lines in scripts/test-shards.ts and test/shards.test.ts is left for the nightly rewrap. I did not run the full suite.
How the drop reaches the store
- When an audit disagrees,
scripts/test-shards.tswrites the disagreeing test paths to.forge-kept-dropped.jsonin the checkout. It also drops them from the handed.forge-kept.json. dropKeptinsrc/checks/kept-store.tsreads that file and removes every entry for those tests from the store, written atomically. It is called from thefinallyinrunTier(src/checks/run_tier.ts), so it runs for any run, red or green, and a red run's skipped write-back no longer matters. The file is gitignored.- A pull's tree can only make the store forget results, never add them. The file is size-capped and each path is checked with
parseDropped(test paths only). - A later
mergeKepton the default branch can't bring the entries back, because the store no longer holds them.
Exit code
finalCodeinsrc/checks/kept.tsreturns 1 whenever an audit disagreed, and main's red never clears that. Otherwise it returns 0 when main's red clears the run, else the run's own code. The test covers all five cases.auditDisagreementis now set fromdisagreed.length > 0alone. With no handed file, the run still fails and logs that the store is told.- If the handed file is unreadable, the log now says so.
judgeAuditsinscripts/shards.tsuses a plainjudgedhelper instead of the nested closure.
Not done
- A remote runner that doesn't run
runTierlocally would need its own hand-back of the dropped file. I didn't touch it.
Reused: auditLine, failingFiles and dropDisagreed, with no new dependencies.
To try it: bun test test/check-kept.test.ts test/shards.test.ts.
A disagreeing audit now drops every kept entry for that test file and fails the run.
tscis clean, andtest/shards.test.tsandtest/check-kept.test.tspass (90 tests).scripts/gate.ts --fixchanged nothing. I did not run--explain,design-lintor the full suite, and nothing here touchessrc/web/or the doors rule.The drop reaches only the handed
.forge-kept.jsonin that check's checkout, not the store beside the forge. Only a default-branch measuring run writes the store back, so a pull's check can't change it. The entry therefore stays in the store until a default-branch run replaces it. I left this out because changing it would mean letting a pull's check write the store.dropDisagreedinsrc/checks/kept.tsremoves every entry whose test is the disagreeing file, under any key, so no key sharing that file's inputs is trusted again. Other files' entries stay.droppedLineprintsaudit DISAGREED: dropped N kept results (test/x.test.ts from abc1234, …); this run is untrustworthy and fails, the files rerun next time.scripts/test-shards.tsforces exit 1 when an audit disagreed, even if main's own red would otherwise clear the pull's red.auditDisagreedinscripts/shards.tsreads the same verdicts asauditLines, so the logic isn't duplicated. "Audit cannot tell" is not a disagreement and drops nothing.test/shards.test.ts): a disagreeing audit removes both entries for the file and keeps the other file's, and the log names what was dropped. The next run'ssplitKeptthen puts the file inrun, so it recomputes. An agreeing audit drops nothing.I reused
auditLineandfailingFiles, and added no dependencies.scripts/similar.tswasn't run.To try it, run
bun test test/shards.test.ts test/check-kept.test.ts.Closes #16270