fix(audit): close the OX low table against its own list (OX-L1..L19) - #43
Merged
Conversation
Audit OX-L1 through OX-L19, DECISIONS §69. Six fixed, five recorded at
their sites, three already "no action" in the audit itself.
max_audit.md's LOW table went unscheduled and was found open weeks later
(§55). The lesson recorded then was: close a document against its own list
of findings, not against the list of work that was done. So every row is
dispositioned here, including the ones not fixed -- that is the half that
goes missing.
Fixed:
L6 the per-session seen-hash cap was a bare 1000 inside
capSeenBlockHashes while sessionTtlMs, maxSessions and
maxContentEntriesPerSession were all settable. The one bound that
grows with conversation length was the one nobody could tune. Now
GatewayConfig.maxSeenBlockHashesPerSession, same default.
L7 the MCP overflow check ran BEFORE processBuffer and then cleared the
whole buffer, so a chunk carrying complete requests followed by one
oversized partial discarded the complete ones too. They were
well-formed, already received and answerable. Draining first leaves
exactly the un-terminated remainder for the limit to judge.
L9 the bench loader's `limits` merge could never fire -- ResolvedConfig
has no such field, which is why it needed two
`as unknown as Record<string, unknown>` casts. Deleting it also
removed the `as unknown as ResolvedConfig` laundering that disabled
type checking for every other key in that literal.
L10 dataset routing matched includes('humaneval') BEFORE checking for a
real path, so ./fixtures/humaneval-comparison-2026.jsonl was silently
answered with the bundled dataset. Now exact name, then path, then
substring as a last resort.
L12 package.json and src/version.ts are hand-synced; a test pins them
equal. Not restructured -- version.ts stays the single source per the
release procedure -- so this closes the drift class, not the
duplication.
L19 .gitignore was the full GitHub Python template: 245 lines, ~111
entries, Django through pdm, none of it used, with the dozen working
entries buried at the bottom. Now 44 lines / 25 entries, keeping a
real Python block for tokendamper-benchmark/. Verified by diffing
`git status --porcelain` across the change: nothing became newly
visible.
L6, L7, L10 and L12 are pinned by a new test file. L6 and L7 were
mutation-checked -- reverting either source file fails its test and only
its test.
Recorded, not fixed:
L1 expectedSavings: 0.45 is unconsumed and is not a measurement (the same
corpus reduces ~20% TS, ~16% Python). Left per the frozen-model
precedent H4 set and OX-H5 followed; nobody can set it, so it misleads
no caller.
L8 the MCP shutdown flush race. The fix depends on stream state that file
does not control, and getting it wrong hangs `tokendamper mcp` on
Ctrl+C -- which this suite cannot exercise. Same call as L4.
L13 /health exposing sessionCount is M8/M9's question. Answering it twice
in two places is how two answers drift.
L17 architecture import linting and L18 coverage tooling both need a new
devDependency. Not a call to make unasked on a LOW finding.
Verified: typecheck, lint and build clean, 91 files / 826 tests.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Audit OX-L1 through OX-L19. DECISIONS §69. Six fixed, five recorded at their sites, three
already "no action" in the audit itself — every row dispositioned.
max_audit.md's LOW table went unscheduled and was found open weeks later (§55). The lessonrecorded then was close a document against its own list of findings, not against the list of work
that was done. So the "not fixed" half is written down too — that is the half that goes missing.
Fixed
1000insidecapSeenBlockHasheswhilesessionTtlMs,maxSessionsandmaxContentEntriesPerSessionwere all settable — the one bound that grows with conversation length was the one nobody could tune. NowGatewayConfig.maxSeenBlockHashesPerSession, same default.processBufferand then cleared the whole buffer, so a chunk carrying complete requests followed by one oversized partial discarded the complete ones too. They were well-formed, already received, answerable. Draining first leaves exactly the un-terminated remainder for the limit to judge.limitsmerge could never fire —ResolvedConfighas no such field, which is why it needed twoas unknown as Record<string, unknown>casts. Deleting it also removed anas unknown as ResolvedConfigthat was disabling type checking for every other key in that literal.includes('humaneval')before checking for a real path, so./fixtures/humaneval-comparison-2026.jsonlwas silently answered with the bundled dataset. Now exact name → path → substring as last resort.package.jsonandsrc/version.tsare hand-synced; a test now pins them equal. Not restructured —version.tsstays the single source per the release procedure — so this closes the drift class rather than the duplication..gitignorewas the full GitHub Python template: 245 lines, ~111 entries, Django through pdm, none of it used, with the dozen working entries buried at the bottom. Now 44 lines / 25 entries, keeping a real Python block fortokendamper-benchmark/.L6, L7, L10 and L12 are pinned by
test/unit/audit-ox-low-findings.test.ts. L6 and L7 weremutation-checked — reverting either source file fails its test and only its test. L19 was verified
by diffing
git status --porcelainacross the change: nothing became newly visible.Recorded at their sites, not fixed
expectedSavings: 0.45is unconsumed, and the number isn't a measurement either (thesame corpus reduces ~20% on TypeScript, ~16% on Python). Left per the frozen-model precedent H4
set and OX-H5 followed: nobody can set it, so it misleads no caller. Wiring it means deriving a
real estimate from the selected stages — a planner change.
but
stop()only removes thedatalistener; whether the process then exits depends on streamstate that file doesn't control, and getting it wrong hangs
tokendamper mcpon Ctrl+C.Delivering SIGINT to exercise that isn't something this suite can do. Same call as L4.
/healthexposingsessionCountis M8/M9's question. On loopback it isn't a leak;on an exposed bind it is, and that's exactly the configuration those two decide. Answering it
twice in two places is how two answers drift.
The audit calls both optional; adding dependencies to someone's package on the strength of a LOW
finding isn't a call to make unasked. Both are one command away when wanted.
What this does not establish
still open. L13 is now explicitly folded into M9.
git statusshowing nothing newlyvisible proves no existing file lost its ignore. A file type that doesn't happen to exist right
now, covered by a removed template line, wouldn't have been caught.
Verification
npm run typecheck,npm run lint,npm run buildandnpx vitest runall pass: 91 files /826 tests.
🤖 Generated with Claude Code