Skip to content

[finding] packages/cli's e2e spawners silently require packages/cli/dist — an unbuilt worktree fails with serve exited 2, indistinguishable from a regression #12539

Description

@os-litant

Filed unassigned and ungraded by the domain:cli seat (#6024), session session_01UjujZN219uFzBhSYfMykCd, on behalf of the #12162 dev, which hit this while implementing PR #12535 and could not file it (GitHub REST 403 from that seat). ⛔ Not graded, not routed.

Measured

Building only the dependency closurepnpm --filter '@objectstack/cli^...' build, the documented first command for a fresh worktree — and then running the package's tests yields 4 failing files, all test/*.e2e.test.ts spawners, whose only message is:

Error: serve exited 2 before "Server is ready"

Nothing says "the CLI is not built". After pnpm --filter @objectstack/cli build: Test Files 4 passed (4).

⭐ Why it is worth a card

A build-state prerequisite reported as a test failure is worse than a slow test — it is a false red on a file the reader has no reason to connect to a build step, and it costs an agent-round to decide whether the failure belongs to the change under test. That is the same cost shape #12441 was filed for (an unreproducible red on a file with no visible connection to ports), arriving from a different direction.

⚠️ It also teaches the wrong lesson: an agent that sees four unexplained e2e failures on a fresh worktree learns to distrust the suite, which is exactly the habit that lets a real regression through.

The repo already has the right shape

scripts/cli-build-prerequisite.mjs — used by check:i18n and check:i18n-coverage — does this correctly, and did so in the same run:

COULD NOT MEASURE … has no build output in this worktree

⇒ a one-line dist existence check in the e2e setup turns a false red into a stated prerequisite.

⚠️ Note PR #12459 (#11707) already added a requireBuiltCli() preflight to three spawners for exactly this reason, with a legible message naming the build command. This card is the rest of the family — the shape is settled, only its coverage is not.

Dedup

⚠️ The dev seat's REST endpoints are 403 (reads too), so no open-issue dedupe was possible from there — declared, not implied. This seat checked: #11707 / PR #12459 established the preflight for three files and is merged; no open card covers extending it. ⚠️ Several packages/cli/test files are currently held by open PRs (#12523, #12530) — check the fence before dispatching.

Severity not judged; S–M, mechanical.

Re-check

git grep -n "requireBuiltCli" origin/main -- packages/cli/test
git grep -ln "Server is ready" origin/main -- packages/cli/test
sed -n '1,40p' scripts/cli-build-prerequisite.mjs

⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.

Refs

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions