Skip to content

fix(scripts): report a stale workspace dist as a prerequisite, not a bundle problem (#7681) - #7718

Merged
huangyiirene merged 1 commit into
mainfrom
claude/issue-7681-i18n-bundles-prereq
Aug 11, 2026
Merged

fix(scripts): report a stale workspace dist as a prerequisite, not a bundle problem (#7681)#7718
huangyiirene merged 1 commit into
mainfrom
claude/issue-7681-i18n-bundles-prereq

Conversation

@huangyiirene

Copy link
Copy Markdown
Collaborator

Fixes#7681

What was wrong

check-i18n-bundles had exactly one prerequisite classifier: looksLikeMissingCliCommand(), which matches oclif's Error: command … not found and therefore recognises an unbuilt CLI only. A stale dependency dist makes the extract fail with a module-export mismatch instead — node refusing the import outright — which matched no classifier, fell past the in-loop prerequisite net into the else branch, and printed as:

check-i18n-bundles: 1 bundle problem(s)
• platform-objects: extract failed - ...

One environment fact, rendered as a content verdict about translation bundles nothing had compared, in the two words ("bundle", "extract") that send the reader to the i18n configs. The sibling check-i18n-coverage met the identical cause in the same QA run and refused to judge instead ("Nothing was compared… the baseline was left exactly as committed" — the #6033/#5862 honesty).

Premise verified at 21888ab: the mislabel path is present on origin/main, and reproduced end-to-end (see below).

What changed

scripts/cli-build-prerequisite.mjs — a second classifier, looksLikeStaleWorkspaceDist(), living beside the first so the sibling gates can adopt it. It recognises two shapes of the same prerequisite:

  • an export mismatch on a workspace specifier — The requested module '@objectstack/spec/system' does not provide an export named 'authorisesIrreversibleAction' — that package's dist predates its source;
  • a Cannot find module reaching into a workspace package's dist/ — never built at all.

It shares the existing oclif-flattening step, since node prints its diagnostics as a frame plus a stack and a per-line regex would meet the frame first.

scripts/check-i18n-bundles.mjs — the in-loop net now tries both signatures and raises a hard PREREQUISITE NOT MET that names the package whose build output is at fault, exonerates the i18n config that was merely holding the bag, and prescribes rebuilding that package rather than the CLI. reportPrerequisiteNotMet also learned how many packages the loop had already attempted: the in-loop nets can fire after other packages have printed "in sync", where the old fixed "Nothing was checked" line would have been false — it now says what was and was not judged, mirroring the coverage gate's partial-round wording.

Deliberately narrow

A genuine content failure must still read as content, so the classifier claims only specifiers naming a package this repo builds. Everything else keeps the verdict it had: a third party's export mismatch, CommonJS interop's differently-worded Named export 'x' not found, a Cannot find module for a path that is not build output, a real bundle drift, and an undeclared authoring key. Both directions are pinned in the self-test — 29 to 53 assertions.

Verification

--self-test (29 to 53 assertions), coverage gate's self-test (shared module unchanged in behaviour), pnpm check:nul-bytes, ESLint over both touched scripts: all green.

End-to-end against a fixture workspace with a scripted CLI, same tree, before = origin/main:

scenariobeforeafter
both packages in syncOK (2 package(s) …)unchanged
genuine drift1 bundle problem(s)unchanged
genuinely broken config1 bundle problem(s)unchanged
stale spec dist (this issue)1 bundle problem(s) / extract failedPREREQUISITE NOT MET — a workspace package this gate loads is built from older source — @objectstack/spec
dependency never built1 bundle problem(s)PREREQUISITE NOT MET — … is not built — @objectstack/spec

Reverse verification, predicted red: neutering looksLikeStaleWorkspaceDist to return null turns exactly the 9 positive pins red and leaves the negative ones green; restored green.

The corpus is honest about its provenance: node's exact message shape was produced locally against a fixture standing in for the stale packages/spec/dist, carrying the specifier and export name of the QA run. A full workspace build was not run in this container (no node_modules), so the healthy-tree confirmation is the fixture matrix above plus the real gate on this worktree still raising the unbuilt-CLI prerequisite.

Changeset

None: internal gate tooling under scripts/, nothing published or user-visible. skip-changeset applied.


Generated by Claude Code

…bundle problem (#7681)
`check-i18n-bundles` had exactly one prerequisite classifier —
`looksLikeMissingCliCommand`, which matches oclif's "command … not found" and
therefore sees an unbuilt CLI only. A stale *dependency* dist makes the extract
throw a module-export mismatch instead, which matched nothing, fell through to
the in-loop `else`, and printed as "check-i18n-bundles: 1 bundle problem(s) /
extract failed …": one environment fact rendered as a content verdict about
translation bundles nothing had compared, in the two words that send the reader
to the i18n configs. Its sibling `check-i18n-coverage` met the identical cause
in the same QA run and refused to judge (#6033/#5862).
`looksLikeStaleWorkspaceDist` (in the shared `cli-build-prerequisite.mjs`, so
the siblings can adopt it) classifies that class in two shapes — an export
mismatch on a workspace specifier, and a `Cannot find module` reaching into a
workspace package's `dist/` — and the gate now raises a hard PREREQUISITE NOT
MET naming the package whose build output is at fault, prescribing a rebuild of
that package rather than of the CLI.
Deliberately narrow: a third party's export mismatch, CommonJS interop's
differently-worded named-export error, a non-dist specifier, a genuine drift and
an undeclared authoring key all keep the verdict they had. The self-test pins
both directions (29 → 53 assertions).
`reportPrerequisiteNotMet` also learned how many packages the loop had already
attempted, because the in-loop nets can fire after other packages printed "in
sync" — "nothing was checked" would then be false, so the message states what
was and was not judged instead.
@vercel

vercelBot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectstackIgnoredIgnoredAug 11, 2026 11:55am

Request Review

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check-i18n-bundles reports a stale-dist prerequisite failure as a content verdict ("1 bundle problem(s)")

2 participants

@huangyiirene@claude