fix(formula): give the test-typecheck program the node typings its two fixture-loading tests already assumed - #16902
Merged
Conversation
…o fixture-loading tests already assumed `packages/formula` declared no `@types/node` and its test program named no `types`, so `node:fs` / `node:path` / `node:url` and `import.meta.url` never resolved in `tsconfig.test.json`. Adds the devDependency and the `types` entry, and re-records the shrink-only ledger. Ledger, measured on this branch with NO test file edited: before 5 file(s) / 15 error(s) / 12 pinned signature(s) after 3 file(s) / 7 error(s) / 4 pinned signature(s) The card's title generalised the cause to all 15; measured, it is 8 of the 15 — the whole of src/rls-predicate.test.ts and src/skill-catalog-sync.test.ts, which both GRADUATED. The surviving 7 are three unrelated classes in three other files and are not this cause. `tsconfig.json` — the BUILD config — is untouched, per its sibling's recorded rationale, and `packages/formula/dist` is byte-identical across the change (6 files, per-file sha256). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 7 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-musk
marked this pull request as ready for review
September 8, 2026 16:12
os-musk
enabled auto-merge
September 8, 2026 16:13
os-musk
disabled auto-merge
September 8, 2026 16:13
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.
Fixes #16297
packages/formuladeclared no@types/nodeand its test program named notypes, sonode:fs/node:path/node:urlandimport.meta.urlnever resolved insidetsconfig.test.json. This adds the devDependency and thetypesentry and re-records the shrink-only ledger. No test file is edited.Clause-②: no
The ledger reading, before and after
Both quoted whole, from
pnpm --filter @objectstack/formula check:test-typecheckon this branch.BEFORE (at
origin/main=eabdd66f45, dependency closure built, exit0):AFTER (exit
0):Delta: 15 -> 7 errors, 5 -> 3 files, 12 -> 4 signatures. Every move is downward; the ledger is shrink-only and nothing was added to it.
The intermediate state is the sharpest evidence of which errors these were. With the fix applied and the ledger not yet regenerated, the gate exits
1and names exactly two files:Coverage did not move to make the number look better:
tsc --noEmit --listFiles -p tsconfig.test.jsonstill puts 29 of 29src/**/*.test.tsin the program after the change.#16297 is titled "15 of its test-typecheck ledger errors have one cause". Measured on
origin/main, the node-typings cause is 8 of the 15, and the repo had already recorded that twice before the card existed.packages/formula/tsconfig.test.json's own header, written by the PR that seeded this ledger:scripts/check-type-check-coverage.mjscarries the same correction independently, and both say 6 + 2 = 8. The full enumeration of the 15 onorigin/main, fromtsc --noEmit --pretty false -p tsconfig.test.json:src/rls-predicate.test.tsnode:fs/node:path/node:urlsrc/rls-predicate.test.tsProperty 'url' does not exist on type 'ImportMeta'src/skill-catalog-sync.test.tsnode:fs/node:url/node:pathsrc/skill-catalog-sync.test.tsProperty 'url' does not exist on type 'ImportMeta'src/cel-to-filter.test.tssrc/matches-filter-temporal-conformance.test.tsTemporalRow/TemporalTimeRownot assignablesrc/normalize.test.ts8 + 7 = 15. The triage comment on the card anticipated exactly this and pre-ruled it: "若改完配置数字只掉了一部分,剩下的不是这张卡的,请另报。" The surviving 7 are three unrelated classes in three other files; they are recorded in the ledger's authored
_noteand are not filed as a card here — see the acceptance notes below.Where the
typesentry goes, and why not the build configThe card said to read the sibling's header first. It answers the question in its opening sentence:
So
typesgoes on the test program. That the build is genuinely untouched is measured rather than asserted:packages/formula/distwas hashed before and after (sha256, all 6 emitted files,diffexit0) and is byte-identical.Which of the two lines actually does the work was measured in both directions on a fully built closure, because the answer is not the obvious one:
types: ["node"]with no package-local devDependency at all already reports 7 — the entry alone does the whole job, resolving@types/nodeoff the root hoist.@types/nodetopackage.jsonon its own would have been a no-op that looked like a repair.The devDependency earns its line by making the dependency declared instead of borrowed, and the pair is what
packages/spec(#5286),packages/verify,packages/cliandpackages/drivers/driver-mongodball carry.Proving the pin can still fail
The ledger only moved down, so the ledger alone cannot show the gate still works. Ablated on the committed tree (
56067ee055), removing both lines the repair added, under atrap … EXIT INT TERMwith absolute paths:Red for exactly the right reason: once the two files GRADUATED, the ledger stops covering them, so the 8 errors are red on arrival rather than absorbed by a number.
Restore is proved, not assumed:
Verification
All exit codes captured by redirect-then-
$?, never across a pipe.pnpm --filter @objectstack/formula test0— 29 test files, 827 tests passedpnpm --filter @objectstack/formula typecheck0— both legs (tsc --noEmit+check:test-typecheck)pnpm --filter @objectstack/formula check:test-typecheck0— the AFTER reading abovenode scripts/check-type-check-coverage.mjs --re-measure0— the card's second criterionpnpm lint(eslint . --no-inline-config, whole repo)0at56067ee0550— all 49, tallied from a per-command exit logcheck:type-check-coverage --re-measurestayed green, which is the card's guard against making the number look better by moving coverage:Gates derived with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, run, then reconciled. The reconciliation line, verbatim:Three things worth flagging about the measurement itself rather than burying:
pnpm check:dual-build-cjs-loadsfirst returned exit 3 — PREREQUISITE NOT MET, which is NOT MEASURED and not a pass. It was re-run to a real verdict (0) afterpnpm build(73/73 tasks).packages/formula/distwas re-hashed after that full rebuild and is still byte-identical to the pre-change baseline.packages/spec/dist; it reported 57 errors, of which 45 wereTS7016 Could not find a declaration file for module '@objectstack/spec'. That reading is void and is disclosed rather than quietly re-run. Re-taken on the settled tree it reports 15.origin/main(625b0c32b4) and that one family-defining file,scripts/check-react-page-adapter-contract.mjs, changed in that range. The derived command set was byte-identical across derivations before and after a freshgit fetch, and that script is neither in the 49 nor reads any of this PR's 4 paths.Changeset route: the
skip-changesetlabelAGENTS.md:1036— measured on this branch ateabdd66f45, which isorigin/main's content; the same sentence sits at a different line number on other trees, so the line number alone is not a citation:Measured against that test, this diff publishes nothing.
npm pack --dry-run --jsoninpackages/formulareports a 10-file tarball; of the four paths this PR touches:packages/formula/tsconfig.test.json— not in the tarballpackages/formula/test-typecheck-debt.json— not in the tarballpnpm-lock.yaml— repo root, not in the tarballpackages/formula/package.json— in the tarball, and its only delta is onedevDependenciesline, which no consumer installsand all 6
dist/files are byte-identical. So: theskip-changesetlabel, never an empty changeset.Clause-②: noholds on the same evidence — no new exported symbol and no new key on any published payload, withdist/byte-identical proving it rather than asserting it.验收备注
packages/formula/test-typecheck-debt.jsonunder the shrink-only ratchet, and PR chore(typecheck): seven ledgered packages type-check their own tests through a sibling test program (#12511) #16295 / [finding] A type error in a ledgered package tests is invisible to its owntypecheckand discoverable only by a full-closure build — 8 packages in that state (was 19; re-measured 2026-09-05) #12511 already track the residue that produced this card. A new card would duplicate that. Their three classes are named in the ledger's_noteso the next reader does not have to re-derive them.scripts/check-type-check-coverage.mjscarries a historical paragraph whose present-tense clause ("this package declares no@types/nodeand its tsconfig names notypes") this PR falsifies. It is left untouched deliberately: the paragraph is explicitly anchored to a measurement at6a1e38244,formulano longer has aTEST_DEBTentry there, and editing that file would put its own self-test and prose pins in this diff for no gain. Flagged for the maintainer rather than swept in.tsconfig.test.json, three declare notypesin their test program while their test layer does import node builtins —@objectstack/core(5 files),@objectstack/platform-objects(1),@objectstack/plugin-email(1). All three already declare@types/nodeas a devDependency and all three carry zero ledger errors of this cause, so the cause is not currently biting them. No card filed.Generated by Claude Code