@zero2webmaster/starter-kit 0.17.1 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # z2w-starter-kit
2
2
 
3
- **Version:** 0.17.1 | **Framework:** 2.18.0
3
+ **Version:** 0.17.2 | **Framework:** 2.18.0
4
4
 
5
5
  > Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.
6
6
 
@@ -83,7 +83,8 @@ The Claude Code skill at `~/.claude/skills/instantiate-z2w-project/SKILL.md` and
83
83
 
84
84
  ## Status
85
85
 
86
- - **v0.17.1 (current)** stops `scripts/rollup-integrations.mjs` counting its own `*-archive.md` spill files in the "Bulletin files scanned" denominator (72 -> 52), and STATES the exclusion rather than silently shrinking the number.
86
+ - **v0.17.2 (current)** closes the gap v0.17.1 left open and stated: the file selection behind that denominator was still an inline chain of filters in `main()`, so **nothing could execute it** without a live database and a full run — the same untestable-inline shape v0.16.2 had just fixed for `--strict`, in the same file, for a second decision. `selectBulletinFiles()` and `describeSelection()` are now pure exported functions with 13 tests, canary-verified by replanting the v0.17.0 bug. Two things came out of the extraction: the selection now **partitions** its input (four disjoint buckets that always sum to the entry count, so a file cannot leave the denominator without changing a number somebody prints), which surfaced two exclusion classes the report had never mentioned; and `main()` now **refuses a run that selected zero files** instead of printing `scanned: 0 / rows that WOULD change: 0` — a summary byte-identical to a healthy, fully-in-sync run. That is this script's own founding failure, relocated one layer up from the parse into the file selection. Real-corpus figure unchanged at **52**, so the refactor is behaviour-preserving.
87
+ - **v0.17.1** stops `scripts/rollup-integrations.mjs` counting its own `*-archive.md` spill files in the "Bulletin files scanned" denominator (72 -> 52), and STATES the exclusion rather than silently shrinking the number.
87
88
  - **v0.17.0** makes the **Cloud-Run-vs-Fly.io host choice a standard** for `python-service` / `node-service` scaffolds, so a long-running service's platform is decided by one test — *does it need a persistent volume?* — rather than per project by whoever is in the chair. Cloud Run for stateless request/response that scales to zero with the database elsewhere; Fly.io for stateful always-on needing a disk that survives a restart, which Cloud Run structurally cannot hold. It is a ruling rather than a preference because `z2w-multi-lingual-api` costed it on a live service (~13 req/hr inside a $2/month budget, because Cloud Run genuinely idles at zero), and it carries the half a new project would not think to ask for: **do not re-litigate this as a migration** — every real incident there traced to Neon's CU-hour cap or to secret hygiene, both external to *both* platforms. Deliberately NOT inserted for `cf-worker` / `cf-pages` / `nextjs`, whose host the project type already settles.
88
89
  - **v0.16.2** fixes `--strict` so it judges only what the invocation actually reconciled, unblocking `z2w-agent-coordination`'s Project Registry reconciler cron.
89
90
  - **v0.15.1 (current)** ships `scripts/rollup-integrations.mjs` **in the npm tarball**, which is the one thing standing between the Project Registry reconciler and a schedule. `z2w-agent-coordination` accepted this project's proposal to host it on a cron and built the workflow, then found neither delivery route worked: a checkout of this private repo needs a PAT that could read every private repo in the org, and although the package *is* published, the tarball shipped **no `scripts/` at all** — `files` listed `dist/**` + README + LICENSE and the reconciler matched none of those globs. *"It is published"* and *"the script is reachable"* were two different facts. A runner can now `npm i @zero2webmaster/starter-kit@latest` and get it with **zero credentials**. Guarded by `src/package-contents.test.ts`, which runs `npm pack --dry-run --json` and asserts on the **artifact** rather than the glob — nothing here could previously tell a shipped file from an unshipped one.
@@ -118,4 +119,4 @@ Inquiries: kerry@zero2webmaster.com.
118
119
  ---
119
120
 
120
121
  *Scaffolded 2026-05-28 via the [[instantiate-z2w-project]] Claude Code skill v1; reconciled against the consolidated skill v1.1.0 (brief-first + Agent Coordination block) on 2026-05-29.*
