Repository navigation
feat(improve): regression corpus store and growth - #987
Merged
Merged
Conversation
LinuxDevil
force-pushed
the
s13-corpus
branch
from
November 8, 2026 21:33
fb31baa to
fb8c7f0
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
s13-corpus
branch
from
November 8, 2026 21:59
fb8c7f0 to
104c8b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
M4 S13 (part 1 of parity B9). The corpus guard (S14) needs a corpus: protected passes, plus each training case a kept edit fixed, so a later edit can't silently break it again.
Changes
src/improve/corpus.ts, exported fromlousho/improve:CorpusCase { id, traceId, input, addedAt, revision, origin: 'protected' | 'fixed', baseline }.readCorpus(dir)reads.lousho/corpus.json. It returns an empty list when the file is missing. It throwsLOUSHO_CONFIG_INVALIDwhen the file is broken, a symlink or not a regular file, or holds an id or trace twice. A broken file is never treated as empty, so it is never overwritten.addToCorpus(dir, cases, maxCases)holds a file lock and does the following:traceId;idthat another trace already uses, since the guard keys by id;fixedcases overmaxCases, ordered by actual time;protectedcases;.lousho.async, unlike the ticket's sketch, because it takes a lock. That matches S4/S5.addedAt; and a baseline with0 <= passed <= scoredandscored >= 1.evidence.ts,run.tsandimprove.tsdon't reference it). S14 replays it only through the probe.fixedcase joins only after the monitor (S10) returnskeptand a fresh 6/6 under the new revision throughadmitProtectedCases.Testing
src/improve/corpus.test.ts(13 tests) covers:maxCases;.lousho, which is refused and leaves the target untouched;.lousho, and id collisions) and 3 medium items (addedAtordering and validation, baseline bounds, empty fields). All are fixed and tested.api:update/api:check,docs:llms:check,docs:verify-snippets -- --skip-build,docs:ratchet(1724) andfallow audit --base origin/main.🤖 Generated with Claude Code