Skip to content

Commit e134fb6

Browse files
committed
test(cli): drop the cardinality from allSixManifests() and its two stale comments
`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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
1 parent 97adce2 commit e134fb6

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

packages/cli/test/scaffold-emission-policy.e2e.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* The control for that reading sits in the same file as the defect:
2222
* `SCAFFOLD_PNPM_RANGE` and `renderPnpmWorkspaceYaml()` are IMPORTED by the
23-
* other scaffolder rather than restated, and across the same five emissions,
23+
* other scaffolder rather than restated, and across the same emissions,
2424
* the same window and the same authors they did not drift at all.
2525
*
2626
* ## 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', () => {
356356
if (sandbox) rmSync(sandbox, { recursive: true, force: true });
357357
});
358358

359-
/** The on-ramp's emission, beside the five the two CLI commands render. */
360-
function allSixManifests(): Array<{ id: string; manifest: Record<string, unknown> }> {
359+
/** Every emission the two CLI commands render, plus the on-ramp's. */
360+
function allScaffolderManifests(): Array<{ id: string; manifest: Record<string, unknown> }> {
361361
return [...emittedManifests(), { id: 'npx create-objectstack', manifest: emitted! }];
362362
}
363363

@@ -376,7 +376,7 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => {
376376

377377
it('declares exactly one range per third-party dependency, across ALL THREE scaffolders', () => {
378378
const byName = new Map<string, Map<string, string[]>>();
379-
for (const { id, manifest } of allSixManifests()) {
379+
for (const { id, manifest } of allScaffolderManifests()) {
380380
for (const [name, range] of [
381381
...thirdPartyOnly(manifest.dependencies as Record<string, unknown>),
382382
...thirdPartyOnly(manifest.devDependencies as Record<string, unknown>),
@@ -403,7 +403,7 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => {
403403

404404
it('emits the exported TypeScript and pnpm constants, not a restatement of them', () => {
405405
const typescriptRanges = new Set(
406-
allSixManifests().map(
406+
allScaffolderManifests().map(
407407
({ manifest }) =>
408408
(manifest.devDependencies as Record<string, string> | undefined)?.typescript
409409
?? (manifest.dependencies as Record<string, string> | undefined)?.typescript,
@@ -414,7 +414,7 @@ describe('the on-ramp emits the same policy — measured by DRIVING it', () => {
414414
]);
415415

416416
const pnpmRanges = new Set(
417-
allSixManifests().map(({ manifest }) => (manifest.engines as Record<string, string> | undefined)?.pnpm),
417+
allScaffolderManifests().map(({ manifest }) => (manifest.engines as Record<string, string> | undefined)?.pnpm),
418418
);
419419
expect([...pnpmRanges], 'every emission declares engines.pnpm, at one range').toEqual([
420420
SCAFFOLD_PNPM_RANGE,

0 commit comments

Comments
 (0)