121
- *Version: 0.17.1 | Last Updated: 2026-08-13*
122
+ *Version: 0.17.2 | Last Updated: 2026-08-14*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zero2webmaster/starter-kit",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.",
5
5
  "author": {
6
6
  "name": "Dr. Kerry Kriger",
@@ -160,6 +160,62 @@ export function strictExitReasons({ strict, statusOnly, unreadableStatus = [], z
160
160
  return reasons;
161
161
  }
162
162
 
163
+ // Select the bulletin files this reconciler may read, and ACCOUNT FOR every entry it does not.
164
+ //
165
+ // 🔴 THIS IS A DENOMINATOR, which is why it is a named function rather than three `.filter()`
166
+ // calls inside `main()`. Its `files.length` is printed as "Bulletin files scanned: N", and
167
+ // every integrations-coverage fraction anyone quotes about this ecosystem is measured
168
+ // against it. v0.17.1 shrank it 72 → 52 by excluding `*-archive.md` spill files — the right
169
+ // call, correctly reported — but it left the selection INLINE in `main()`, so no test could
170
+ // execute it without a DB and a full run. That is the identical untestable-inline shape
171
+ // v0.16.2 fixed for the `--strict` decision, in this same file, for a second decision.
172
+ //
173
+ // Three classes are excluded and ALL THREE ARE RETURNED rather than silently dropped,
174
+ // because a denominator that quietly got smaller is as unreadable as one that was wrong —
175
+ // the next reader must be able to see WHICH entries were left out, not just how many:
176
+ // - `*-archive.md` spill files created by the trim policy. Their content is by
177
+ // definition already-handled history; none carries an `## Integrations`
178
+ // section and none ever will.
179
+ // - `_*.md` convention-reserved (READMEs, templates). Not projects.
180
+ // - everything else scripts, directories, `.DS_Store` — not bulletin files at all.
181
+ //
182
+ // The buckets are DISJOINT and CONSERVING: every input entry lands in exactly one, so the
183
+ // four lengths always sum to the input length. That is what makes the report auditable —
184
+ // an entry cannot go missing without changing a number somebody prints.
185
+ export function selectBulletinFiles(entries) {
186
+ const md = entries.filter((f) => f.endsWith(".md"));
187
+ const project = md.filter((f) => !f.startsWith("_"));
188
+ return {
189
+ files: project.filter((f) => !f.endsWith("-archive.md")).sort(),
190
+ archives: project.filter((f) => f.endsWith("-archive.md")).sort(),
191
+ reserved: md.filter((f) => f.startsWith("_")).sort(),
192
+ nonMarkdown: entries.filter((f) => !f.endsWith(".md")).sort(),
193
+ };
194
+ }
195
+
196
+ // Render the scanned-files line, STATING each exclusion rather than letting the number
197
+ // silently shrink. Interpolates the counts it actually holds — never a literal — so the
198
+ // sentence cannot drift from the selection it describes.
199
+ export function describeSelection(selection) {
200
+ const { files, archives, reserved, nonMarkdown } = selection;
201
+ const excluded = [];
202
+ if (archives.length > 0) {
203
+ excluded.push(
204
+ `${archives.length} *-archive.md spill file(s), which carry no ## Integrations section by construction`,
205
+ );
206
+ }
207
+ if (reserved.length > 0) {
208
+ excluded.push(`${reserved.length} _-prefixed file(s), which are conventions rather than projects`);
209
+ }
210
+ if (nonMarkdown.length > 0) {
211
+ excluded.push(`${nonMarkdown.length} non-markdown entries, which are not bulletin files`);
212
+ }
213
+ return (
214
+ `Bulletin files scanned: ${files.length}` +
215
+ (excluded.length > 0 ? ` (excluded ${excluded.join("; ")})` : "")
216
+ );
217
+ }
218
+
163
219
  // Extract the `## Integrations` section body (everything until the next `## ` heading).
164
220
  export function extractIntegrationsSection(md) {
165
221
  const lines = md.split("\n");
@@ -450,25 +506,33 @@ async function main() {
450
506
  process.exit(1);
451
507
  }
452
508
 
453
- // `*-archive.md` are SPILL files, not projects. They exist because bulletin
454
- // files are trimmed against a hard read-cap, so their content is by
455
- // definition already-handled history — none carries a `## Integrations`
456
- // section and none ever will. Counting them was never a correctness bug (they
457
- // fall out at the `section == null` gate below, and `known.has(slug)` would
458
- // reject them anyway), but it inflated the denominator this script PRINTS:
459
- // "Bulletin files scanned: 72" when only 52 files can ever contribute.
460
- //
461
- // Reported by `z2w-agent-coordination` 2026-08-13 as a denominator-honesty
462
- // item, and they were right to file it as one: a coverage figure whose
463
- // denominator includes files that are structurally incapable of counting
464
- // makes coverage look worse than it is, and the reader cannot tell which.
465
- // This is the second occurrence of glob-matches-your-own-archives in this
466
- // ecosystem; the first cost Kerry a false 🔴. See [[zero-is-not-a-pass]].
467
- const allMd = (await readdir(projectsDir)).filter(
468
- (f) => f.endsWith(".md") && !f.startsWith("_"),
469
- );
470
- const archives = allMd.filter((f) => f.endsWith("-archive.md"));
471
- const files = allMd.filter((f) => !f.endsWith("-archive.md"));
509
+ // The selection rules, their rationale, and the reason this is a named function rather
510
+ // than inline filters all live on `selectBulletinFiles()` above. In short: `*-archive.md`
511
+ // are SPILL files from the trim policy and can never carry an `## Integrations` section,
512
+ // so counting them inflated the denominator this script PRINTS ("scanned: 72" when only
513
+ // 52 files can ever contribute). Reported by `z2w-agent-coordination` 2026-08-13 as a
514
+ // denominator-honesty item. See [[zero-is-not-a-pass]].
515
+ const selection = selectBulletinFiles(await readdir(projectsDir));
516
+ const { files, archives } = selection;
517
+
518
+ // 🔴 A RUN THAT SELECTED NOTHING MUST NOT PRINT LIKE A CLEAN ONE.
519
+ // Every counter below is initialised to 0, so an empty selection produces a summary
520
+ // BYTE-IDENTICAL to a healthy, fully-in-sync run: "scanned: 0 / with ## Integrations: 0 /
521
+ // rows that WOULD change: 0". That is this script's own founding failure — the five days
522
+ // in 2026-07-25 when "0 rows would change" meant the parser was inert — relocated one
523
+ // layer up, from the parse into the FILE SELECTION, where nothing was guarding it.
524
+ // A wrong `--bulletin` path, a renamed `projects/` layout, or an exclusion rule that
525
+ // over-matches all land here, and all three would otherwise be reported as success.
526
+ if (files.length === 0) {
527
+ console.error(`✗ ${projectsDir} yielded ZERO bulletin files. ${describeSelection(selection)}.`);
528
+ console.error(
529
+ " This is NOT a clean run — nothing was examined, which is a different thing from nothing being wrong.",
530
+ );
531
+ console.error(
532
+ " Check that --bulletin points at a z2w-agent-coordination checkout whose projects/ holds {slug}.md files.",
533
+ );
534
+ process.exit(1);
535
+ }
472
536
  const sql = neon(dbUrl);
473
537
  const known = new Set((await sql`SELECT slug FROM projects`).map((r) => r.slug));
474
538
 
@@ -478,7 +542,7 @@ async function main() {
478
542
  const unreadableStatus = []; // line present, value unreadable — a DEFECT
479
543
  const noStatusLine = []; // no line at all — legitimate; skip and report
480
544
 
481
- for (const file of files.sort()) {
545
+ for (const file of files) { // already sorted by selectBulletinFiles()
482
546
  const slug = file.replace(/\.md$/, "");
483
547
  const md = await readFile(join(projectsDir, file), "utf8");
484
548
  const section = extractIntegrationsSection(md);
@@ -587,15 +651,11 @@ async function main() {
587
651
  }
588
652
 
589
653
  console.log("");
590
- // State the exclusion rather than silently shrinking the number — a
591
- // denominator that quietly got smaller is as unreadable as one that was
592
- // wrong, and the next reader must be able to tell which files were left out.
593
- console.log(
594
- `Bulletin files scanned: ${files.length}` +
595
- (archives.length > 0
596
- ? ` (excluded ${archives.length} *-archive.md spill file(s), which carry no ## Integrations section by construction)`
597
- : ""),
598
- );
654
+ // State the exclusions rather than silently shrinking the number — a denominator that
655
+ // quietly got smaller is as unreadable as one that was wrong, and the next reader must be
656
+ // able to tell WHICH files were left out. Rendered by `describeSelection()` so the
657
+ // sentence and the selection cannot drift apart.
658
+ console.log(describeSelection(selection));
599
659
  console.log(` with ## Integrations: ${parsed} (no section: ${skippedNoSection}, unknown slug: ${skippedUnknown})`);
600
660
  console.log(` rows ${args.apply ? "UPDATED" : "that WOULD change"}: ${changed}`);
601
661
  if (zeroEdges.length > 0) {