@tekyzinc/gsd-t 3.12.15 → 3.13.10

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.
@@ -26,6 +26,10 @@ Per `.gsd-t/contracts/model-selection-contract.md` v1.0.0.
26
26
 
27
27
  ## Step 0.1: Launch via Subagent
28
28
 
29
+ ```bash
30
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 0 --step-label ".1: Launch via Subagent" 2>/dev/null || true
31
+ ```
32
+
29
33
  To give this task a fresh context window and prevent compaction during consecutive quick runs, always execute via a Task subagent.
30
34
 
31
35
  **If you are the orchestrating agent** (you received the slash command directly):
@@ -127,6 +131,10 @@ Continue to Step 1 below.
127
131
 
128
132
  ## Step 1: Load Context (Fast)
129
133
 
134
+ ```bash
135
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 1 --step-label "Load Context (Fast)" 2>/dev/null || true
136
+ ```
137
+
130
138
  Read:
131
139
  1. `CLAUDE.md`
132
140
  2. `.gsd-t/progress.md` (if exists)
@@ -134,6 +142,10 @@ Read:
134
142
 
135
143
  ## Step 1.5: Graph-Enhanced Scope Check
136
144
 
145
+ ```bash
146
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 1 --step-label ".5: Graph-Enhanced Scope Check" 2>/dev/null || true
147
+ ```
148
+
137
149
  If `.gsd-t/graph/meta.json` exists (graph index is available):
138
150
  1. Query `getDomainOwner` for the target function/file to verify it belongs to the expected domain
139
151
  2. Query `getDomainBoundaryViolations` to check if the quick change would cross domain boundaries
@@ -143,6 +155,10 @@ If graph is not available, skip this step.
143
155
 
144
156
  ## Step 2: Scope Check
145
157
 
158
+ ```bash
159
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 2 --step-label "Scope Check" 2>/dev/null || true
160
+ ```
161
+
146
162
  Based on $ARGUMENTS, determine:
147
163
  - Which domain does this touch? (check `.gsd-t/domains/*/scope.md` if available)
148
164
  - Does it cross a domain boundary?
@@ -158,6 +174,10 @@ Proceed.
158
174
 
159
175
  ## Step 3: Execute
160
176
 
177
+ ```bash
178
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 3 --step-label "Execute" 2>/dev/null || true
179
+ ```
180
+
161
181
  ### Deviation Rules
162
182
 
163
183
  When you encounter unexpected situations:
@@ -190,6 +210,10 @@ When you encounter unexpected situations:
190
210
 
191
211
  ## Step 3.5: Emit Task Metrics
192
212
 
213
+ ```bash
214
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 3 --step-label ".5: Emit Task Metrics" 2>/dev/null || true
215
+ ```
216
+
193
217
  After committing, emit a task-metrics record for this quick task — run via Bash:
194
218
  `node bin/metrics-collector.js --milestone {current-milestone-or-none} --domain {domain-or-quick} --task quick-{timestamp} --command quick --duration_s {elapsed} --tokens_used {estimated} --context_pct ${CTX_PCT:-0} --pass {true|false} --fix_cycles {0|N} --signal_type {pass-through|fix-cycle} --notes "[quick] {description}" 2>/dev/null || true`
195
219
 
@@ -200,6 +224,10 @@ Emit task_complete event — run via Bash:
200
224
 
201
225
  ## Step 4: Document Ripple (if GSD-T is active)
202
226
 
227
+ ```bash
228
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 4 --step-label "Document Ripple (if GSD-T is active)" 2>/dev/null || true
229
+ ```
230
+
203
231
  If `.gsd-t/progress.md` exists, assess what documentation was affected and update ALL relevant files:
204
232
 
205
233
  ### Always update:
@@ -231,6 +259,10 @@ Skip scan docs not affected by this task. Skip analytical sections — those req
231
259
 
232
260
  ## Step 5: Test & Verify (MANDATORY)
233
261
 
262
+ ```bash
263
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 5 --step-label "Test & Verify (MANDATORY)" 2>/dev/null || true
264
+ ```
265
+
234
266
  Quick does not mean skip testing. Before committing:
235
267
 
