fix(devx): refresh the ledgered packages' dep closure before --re-measure, so a stale dist stops reporting phantom drift - #8330
Merged
Conversation
…sure `check:type-check-debt --re-measure` asserted that every workspace dependency of a ledgered package has a built type entry point, and stopped there. Presence is not currency: a `dist/*.d.ts` that predates its own source sails through the precondition, and tsc then resolves the ledgered package's imports through an artifact describing a package that no longer exists. The drift it reports is not in the source at all. That is not hypothetical -- #8235 was filed in good faith as a `priority:p0` main-red stanch off four such errors, while CI's own re-measure was green on two consecutive runs. CI never sees it because lint.yml builds the closure immediately before invoking the gate; only the local path lacked that step. So run it: `refreshBuiltClosure` invokes the same turbo command with the same filters lint.yml uses, then measures. The nothing-is-built case keeps its existing refusal -- a cold closure is minutes and a gate that vanishes for minutes is one nobody runs before pushing -- and an mtime freshness read stays on as a backstop over what those filters do not reach. Fixes #8271 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNfj35pXRxnF1D3gZN5zjc
…py of it The self-test's source-file cases re-spelled `SOURCE_FILE.test(name) && !TEST_FILE.test(name)` inline, so they pinned the two constants and nothing about how `newestSourceMtime` combines them -- an assertion that would stay green through a walk that had stopped excluding test files. Name the predicate and call it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNfj35pXRxnF1D3gZN5zjc
…ames Mutation testing found this case green against a staleClosure with its type-entry guard deleted: the node described `built: false`, so the built guard alone carried it and the label was describing an assertion that was not being made. Describe it as built -- a shape the fs read cannot produce, which is the point, since the pure function's contract is total. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNfj35pXRxnF1D3gZN5zjc
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This was referenced Aug 13, 2026
os-zhuang
marked this pull request as ready for review
August 13, 2026 06:07
This was referenced Aug 13, 2026
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 #8271
check:type-check-debt --re-measureasserted that every workspace dependency of a ledgered package has a built type entry point on disk, and stopped there. Presence is not currency. Adist/*.d.tsthat predates its own source sails through that precondition, and tsc then resolves the ledgered package's imports through an artifact describing a package that no longer exists — so the drift the gate reports is not in the source at all.CI never sees this because
lint.ymlbuilds the closure immediately before invoking the gate. Only the local path lacked that step, which is how #8235 came to be filed in good faith as apriority:p0main-red stanch off four errors that were never in any source.What changed
--re-measurenow refreshes the closure instead of merely asserting it —refreshBuiltClosure()runs the same turbo command with the same filterslint.ymlruns immediately before this gate, then measures. Two things are deliberately kept:Why refresh rather than detect-and-refuse
The card offered both directions. Three measurements chose this one:
*.test.tsthat nodist/is generated from, 1 by agit checkoutthat rewrote a file to byte-identical contentThat last row is what settled it: an error rate fine for a backstop is disqualifying for a refusal, because refusing costs a 4-minute lap while the rebuild it would demand costs 9.5 seconds. turbo decides what is genuinely out of date by hashing inputs, which is strictly better than an mtime guess, and its cache replay rewrites the outputs it restores — so a refreshed closure reads as current afterwards.
Verification
The defect, reproduced. Staged deterministically: drop one export from
driver-sql/src/index.ts, build that package alone, restore the source from HEAD (git hash-objectconfirms byte-identical,git statusclean).dist/now carries the pre-change shape while the source is current — the #8235 world.@objectstack/service-analytics: DEBT records 10 raw tsc error(s), now reports 11 (+1), with the source tree byte-identical to HEAD.surplus: none.surplus: none.Per #8218's lesson that changing where you measure changes what you measure, the readings are equal item by item, not merely in total:
surplus: nonemeans every one of the 33 entries sat exactly at its recorded number, and it holds in both runs. The gate is also observed to have repaired the staged artifact itself.Self-test: 28 built-closure cases (up from 15), paired the way the file's existing table is — the same graph asserted quiet, then with one flag flipped.
Mutation-tested, and it found a real hole. Seven mutations; the first pass caught six. The survivor was my own case labelled "a package that declares no type entry point is never stale" — it described the node as
built: false, so thebuiltguard alone carried it and the type-entry guard it named was never exercised. Fixed, re-run, 7 of 7 caught. A separate weakness found the same way: the source-file cases re-spelled the predicate inline instead of calling it, so they would have stayed green through a walk that had stopped excluding test files; the predicate is now named and called.Not changed, deliberately
lint.ymlstep 31 is now redundant (roughly 9.5 s of cache hits before a gate that does the same thing). Removing it is alint.ymledit pulling in seven more gate families for no measured benefit, and leaving it costs cache hits. Out of scope here.Gates
pnpm check:type-check-debt(the wired npm script, end to end),check:type-check-coverage,check:type-source-resolution,check:nul-bytes— all green.scripts/pm/dispatch-gates.mjsre-derived against the actual changed path returns exactly the three named families; no delta.Releases nothing — a repo gate script, no published package touched. Takes
skip-changeset.Generated by Claude Code