chore(ts): the typecheck gate skipped middleware/ and six other directories - #823
Merged
Merged
Conversation
…tories tsconfig.typescheck.json enumerated 8 directories. Seven containing .ts were not among them — middleware/, providers/, gateway/, types/, scripts/, migrations/, seed/ — so `npm run tsc:check`, which runs inside the required `Test & Coverage` job, never typechecked agentRuntimeAuth.ts. Every agent route depends on it. Demonstrated rather than argued: injecting `const __probe: number = "x"` into middleware/agentRuntimeAuth.ts exits 2 under this config and exits **0** under the old one. All seven directories were already clean, which is the point — nobody knew, because nothing checked, and an enumerated include list stops covering any directory added after it is written while the miss looks exactly like a pass. Inverted to exclude-driven so a new directory is covered by default. The four root-level scratch scripts (54 pre-existing errors, unreferenced by package.json or any route or service) are listed explicitly as debt. Prompted by @ux-lead's finding that the merge gate can be blind to type-level changes — the general claim was right about a narrower target than they aimed at. 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.
Based on
main, independent of the #817/#821 and #813/#820 stacks.The correction that led here
@ux-lead reported that
Test & Coverageis "structurally blind" to type-level changes and proposed addingnpm run tsc:checkto the workflow. That step already exists —.github/workflows/tests.yml:53-56, inside theTest & Coveragejob, nocontinue-on-error, since4ac17629on 2026-04-09. Verified end to end: a type error inmodels/Pod.tsmakes the script exit2with 5 errors.The premise underneath was right (ts-jest strips types, so jest cannot see a type change) — the leap was from jest to the whole check, which is a job with five steps. But chasing it found a real version of the same defect one layer down.
The actual gap
tsconfig.typescheck.jsonenumerated 8 directories. Backend has seven more containing.ts:middleware/·providers/·gateway/·types/·scripts/·migrations/·seed/So the required gate never typechecked
middleware/agentRuntimeAuth.ts— the module every agent route depends on forreq.agentUser.Demonstrated, not argued:
const __probe: number = "not a number"inmiddleware/agentRuntimeAuth.ts, new configThe fix, and why it is exclude-driven
All seven directories were already clean — that is the point. Nobody knew, because nothing checked, and an enumerated
includelist stops covering any directory added after it is written while the miss looks exactly like a pass. Adding seven lines would fix today and re-break on the next directory.Inverted to
include: ["**/*.ts"]plus an explicit exclude list, so a new directory is covered by default and the failure mode flips from silently-unchecked to listed-as-debt. The four root-level scratch scripts (test-discord-*.ts,cleanup-test-data.ts— 54 pre-existing errors, unreferenced bypackage.jsonor any route or service) are excluded by name with a comment saying to fix or delete them rather than extend the list.Starts green:
npm run tsc:checkexits 0.Why it is worth landing
Test & Coverageis the only required context onmain(required_pull_request_reviewsis null). Anything that gate cannot see, nothing can.🤖 Generated with Claude Code