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(scripts): anchor check-i18n-bundles' population at the repo root (#11675)
* fix(scripts): anchor check-i18n-bundles' population at the repo root
`findExtractConfigs`'s first parameter is its ABSOLUTE walk root — its own
docstring says so, and the module's other consumer (scripts/pm/dispatch-gates.mjs)
has always passed one. This gate passed the repo-relative vocabulary word for
BOTH parameters, so the walk landed on `<cwd>/packages`: right by coincidence at
the repo root, and from anywhere else an uncaught `ENOENT ... scandir 'packages'`
with a `node:fs` stack.
The anchor goes at the call site, not in the shared module: that module's
contract is already correct and already honoured by its other caller, so moving
the anchor into it would silently re-root a second consumer's population.
The direction is LOUD, not silently green — the cost was a wrong first diagnosis,
not a false pass. What makes it worth fixing is that the throw bypassed every
worded channel this gate owns (#5217, #7681, reportPrerequisiteNotMet), which
exist so an environment fact never reaches the reader as a content verdict.
Anchoring a scan without refusing an empty result would trade the loud crash for
a silent green, so the population verdict is a pure classifier splitting the two
causes: an empty population is a prerequisite failure (#4690), while a --filter
that matched nothing is a typo and must not describe a healthy repo as broken.
Also anchors the reads the population feeds (the config docstring, the documented
--out=) and the child extractor's cwd — all three resolve repo-relative argv, and
without them the anchored walk would only move the failure one line down.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
* chore(pm): record check:i18n's bare-root verdict as REFUSE-UNSPELLABLE
Anchoring the population gave the bare literal a population-constant name
(`PACKAGES_DIR`), which is what made it visible to the bare-root sweep. A bare
single-segment word yields no watch hint, so the row is real and needed a
verdict.
REFUSE-UNSPELLABLE, not REFUSE-WIDE: the population is a filename-and-segment
filter, 9 of 5093 tracked files under the root (0.18%), so a subtree declaration
would be false rather than merely wide. That is the table's own definition of
the two refusals, and it ties the check:i18n-coverage sibling row for the
narrowest on the list — the two gates select the same nine configs by the same
test, so they are refused alike.
No narrower declaration is spellable, measured rather than assumed: collapseHint
deletes glob segments, so every glob spelling of the real population reduces to a
malformed double-separator prefix that hintCovers matches against nothing. Such a
hint would be live and cover zero files, which is worse than the refusal.
The miss is also smaller than the row: check:i18n already reaches the cards that
can actually move a bundle through the convention triggers -- a package owning an
extract config, and a metadata form module -- both verified live against the
derivation.
Data ledger only: 16 insertions, 0 deletions, no change to the recogniser, the
sweep or the self-test.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
---------
Co-authored-by: Claude <noreply@anthropic.com>
'the classifier must be silent over the tree CI actually runs on',
829
+
);
830
+
831
+
// The walk-threw path: it must blame the CHECKOUT, never the caller's cwd —
832
+
// post-#11647 the cwd cannot cause it, so a message that says "run from the
833
+
// repo root" would send the reader somewhere that changes nothing.
834
+
constunreadable=unreadablePopulationDetail(Object.assign(newError("ENOENT: no such file or directory, scandir 'packages'"),{code: 'ENOENT'})).join('\n');
835
+
expect('#11647 the unreadable-walk detail carries the evidence',unreadable.includes("scandir 'packages'"),`a conclusion with no reading under it is not auditable; got ${JSON.stringify(unreadable)}`);
836
+
expect(
837
+
'#11647 …names the tree it actually walked',
838
+
unreadable.includes(atRepoRoot(PACKAGES_DIR)),
839
+
'the reader has to be told WHICH packages/ was missing, not merely that one was',
0 commit comments