@zero2webmaster/starter-kit 0.47.1 → 0.47.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.47.1 | **Framework:** 2.19.0
3
+ **Version:** 0.47.2 | **Framework:** 2.19.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.47.1 (current)** reads pasted briefs more accurately. A multi-tenant product now reads as Zero2Webmaster even when it names SAVE THE FROGS! as a tenant. Card payments are no longer switched on by a sentence about another app's checkout, or by a "donate" button. The slug is read from the `# slug — Project Brief` title line.
86
+ - **v0.47.2 (current)** records a newly scaffolded project as `Scaffolded` in the Project Registry. An existing `Planning` row is promoted; a later stage such as `Live` is never changed.
87
+ - **v0.47.1** reads pasted briefs more accurately. A multi-tenant product now reads as Zero2Webmaster even when it names SAVE THE FROGS! as a tenant. Card payments are no longer switched on by a sentence about another app's checkout, or by a "donate" button. The slug is read from the `# slug — Project Brief` title line.
87
88
 
88
89
  - **v0.47.0** keeps our names out of an outside customer's project. A scaffold made with `audience: "external"` used to carry, outside `CLAUDE.md`, code comments citing our internal rules and organizations and about 60 links to our private skills (133 lines across the eight project types). Those comments now read neutrally for everyone, skill links become plain names for outside customers, and an outside `wp-plugin` no longer lists our wordpress.org username. The `@zero2webmaster/starter-kit` credit stays.
89
90
 
@@ -145,4 +146,4 @@ Inquiries: kerry@zero2webmaster.com.
145
146
  ---
146
147
 
147
148
  *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.*
148
- *Version: 0.47.1 | Last Updated: 2026-10-27*
149
+ *Version: 0.47.2 | Last Updated: 2026-10-27*
@@ -73,6 +73,22 @@ export declare function ecosystemRoleFor(slug: string): string;
73
73
  * the next re-registration would have reintroduced one of them and 42 others.
74
74
  */
75
75
  export declare const INSERT_ONLY_COLUMNS: readonly string[];
76
+ /**
77
+ * Columns this CLI writes on a new row and may only PROMOTE on an existing one:
78
+ * the DO UPDATE replaces the stored value only when it is NULL or one of the
79
+ * listed earlier stages, and otherwise keeps it.
80
+ *
81
+ * `production_status` is the case (2026-10-27). A scaffold means the project is
82
+ * `Scaffolded`, but the row usually already exists as `Planning` (a greenlit
83
+ * project gets its Project Registry row before its scaffold), and the CLI used
84
+ * to leave it there: `booking`, `video-messages` and `grantseeker` were each set
85
+ * to `Scaffolded` by hand. A plain `= EXCLUDED` would fix those and break worse
86
+ * ones: re-registering a `Live` project would demote it. So it is neither
87
+ * insert-only nor freely updated.
88
+ */
89
+ export declare const PROMOTE_ONLY_COLUMNS: Readonly<Record<string, readonly string[]>>;
90
+ /** What a scaffold makes a project, written through `PROMOTE_ONLY_COLUMNS`. */
91
+ export declare const SCAFFOLDED_STATUS = "Scaffolded";
76
92
  export interface InventoryConfig {
77
93
  /** Postgres connection string (Neon pooled "Connection String"). */
78
94
  databaseUrl: string;
package/dist/inventory.js CHANGED
@@ -115,6 +115,24 @@ export function ecosystemRoleFor(slug) {
115
115
  * the next re-registration would have reintroduced one of them and 42 others.
116
116
  */
117
117
  export const INSERT_ONLY_COLUMNS = ["project_name"];
118
+ /**
119
+ * Columns this CLI writes on a new row and may only PROMOTE on an existing one:
120
+ * the DO UPDATE replaces the stored value only when it is NULL or one of the
121
+ * listed earlier stages, and otherwise keeps it.
122
+ *
123
+ * `production_status` is the case (2026-10-27). A scaffold means the project is
124
+ * `Scaffolded`, but the row usually already exists as `Planning` (a greenlit
125
+ * project gets its Project Registry row before its scaffold), and the CLI used
126
+ * to leave it there: `booking`, `video-messages` and `grantseeker` were each set
127
+ * to `Scaffolded` by hand. A plain `= EXCLUDED` would fix those and break worse
128
+ * ones: re-registering a `Live` project would demote it. So it is neither
129
+ * insert-only nor freely updated.
130
+ */
131
+ export const PROMOTE_ONLY_COLUMNS = {
132
+ production_status: ["Planning"],
133
+ };
134
+ /** What a scaffold makes a project, written through `PROMOTE_ONLY_COLUMNS`. */
135
+ export const SCAFFOLDED_STATUS = "Scaffolded";
118
136
  /**
119
137
  * Resolve the Neon inventory config from the environment. Returns null when no
120
138
  * Z2W_INVENTORY_DATABASE_URL is set — the signal that the Neon write is disabled
@@ -195,6 +213,9 @@ export function buildProjectRow(inputs, opts = {}) {
195
213
  // Derived rather than hardcoded so a re-registration of one of the 8 cannot
196
214
  // demote it through the UPSERT's DO UPDATE (see `ecosystemRoleFor`).
197
215
  ecosystem_role: ecosystemRoleFor(inputs.slug),
216
+ // Promote-only: lifts `Planning` (or empty) to `Scaffolded`, never demotes
217
+ // a later stage — see `PROMOTE_ONLY_COLUMNS`.
218
+ production_status: SCAFFOLDED_STATUS,
198
219
  };
199
220
  // Only assert agent_coordination = Registered when the scaffold actually
200
221
  // carries the coordination block; otherwise leave it unset for Kerry. When the
@@ -265,7 +286,15 @@ export function buildUpsert(row) {
265
286
  const placeholders = columns.map((_, i) => `$${i + 1}`);
266
287
  const updates = columns
267
288
  .filter((col) => col !== INVENTORY_CONFLICT_KEY && !INSERT_ONLY_COLUMNS.includes(col))
268
- .map((col) => `${col} = EXCLUDED.${col}`);
289
+ .map((col) => {
290
+ const promoteFrom = PROMOTE_ONLY_COLUMNS[col];
291
+ if (!promoteFrom)
292
+ return `${col} = EXCLUDED.${col}`;
293
+ // The stage names are our own constants, never user input.
294
+ const earlier = promoteFrom.map((v) => `'${v}'`).join(", ");
295
+ const current = `${INVENTORY_TABLE}.${col}`;
296
+ return `${col} = CASE WHEN ${current} IS NULL OR ${current} IN (${earlier}) THEN EXCLUDED.${col} ELSE ${current} END`;
297
+ });
269
298
  // A row may carry only `slug` in pathological cases; guard the empty SET.
270
299
  const conflictClause = updates.length > 0
271
300
  ? `ON CONFLICT (${INVENTORY_CONFLICT_KEY}) DO UPDATE SET ${updates.join(", ")}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zero2webmaster/starter-kit",
3
- "version": "0.47.1",
3
+ "version": "0.47.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",