great-cto 2.73.1 → 2.74.0

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.
@@ -1331,6 +1331,13 @@ export const REVIEWERS_BY_ARCHETYPE = {
1331
1331
  "gov-public": ["gov-reviewer", "security-officer"],
1332
1332
  "insurance": ["insurance-reviewer", "regulated-reviewer"],
1333
1333
  "defense-govcon": ["cmmc-reviewer", "gov-reviewer", "security-officer"],
1334
+ // Product Builder archetypes (A1–A6) — lean reviewer sets; payments → pci.
1335
+ "vertical-saas": ["security-officer"],
1336
+ "booking": ["pci-reviewer", "security-officer"],
1337
+ "crm": ["security-officer"],
1338
+ "dashboard": ["security-officer"],
1339
+ "content-platform": ["pci-reviewer", "security-officer"],
1340
+ "marketplace-lite": ["pci-reviewer", "security-officer"],
1334
1341
  "greenfield": [],
1335
1342
  };
1336
1343
  /**
@@ -1367,6 +1374,14 @@ export const GATES_BY_ARCHETYPE = {
1367
1374
  "gov-public": ["plan", "qa", "gov-review", "security", "ship", "compliance"],
1368
1375
  "insurance": ["plan", "qa", "insurance-review", "security", "ship", "compliance"],
1369
1376
  "defense-govcon": ["plan", "qa", "cmmc-assessment", "security", "ship", "compliance"],
1377
+ // Product Builder archetypes (A1–A6) — non-regulated baseline; the single CTO gate
1378
+ // emerges at change_tier T1 (effectiveGates → [plan]).
1379
+ "vertical-saas": ["plan", "qa", "ship"],
1380
+ "booking": ["plan", "qa", "ship"],
1381
+ "crm": ["plan", "qa", "ship"],
1382
+ "dashboard": ["plan", "qa", "ship"],
1383
+ "content-platform": ["plan", "qa", "ship"],
1384
+ "marketplace-lite": ["plan", "qa", "ship"],
1370
1385
  "greenfield": ["plan"],
1371
1386
  };
1372
1387
  /**
@@ -1386,6 +1401,46 @@ export function gatesFor(archetype, size) {
1386
1401
  // large + enterprise → ensure compliance is included
1387
1402
  return all.includes("compliance") ? all : [...all, "compliance"];
1388
1403
  }
1404
+ /** Gates that form the non-negotiable floor for a *regulated* archetype. */
1405
+ const FLOOR_GATES = ["security", "compliance", "ship"];
1406
+ /**
1407
+ * The human gates the pipeline opens for a change, given its archetype, the
1408
+ * project size, AND the per-change risk tier. Composes with `gatesFor()`:
1409
+ *
1410
+ * - T2 (default): the full size baseline, with `ship` guaranteed even if a
1411
+ * small project_size had stripped it. An irreversible change always gets a
1412
+ * final go/no-go. Nothing is ever removed → fail-safe for an unknown tier.
1413
+ * - T1: only `plan` (you review intent) PLUS the regulated floor. The standalone
1414
+ * qa/security-as-ceremony is dropped because CI + tests cover a reversible change.
1415
+ * - T0: the regulated floor only — for a plain archetype that is the empty set
1416
+ * (CI is the gate); for a regulated one, security+compliance+ship still fire.
1417
+ *
1418
+ * An archetype is "regulated" iff its baseline contains `security` or `compliance`.
1419
+ * That is what keeps the downgrade sound: a fintech repo cannot ship an
1420
+ * irreversible change unreviewed even when the change is labelled a fix.
1421
+ *
1422
+ * NOTE: change-specific T2 triggers (a migration, a new write-connector, a prod
1423
+ * deploy) are resolved upstream by the classifier, which escalates such a change
1424
+ * to T2 before this function sees it. Here we only map an already-decided tier.
1425
+ */
1426
+ export function effectiveGates(archetype, size, tier = "T2") {
1427
+ const base = gatesFor(archetype, size);
1428
+ // T2 (and any unrecognized tier) → full baseline, never downgraded, ship forced.
1429
+ if (tier !== "T0" && tier !== "T1") {
1430
+ return base.includes("ship") ? base : [...base, "ship"];
1431
+ }
1432
+ // Regulated archetypes carry a floor that survives every downgrade.
1433
+ const isRegulated = base.includes("security") || base.includes("compliance");
1434
+ const floor = isRegulated ? base.filter((g) => FLOOR_GATES.includes(g)) : [];
1435
+ if (tier === "T1") {
1436
+ const keep = new Set(floor);
1437
+ if (base.includes("plan"))
1438
+ keep.add("plan");
1439
+ return base.filter((g) => keep.has(g)); // preserve base order
1440
+ }
1441
+ // T0 — maintenance.
1442
+ return floor;
1443
+ }
1389
1444
  /**
1390
1445
  * Returns the ordered list of reviewers for an archetype. Empty for
1391
1446
  * `greenfield`. Used by the orchestrator to spawn the right
package/dist/flow.js CHANGED
@@ -31,6 +31,12 @@ const ARCHETYPE_TITLE = {
31
31
  "gov-public": "Government",
32
32
  "insurance": "Insurance",
33
33
  "regulated": "Regulated system",
34
+ "vertical-saas": "Vertical SaaS",
35
+ "booking": "Booking / scheduling",
36
+ "crm": "CRM",
37
+ "dashboard": "Dashboard / analytics",
38
+ "content-platform": "Content / media platform",
39
+ "marketplace-lite": "Marketplace",
34
40
  "greenfield": "New project",
35
41
  };
36
42
  // Gate id (StandardGate) → user label
@@ -76,8 +82,29 @@ const ARCHETYPE_COST = {
76
82
  "infra": [3, 8],
77
83
  "library": [0.5, 3],
78
84
  "cli-tool": [0.5, 3],
85
+ // Product Builder archetypes — cheap, high-automation builds.
86
+ "vertical-saas": [3, 8],
87
+ "booking": [3, 8],
88
+ "crm": [3, 8],
89
+ "dashboard": [3, 8],
90
+ "content-platform": [3, 8],
91
+ "marketplace-lite": [3, 8],
79
92
  "greenfield": [0.5, 3],
80
93
  };
94
+ /**
95
+ * Archetypes that ship a user-facing interface and therefore get a
96
+ * `design-advisor` stage (plan-altitude, before pm). Backend/infra/library/CLI
97
+ * archetypes have no UI surface and skip it. design-advisor itself skips a
98
+ * change classified T0 at runtime (see scripts/lib/change-tier.mjs).
99
+ */
100
+ export const UI_BEARING_ARCHETYPES = new Set([
101
+ "web-service", "mobile-app", "commerce", "marketplace", "cms",
102
+ "enterprise-saas", "edtech", "game", "browser-extension",
103
+ "healthcare", "fintech", "insurance", "gov-public", "web3",
104
+ // Product Builder archetypes (A1–A6) — all ship a UI.
105
+ "vertical-saas", "booking", "crm", "dashboard", "content-platform",
106
+ "marketplace-lite",
107
+ ]);
81
108
  // ── Main export ───────────────────────────────────────────────────────────
82
109
  /**
83
110
  * Compile all detection outputs into a single FlowResult.
@@ -96,6 +123,9 @@ export function compileFlow(archetype, size, detection, compliance, confidence)
96
123
  agentSet.add("architect");
97
124
  agentSet.add("senior-dev");
98
125
  agentSet.add("qa-engineer");
126
+ // Design-advisor for UI-bearing archetypes (plan-altitude, before pm).
127
+ if (UI_BEARING_ARCHETYPES.has(archetype))
128
+ agentSet.add("design-advisor");
99
129
  // ── Gates ────────────────────────────────────────────────────────────────
100
130
  const gateSet = new Set(gatesFor(archetype, size).map((g) => GATE_LABEL[g] ?? `gate:${g}`));
101
131
  for (const g of suggestPackGates(detection))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "great-cto",
3
- "version": "2.73.1",
3
+ "version": "2.74.0",
4
4
  "description": "One command install for the great_cto Claude Code plugin. Auto-detects your stack, picks the right archetype, bootstraps PROJECT.md.",
5
5
  "keywords": [
6
6
  "claude-code",