Skip to content

Fixes #8210: honest test-surface rationale for query-options/no-any-erasure - #8444

Merged
qq9340100 merged 1 commit into
mainfrom
claude/issue-8210-erasure-rule-honest-rationale
Aug 13, 2026
Merged

Fixes #8210: honest test-surface rationale for query-options/no-any-erasure#8444
qq9340100 merged 1 commit into
mainfrom
claude/issue-8210-erasure-rule-honest-rationale

Conversation

@qq9340100

Copy link
Copy Markdown
Collaborator

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.mjs uses @typescript-eslint/parser only for AST parsing; it never sets parserOptions.project (or any other type-information option) and registers no @typescript-eslint/eslint-plugin typed 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):

  • Added const opts: EngineAggregateOptions = { aggregations: [{ func: 'count', alias: … }] } (wrong key — declared key is function) to packages/objectql/src/engine-aggregate-having.test.ts, which packages/objectql/tsconfig.json excludes via **/*.test.ts.
  • pnpm --filter @objectstack/objectql typecheckexit 0 (confirms the exclusion premise, still true on origin/main).
  • pnpm exec eslint --no-inline-config packages/objectql/src/engine-aggregate-having.test.ts0 problems (confirms ESLint doesn't fill the gap either).
  • File reverted; git diff against origin/main for 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 typecheck structurally blind to 12 new TS2339s in packages/lint test 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's QUERY_OPTIONS_TEST_GLOBS comment (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.json excludes **/*.test.ts, typing the options bag removes an any that would blind whatever type-aware tool eventually DOES run over the file (an editor's language service today; tsc itself 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, with QUERY_OPTIONS_TEST_GLOBS lifted) against each site's package's own tsconfig.json:

packagesfilessites
tsconfig excludes **/*.test.ts (uncaught by tsc)objectql, runtime, spec, drivers/driver-mongodb, plugins/plugin-approvals, plugins/plugin-auth24143
tsconfig does NOT exclude (caught by tsc)drivers/driver-memory, drivers/driver-sql, drivers/driver-sqlite-wasm2397
total947240

Recorded 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-erasure verdict is byte-identical before/after this PR:

✓ query-options-erasure ratchet holds: 67 unswept non-test site(s) in 17 file(s), none new.
test surface: 240 site(s) in 47 file(s) — at the ceiling.
baseline key set verified against dd0f681: no files added.

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

  • Whether the ratchet's framing structure or the tsconfig exclusions themselves should change — different cards (TEST_DEBT owns the exclusions' plan).
  • Sweeping any erasure site — the baseline and ceiling are untouched by design.

skip-changeset

Scripts + eslint-config prose only, nothing user-visible — applying skip-changeset on this PR.


Generated by Claude Code

…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
@vercel

vercelBot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectstackIgnoredIgnoredAug 13, 2026 1:18pm

Request Review

@qq9340100qq9340100 added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 13, 2026 — with Claude
@qq9340100
qq9340100 marked this pull request as ready for review August 13, 2026 13:28
@qq9340100
qq9340100 added this pull request to the merge queueAug 13, 2026
Merged via the queue into main with commit a911de9Aug 13, 2026
24 checks passed
@qq9340100
qq9340100 deleted the claude/issue-8210-erasure-rule-honest-rationale branch August 13, 2026 13:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] query-options/no-any-erasure's test surface promises a guard tsc cannot deliver — 20 packages exclude **/*.test.ts from their tsconfig

2 participants

@qq9340100@claude