Commit 1847594
test(qa): ledger out-of-repo consumers’ specifiers against the published exports maps (#15717)
* wip(qa): inherited draft of the consumer-specifier ledger
Committed as-is from a dead session's worktree, before verification, so a
container restart cannot lose it. Verified and rewritten in the commits that
follow.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
* test(qa): ledger the out-of-repo consumer specifiers, held against the exports maps
An `exports` map is a PACKAGING contract, and inside this monorepo nothing is
sealed: every in-repo consumer reaches any file through a relative import, a
vitest alias or a `paths` entry. So the repo could not observe a sealing
regression at all, by construction — twice the seal 17.3.0 introduced (#13123)
was found after publish, by the consumer, during an upgrade (#13662, #15325).
`consumer-specifiers.ledger.json` imports that knowledge from outside: the bare
specifiers named out-of-repo consumers import, each with the consumer, a date
and the card that ratified it. The suite packs each ledgered package with
`pnpm pack`, unpacks it into a throwaway `node_modules` outside the workspace,
and resolves every specifier from there with Node's real resolver under both
the `require` and `import` conditions — failing with a message that names the
specifier AND the consumer it breaks.
Option A of #15589 only. Option B (a changeset-gated seal declaration in
`check:published-files`) is deliberately not here.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
* test(qa): shrink SEALED_TODAY to empty — #15611 landed and opened both doors
The set-equality assertion did exactly what its header said it would. #15611
ratified `./hook-body` and `./package.json` and merged while this branch was in
flight; merging main turned the suite red naming the two lines to delete. They
are deleted, so the ledger of losses has reached its floor: every specifier a
named out-of-repo consumer imports now resolves from a packed tarball.
The empty table is KEPT rather than removed. "Every ledgered specifier resolves"
is the contract; "the sealed set is exactly empty" is the ratchet — the line an
author has to edit, past a ⛔, to make a red green by recording a break instead
of repairing it.
Also separates two diagnoses the exports map cannot tell apart on its own: a
specifier that fails with ERR_PACKAGE_PATH_NOT_EXPORTED is SEALED (the subject
of this file), while one failing MODULE_NOT_FOUND is a declared door leading
nowhere — the package is unbuilt, or `files` does not ship the path `exports`
names. Now that all three doors are open, an unbuilt tree would otherwise have
read as "hotcrm is broken".
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 76ba5b7 commit 1847594
4 files changed
Lines changed: 497 additions & 2 deletions
File tree
- packages/qa/downstream-contract
- test
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
0 commit comments