You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tooling): the bundle freshness rule can be answered — the build stamp acquits a tree whose bytes never moved (#16240)
* fix(tooling): the bundle freshness rule can be answered — the build stamp acquits a tree whose sources were re-checked-out unchanged
`bundlesAreStale` compared `dist/**/*.mjs`/`*.js` mtimes against `src/**/*.ts`
and `tsup.config.ts` mtimes and had no way to be answered. A `git merge`,
`git checkout` or `git worktree add` re-checks-out a source file with identical
bytes and bumps its mtime; the build that follows correctly does not run
(turbo's cache hashes content, so it is a cache hit that rewrites nothing) and
every `dist/` mtime stays where the previous build left it. The rule then
refused `check:browser-reachable-entries` over bundles that were exactly
current, and the only remedy was a multi-minute rebuild under the shared verify
lock.
The mtime rule keeps its power to convict and gains one way to be answered:
`dist/.build-input-hash`, already written by every build of the package. That is
the file #7122 proposed for the DECLARATION rule, where it was measured wrong
and stays rejected — `OS_SKIP_DTS=1` writes it while skipping the declarations.
On the bundle axis that same flag emits exactly the artifact being vouched for,
and what makes the evidence sound is the build script's order rather than the
flag: the unconditional `tsup` pass runs before `--stamp` in one `&&` chain, so
nothing writes this stamp without having emitted bundles first.
The evidence may only ever ACQUIT: a missing, unreadable or mismatched stamp
leaves the mtime verdict standing, so nothing that passed before can start
failing.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
* test: pin the bundle-stamp acquittal and the two cases that keep it non-vacuous
Three cases in `check:browser-reachable-entries --self-test`, beside the mtime
cases that already drive `inspectBundleFreshness`: the acquittal itself, the
conviction that returns the moment a source byte changes (so the rule is keyed
on the digest and not on the stamp's presence), and a stamp that is not a digest
at all leaving the refusal standing. A fourth asserts the sandbox digest can be
computed, so a fixture that silently stopped producing one cannot pass the rest
by accident.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments