Uh oh!
There was an error while loading. Please reload this page.
Fixes #8210: honest test-surface rationale for query-options/no-any-erasure - #8444
Merged
Merged
Conversation
…asure The `check:query-options-erasure` ratchet's test-surface half was framed as "type it and the compiler catches a malformed bag" without qualification. Measured (#8210): 6 of the 9 packages holding test-surface sites exclude `**/*.test.ts` from their own tsconfig, so `tsc` never reads ~143 of the 240 counted sites; ESLint does not fill the gap either — this repo's one eslint.config.mjs never enables type-aware linting for any file, test or not (no `parserOptions.project`, no typed `@typescript-eslint` rule). Positive control: a typed, wrong-keyed `EngineAggregateOptions` planted in an excluded objectql test file left both `pnpm --filter @objectstack/objectql typecheck` and `pnpm exec eslint --no-inline-config` silent. Cross-checked against PR #8406, where the identical shape independently surfaced in packages/lint the same day. Rewrites the rule's rationale prose (eslint.config.mjs's QUERY_OPTIONS_TEST_GLOBS comment, the ratchet script's header, and the ratchet's growth-error message) to state the real benefit where a tsconfig exclusion applies: it removes an `any` that blinds whatever tooling IS type-aware over the file, and is a precondition for the day the exclusion lifts — not a compiler guard today. No ratchet threshold, baseline, or tsconfig exclusion changed; `pnpm check:query-options-erasure` verdict is byte-identical before and after (67 non-test sites, 240 test-surface sites, none new). Fixes#8210
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
qq9340100
marked this pull request as ready for review
August 13, 2026 13:28
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#8210
What
check:query-options-erasure's test-surface half was described — in the rule's own comments, and in the rationale carried into #8112's dispatch — as "type the options and the compiler catches a malformed bag." That is true for the sites the rule actually blocks (non-test code), but not for a large share of the sites the ratchet only counts (test code). This PR fixes the prose, not the behavior: same rule, same ratchet, same baseline, same ceiling.Step 1 — the flagged unknown, measured (widens the finding)
Card asked: does a type-aware ESLint program check the excluded test files? No — and not narrowly: this repo runs no type-aware ESLint pass over ANY file, test or non-test.
eslint.config.mjsuses@typescript-eslint/parseronly for AST parsing; it never setsparserOptions.project(or any other type-information option) and registers no@typescript-eslint/eslint-plugintyped rule. So the finding widens rather than narrows — ESLint fills none of the gap tsconfig exclusions leave.Positive control (planted, measured, then reverted — no test-file diff in this PR):
const opts: EngineAggregateOptions = { aggregations: [{ func: 'count', alias: … }] }(wrong key — declared key isfunction) topackages/objectql/src/engine-aggregate-having.test.ts, whichpackages/objectql/tsconfig.jsonexcludes via**/*.test.ts.pnpm --filter @objectstack/objectql typecheck→ exit 0 (confirms the exclusion premise, still true onorigin/main).pnpm exec eslint --no-inline-config packages/objectql/src/engine-aggregate-having.test.ts→ 0 problems (confirms ESLint doesn't fill the gap either).git diffagainstorigin/mainfor that path is empty.Second measured instance (per the claim comment): PR #8406's patch round independently hit the identical shape the same day —
pnpm --filter @objectstack/lint typecheckstructurally blind to 12 new TS2339s inpackages/linttest files, caught only by the TEST_DEBT hidden-layer measurement. Cited in the prose as a cross-check, not re-derived here.Step 2 — rewritten prose
Three spots, all comments/messages, no logic:
eslint.config.mjs'sQUERY_OPTIONS_TEST_GLOBScomment (the rule's own framing for the test-surface carve-out).scripts/check-query-options-erasure-ratchet.mjs's module header (the gate's own framing).diffRatchet's test-surface-growth error message (what a developer actually sees when the ceiling moves).All three now say the same honest thing: where a package's
tsconfig.jsonexcludes**/*.test.ts, typing the options bag removes ananythat would blind whatever type-aware tool eventually DOES run over the file (an editor's language service today;tscitself the day the exclusion lifts) — it is a precondition, not a compiler guard, today.Step 3 — the split, made inspectable (optional scope, done)
Intersected the ratchet's actual test-surface file list (measured via the same
measure()the gate uses, withQUERY_OPTIONS_TEST_GLOBSlifted) against each site's package's owntsconfig.json:**/*.test.ts(uncaught bytsc)objectql,runtime,spec,drivers/driver-mongodb,plugins/plugin-approvals,plugins/plugin-authtsc)drivers/driver-memory,drivers/driver-sql,drivers/driver-sqlite-wasmRecorded in the gate script's header so it's re-derivable rather than rediscoverable.
Hard boundary respected
No ratchet threshold, no baseline entry, no tsconfig exclusion touched.
pnpm check:query-options-erasureverdict is byte-identical before/after this PR:Tests / gates run
pnpm check:query-options-erasure(self-test + ratchet) — green, verdict unchanged (above).node scripts/check-nul-bytes.mjs— green (7611 files scanned, no raw control bytes).pnpm exec eslint --no-inline-config eslint.config.mjs scripts/check-query-options-erasure-ratchet.mjs— 0 problems.node scripts/pm/dispatch-gates.mjs eslint.config.mjs scripts/check-query-options-erasure-ratchet.mjs— no additional check family names either path; the named families above are the full local scope.Not in scope
TEST_DEBTowns the exclusions' plan).skip-changeset
Scripts + eslint-config prose only, nothing user-visible — applying
skip-changeseton this PR.Generated by Claude Code