@tekyzinc/gsd-t 4.0.27 → 4.0.29

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/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [4.0.29] - 2026-06-05 (M81 Workflows Runtime-Native - patch)
6
+
7
+ ### Fixed - TD-113: 6 of 7 workflows (+ quick) crashed in the Workflow sandbox and had never run
8
+
9
+ The GSD-T self-scan (Scan #12) and a live NiceNote session both confirmed it: every `*.workflow.js` except `gsd-t-scan` opened with `require("./_lib.js")`, which the Anthropic Workflow sandbox forbids (it provides only `agent/parallel/pipeline/log/phase/budget/args` — no `require`/`fs`/`path`/`child_process`/`process`). Each threw `ReferenceError` on first eval, so the entire orchestration layer — `execute`, `verify`, `wave`, `integrate`, `debug`, `phase`, `quick` — silently fell back to hand-driven runs and never actually executed as workflows.
10
+
11
+ Ported all 7 to the runtime-native pattern proven on scan in M71/M80: inline `async` helpers that delegate each CLI call (preflight, verify-gate, brief, build-coverage, ci-parity, test-data, parallel/disjointness) to an `agent()`'s Bash — preferring project-local `bin/<tool>.cjs`, falling back to the global `gsd-t` PATH binary — and parse the JSON envelope. `args` is now `JSON.parse`d (it arrives stringified). File reads moved into the agents that have `Read` (worker reads its own scope.md/tasks.md; triad agents read their own protocol from `templates/prompts/`). `verify`'s raw `spawnSync`/`require` CI-parity block and `Date.now()` run-id were replaced; the M57/M58 FAIL-blocking semantics are unchanged.
12
+
13
+ - `templates/workflows/gsd-t-{execute,verify,wave,integrate,debug,phase,quick}.workflow.js`: runtime-native port.
14
+ - `test/m71-workflow-runtime-native-lint.test.js`: lint now covers all 8 workflows (was scan-only).
15
+ - `test/m81-workflows-runtime-native.test.js`: structural invariants (no `_lib` require, args-string parse, no `spawnSync`/`Date.now`/`Math.random` in orchestrator, FAIL-blocking gates preserved).
16
+ - `CLAUDE.md`, `~/.claude/CLAUDE.md` + `templates/CLAUDE-global.md`: documented the runtime-native invariant; retired `_lib.js` as a workflow dependency.
17
+
18
+ Proven in the REAL sandbox: `quick` ran end-to-end (verify-gate PASS), `verify` evaluated through its CLI delegations returning a real verify-gate envelope, `execute` evaluated cleanly to its arg-guard — all with zero ReferenceError. Suite 1341/1341 pass.
19
+
20
+ ## [4.0.28] - 2026-06-04 (M80 Scan Document-Phase Fixes - patch)
21
+
22
+ ### Fixed - scan workflow crashed at the document phase, then shipped a truncated plain-English doc
23
+
24
+ Three bugs in the scan workflow's late (document) stage, all surfaced by running the deep scan on the GSD-T repo itself (5,647 files, 181 verified findings). Each runs AFTER ~220 finder/verify/synthesis agents, so a late-stage bug wastes the whole expensive run.
25
+
26
+ 1. **`ReferenceError: findingsJson is not defined`** crashed the entire workflow at the Document phase. The variable was consumed by `baseCtx` (the context every document agent reads) but never declared. Fixed by defining it as a compact JSON projection of the verified findings.
27
+ 2. **Plain-English companion shipped truncated** (65 of 181 entries — Critical+High + a 2-item tail; Medium/Low silently dropped). The prior design fanned each ~30KB chunk to a separate haiku agent via heredoc-append, which reported "OK" without faithfully writing the blob. Rewritten to a SINGLE owning agent that writes all chunks sequentially and self-verifies the on-disk `### TD-` count, with an independent second-agent count check; completeness is surfaced in the return (`plainEnglishComplete`).
28
+ 3. **`parseComponents` returned zero domains** from the freshly regenerated `scan/architecture.md`. The document agent writes domains as a `## Components / Domains` section of `### N. Title` subsections (and Structure as a markdown table), but the parser only knew the legacy `## Component Inventory` table + bare-line Structure format — so the renderer's domain list came up empty.
29
+
30
+ - `templates/workflows/gsd-t-scan.workflow.js`: define `findingsJson`; single self-verifying plain-English writer; surface `plainEnglishComplete`/`plainEnglishEntries`/`plainEnglishExpected`.
31
+ - `bin/scan-data-collector.js`: `parseComponents` now also parses `## Components / Domains` `### N.` subsections and Structure markdown tables.
32
+ - `test/m80-scan-document-phase-refs.test.js`: regression tests (baseCtx refs declared, findingsJson declared-before-use, single-owner PE write guard, domain parsing of the new format). Mutation-tested against a workflow copy with the bug reintroduced.
33
+
34
+ All three fixes proven in the real Workflow sandbox via resume (cached finder/verify/synthesis agents, live document phase): final run returned `plainEnglishComplete:true` (181/181), 17 domains parsed.
35
+
5
36
  ## [4.0.27] - 2026-06-04 (M79 Diagram Quality - patch)
6
37
 
7
38
  ### Fixed - scan-report diagrams were generic boilerplate, clashed with the dark theme, and one was actively misleading
package/README.md CHANGED
@@ -1,27 +1,25 @@
1
1
  # GSD-T: Contract-Driven Development for Claude Code
2
2
 
3
- A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
3
+ **v4.0.27** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
4
4
 
5
5
  **Eliminates context rot** — task-level fresh dispatch (one subagent per task, ~10-20% context each) means compaction never triggers.
6
6
  **Compaction-proof debug loops** — `gsd-t headless --debug-loop` runs test-fix-retest cycles as separate `claude -p` sessions. A JSONL debug ledger persists all hypothesis/fix/learning history across fresh sessions. Anti-repetition preamble injection prevents retrying failed hypotheses. Escalation tiers (sonnet → opus → human) and a hard iteration ceiling enforced externally.
7
- **Safe parallel execution** — worktree isolation gives each domain agent its own filesystem; sequential atomic merges prevent conflicts.
7
+ **Safe parallel execution** — file-disjointness gates (`gsd-t-file-disjointness.cjs`) verify no two concurrent domain workers claim the same write targets before spawning; sequential atomic merges prevent conflicts.
8
8
  **Maintains test coverage** — automatically keeps tests aligned with code changes.
9
9
  **Catches downstream effects** — analyzes impact before changes break things.
10
10
  **Protects existing work** — destructive action guard prevents schema drops, architecture replacements, and data loss without explicit approval.
11
11
  **Visualizes execution in real time** — live browser dashboard renders agent hierarchy, tool activity, and phase progression from the event stream.
12
- **Generates visual scan reports** — every `/gsd-t-scan` produces a self-contained HTML report with 6 live architectural diagrams, a tech debt register, and domain health scores; optional DOCX/PDF export via `--export docx|pdf`.
12
+ **Generates visual scan reports** — every `/gsd-t-scan` runs a volume-scaled native Workflow (M66+): a volume-probe stage counts files/routes/tables/components and derives a slice list (1-40+ slices depending on codebase size), parallel deep-finder agents enumerate every module, a synthesis stage merges findings into a prioritized tech-debt register, and a deterministic render stage produces a self-contained HTML report with architectural diagrams, domain health scores, and living-doc cross-population. Optional DOCX/PDF export via `--export docx|pdf`.
13
13
  **Self-learning rule engine** — declarative rules in rules.jsonl detect failure patterns from task metrics. Candidate patches progress through a 5-stage lifecycle (candidate, applied, measured, promoted, graduated) with >55% improvement gates before becoming permanent methodology artifacts.
14
14
  **Cross-project learning** — proven rules propagate to `~/.claude/metrics/` and sync across all registered projects via `update-all`. Rules validated in 3+ projects become universal; 5+ projects qualify for npm distribution. Cross-project signal comparison and global ELO rankings available via `gsd-t-metrics --cross-project` and `gsd-t-status`.
15
- **Stack Rules Engine** — auto-detects project tech stack (React, TypeScript, Node API, Python, Go, Rust) from manifest files and injects mandatory best-practice rules into subagent prompts at execute-time. Universal security rules always apply; stack-specific rules layer on top. Includes **design-to-code** rules for pixel-perfect frontend implementation from Figma, screenshots, or design images with Figma MCP integration, design token extraction, stack capability evaluation, and mandatory visual verification: every screen is rendered in a real browser, screenshotted at mobile/tablet/desktop, and compared pixel-by-pixel against the Figma design. Auto-bootstraps during partition when design references are detected. Extensible: drop a `.md` file in `templates/stacks/` to add a new stack.
16
- **External Task Orchestrator + Streaming Watcher UI (M40, v3.14.10)** — JS orchestrator drives `claude -p` one task per spawn: short-lived, fresh context, architecturally compaction-free. Benchmarks 0.72× wall-clock vs in-session on 20-task/3-wave workloads. Paired with a zero-Claude-cost local streaming UI at `127.0.0.1:7842` that renders all workers' stream-json output as a continuous claude.ai-style feed task/wave banners, duration + usage chips, token corner bar, localStorage filters, replay via `WS /feed?from=N`. Recovery: `--resume` reconciles interrupted runs using commit + progress.md evidence; ambiguous tasks (commit without progress entry) are flagged for operator triage, never silently claimed done. CLI: `gsd-t orchestrate`, `gsd-t benchmark-orchestrator`, `gsd-t stream-feed`. Contracts: `stream-json-sink-contract.md` v1.1.0, `wave-join-contract.md`, `completion-signal-contract.md`, `metrics-schema-contract.md`.
17
- **Always-Headless Spawn (M43 D4, v3.16.x+) — Channel Separation** — every GSD-T command spawns detached, unconditionally. No `--watch`, no `--in-session`, no `--headless` opt-in, no context-meter threshold that reroutes. The dialog channel is reserved for human↔Claude conversation; every workflow turn is a detached headless child. Interactive session shows a launch banner + live-transcript URL + event-stream path, then exits results surface via the read-back banner on the user's next message. Detached workers emit JSONL events to `.gsd-t/events/YYYY-MM-DD.jsonl` at every phase boundary — shared by dashboard and (historically) the watch command. The only in-session surface is the `/gsd` router (for dialog-only exploratory turns). See `.gsd-t/contracts/headless-default-contract.md` v2.0.0 and `unattended-event-stream-contract.md` v1.0.0.
18
- **Live Transcript as Primary Surface (M43 D6, v3.16.13 — extended in M47, v3.21.10)** — every detached spawn prints a one-line banner (`▶ Live transcript: http://127.0.0.1:{port}/transcript/{id}`) pointing at a browser viewer that SSE-streams the child's stdout and renders a collapsible "Tool Cost" sidebar panel showing per-tool attributed tokens and cost (sourced from `/transcript/:id/tool-cost`, which proxies to the M43 D2 tool-attribution library). The dashboard server auto-starts (`scripts/gsd-t-dashboard-autostart.cjs`) idempotently on each spawn a port probe backs off when a server is already running, otherwise a fork-detach writes `.gsd-t/.dashboard.pid`. Port is project-scoped via `projectScopedDefaultPort(projectDir)` so multi-project workflows don't clobber each other.
19
- **Rigorous User-Journey Coverage + Anti-Drift Test Quality (M52, v3.23.10)** — closes the M48→M51 drift pattern where each test round only caught previously-named bug shapes. Two-part fix: (a) `bin/journey-coverage.cjs` regex listener detector + `gsd-t check-coverage` CLI + `scripts/hooks/pre-commit-journey-coverage` commit gate (auto-installed on `gsd-t init`) blocks viewer-source commits when uncovered listeners exist; (b) 12 inaugural journey specs in `e2e/journeys/` covering all 20 detected viewer listeners with functional assertions (zero `toBeVisible`-only tests). Red Team GRUDGING PASS: 5/5 broken viewer patches caught; hook block-then-unblock exercised. Suite: 2195/2195 unit + 35/35 E2E pass.
20
- **Universal Playwright Bootstrap + Deterministic UI Enforcement (M50, v3.22.10)** — converts the prose-only "Playwright Readiness Guard" into three executable enforcement layers so agents cannot skip UI tests. Layer 1: `bin/playwright-bootstrap.cjs` + `bin/ui-detection.cjs` wired into `init`/`update-all`/`doctor`/new `gsd-t setup-playwright [path]` subcommand idempotent installer detects package manager, installs `@playwright/test` + chromium, writes config from a contract-locked template, scaffolds `e2e/`. Layer 2: `bin/headless-auto-spawn.cjs::autoSpawnHeadless()` auto-installs before any of 9 whitelisted testing/UI commands when `hasUI && !hasPlaywright`; install failure → `mode: 'blocked-needs-human'` exit-4. Layer 3: `scripts/hooks/pre-commit-playwright-gate` (opt-in via `gsd-t doctor --install-hooks`) reads `.gsd-t/.last-playwright-pass` and blocks viewer-source commits when staged files are newer than the last playwright test pass. Also ships the M47/M48/M49 E2E viewer specs (`e2e/viewer/title`, `timestamps`, `chat-bubbles`, `dual-pane`, `lazy-dashboard`). 62 new unit tests; E2E 8/9 pass.
21
- **Focused Visualizer Redesign (M47, v3.21.10)** — `/transcripts` opens directly to a dual-pane focused view: the **top pane** auto-streams the orchestrator's main in-session conversation (zero clicks — fetched via new `GET /api/main-session`), and the **bottom pane** streams whichever spawn the user clicks. A keyboard- and mouse-resizable splitter sits between them, with position persisted in `sessionStorage` (along with selection, completed-section toggle, and right-rail collapsed state). The left rail splits into three sections — `★ Main Session`, `Live Spawns`, and `Completed` (last 100 spawns, newest first, status-badged, collapsible). When a spawn transitions running → completed it moves rail sections live without a full reload, and stays selected if focused. The right rail (Spawn Plan / Parallelism / Tool Cost) is preserved under a new collapsible toggle. Bookmarks to `/transcript/:spawnId` continue to land that spawn pre-selected in the bottom pane. Contract: `dashboard-server-contract.md` v1.3.0 (additive — `status: 'active' \| 'completed'` field on in-session entries, derived from a 30s mtime window; `/api/main-session` endpoint with path-traversal guard + `Cache-Control: no-store`).
22
- - **Surgical model selection** — `bin/model-selector.js` assigns haiku/sonnet/opus per phase via a declarative rules table; `/advisor` escalation path with convention-based fallback.
23
- - **Per-spawn token telemetry** — `.gsd-t/token-metrics.jsonl` records one 18-field row per Task subagent spawn.
24
- **Context Meter (M34/M38/M43 D4) — Observational Only** — PostToolUse hook writes `.gsd-t/.context-meter-state.json` via local token estimation. Under M43 D4 (channel-separation inversion, `headless-default-contract.md` v2.0.0) the meter is OBSERVATIONAL ONLY: the pct is recorded into the token-log `Ctx%` column on the next spawn, but no threshold gates any routing decision — every command spawns detached regardless. The `context-meter-contract.md` single-band model is preserved for the value itself; it no longer drives in-flight pauses or spawn-time rerouting.
15
+ **Stack Rules Engine** — auto-detects project tech stack from manifest files (`package.json`, `requirements.txt`, `pyproject.toml`, `go.mod`, `Cargo.toml`) and injects mandatory best-practice rules into subagent prompts at execute-time. 29 stack templates currently ship (`templates/stacks/`), covering React, TypeScript, Vue, Next.js, Node API, Python, FastAPI, Flutter, Tailwind, Playwright, Prisma, PostgreSQL, Supabase, Firebase, Neo4j, GraphQL, Redux, Zustand, Vite, Docker, GitHub Actions, LLM integrations, queues, REST API, and more. Universal `_security.md` and `_auth.md` rules always apply. Includes **design-to-code** rules for pixel-perfect frontend implementation from Figma, screenshots, or design images - with Figma MCP integration, design token extraction, stack capability evaluation, and mandatory visual verification. Auto-bootstraps during partition when design references are detected. Extensible: drop a `.md` file in `templates/stacks/` to add a new stack.
16
+ **Native Workflow Orchestration (M61+)** — all major phases run as self-contained native Workflow scripts (`templates/workflows/`): execute, verify, wave, integrate, debug, quick, phase, and scan. The Workflow runtime owns spawning and context; no external orchestrator processes are needed for routine build/debug/deliver actions. Detached workers emit JSONL events to `.gsd-t/events/YYYY-MM-DD.jsonl` at every phase boundary, consumed by the real-time dashboard. The `/gsd` smart router handles plain-text messages via the auto-route hook.
17
+ **Real-Time Agent Dashboard** — `gsd-t-stream-feed-server.js` serves a streaming UI at `127.0.0.1:7842` that renders all workers' stream-json output as a continuous feed with task/wave banners, duration + usage chips, token corner bar, localStorage filters, and replay via `WS /feed?from=N`. Dashboard auto-starts idempotently on each spawn (`scripts/gsd-t-dashboard-autostart.cjs`). Port is project-scoped via `projectScopedDefaultPort(projectDir)` so multi-project workflows do not clobber each other.
18
+ **Rigorous User-Journey Coverage + Anti-Drift Test Quality** — `bin/journey-coverage.cjs` regex listener detector + `gsd-t check-coverage` CLI + `scripts/hooks/pre-commit-journey-coverage` commit gate blocks viewer-source commits when uncovered listeners exist. Journey specs in `e2e/journeys/` use functional assertions (zero `toBeVisible`-only tests) per the E2E Test Quality Standard in CLAUDE.md.
19
+ **Universal Playwright Bootstrap + Deterministic UI Enforcement (M50)** — three executable enforcement layers: (1) `bin/playwright-bootstrap.cjs` + `bin/ui-detection.cjs` - idempotent installer detects package manager, installs `@playwright/test` + chromium, scaffolds `e2e/`; (2) Workflow runtime runs `playwright-bootstrap.cjs::installPlaywright()` before any E2E stage when `hasUI && !hasPlaywright`; install failure halts with `blocked-needs-human`; (3) `scripts/hooks/pre-commit-playwright-gate` (opt-in via `gsd-t doctor --install-hooks`) blocks viewer-source commits when staged files are newer than `.gsd-t/.last-playwright-pass`. The `gsd-t setup-playwright [path]` subcommand handles manual install.
20
+ **Visualizer (`/gsd-t-visualize`)** — launches a real-time browser dashboard with dual-pane view: top pane streams the main session, bottom pane streams whichever spawn the user clicks. Left rail shows Live Spawns and Completed (last 100 spawns, status-badged, collapsible). Right rail shows Spawn Plan / Parallelism / Tool Cost. Powered by `gsd-t-stream-feed-server.js` + `gsd-t-dashboard.html`.
21
+ **Surgical model selection** — `bin/model-selector.js` assigns haiku/sonnet/opus per phase via a declarative rules table; `/advisor` escalation path with convention-based fallback.
22
+ **Token Telemetry** — `gsd-t-calibration-hook.js` records token usage per spawn to `.gsd-t/token-metrics.jsonl` (18-field rows). `gsd-t-token-aggregator.js` aggregates across tasks for the `/gsd-t-metrics` view. Use the native Claude Code `/context` command for live in-session context percentage.
25
23
  **Quality North Star** — projects define a `## Quality North Star` section in CLAUDE.md (1–3 sentences, e.g., "This is a published npm library. Every public API must be intuitive and backward-compatible."). `gsd-t-init` auto-detects preset (library/web-app/cli) from package.json signals; `gsd-t-setup` configures it for existing projects. Subagents read it as a quality lens; absent = silent skip (backward compatible).
26
24
  **Design Brief Artifact** — during partition, UI/frontend projects (React, Vue, Svelte, Flutter, Tailwind) automatically get `.gsd-t/contracts/design-brief.md` with color palette, typography, spacing system, component patterns, and tone/voice. Non-UI projects skip silently. User-customized briefs are preserved. Referenced in plan phase for visual consistency.
27
25
  **Design Verification Agent** — after QA passes on design-to-code projects, a dedicated verification agent opens a browser with both the built frontend AND the original design (Figma page, design image, or MCP screenshot) side-by-side for direct visual comparison. Produces a structured element-by-element comparison table (30+ rows) with specific design values vs. implementation values and MATCH/DEVIATION verdicts. An artifact gate enforces that the comparison table exists — missing it blocks completion. Separation of concerns: coding agents code, verification agents verify. Wired into execute (Step 5.25) and quick (Step 5.25). Only fires when `.gsd-t/contracts/design-contract.md` exists — non-design projects are unaffected.
@@ -37,7 +35,7 @@ A methodology for reliable, parallelizable development using Claude Code with op
37
35
  npx @tekyzinc/gsd-t install
38
36
  ```
39
37
 
40
- This installs 49 GSD-T commands + 5 utility commands (54 total) to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
38
+ This installs 46 GSD-T workflow commands + 5 utility commands (51 total) to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
41
39
 
42
40
  ### Start Using It
43
41
 
@@ -84,7 +82,7 @@ GSD-T reads all state files and tells you exactly where you left off.
84
82
  ## CLI Commands
85
83
 
86
84
  ```bash
87
- npx @tekyzinc/gsd-t install # Install commands + global CLAUDE.md
85
+ npx @tekyzinc/gsd-t install # Install commands + global CLAUDE.md (51 commands)
88
86
  npx @tekyzinc/gsd-t update # Update global commands + CLAUDE.md
89
87
  npx @tekyzinc/gsd-t update-all # Update globally + all registered project CLAUDE.md files
90
88
  npx @tekyzinc/gsd-t init [name] # Scaffold GSD-T project (auto-registers)
@@ -93,6 +91,7 @@ npx @tekyzinc/gsd-t status # Check installation + version
93
91
  npx @tekyzinc/gsd-t doctor # Diagnose common issues
94
92
  npx @tekyzinc/gsd-t changelog # Open changelog in the browser
95
93
  npx @tekyzinc/gsd-t uninstall # Remove commands (keeps project files)
94
+ npx @tekyzinc/gsd-t setup-playwright [path] # Install Playwright + chromium for a project
96
95
 
97
96
  # Headless mode (CI/CD)
98
97
  gsd-t headless verify --json --timeout=1200 # Run verify non-interactively
@@ -184,7 +183,6 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
184
183
  |---------|---------|------|
185
184
  | `/gsd-t-milestone` | Define new milestone | Manual |
186
185
  | `/gsd-t-partition` | Decompose into domains + contracts | In wave |
187
- | `/gsd-t-discuss` | Multi-perspective design exploration | In wave |
188
186
  | `/gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) | In wave |
189
187
  | `/gsd-t-impact` | Analyze downstream effects | In wave |
190
188
  | `/gsd-t-execute` | Run tasks — task-level fresh dispatch, worktree isolation, adaptive replanning | In wave |
@@ -196,14 +194,6 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
196
194
  | `/gsd-t-verify` | Run quality gates + goal-backward behavior verification | In wave |
197
195
  | `/gsd-t-complete-milestone` | Archive + git tag (goal-backward gate required) | In wave |
198
196
 
199
- ### Overnight / Idle-Run Commands (slower than in-session — use only for unattended overnight or multi-hour idle runs)
200
-
201
- | Command | Purpose | Auto |
202
- |---------|---------|------|
203
- | `/gsd-t-unattended` | Launch detached supervisor for overnight/idle runs only | Manual |
204
- | `/gsd-t-unattended-watch` | Watch tick — fires every 270s via ScheduleWakeup, reports supervisor status | Auto |
205
- | `/gsd-t-unattended-stop` | Touch stop sentinel — supervisor halts after current worker finishes | Manual |
206
-
207
197
  ### Automation & Utilities
208
198
 
209
199
  | Command | Purpose | Auto |
@@ -243,6 +233,7 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
243
233
  |---------|---------|------|
244
234
  | `/branch` | Create and switch to a new git branch | Manual |
245
235
  | `/checkin` | Auto-bump version, stage, commit, and push | Manual |
236
+ | `/cpua` | Commit, Publish, Update All — bump version, publish to npm, propagate to all registered projects | Manual |
246
237
  | `/Claude-md` | Reload CLAUDE.md directives mid-session | Manual |
247
238
  | `/global-change` | Apply file changes across all registered GSD-T projects | Manual |
248
239
 
@@ -256,10 +247,9 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
256
247
  | **Project/Feature/Scan** | Initialize work | Solo (team for large scans) |
257
248
  | **Milestone** | Define deliverable | Solo |
258
249
  | **Partition** | Decompose into domains + contracts | Solo |
259
- | **Discuss** | Explore design decisions | Both |
260
250
  | **Plan** | Create atomic task lists | Solo (always) |
261
251
  | **Impact** | Downstream effect analysis | Solo |
262
- | **Execute** | Build it — task-level parallelism via `gsd-t parallel --help` (M44 D2/D3); conditional on >1 gate-passing task, falls back to sequential silently | Both |
252
+ | **Execute** | Build it - domain workers run in parallel (file-disjointness gated); Workflow: preflight brief disjointness parallel workers integrate → verify-gate | Both |
263
253
  | **Test-Sync** | Maintain test coverage | Solo |
264
254
  | **Integrate** | Wire domains together | Solo (always) |
265
255
  | **Verify** | Quality gates | Both |
@@ -338,104 +328,27 @@ your-project/
338
328
 
339
329
  ---
340
330
 
341
- ## Overnight / Idle-Run Supervisor (M36 — v3.10.10+)
342
-
343
- > **Daytime work runs in-session.** This supervisor is provided for unattended overnight or multi-hour idle runs only — it is dramatically slower than in-session execution because every worker iteration pays cold-context startup cost (re-reads CLAUDE.md, progress.md, all domain files) before doing real work, then is bounded to a 270s cache-warm budget. Reach for it only when you genuinely cannot supervise the run.
344
-
345
- ```bash
346
- # Launch from the CLI (detached OS process)
347
- gsd-t unattended --hours=24
348
-
349
- # Or from within Claude Code
350
- /gsd-t-unattended
351
-
352
- # Stop (graceful — supervisor halts after the current worker finishes)
353
- /gsd-t-unattended-stop
354
- ```
355
-
356
- **How it works:**
357
-
358
- - `gsd-t unattended` spawns `bin/gsd-t-unattended.js` as a fully detached OS process. The supervisor runs `claude -p` workers in a relay — one worker per iteration — each in a fresh context window. State is written atomically to `.gsd-t/.unattended/state.json` between iterations.
359
- - `/gsd-t-unattended` does the same from inside Claude Code, then calls `ScheduleWakeup(270, '/gsd-t-unattended-watch')` to start an in-session watch loop that ticks every 270 seconds and prints progress.
360
- - If you run `/clear` + `/gsd-t-resume` during a live run, the resume command auto-detects the running supervisor and re-attaches the watch loop — no re-launch needed.
361
- - The supervisor halts automatically when: the milestone reaches COMPLETED status, the `--hours` wall-clock cap expires, `--max-iterations` is reached, safety rails detect a stall or unrecoverable error, or the stop sentinel is touched.
331
+ ## Unattended / Background Runs
362
332
 
363
- **Platform support:** macOS and Linux fully supported (including sleep-prevention via `caffeinate` on macOS). Windows is supported except sleep-prevention. See `docs/unattended-windows-caveats.md` for known Windows limitations.
333
+ For zero-touch overnight or multi-hour runs, use the `/loop` skill with a GSD-T command, or the `/gsd-t-unattended` skill (via the Smart Router). State is written atomically to `.gsd-t/.unattended/state.json` between worker iterations.
364
334
 
365
- **Key flags:**
335
+ The supervisor halts automatically when: the milestone reaches COMPLETED status, the wall-clock cap expires, `--max-iterations` is reached, safety rails detect a stall or unrecoverable error, or the stop sentinel is touched.
366
336
 
367
- | Flag | Default | Description |
368
- |------|---------|-------------|
369
- | `--hours=N` | 24 | Wall-clock cap |
370
- | `--max-iterations=N` | 200 | Iteration cap |
371
- | `--milestone=NAME` | (current) | Override active milestone |
372
- | `--dry-run` | false | Preflight only — no spawn |
373
-
374
- **State files** live under `.gsd-t/.unattended/`: `supervisor.pid`, `state.json`, `run.log`, `stop` (sentinel). Authoritative field definitions: `.gsd-t/contracts/unattended-supervisor-contract.md` v1.0.0.
337
+ **State files** live under `.gsd-t/.unattended/`: `supervisor.pid`, `state.json`, `run.log`, `stop` (sentinel).
375
338
 
376
339
  ---
377
340
 
378
- ## Context Meter Setup (M34 — v2.75.10+)
379
-
380
- The Context Meter replaces the v2.74.12 task-counter proxy with real context-window measurement via the Anthropic `count_tokens` API. This is the authoritative signal for session-stop gates in `gsd-t-execute`, `gsd-t-wave`, `gsd-t-quick`, `gsd-t-integrate`, and `gsd-t-debug`.
381
-
382
- ### 1. Set your API key
383
-
384
- Create a key at [console.anthropic.com](https://console.anthropic.com) (free tier is sufficient — `count_tokens` calls are inexpensive) and export it in your shell profile:
385
-
386
- ```bash
387
- export ANTHROPIC_API_KEY="sk-ant-..."
388
- ```
389
-
390
- The env var name is configurable in `.gsd-t/context-meter-config.json` (default: `ANTHROPIC_API_KEY`).
391
-
392
- ### 2. Verify with `gsd-t doctor`
393
-
394
- ```bash
395
- npx @tekyzinc/gsd-t doctor
396
- ```
397
-
398
- Doctor checks:
399
- - `ANTHROPIC_API_KEY` is set (RED if missing)
400
- - PostToolUse hook is registered in `~/.claude/settings.json`
401
- - `scripts/gsd-t-context-meter.js` exists in the project
402
- - `.gsd-t/context-meter-config.json` parses cleanly
403
- - A live `count_tokens` dry-run succeeds (RED on 401/403/network failure)
404
-
405
- ### 3. Adjust thresholds (optional)
406
-
407
- Edit `.gsd-t/context-meter-config.json`:
341
+ ## Context and Token Monitoring
408
342
 
409
- ```json
410
- {
411
- "enabled": true,
412
- "apiKeyEnvVar": "ANTHROPIC_API_KEY",
413
- "modelWindowSize": 200000,
414
- "thresholdPct": 85,
415
- "checkFrequency": 1
416
- }
417
- ```
418
-
419
- - `modelWindowSize` — total context window (200K for Opus/Sonnet)
420
- - `thresholdPct` — percentage at which the orchestrator halts (85% = stop band; 70% = warn band — cue for explicit pause/resume; no silent degradation)
421
- - `checkFrequency` — run `count_tokens` every N tool calls (1 = every call; higher = cheaper + slightly delayed signal)
422
-
423
- ### 4. Live status
343
+ GSD-T uses the Claude Code native `/context` command for live in-session context usage. The `ANTHROPIC_API_KEY` env var is used for token count diagnostics and measurement only - not for inference (inference runs via Claude Max subscription).
424
344
 
425
345
  ```bash
426
- npx @tekyzinc/gsd-t status
346
+ export ANTHROPIC_API_KEY="sk-ant-..." # for count_tokens diagnostics
427
347
  ```
428
348
 
429
- Displays a Context line with `{pct}% of {window} tokens ({band}) last check {time ago}`. Missing state file shows `N/A (meter hook not run this session)`.
430
-
431
- ### Upgrading from pre-M34
349
+ The `gsd-t-calibration-hook.js` hook auto-detects model window size (1M for Opus 4.7/4.8, Sonnet 4.5+) and records token usage to `.gsd-t/token-metrics.jsonl` (one 18-field row per spawn). The `gsd-t-token-aggregator.js` script aggregates JSONL data for the `/gsd-t-metrics` view.
432
350
 
433
- Running `gsd-t update-all` handles the migration automatically:
434
- - Copies the new hook script, runtime files, config template, and `context-meter-config.cjs` loader into every registered project
435
- - Runs a one-time task-counter retirement — deletes `bin/task-counter.cjs`, `.gsd-t/task-counter-config.json`, `.gsd-t/.task-counter-state.json`, and the `.gsd-t/.task-counter` state file
436
- - Writes `.gsd-t/.task-counter-retired-v1` marker (subsequent runs are no-op)
437
-
438
- After upgrading, **you must set `ANTHROPIC_API_KEY`** — `gsd-t doctor` will fail otherwise.
351
+ If `.gsd-t/context-meter-config.json` exists, you can adjust `thresholdPct` and `modelWindowSize` (use `1000000` for current 1M-window models). Run `gsd-t doctor` to verify configuration.
439
352
 
440
353
  ---
441
354
 
@@ -472,45 +385,81 @@ Verify with: `/gsd-t-help`
472
385
  ```
473
386
  get-stuff-done-teams/
474
387
  ├── README.md
475
- ├── package.json
388
+ ├── package.json # @tekyzinc/gsd-t v4.0.27
476
389
  ├── LICENSE
477
- ├── bin/
478
- └── gsd-t.js # CLI installer
479
- ├── commands/ # 56 slash commands
480
- │ ├── gsd-t-*.md # 50 GSD-T workflow commands
481
- │ ├── gsd.md # GSD-T smart router
390
+ ├── bin/ # CLI entry + orchestrators + support modules (52 modules)
391
+ ├── gsd-t.js # CLI installer + all subcommands
392
+ ├── orchestrator.js # Design orchestrator
393
+ │ ├── cli-preflight.cjs # Preflight gate (branch, ports, contracts)
394
+ │ ├── gsd-t-verify-gate.cjs # Two-track verify gate (preflight + parallel CLIs)
395
+ │ ├── gsd-t-parallel.cjs # Task-level parallelism + mode-aware gating
396
+ │ ├── gsd-t-task-graph.cjs # Dependency graph + topological sort
397
+ │ ├── gsd-t-file-disjointness.cjs # Pre-spawn file overlap gate
398
+ │ ├── gsd-t-context-brief.cjs # <=2500-token JSON snapshot for worker spawns
399
+ │ ├── gsd-t-context-brief-kinds/ # 11 brief collectors (execute, verify, scan, qa, ...)
400
+ │ ├── scan-*.js # Scan data collection, schema, diagrams, HTML report
401
+ │ ├── graph-*.js # Code graph engine (CGC/Neo4j integration)
402
+ │ ├── journey-coverage.cjs # Listener detector + coverage gap reporting
403
+ │ ├── playwright-bootstrap.cjs # Idempotent Playwright installer
404
+ │ ├── model-selector.js # Phase-to-model assignment (haiku/sonnet/opus)
405
+ │ ├── rule-engine.js # Declarative failure-pattern rules
406
+ │ ├── patch-lifecycle.js # 5-stage patch candidate→graduated lifecycle
407
+ │ └── metrics-collector.js # Task telemetry + ELO tracking
408
+ ├── commands/ # 51 slash commands
409
+ │ ├── gsd-t-*.md # 46 GSD-T workflow commands
410
+ │ ├── gsd.md # Smart router
482
411
  │ ├── branch.md # Git branch helper
483
- │ ├── checkin.md # Auto-version + commit/push helper
484
- └── Claude-md.md # Reload CLAUDE.md directives
485
- ├── templates/ # Document templates (10 base + stacks/)
486
- ├── CLAUDE-global.md
487
- │ ├── CLAUDE-project.md
488
- │ ├── requirements.md
489
- │ ├── architecture.md
490
- │ ├── workflows.md
491
- │ ├── infrastructure.md
492
- │ ├── progress.md
493
- │ ├── backlog.md
494
- │ ├── backlog-settings.md
495
- │ ├── design-contract.md # Design-to-code token extraction template
496
- └── stacks/ # Stack Rules Engine templates
412
+ │ ├── checkin.md # Auto-version + commit/push
413
+ ├── cpua.md # Commit, Publish, Update All
414
+ │ └── global-change.md # Cross-project file propagation
415
+ ├── templates/
416
+ │ ├── CLAUDE-global.md # Global CLAUDE.md template
417
+ │ ├── CLAUDE-project.md # Project CLAUDE.md template
418
+ │ ├── requirements.md / architecture.md / workflows.md / infrastructure.md / progress.md
419
+ │ ├── backlog.md / backlog-settings.md
420
+ │ ├── design-contract.md / element-contract.md / widget-contract.md / page-contract.md
421
+ │ ├── workflows/ # 9 native Workflow scripts
422
+ ├── gsd-t-execute.workflow.js
423
+ ├── gsd-t-verify.workflow.js
424
+ ├── gsd-t-wave.workflow.js
425
+ │ ├── gsd-t-scan.workflow.js # Volume-scaled (M66+)
426
+ │ │ ├── gsd-t-integrate.workflow.js
427
+ │ │ ├── gsd-t-debug.workflow.js
428
+ │ │ ├── gsd-t-quick.workflow.js
429
+ │ │ ├── gsd-t-phase.workflow.js
430
+ │ │ └── _lib.js # Shared workflow helpers
431
+ │ ├── prompts/ # Validation subagent protocols
432
+ │ │ ├── qa-subagent.md
433
+ │ │ ├── red-team-subagent.md
434
+ │ │ └── design-verify-subagent.md
435
+ │ └── stacks/ # Stack Rules Engine (29 templates)
497
436
  │ ├── _security.md # Universal — always injected
498
- │ ├── react.md
499
- │ ├── typescript.md
500
- │ ├── design-to-code.md # Pixel-perfect design implementation
501
- └── node-api.md
502
- ├── scripts/ # Runtime utility scripts (installed to ~/.claude/scripts/)
437
+ │ ├── _auth.md # Universal auth rules
438
+ │ ├── react.md / typescript.md / vue.md / nextjs.md / node-api.md
439
+ │ ├── python.md / fastapi.md / flutter.md / tailwind.md
440
+ ├── playwright.md / prisma.md / postgresql.md / supabase.md
441
+ ├── firebase.md / neo4j.md / graphql.md / docker.md
442
+ │ └── ... (29 total — ls templates/stacks/ for full list)
443
+ ├── scripts/ # Runtime utility scripts
503
444
  │ ├── gsd-t-tools.js # State CLI (get/set/validate/list)
504
445
  │ ├── gsd-t-statusline.js # Context usage bar
505
446
  │ ├── gsd-t-event-writer.js # Structured JSONL event writer
506
- │ ├── gsd-t-dashboard-server.js # Zero-dep SSE server for dashboard
507
- └── gsd-t-dashboard.html # React Flow + Dagre real-time dashboard
447
+ │ ├── gsd-t-stream-feed-server.js # WebSocket + SSE streaming server
448
+ ├── gsd-t-stream-feed.html # Streaming feed viewer
449
+ │ ├── gsd-t-dashboard.html # Real-time agent dashboard
450
+ │ ├── gsd-t-dashboard-autostart.cjs # Idempotent dashboard launcher
451
+ │ ├── gsd-t-token-aggregator.js # JSONL token data aggregation
452
+ │ ├── gsd-t-date-guard.js # PreToolUse timestamp validation hook
453
+ │ ├── gsd-t-auto-route.js # UserPromptSubmit smart-router hook
454
+ │ └── gsd-t-design-review-server.js # Design review proxy + queue server
455
+ ├── test/ # 78 test files (Node built-in test runner)
456
+ ├── e2e/ # Playwright E2E specs
508
457
  ├── examples/
509
458
  │ ├── settings.json
510
459
  │ └── .gsd-t/
511
- ├── docs/
512
- ├── GSD-T-README.md # Detailed methodology + usage guide
513
- └── methodology.md
460
+ └── docs/
461
+ ├── GSD-T-README.md # Detailed methodology + usage guide
462
+ └── methodology.md
514
463
  ```
515
464
 
516
465
  ---
@@ -52,6 +52,7 @@ function parseFilesAndLoc(text) {
52
52
  }
53
53
 
54
54
  function parseComponents(text) {
55
+ if (!text) return [];
55
56
  const sec = text.match(/## Component Inventory([\s\S]*?)(?=\n## |\n---|\n#[^#]|$)/);
56
57
  if (sec) {
57
58
  const tableRows = sec[1].split('\n')
@@ -66,8 +67,35 @@ function parseComponents(text) {
66
67
  .filter(Boolean);
67
68
  if (tableRows.length > 0) return tableRows;
68
69
  }
70
+ // M80: the deep-scan document agent writes the real domain list under a
71
+ // "## Components / Domains" (or "## Components") heading as "### N. Title"
72
+ // subsections — parse those as the authoritative domain entries. (The prior
73
+ // parser only knew "## Component Inventory" tables + a bare-line Structure
74
+ // format, so the freshly regenerated scan/architecture.md yielded zero domains
75
+ // and broke the renderer's domain list — caught by the GSD-T self-scan.)
76
+ const compSec = text.match(/## Components(?:\s*\/\s*Domains)?\b([\s\S]*?)(?=\n## |\n---\s*\n|$)/);
77
+ if (compSec) {
78
+ const domains = [];
79
+ for (const m of compSec[1].matchAll(/^#{3,4}\s+(?:\d+\.\s+)?(.+?)\s*$/gm)) {
80
+ const name = m[1].trim().replace(/\*\*/g, '').replace(/`/g, '');
81
+ if (name && !/^(overview|summary|notes?)$/i.test(name)) {
82
+ domains.push({ name, filePath: '', size: '', purpose: '', files: 1, healthScore: 80 });
83
+ }
84
+ }
85
+ if (domains.length > 0) return domains;
86
+ }
69
87
  const structSec = text.match(/## Structure([\s\S]*?)(?=\n## |\n---|\n#[^#]|$)/);
70
88
  if (!structSec) return [];
89
+ // Structure rendered as a markdown TABLE: | `bin/` | purpose | N files | ~LOC |
90
+ const tableDirs = structSec[1].split('\n')
91
+ .filter(l => /^\|/.test(l) && !/---/.test(l) && !/Directory|Grand Total|^\|\s*Component/i.test(l))
92
+ .map(row => {
93
+ const cols = row.split('|').map(c => c.trim().replace(/\*\*/g, '').replace(/`/g, '')).filter(Boolean);
94
+ if (cols.length < 2 || !/\//.test(cols[0]) || /^total/i.test(cols[0])) return null;
95
+ return { name: cols[0].replace(/\/$/, ''), filePath: cols[0], size: cols.slice(2).join(', '), purpose: cols[1] || '', files: 1, healthScore: 80 };
96
+ })
97
+ .filter(Boolean);
98
+ if (tableDirs.length > 0) return tableDirs;
71
99
  const entryRe = /^([a-zA-Z0-9_.\-]+\/)\s+(?:~?\s*)?(?:(\d+)\s+files?\s*)?\(?\s*~?\s*([\d,]+)\s+LOC\s*\)?\s*(.*)$/gm;
72
100
  const out = [];
73
101
  let m;