From e134fb6a8020e54d2abc879996f4b0daf1cd00a0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 20:12:05 +0000 Subject: [PATCH] test(cli): drop the cardinality from allSixManifests() and its two stale comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `allSixManifests()` was named for a population of six (5 CLI emissions + the on-ramp). #16483 retired `os create example`, taking the CLI side to four, so the helper now harvests five — measured by running it, not by reading it: length=5 ids=["os init -t app","os init -t plugin","os init -t empty", "os create plugin","npx create-objectstack"] Nothing went red, because the harvest is derived from the live maps (`Object.entries(TEMPLATES)` + `Object.entries(templates)`) and no assertion counts to six. The number lived only in the identifier and in two comments, which had gone stale in two different senses: the identifier overstated the TOTAL, and the docblock above it overstated the CLI SUB-count ("the five the two CLI commands render" — it is four). The repair is to stop naming a moving fact, not to gate it: a detector for "identifier's number disagrees with a runtime set" needs either NL parsing or a hand-maintained map that drifts, which costs more than the p3 it catches. - `allSixManifests` -> `allScaffolderManifests` (4 sites, all in this file) - the docblock above it, and the header comment about the control, lose their cardinality words rather than trading them for a smaller number ⛔ No count assertion added — that would convert a harmless statement into a gate needing a hand update on every scaffold change. The derivation path and the on-ramp firing control are untouched. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8 --- .../cli/test/scaffold-emission-policy.e2e.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/test/scaffold-emission-policy.e2e.test.ts b/packages/cli/test/scaffold-emission-policy.e2e.test.ts index 9c2201fa1b..050a00e54b 100644 --- a/packages/cli/test/scaffold-emission-policy.e2e.test.ts +++ b/packages/cli/test/scaffold-emission-policy.e2e.test.ts @@ -20,7 +20,7 @@ * * The control for that reading sits in the same file as the defect: * `SCAFFOLD_PNPM_RANGE` and `renderPnpmWorkspaceYaml()` are IMPORTED by the - * other scaffolder rather than restated, and across the same five emissions, + * other scaffolder rather than restated, and across the same emissions, * the same window and the same authors they did not drift at all. * * ## What is asserted, and why no expected value is written down here @@ -356,8 +356,8 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => { if (sandbox) rmSync(sandbox, { recursive: true, force: true }); }); - /** The on-ramp's emission, beside the five the two CLI commands render. */ - function allSixManifests(): Array<{ id: string; manifest: Record }> { + /** Every emission the two CLI commands render, plus the on-ramp's. */ + function allScaffolderManifests(): Array<{ id: string; manifest: Record }> { return [...emittedManifests(), { id: 'npx create-objectstack', manifest: emitted! }]; } @@ -376,7 +376,7 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => { it('declares exactly one range per third-party dependency, across ALL THREE scaffolders', () => { const byName = new Map>(); - for (const { id, manifest } of allSixManifests()) { + for (const { id, manifest } of allScaffolderManifests()) { for (const [name, range] of [ ...thirdPartyOnly(manifest.dependencies as Record), ...thirdPartyOnly(manifest.devDependencies as Record), @@ -403,7 +403,7 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => { it('emits the exported TypeScript and pnpm constants, not a restatement of them', () => { const typescriptRanges = new Set( - allSixManifests().map( + allScaffolderManifests().map( ({ manifest }) => (manifest.devDependencies as Record | undefined)?.typescript ?? (manifest.dependencies as Record | undefined)?.typescript, @@ -414,7 +414,7 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => { ]); const pnpmRanges = new Set( - allSixManifests().map(({ manifest }) => (manifest.engines as Record | undefined)?.pnpm), + allScaffolderManifests().map(({ manifest }) => (manifest.engines as Record | undefined)?.pnpm), ); expect([...pnpmRanges], 'every emission declares engines.pnpm, at one range').toEqual([ SCAFFOLD_PNPM_RANGE,