Surfaced while implementing #6849 (it was the one red case in that branch's scripts/ run, and had to be shown independent of the diff before the branch could be reported). Filed unassigned; out of that card's scope.
The symptom
FAIL scripts/__tests__/check-sdui-registration-pins.test.ts
> the real workspace > derives the keys from the arrays, and the ruled controls are among them
AssertionError: expected 'packages/app-shell/dist/console/conne…' to be 'packages/app-shell/src/console/connec…'
Expected: "packages/app-shell/src/console/connect/ConnectAgentWidget.tsx"
Received: "packages/app-shell/dist/console/connect/ConnectAgentWidget.js"
The assertion pins a src/ path. The derivation resolves through the package's built output when that output is on disk, so it answers dist/ instead.
What decides it is untracked state, not the tree
packages/app-shell/dist is gitignored — git ls-files packages/app-shell/dist returns 0 entries — and check-sdui-registration-pins.mjs walks the filesystem (fs.existsSync), not git ls-files. So the same commit passes or fails depending on whether anyone has built app-shell in that checkout.
Measured in a clean worktree of origin/main at 9ce20233f plus an unrelated branch: the case fails, with byte-identical Expected/Received, with the branch's own changes reverted — so it is not a regression from any diff, it is a property of a built tree.
Why it is worth a card rather than a shrug
This is the same family as the instruments this repo has been grading all round: a test whose verdict is a function of hidden local state. Two directions, both bad:
- On a developer or agent machine that has built
app-shell, it is a permanently red case sitting in an otherwise green suite. A red case that everyone learns to expect is a case nobody reads — and it is in the same file as the pins that actually matter.
- The reverse reading is the one that costs: someone lands a change that genuinely breaks the derivation, sees this familiar red, and attributes it to "the dist thing".
It also makes every scripts/ suite run in a built worktree non-deterministic from the runner's point of view, which is precisely what makes an agent seat unable to tell "my diff did this" from "this tree does this" without spending a control run on it.
Shape of a fix (for triage)
- Make the derivation source-first — prefer
src/ when both exist, so the answer does not depend on build state. Probably right, but it changes what the gate reads in CI too, so it needs a reading of whether the dist preference is load-bearing for the real check.
- Make the test declare its precondition — skip (loudly) when
packages/app-shell/dist is present, or assert against whichever spelling is on disk. Cheap; keeps the ambiguity.
- Assert BOTH spellings are acceptable and pin the module identity rather than the path.
⭐ Recommend 1 if the dist preference turns out to be incidental, 3 otherwise; ⛔ not 2 on its own — a conditional skip is how a case stops being run on exactly the machines where it would have fired.
Not measured here: whether CI hits this. ci.yml builds, so whether it reproduces depends on step order between the build and the shard that owns scripts/. Worth checking as part of the fix rather than assumed either way.
Surfaced while implementing #6849 (it was the one red case in that branch's
scripts/run, and had to be shown independent of the diff before the branch could be reported). Filed unassigned; out of that card's scope.The symptom
The assertion pins a
src/path. The derivation resolves through the package's built output when that output is on disk, so it answersdist/instead.What decides it is untracked state, not the tree
packages/app-shell/distis gitignored —git ls-files packages/app-shell/distreturns 0 entries — andcheck-sdui-registration-pins.mjswalks the filesystem (fs.existsSync), notgit ls-files. So the same commit passes or fails depending on whether anyone has builtapp-shellin that checkout.Measured in a clean worktree of
origin/mainat9ce20233fplus an unrelated branch: the case fails, with byte-identicalExpected/Received, with the branch's own changes reverted — so it is not a regression from any diff, it is a property of a built tree.Why it is worth a card rather than a shrug
This is the same family as the instruments this repo has been grading all round: a test whose verdict is a function of hidden local state. Two directions, both bad:
app-shell, it is a permanently red case sitting in an otherwise green suite. A red case that everyone learns to expect is a case nobody reads — and it is in the same file as the pins that actually matter.It also makes every
scripts/suite run in a built worktree non-deterministic from the runner's point of view, which is precisely what makes an agent seat unable to tell "my diff did this" from "this tree does this" without spending a control run on it.Shape of a fix (for triage)
src/when both exist, so the answer does not depend on build state. Probably right, but it changes what the gate reads in CI too, so it needs a reading of whether thedistpreference is load-bearing for the real check.packages/app-shell/distis present, or assert against whichever spelling is on disk. Cheap; keeps the ambiguity.⭐ Recommend 1 if the
distpreference turns out to be incidental, 3 otherwise; ⛔ not 2 on its own — a conditional skip is how a case stops being run on exactly the machines where it would have fired.Not measured here: whether CI hits this.
ci.ymlbuilds, so whether it reproduces depends on step order between the build and the shard that ownsscripts/. Worth checking as part of the fix rather than assumed either way.