Uh oh!
There was an error while loading. Please reload this page.
fix(scripts): report a stale workspace dist as a prerequisite, not a bundle problem (#7681) - #7718
Merged
Merged
Conversation
…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.
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
huangyiirene
marked this pull request as ready for review
August 11, 2026 12:10
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#7681
What was wrong
check-i18n-bundleshad exactly one prerequisite classifier:looksLikeMissingCliCommand(), which matches oclif'sError: command … not foundand 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 theelsebranch, and printed as: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-coveragemet 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 onorigin/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:The requested module '@objectstack/spec/system' does not provide an export named 'authorisesIrreversibleAction'— that package'sdistpredates its source;Cannot find modulereaching into a workspace package'sdist/— 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 hardPREREQUISITE NOT METthat 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.reportPrerequisiteNotMetalso 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, aCannot find modulefor 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:OK (2 package(s) …)1 bundle problem(s)1 bundle problem(s)1 bundle problem(s) / extract failedPREREQUISITE NOT MET — a workspace package this gate loads is built from older source — @objectstack/spec1 bundle problem(s)PREREQUISITE NOT MET — … is not built — @objectstack/specReverse verification, predicted red: neutering
looksLikeStaleWorkspaceDistto returnnullturns 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 (nonode_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-changesetapplied.Generated by Claude Code