Soundness corpus: eighteen classes from bugs agents really shipped, after a study of which real fixes the checker reports #131
Loading…
Reference in a new issue
No description provided.
Delete branch "field-study"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Based on
whole-program-reach(#130), and contains it: the diff shown is this piece alone. It changes no rule and no pack data, only the soundness corpus.The corpus counts the bug classes that pass every gate and fail at run time, and until now every class in it was thought up by the people who wrote the rules. It measured what we imagined: 2 of 74 escaping. Nobody had asked the other question: of the bugs agents really shipped in a SAFE-TS project and later had to fix, how many would today's checker have reported?
The study
One adopter's history was read in full: all 506 commits that are not merges and change TypeScript source, subject and body, plus the defect log of its migration. That gives 124 fixes, one per thing repaired, each judged by what was wrong in the code before it:
The code before each fix of the first kind was checked with today's checker and today's std and packs. Of the 46 that could be judged:
Of the 15 judged defects from the migration log, 10 are reported today.
Two things make the 26% look better than it is. Several rules (
cycle-init-read,no-positional-children,exhaustive-dispatch,pending-without-close,unbounded-poll, ...) were written from this same history, so that share is mostly rules working on the bugs they were made from. And about half of the first kind were written before the project turned SAFE-TS on. The 72% is the more independent figure.What this adds
scripts/soundness/classes/field.mjs: eighteen classes, each the reduction of fixes the checker is silent on, under names of its own, with asourcefield saying how many fixes are behind it (corpus.mjs --listprints it). All eighteen passtsc,safe-ts check --deny-warningsand oxlint, and go wrong at run time, so the tracked number moves from 2 of 74 to 20 of 92: the corpus got harder, the checker did not get weaker. The corpus README gains "Where the classes come from", with the method and its bias.clock-domain-mixupperformance.now()andDate.now()literal-size-instead-of-tablevoid-discards-resultvoidon aResultreported, or counted as an escape hatchcoordinate-frame-mixupinit-path-divergenceduplicated-formula-driftsuperseded-task-applies-lateunused-task-signalwidened to a callback that writes captured state after anawait(0.4.0 reported this; it was narrowed since)encode-into-uncheckedencodeIntomust be usedlistener-after-awaitcloseorabortlistener added after anawaitexit-path-skips-releaseunreleased-resourcefor acquire and release pairs a project declaresstate-cleared-before-readargument-shift-after-insertlibrary-update-not-calledout-of-order-responsesuseTaskandlatestSignalexist; a rule would be noisyloop-decision-reads-loop-effectsset-add-counted-twice,float-roundoff-guard,lone-surrogate-lossyinsertin std that says whether it added; a pack hintFixes with no class: wrong predicates and checks that disagree (visible, but no rule could close them without knowing what the code is for), an observer only a browser keeps alive, tests that fail only under load.
Review
I read nine of the fixes against their verdicts (three of the first kind, six of the second) and agree with each. I ran today's binary on two of the extracted trees: one fix judged silent has no finding at its line, and one judged reported has the finding exactly where the fix later added the missing handler. I read all eighteen programs and ran the corpus with the binary of the base and of this branch: the same twenty escape. Four names in the programs had come from the fixes they reduce and are replaced.
For the owner to decide
init-path-divergence,duplicated-formula-drift,loop-decision-reads-loop-effects,out-of-order-responses). They are honest, and they mean the number will not reach zero.voidon aResult. The docs call it the explicit discard, and two real fixes are an agent using it to drop a failure it should have shown.Created with Claude Opus 5.5 (the study and the classes) and Claude Fable 5.2 (review, the merge) in Claude Code.