236
268
  1. **Write/update tests for every new or changed code path**:
@@ -265,6 +297,10 @@ Note: Exploratory findings do NOT count against the scripted test pass/fail rati
265
297
 
266
298
  ## Step 5.25: Design Verification Agent (MANDATORY when design contract exists)
267
299
 
300
+ ```bash
301
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 5 --step-label ".25: Design Verification Agent (MANDATORY when design contract exists)" 2>/dev/null || true
302
+ ```
303
+
268
304
  After tests pass, check if `.gsd-t/contracts/design-contract.md` exists. If it does NOT, skip to Step 5.5.
269
305
 
270
306
  If it DOES exist and this task involved UI changes — spawn the Design Verification Agent. This agent's ONLY job is to open a browser, compare the built frontend against the original design, and produce a structured comparison table. It writes NO feature code.
@@ -338,6 +374,10 @@ After subagent returns — run observability Bash and append to token-log.md.
338
374
 
339
375
  ## Step 5.5: Red Team — Adversarial QA (MANDATORY)
340
376
 
377
+ ```bash
378
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 5 --step-label ".5: Red Team — Adversarial QA (MANDATORY)" 2>/dev/null || true
379
+ ```
380
+
341
381
  After tests pass, spawn an adversarial Red Team agent. Its success is measured by bugs found, not tests passed.
342
382
 
343
383
  ⚙ [opus] Red Team → adversarial validation of quick task
@@ -369,6 +409,10 @@ Append to `.gsd-t/token-log.md`:
369
409
 
370
410
  ## Step 6: Doc-Ripple (Automated)
371
411
 
412
+ ```bash
413
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-quick --step 6 --step-label "Doc-Ripple (Automated)" 2>/dev/null || true
414
+ ```
415
+
372
416
  After all work is committed but before reporting completion:
373
417
 
374
418
  1. Run threshold check — read `git diff --name-only HEAD~1` and evaluate against doc-ripple-contract.md trigger conditions
@@ -4,6 +4,10 @@ You are resuming work after an interruption. This handles both same-session paus
4
4
 
5
5
  ## Step 0: Unattended Supervisor Auto-Reattach
6
6
 
7
+ ```bash
8
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 0 --step-label "Unattended Supervisor Auto-Reattach" 2>/dev/null || true
9
+ ```
10
+
7
11
  **This step runs FIRST, before reading any docs, contracts, or continue-here files.**
8
12
 
9
13
  **Worker bypass**: If the environment variable `GSD_T_UNATTENDED_WORKER=1` is set, this resume is being invoked by the unattended supervisor as a worker iteration. **SKIP this entire Step 0** — do NOT check for supervisor.pid, do NOT auto-reattach, do NOT schedule a watch tick. Fall through directly to Step 0.1. The worker's job is to do actual work, not watch itself.
@@ -33,6 +37,10 @@ Contract reference: `unattended-supervisor-contract.md` §9 (Resume Auto-Reattac
33
37
 
34
38
  ## Step 0.1: Detect Resume Mode
35
39
 
40
+ ```bash
41
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 0 --step-label ".1: Detect Resume Mode" 2>/dev/null || true
42
+ ```
43
+
36
44
  **Same-session** (conversation context still available — you can see prior messages about the active phase/task):
37
45
  - Skip to Step 2 — you already have the context loaded
38
46
  - Do NOT re-read all state files
@@ -42,6 +50,10 @@ Contract reference: `unattended-supervisor-contract.md` §9 (Resume Auto-Reattac
42
50
 
43
51
  ## Step 0.2: Handoff Lock Wait (headless resume only)
44
52
 
53
+ ```bash
54
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 0 --step-label ".2: Handoff Lock Wait (headless resume only)" 2>/dev/null || true
55
+ ```
56
+
45
57
  Before reading any continue-here file or state file, check if a parent process wrote a handoff lock for this session:
46
58
 
47
59
  ```bash
@@ -64,6 +76,10 @@ This prevents the child side of a headless spawn from reading a partial continue
64
76
 
65
77
  ## Step 0.5: Headless Read-Back Banner (MANDATORY)
66
78
 
79
+ ```bash
80
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 0 --step-label ".5: Headless Read-Back Banner (MANDATORY)" 2>/dev/null || true
81
+ ```
82
+
67
83
  Before loading full state, surface any completed headless sessions the user hasn't seen yet. Run this once at the start of every resume invocation:
68
84
 
69
85
  ```bash
@@ -76,6 +92,10 @@ Contract: `.gsd-t/contracts/headless-default-contract.md` v1.0.0
76
92
 
77
93
  ## Step 0.6: Context Meter Health Check (MANDATORY, v3.10.12+)
78
94
 
95
+ ```bash
96
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 0 --step-label ".6: Context Meter Health Check (MANDATORY, v3.10.12+)" 2>/dev/null || true
97
+ ```
98
+
79
99
  Before loading any other state, verify the Context Meter (M34) is actually alive. A dead meter was the root cause of the M36 `/compact` regression (2026-04-15) — `checkCount=2102` but every hook call failed fail-open because `ANTHROPIC_API_KEY` was unset, and the gate silently reported `pct=0` forever.
80
100
 
81
101
  Run via Bash:
@@ -105,6 +125,10 @@ Contract: `context-meter-contract.md` v1.1.0 (v3.10.12) — §"Stale Band and Re
105
125
 
106
126
  ## Step 1: Load Full State (cross-session only)
107
127
 
128
+ ```bash
129
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 1 --step-label "Load Full State (cross-session only)" 2>/dev/null || true
130
+ ```
131
+
108
132
  Read in this exact order:
109
133
  1. `CLAUDE.md` — project context and conventions
110
134
  2. **Check for continue-here files first**: List `.gsd-t/continue-here-*.md` files. If any exist, read the most recent one (highest timestamp). It contains exact position, next action, and open items — use this as the primary resume point.
@@ -118,6 +142,10 @@ Read in this exact order:
118
142
 
119
143
  ## Step 2: Determine Current Position
120
144
 
145
+ ```bash
146
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 2 --step-label "Determine Current Position" 2>/dev/null || true
147
+ ```
148
+
121
149
  From the continue-here file (if present) OR progress.md (or conversation context if same-session), identify:
122
150
  - Current milestone and status
123
151
  - Which phase we're in
@@ -129,6 +157,10 @@ From the continue-here file (if present) OR progress.md (or conversation context
129
157
 
130
158
  ## Step 3: Report and Continue
131
159
 
160
+ ```bash
161
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 3 --step-label "Report and Continue" 2>/dev/null || true
162
+ ```
163
+
132
164
  **Level 3 (Full Auto)**: Log a brief status line and auto-resume from the current task/phase. Do NOT wait for user input.
133
165
 
134
166
  ```
@@ -154,6 +186,10 @@ Ready to continue? Or run /gsd-t-status for full details.
154
186
 
155
187
  ## Step 4: Continue
156
188
 
189
+ ```bash
190
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 4 --step-label "Continue" 2>/dev/null || true
191
+ ```
192
+
157
193
  If $ARGUMENTS specifies what to do next, proceed with that.
158
194
  Otherwise, pick up from the logical next action based on current state:
159
195
  - Mid-execution → Continue with next unblocked task
@@ -163,6 +199,10 @@ Otherwise, pick up from the logical next action based on current state:
163
199
 
164
200
  ## Step 5: Auto-Advance Through End of Milestone (MANDATORY)
165
201
 
202
+ ```bash
203
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 5 --step-label "Auto-Advance Through End of Milestone (MANDATORY)" 2>/dev/null || true
204
+ ```
205
+
166
206
  **Resume does NOT stop at the end of a wave or phase. It must chain all the way to `COMPLETED` status.**
167
207
 
168
208
  When the resumed work reaches a natural handoff point, do NOT print a "Next Up" hint and wait for the user. At Level 3 Full Auto, keep going. The successor mapping in CLAUDE-global.md is the contract — resume honors it exactly like any other command:
@@ -17,6 +17,10 @@ Default path is `autoSpawnHeadless({command, spawnType, watch: WATCH_FLAG, proje
17
17
 
18
18
  ## Step 0: Launch via Subagent
19
19
 
20
+ ```bash
21
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 0 --step-label "Launch via Subagent" 2>/dev/null || true
22
+ ```
23
+
20
24
  Scans are long-running and context-heavy. Always execute via a Task subagent for a fresh context window.
21
25
 
22
26
  **If you are the orchestrating agent** (you received the slash command directly):
@@ -36,6 +40,10 @@ Continue to Step 1 below. At Step 2, use team mode — spawn the 5 teammates in
36
40
 
37
41
  ## Step 1: Load Existing Context
38
42
 
43
+ ```bash
44
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 1 --step-label "Load Existing Context" 2>/dev/null || true
45
+ ```
46
+
39
47
  Read:
40
48
  1. `CLAUDE.md` (if exists)
41
49
  2. `.gsd-t/progress.md` (if exists)
@@ -45,6 +53,10 @@ Read:
45
53
 
46
54
  ## Step 1.5: Graph Index (if available)
47
55
 
56
+ ```bash
57
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 1 --step-label ".5: Graph Index (if available)" 2>/dev/null || true
58
+ ```
59
+
48
60
  Before scanning, check if `bin/graph-indexer.js` exists in the GSD-T installation or if `.gsd-t/graph/meta.json` exists in the project. If so:
49
61
 
50
62
  ```bash
@@ -63,6 +75,10 @@ Pass the graph query results to each teammate in their prompt context so they ca
63
75
 
64
76
  ## Step 2: Full Codebase Scan
65
77
 
78
+ ```bash
79
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 2 --step-label "Full Codebase Scan" 2>/dev/null || true
80
+ ```
81
+
66
82
  **Always use Team Mode** unless the codebase is trivially small (< 5 files) or agent teams are explicitly disabled. Each dimension is fully independent — parallel scanning is faster and produces better results.
67
83
 
68
84
  ```
@@ -283,6 +299,10 @@ Produce: `.gsd-t/scan/contract-drift.md`
283
299
 
284
300
  ## Step 2.5: Schema Extraction
285
301
 
302
+ ```bash
303
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 2 --step-label ".5: Schema Extraction" 2>/dev/null || true
304
+ ```
305
+
286
306
  Run schema extraction on the scanned project to detect ORM/database schema files and parse entity definitions. This data feeds the database schema diagram in Step 3.5.
287
307
 
288
308
  Using Bash tool:
@@ -298,6 +318,10 @@ If `schemaData.detected === false`, note: "No ORM/schema files detected — data
298
318
 
299
319
  ## Step 2.9: Archive Previous Tech Debt Register
300
320
 
321
+ ```bash
322
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 2 --step-label ".9: Archive Previous Tech Debt Register" 2>/dev/null || true
323
+ ```
324
+
301
325
  Before building the new register, archive the existing one so the file stays small. Each scan is a complete snapshot — the archive preserves history.
302
326
 
303
327
  If `.gsd-t/techdebt.md` exists:
@@ -309,6 +333,10 @@ The new `techdebt.md` created in Step 3 will contain only the current scan's fin
309
333
 
310
334
  ## Step 3: Build Tech Debt Register
311
335
 
336
+ ```bash
337
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 3 --step-label "Build Tech Debt Register" 2>/dev/null || true
338
+ ```
339
+
312
340
  Synthesize ALL findings into a **fresh** `.gsd-t/techdebt.md` (the previous version was archived in Step 2.9). This file contains only the current scan's findings — no resolved items table, no scan history. Previous scans are preserved in `techdebt_YYYY-MM-DD.md` archives.
313
341
 
314
342
  **Between scans:** when an item is fixed, change its `**Status**:` field to `[RESOLVED] — {brief reason/milestone}`. Do not delete the item — it stays visible until the next scan replaces the file.
@@ -399,6 +427,10 @@ Nice-to-haves and cleanup.
399
427
 
400
428
  ## Step 3.5: Diagram Generation
401
429
 
430
+ ```bash
431
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 3 --step-label ".5: Diagram Generation" 2>/dev/null || true
432
+ ```
433
+
402
434
  Generate all 6 architectural diagrams using analysis data from Step 2 and schema data from Step 2.5.
403
435
 
404
436
  Using Bash tool:
@@ -418,6 +450,10 @@ Capture the full array as `diagrams`. Log:
418
450
 
419
451
  ## Step 4: Suggest Milestone Promotions
420
452
 
453
+ ```bash
454
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 4 --step-label "Suggest Milestone Promotions" 2>/dev/null || true
455
+ ```
456
+
421
457
  Review all items marked `Milestone candidate: YES` and group them into logical milestones:
422
458
 
423
459
  ```markdown
@@ -447,6 +483,10 @@ Note: Use `/gsd-t-partition` Step 1.6 to design the SharedCore domain
447
483
 
448
484
  ## Step 5: Update Living Documents
449
485
 
486
+ ```bash
487
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 5 --step-label "Update Living Documents" 2>/dev/null || true
488
+ ```
489
+
450
490
  The scan produces deep analysis in `.gsd-t/scan/`. Now cross-populate findings into the living docs so knowledge persists across milestones.
451
491
 
452
492
  ### docs/architecture.md
@@ -505,6 +545,10 @@ If `README.md` exists, merge — update tech stack and setup sections but preser
505
545
 
506
546
  ## Step 6: Test Verification
507
547
 
548
+ ```bash
549
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 6 --step-label "Test Verification" 2>/dev/null || true
550
+ ```
551
+
508
552
  After updating living documents, verify nothing was broken:
509
553
 
510
554
  1. **Run existing tests**: Execute the full test suite to establish a baseline — document what passes and what was already failing
@@ -513,6 +557,10 @@ After updating living documents, verify nothing was broken:
513
557
 
514
558
  ## Step 6.5: Generate Scan Freshness Cache
515
559
 
560
+ ```bash
561
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 6 --step-label ".5: Generate Scan Freshness Cache" 2>/dev/null || true
562
+ ```
563
+
516
564
  After the scan completes and living docs are updated, generate a hash cache so downstream commands can detect staleness without re-scanning.
517
565
 
518
566
  Create `.gsd-t/scan/.cache.json` with this structure:
@@ -557,6 +605,10 @@ This cache enables downstream commands (`partition`, `feature`, `gap-analysis`)
557
605
 
558
606
  ## Step 7: Update Project State
559
607
 
608
+ ```bash
609
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 7 --step-label "Update Project State" 2>/dev/null || true
610
+ ```
611
+
560
612
  If `.gsd-t/progress.md` exists:
561
613
  - Log scan in Decision Log
562
614
  - Note critical findings
@@ -570,6 +622,10 @@ If `CLAUDE.md` exists:
570
622
 
571
623
  ## Step 8: Report to User
572
624
 
625
+ ```bash
626
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-scan --step 8 --step-label "Report to User" 2>/dev/null || true
627
+ ```
628
+
573
629
  Present a summary:
574
630
  1. Architecture overview (brief)
575
631
  2. Business rules found (count + any undocumented ones)
@@ -15,6 +15,10 @@ This command is:
15
15
 
16
16
  ## Step 1: Load Context
17
17
 
18
+ ```bash
19
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 1 --step-label "Load Context" 2>/dev/null || true
20
+ ```
21
+
18
22
  Read:
19
23
  1. `CLAUDE.md` — testing conventions, test locations
20
24
  2. `.gsd-t/progress.md` — what just changed
@@ -30,6 +34,10 @@ Identify:
30
34
 
31
35
  ## Step 1.5: Graph-Enhanced Test Discovery
32
36
 
37
+ ```bash
38
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 1 --step-label ".5: Graph-Enhanced Test Discovery" 2>/dev/null || true
39
+ ```
40
+
33
41
  If `.gsd-t/graph/meta.json` exists (graph index is available):
34
42
  1. Query `getTestsFor` each changed entity to find stale or missing tests more precisely than filesystem search
35
43
  2. Query `getTransitiveCallers` for changed functions to find indirectly affected tests that may need updating
@@ -39,6 +47,10 @@ If graph is not available, skip this step.
39
47
 
40
48
  ## Step 2: Contract Coverage Audit
41
49
 
50
+ ```bash
51
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 2 --step-label "Contract Coverage Audit" 2>/dev/null || true
52
+ ```
53
+
42
54
  Perform inline contract testing and gap analysis:
43
55
 
44
56
  1. Read all contracts in `.gsd-t/contracts/` — identify the interface each one defines
@@ -51,6 +63,10 @@ Test-sync cannot complete if critical contract gaps remain unaddressed.
51
63
 
52
64
  ## Step 3: Map Code to Tests
53
65
 
66
+ ```bash
67
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 3 --step-label "Map Code to Tests" 2>/dev/null || true
68
+ ```
69
+
54
70
  For each file changed in recent tasks:
55
71
 
56
72
  ### A) Find Existing Tests
@@ -73,6 +89,10 @@ find . -name "*.spec.*" | xargs grep -l "{class_name}"
73
89
 
74
90
  ## Step 4: Detect Test Issues
75
91
 
92
+ ```bash
93
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 4 --step-label "Detect Test Issues" 2>/dev/null || true
94
+ ```
95
+
76
96
  ### A) Stale Tests
77
97
  Tests that reference old behavior:
78
98
  - Function signatures that changed
@@ -107,6 +127,10 @@ Tests that sometimes fail:
107
127
 
108
128
  ## Step 5: Run Affected Tests
109
129
 
130
+ ```bash
131
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 5 --step-label "Run Affected Tests" 2>/dev/null || true
132
+ ```
133
+
110
134
  ### A) Unit/Integration Tests
111
135
  Execute tests that cover changed code:
112
136
 
@@ -187,6 +211,10 @@ For all test types:
187
211
 
188
212
  ## Step 6: Produce Test Coverage Report
189
213
 
214
+ ```bash
215
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 6 --step-label "Produce Test Coverage Report" 2>/dev/null || true
216
+ ```
217
+
190
218
  Create/update `.gsd-t/test-coverage.md`:
191
219
 
192
220
  ```markdown
@@ -274,6 +302,10 @@ Create/update `.gsd-t/test-coverage.md`:
274
302
 
275
303
  ## Step 7: Generate Test Tasks
276
304
 
305
+ ```bash
306
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 7 --step-label "Generate Test Tasks" 2>/dev/null || true
307
+ ```
308
+
277
309
  If issues found, add to current domain's tasks:
278
310
 
279
311
  ```markdown
@@ -297,6 +329,10 @@ If issues found, add to current domain's tasks:
297
329
 
298
330
  ## Step 8: Integration with Workflow
299
331
 
332
+ ```bash
333
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 8 --step-label "Integration with Workflow" 2>/dev/null || true
334
+ ```
335
+
300
336
  ### During Execute Phase (auto-invoked):
301
337
  After each task completes:
302
338
  1. Scan changed files and map to existing tests
@@ -331,6 +367,10 @@ Full sync:
331
367
 
332
368
  ## Step 9: Report to User
333
369
 
370
+ ```bash
371
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-test-sync --step 9 --step-label "Report to User" 2>/dev/null || true
372
+ ```
373
+
334
374
  ### Quick Mode (during execute):
335
375
  ```
336
376
  🧪 Test sync: 3 tests affected, 3 passing
@@ -347,7 +347,7 @@ const fs = require('fs');
347
347
  let state = {};
348
348
  try { state = JSON.parse(fs.readFileSync('.gsd-t/.unattended/state.json','utf8')); } catch(_){}
349
349
  const { events, newCursor } = es.readSinceCursor('.');
350
- console.log(wf.formatWatchTick({ events, state }));
350
+ console.log(wf.formatWatchTick({ events, state, withWatchProgress: true }));
351
351
  es.advanceCursor('.', newCursor);
352
352
  "
353
353
  ```
@@ -10,6 +10,10 @@ See `unattended-supervisor-contract.md` §7 (Launch Handshake), §4 (Status Enum
10
10
 
11
11
  ## Step 1: Pre-Flight Checks
12
12
 
13
+ ```bash
14
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-unattended --step 1 --step-label "Pre-Flight Checks" 2>/dev/null || true
15
+ ```
16
+
13
17
  ### 1a: Verify GSD-T Project
14
18
 
15
19
  Run via Bash:
@@ -247,6 +251,10 @@ If `WARNINGS` were emitted, print them as a non-blocking advisory before proceed
247
251
 
248
252
  ## Step 2: Spawn the Detached Supervisor
249
253
 
254
+ ```bash
255
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-unattended --step 2 --step-label "Spawn the Detached Supervisor" 2>/dev/null || true
256
+ ```
257
+
250
258
  ⚙ [sonnet] gsd-t-unattended → spawning detached supervisor
251
259
 
252
260
  **Before spawn — read starting context tokens (observability bracket):**
@@ -323,6 +331,10 @@ fs.appendFileSync(LOG, row);
323
331
 
324
332
  ## Step 3: Verify Supervisor Liveness
325
333
 
334
+ ```bash
335
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-unattended --step 3 --step-label "Verify Supervisor Liveness" 2>/dev/null || true
336
+ ```
337
+
326
338
  Wait up to 2 seconds for the supervisor to write its PID file and transition out of `initializing`:
327
339
 
328
340
  ```bash
@@ -400,6 +412,10 @@ End the turn without scheduling a watch tick.
400
412
 
401
413
  ## Step 4: Display Initial Status Block
402
414
 
415
+ ```bash
416
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-unattended --step 4 --step-label "Display Initial Status Block" 2>/dev/null || true
417
+ ```
418
+
403
419
  Print the launch confirmation block:
404
420
 
405
421
  ```
@@ -421,6 +437,10 @@ Print the launch confirmation block:
421
437
 
422
438
  ## Step 5: Schedule the First Watch Tick
423
439
 
440
+ ```bash
441
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-unattended --step 5 --step-label "Schedule the First Watch Tick" 2>/dev/null || true
442
+ ```
443
+
424
444
  Call the harness `ScheduleWakeup` tool with these exact parameters:
425
445
 
426
446
  - `delaySeconds`: `270` (fixed — inside the 5-minute prompt-cache TTL)
@@ -23,6 +23,10 @@ Per `.gsd-t/contracts/model-selection-contract.md` v1.0.0.
23
23
 
24
24
  ## Step 1: Load State
25
25
 
26
+ ```bash
27
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 1 --step-label "Load State" 2>/dev/null || true
28
+ ```
29
+
26
30
  Read:
27
31
  1. `CLAUDE.md`
28
32
  2. `.gsd-t/progress.md` — confirm status is INTEGRATED
@@ -33,6 +37,10 @@ Read:
33
37
 
34
38
  ## Step 1.5: Graph-Enhanced Traceability Check
35
39
 
40
+ ```bash
41
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 1 --step-label ".5: Graph-Enhanced Traceability Check" 2>/dev/null || true
42
+ ```
43
+
36
44
  If `.gsd-t/graph/meta.json` exists (graph index is available):
37
45
  1. Query `getRequirementFor` on implemented entities to build a requirement-to-code traceability chain — flag entities with no requirement mapping
38
46
  2. Query `getDomainBoundaryViolations` to verify no cross-domain boundary violations exist in the final codebase
@@ -42,6 +50,10 @@ If graph is not available, skip this step.
42
50
 
43
51
  ## Step 2: Full Test Audit (Inline)
44
52
 
53
+ ```bash
54
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 2 --step-label "Full Test Audit (Inline)" 2>/dev/null || true
55
+ ```
56
+
45
57
  Run the full test audit directly:
46
58
 
47
59
  1. Run the full test suite: `npm test` (or project equivalent) — record pass/fail counts
@@ -54,6 +66,10 @@ Verification cannot complete if any test fails or critical contract gaps remain.
54
66
 
55
67
  ## Step 2.5: High-Risk Domain Gate (MANDATORY — Categories 2 and 7)
56
68
 
69
+ ```bash
70
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 2 --step-label ".5: High-Risk Domain Gate (MANDATORY — Categories 2 and 7)" 2>/dev/null || true
71
+ ```
72
+
57
73
  Before running standard verification dimensions, check whether this milestone involves any high-risk domain:
58
74
 
59
75
  **High-risk domains**: audio capture/playback, GPU/WebGPU/WebGL, ML/inference/model loading, background workers, native APIs (camera, bluetooth, filesystem), IPC, WebAssembly, real-time data streams.
@@ -85,6 +101,10 @@ For each such feature:
85
101
 
86
102
  ## Step 3: Define Verification Dimensions
87
103
 
104
+ ```bash
105
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 3 --step-label "Define Verification Dimensions" 2>/dev/null || true
106
+ ```
107
+
88
108
  Standard dimensions (adjust based on project):
89
109
 
90
110
  1. **Functional Correctness**: Does it work per requirements?
@@ -115,6 +135,10 @@ Standard dimensions (adjust based on project):
115
135
 
116
136
  ## Step 4: Execute Verification
117
137
 
138
+ ```bash
139
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 4 --step-label "Execute Verification" 2>/dev/null || true
140
+ ```
141
+
118
142
  ### Solo Mode (default)
119
143
  Work through each dimension sequentially. For each:
120
144
  1. Define what you're checking
@@ -188,6 +212,10 @@ Collect all reports, synthesize, create remediation plan.
188
212
 
189
213
  ## Step 5: Compile Verification Report
190
214
 
215
+ ```bash
216
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 5 --step-label "Compile Verification Report" 2>/dev/null || true
217
+ ```
218
+
191
219
  Create or update `.gsd-t/verify-report.md`:
192
220
 
193
221
  ```markdown
@@ -226,6 +254,10 @@ Create or update `.gsd-t/verify-report.md`:
226
254
 
227
255
  ## Step 5.25: Metrics Quality Budget Check
228
256
 
257
+ ```bash
258
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 5 --step-label ".25: Metrics Quality Budget Check" 2>/dev/null || true
259
+ ```
260
+
229
261
  Check task-metrics for the current milestone to detect quality budget violations:
230
262
 
231
263
  1. Run via Bash:
@@ -241,6 +273,10 @@ Check task-metrics for the current milestone to detect quality budget violations
241
273
 
242
274
  ## Step 5.5: Goal-Backward Verification (Post-Gate Behavior Check)
243
275
 
276
+ ```bash
277
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 5 --step-label ".5: Goal-Backward Verification (Post-Gate Behavior Check)" 2>/dev/null || true
278
+ ```
279
+
244
280
  This step runs **after all 8 quality gates pass**. It verifies that milestone goals are actually achieved end-to-end — not just structurally present. It catches placeholder implementations that pass all structural gates.
245
281
 
246
282
  Refer to `.gsd-t/contracts/goal-backward-contract.md` for the full verification flow, placeholder patterns, and findings report format.
@@ -315,6 +351,10 @@ Add a `Goal-Backward:` line to the Step 5 verification report summary:
315
351
 
316
352
  ## Step 6: Handle Remediation
317
353
 
354
+ ```bash
355
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 6 --step-label "Handle Remediation" 2>/dev/null || true
356
+ ```
357
+
318
358
  If there are CRITICAL findings:
319
359
  1. Create remediation tasks in the affected domain's `tasks.md`
320
360
  2. Execute fixes (solo — don't spawn teams for remediation)
@@ -323,6 +363,10 @@ If there are CRITICAL findings:
323
363
 
324
364
  ## Step 7: Update State
325
365
 
366
+ ```bash
367
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 7 --step-label "Update State" 2>/dev/null || true
368
+ ```
369
+
326
370
  Update `.gsd-t/progress.md`:
327
371
  - If all PASS: Set status to `VERIFIED`
328
372
  - If CONDITIONAL PASS: Set status to `VERIFIED-WITH-WARNINGS`, list warnings
@@ -353,6 +397,10 @@ Update `.gsd-t/progress.md`:
353
397
 
354
398
  ## Step 8: Auto-Invoke Complete-Milestone
355
399
 
400
+ ```bash
401
+ node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-verify --step 8 --step-label "Auto-Invoke Complete-Milestone" 2>/dev/null || true
402
+ ```
403
+
356
404
  **This step is MANDATORY and runs at ALL autonomy levels.** Completing a verified milestone is a mechanical operation (archive, tag, bump version, update docs). There is no decision that benefits from user review — the decision was made when verification passed.
357
405
 
358
406
  If status is VERIFY-FAILED: