gsdd-cli 0.18.5 → 0.19.1

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.
Files changed (101) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +610 -608
  3. package/agents/DISTILLATION.md +421 -421
  4. package/agents/README.md +62 -62
  5. package/agents/approach-explorer.md +370 -361
  6. package/agents/debugger.md +82 -82
  7. package/agents/executor.md +473 -394
  8. package/agents/integration-checker.md +318 -318
  9. package/agents/mapper.md +103 -103
  10. package/agents/planner.md +342 -313
  11. package/agents/researcher.md +84 -84
  12. package/agents/roadmapper.md +296 -296
  13. package/agents/synthesizer.md +236 -236
  14. package/agents/verifier.md +337 -337
  15. package/bin/adapters/agents.mjs +34 -34
  16. package/bin/adapters/claude.mjs +193 -191
  17. package/bin/adapters/codex.mjs +85 -85
  18. package/bin/adapters/index.mjs +20 -20
  19. package/bin/adapters/opencode.mjs +280 -278
  20. package/bin/gsdd.mjs +123 -116
  21. package/bin/lib/cli-utils.mjs +28 -28
  22. package/bin/lib/evidence-contract.mjs +325 -112
  23. package/bin/lib/file-ops.mjs +186 -144
  24. package/bin/lib/health-truth.mjs +196 -178
  25. package/bin/lib/health.mjs +246 -226
  26. package/bin/lib/init-flow.mjs +247 -231
  27. package/bin/lib/init-prompts.mjs +248 -247
  28. package/bin/lib/init-runtime.mjs +193 -190
  29. package/bin/lib/init.mjs +17 -17
  30. package/bin/lib/lifecycle-preflight.mjs +760 -326
  31. package/bin/lib/lifecycle-state.mjs +356 -267
  32. package/bin/lib/manifest.mjs +116 -114
  33. package/bin/lib/models.mjs +411 -411
  34. package/bin/lib/phase.mjs +365 -358
  35. package/bin/lib/plan-constants.mjs +35 -30
  36. package/bin/lib/provenance.mjs +109 -106
  37. package/bin/lib/rendering.mjs +119 -83
  38. package/bin/lib/runtime-freshness.mjs +214 -214
  39. package/bin/lib/session-fingerprint.mjs +91 -14
  40. package/bin/lib/templates.mjs +225 -224
  41. package/bin/lib/workspace-root.mjs +2 -1
  42. package/distilled/DESIGN.md +2461 -2323
  43. package/distilled/EVIDENCE-INDEX.md +418 -392
  44. package/distilled/README.md +196 -193
  45. package/distilled/SKILL.md +86 -85
  46. package/distilled/templates/agents.block.md +21 -21
  47. package/distilled/templates/agents.md +6 -6
  48. package/distilled/templates/approach.md +272 -232
  49. package/distilled/templates/auth-matrix.md +78 -78
  50. package/distilled/templates/brownfield-change/CHANGE.md +99 -0
  51. package/distilled/templates/brownfield-change/HANDOFF.md +38 -0
  52. package/distilled/templates/brownfield-change/VERIFICATION.md +56 -0
  53. package/distilled/templates/codebase/architecture.md +110 -110
  54. package/distilled/templates/codebase/concerns.md +95 -95
  55. package/distilled/templates/codebase/conventions.md +193 -193
  56. package/distilled/templates/codebase/stack.md +96 -96
  57. package/distilled/templates/delegates/approach-explorer.md +28 -25
  58. package/distilled/templates/delegates/mapper-arch.md +26 -26
  59. package/distilled/templates/delegates/mapper-concerns.md +27 -27
  60. package/distilled/templates/delegates/mapper-quality.md +28 -28
  61. package/distilled/templates/delegates/mapper-tech.md +25 -25
  62. package/distilled/templates/delegates/plan-checker.md +78 -68
  63. package/distilled/templates/delegates/researcher-architecture.md +30 -30
  64. package/distilled/templates/delegates/researcher-features.md +30 -30
  65. package/distilled/templates/delegates/researcher-pitfalls.md +30 -30
  66. package/distilled/templates/delegates/researcher-stack.md +30 -30
  67. package/distilled/templates/delegates/researcher-synthesizer.md +31 -31
  68. package/distilled/templates/research/architecture.md +57 -57
  69. package/distilled/templates/research/features.md +23 -23
  70. package/distilled/templates/research/pitfalls.md +46 -46
  71. package/distilled/templates/research/stack.md +45 -45
  72. package/distilled/templates/research/summary.md +67 -67
  73. package/distilled/templates/roadmap.md +74 -62
  74. package/distilled/templates/spec.md +110 -110
  75. package/distilled/workflows/audit-milestone.md +303 -271
  76. package/distilled/workflows/complete-milestone.md +349 -332
  77. package/distilled/workflows/execute.md +457 -450
  78. package/distilled/workflows/map-codebase.md +253 -253
  79. package/distilled/workflows/new-milestone.md +242 -238
  80. package/distilled/workflows/new-project.md +398 -398
  81. package/distilled/workflows/pause.md +160 -156
  82. package/distilled/workflows/plan-milestone-gaps.md +183 -183
  83. package/distilled/workflows/plan.md +454 -448
  84. package/distilled/workflows/progress.md +227 -223
  85. package/distilled/workflows/quick.md +351 -347
  86. package/distilled/workflows/resume.md +220 -212
  87. package/distilled/workflows/verify-work.md +260 -260
  88. package/distilled/workflows/verify.md +431 -429
  89. package/docs/BROWNFIELD-PROOF.md +95 -95
  90. package/docs/RUNTIME-SUPPORT.md +80 -69
  91. package/docs/USER-GUIDE.md +394 -386
  92. package/docs/VERIFICATION-DISCIPLINE.md +59 -59
  93. package/docs/claude/context-monitor.md +98 -98
  94. package/docs/proof/consumer-node-cli/README.md +37 -37
  95. package/docs/proof/consumer-node-cli/ROADMAP.md +14 -14
  96. package/docs/proof/consumer-node-cli/SPEC.md +17 -17
  97. package/docs/proof/consumer-node-cli/brief.md +9 -9
  98. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-PLAN.md +34 -34
  99. package/docs/proof/consumer-node-cli/phases/01-foundation/01-01-SUMMARY.md +10 -10
  100. package/docs/proof/consumer-node-cli/phases/01-foundation/01-VERIFICATION.md +30 -30
  101. package/package.json +62 -61
@@ -1,333 +1,350 @@
1
- <role>
2
- You are the MILESTONE CLOSER. Your job is to formally archive a shipped milestone — gather stats, archive planning artifacts, evolve SPEC.md, collapse the roadmap, and prepare for the next cycle.
3
-
4
- Core mindset: archive facts, not intentions. Every claim in the archived record must be derivable from phase SUMMARY.md files or git history.
5
-
6
- Scope boundary: you archive the current milestone. You do not start the next one — that is `/gsdd-new-milestone` territory.
7
- </role>
8
-
9
- <prerequisites>
10
- `.planning/ROADMAP.md` must exist with phases.
11
- `.planning/SPEC.md` must exist.
12
- If `.planning/MILESTONES.md` does not exist, create it now (this is the first milestone completion — Step 8 will write the first entry).
13
-
14
- If `.planning/milestones/` does not exist, create it before writing archive files.
15
- </prerequisites>
16
-
17
- <load_context>
18
- Before starting, read these files:
19
-
20
- 1. `.planning/ROADMAP.md` — phase statuses, milestone name, phase range
21
- 2. `.planning/SPEC.md` — requirements, validated capabilities, current state section
22
- 3. `.planning/MILESTONES.md` — previous milestone entries (for format reference); if this is the first milestone, skip — no previous entries exist yet
23
- 4. `.planning/config.json` — `gitProtocol`, `mode` (for STOP gate behavior)
24
- 5. All phase SUMMARY.md files in `.planning/phases/` — accomplishments, task counts
25
- 6. Most recent `.planning/v*-MILESTONE-AUDIT.md` — audit status (passed / gaps_found)
26
- </load_context>
27
-
28
- <lifecycle_preflight>
29
- Before verifying readiness or gathering archive stats, run:
30
-
1
+ <role>
2
+ You are the MILESTONE CLOSER. Your job is to formally archive a completed milestone — gather stats, archive planning artifacts, evolve SPEC.md, collapse the roadmap, and prepare for the next cycle.
3
+
4
+ Core mindset: archive facts, not intentions. Every claim in the archived record must be derivable from phase SUMMARY.md files or git history.
5
+
6
+ Scope boundary: you archive the current milestone. You do not start the next one — that is `/gsdd-new-milestone` territory.
7
+ </role>
8
+
9
+ <prerequisites>
10
+ `.planning/ROADMAP.md` must exist with phases.
11
+ `.planning/SPEC.md` must exist.
12
+ If `.planning/MILESTONES.md` does not exist, create it now (this is the first milestone completion — Step 8 will write the first entry).
13
+
14
+ If `.planning/milestones/` does not exist, create it before writing archive files.
15
+ </prerequisites>
16
+
17
+ <load_context>
18
+ Before starting, read these files:
19
+
20
+ 1. `.planning/ROADMAP.md` — phase statuses, milestone name, phase range
21
+ 2. `.planning/SPEC.md` — requirements, validated capabilities, current state section
22
+ 3. `.planning/MILESTONES.md` — previous milestone entries (for format reference); if this is the first milestone, skip — no previous entries exist yet
23
+ 4. `.planning/config.json` — `gitProtocol`, `mode` (for STOP gate behavior)
24
+ 5. All phase SUMMARY.md files in `.planning/phases/` — accomplishments, task counts
25
+ 6. Most recent `.planning/v*-MILESTONE-AUDIT.md` — audit status (passed / gaps_found)
26
+ </load_context>
27
+
28
+ <repo_root_helper_contract>
29
+ All `node .planning/bin/gsdd.mjs ...` helper commands below assume the current working directory is the repo root. If the runtime launched from a subdirectory, change to the repo root before running them.
30
+ </repo_root_helper_contract>
31
+
32
+ <lifecycle_preflight>
33
+ Before verifying readiness or gathering archive stats, run:
34
+
31
35
  - `node .planning/bin/gsdd.mjs lifecycle-preflight complete-milestone`
32
-
33
- If the preflight result is `blocked`, STOP and report the blocker instead of inferring milestone-close eligibility from workflow-local prose.
34
-
35
- Treat the preflight as an authorization seam over shared repo truth only:
36
- - it may authorize or reject milestone completion
37
- - it does not mutate lifecycle state by itself
38
- - owned writes remain the archive artifacts, `MILESTONES.md`, `.planning/SPEC.md`, and the retained `ROADMAP.md` collapse
39
- </lifecycle_preflight>
40
-
41
- <evidence_contract>
42
- Milestone completion inherits the closure posture proven by the passed milestone audit.
43
-
44
- Stable evidence kinds carried forward from audit:
45
- - `code`
46
- - `test`
47
- - `runtime`
48
- - `delivery`
49
- - `human`
50
-
51
- Read the audit frontmatter and preserve:
52
- - `delivery_posture`
53
- - `evidence_contract.required_kinds`
54
- - `evidence_contract.observed_kinds`
55
- - `evidence_contract.missing_kinds`
56
-
57
- Shared closure rules:
58
- - `repo_only` completion may proceed with repo-local closure evidence only; do not invent `runtime` or `delivery` proof
59
- - `delivery_sensitive` completion must not proceed on code/prose-only evidence; the audit must already show required `code`, `test`, `runtime`, and `delivery` evidence with no missing required kinds
60
- - if the audit omits the evidence contract or still has missing required kinds, STOP and route back to `/gsdd-audit-milestone` or `/gsdd-plan-milestone-gaps` instead of silently closing the milestone
61
- </evidence_contract>
62
-
63
- <process>
64
-
65
- ## 1. Verify Readiness
66
-
67
- Check:
68
- - **Phase completion**: Are all ROADMAP.md phases for this milestone marked `[x]`? List any that are not.
69
- - **Audit status**: Does a MILESTONE-AUDIT.md exist and have status `passed`? If it has status `gaps_found`, the milestone has open gaps.
70
- - **Audit evidence posture**: Does the passed audit frontmatter include `delivery_posture` and an `evidence_contract` block with no missing required kinds?
71
- - **Spent-branch guard**: Run `git branch --merged origin/main` (substitute `master` or the configured default branch from `config.json gitProtocol.branch` if different) and verify HEAD is not a spent/already-merged branch. If the current branch already backs a merged PR, STOP - do not instruct any commit or tag operations. Prompt the user to check out a fresh active branch before continuing.
72
- - **Integration-surface warning pass**: Inspect staged, unstaged, untracked, unpushed, and PR-less local truth separately from the milestone artifacts. Warn if the archive is being attempted from a mixed-scope or stale branch even when the milestone documents themselves look complete.
73
-
74
- **If phases incomplete, audit not passed, or the audit evidence contract is missing/insufficient:**
75
-
76
- Present options:
77
- 1. **Proceed anyway** — archive with known gaps noted in MILESTONES.md
78
- 2. **Run audit first** — `/gsdd-audit-milestone` (if audit is missing or stale)
79
- 3. **Close gaps first** — `/gsdd-plan-milestone-gaps` (if audit found gaps)
80
- 4. **Abort** — stop without archiving
81
-
82
- **STOP. Wait for user selection.**
83
-
84
- Exception: if `config.json -> mode` is `yolo`, skip the stop gate and proceed with a note about any gaps.
85
-
86
- **If all phases complete, audit passed, and the audit evidence contract is satisfied:** Proceed.
87
-
88
- ## 2. Determine Version
89
-
90
- Parse the in-progress milestone version from ROADMAP.md (e.g., the `🚧` or active entry in the Milestones list). Confirm with user if unclear.
91
-
92
- ## 3. Gather Stats
93
-
94
- Extract from phase SUMMARY.md files and git:
95
-
96
- - Phase count, plan count, task count (aggregate from SUMMARY files)
97
- - Test count if discernible from SUMMARY files
98
- - Start date (first phase completion date) and end date (today)
99
- - Brief git stats: `git log --oneline --since="[start date]" | wc -l` for commit count
100
-
101
- Present a concise stats block for review.
102
-
103
- ## 4. Extract Accomplishments
104
-
105
- Read each phase SUMMARY.md in the milestone's phase range. Extract a one-liner from each phase describing the key delivery.
106
-
107
- Present 4-8 accomplishments for review. Trim or adjust with user before writing to archive.
108
-
109
- ## 5. Archive Roadmap
110
-
111
- Create `.planning/milestones/v[X.Y]-ROADMAP.md` with full milestone details:
112
-
113
- ```markdown
114
- # Milestone v[X.Y]: [Name]
115
-
116
- **Status:** ✅ SHIPPED [date]
117
- **Phases:** [N]–[M]
118
- **Total Plans:** [count]
119
- **Tag:** v[X.Y]
120
-
121
- ## Overview
122
-
123
- [One paragraph describing what this milestone delivered and why it mattered.]
124
-
125
- ## Phases
126
-
127
- ### Phase [N]: [Name]
128
-
129
- **Goal**: [goal from ROADMAP.md]
130
- **Requirements**: [REQ-IDs]
131
-
132
- Plans:
133
- - [x] [plan summary from SUMMARY.md]
134
-
135
- **Details:**
136
- [Key implementation decisions and what was built]
137
-
138
- **Success Criteria verified:**
139
- 1. [criterion]
140
- 2. [criterion]
141
-
142
- ---
143
-
144
- [Repeat for each phase]
145
-
146
- ## Milestone Summary
147
-
148
- **Key Decisions:**
149
- - [Decision and rationale from phase summaries]
150
-
151
- **Issues Resolved:**
152
- - [What gaps/issues were closed this milestone]
153
-
154
- **Issues Deferred (LATER):**
155
- - [Any LATER-tagged items not addressed]
156
-
157
- **Technical Debt Incurred:**
158
- - [Any known shortcuts or deferred quality work]
159
-
160
- ---
161
-
162
- *For current project status, see `.planning/ROADMAP.md`*
163
- ```
164
-
165
- ## 6. Archive Requirements
166
-
167
- Create `.planning/milestones/v[X.Y]-REQUIREMENTS.md`:
168
-
169
- ```markdown
170
- # Requirements Archive: v[X.Y] Milestone
171
-
172
- **Archived:** [date]
173
- **Milestone:** [name]
174
- **Source:** `.planning/SPEC.md` requirements section at milestone completion
175
-
176
- ---
177
-
178
- ## v1 Must-Have Requirements (all satisfied)
179
-
180
- | ID | Title | Status | Phase | Outcome |
181
- |----|-------|--------|-------|---------|
182
- | [ID] | [title] | ✅ verified | Phase [N] | [brief outcome] |
183
-
184
- **Result: [N]/[N] requirements satisfied**
185
-
186
- ---
187
-
188
- ## Validated (pre-existing capabilities confirmed at milestone)
189
-
190
- [Copy from SPEC.md Validated section]
191
-
192
- ---
193
-
194
- ## Nice to Have (v2 — deferred)
195
-
196
- [Copy from SPEC.md Nice to Have section]
197
-
198
- ---
199
-
200
- *Source: `.planning/SPEC.md` as of [date]*
201
- *Next milestone requirements: defined via `/gsdd-new-milestone`*
202
- ```
203
-
204
- ## 7. Move Audit File
205
-
206
- If `.planning/v[X.Y]-MILESTONE-AUDIT.md` exists, note its location in the MILESTONES.md entry. (Leave the file in `.planning/` — it is already in the gitignored planning directory. No move required unless you prefer to co-locate it with the other archives.)
207
-
208
- ## 8. Update MILESTONES.md
209
-
210
- Append an entry to `.planning/MILESTONES.md`:
211
-
212
- ```markdown
213
- ## ✅ v[X.Y] — [Name] ([date])
214
-
215
- **Phases:** [N]–[M] | **Plans:** [count] | **Tasks:** [count] | **Tests:** [N] assertions, 0 failures
216
-
217
- **Delivered:** [One sentence summary of what shipped.]
218
-
219
- **Key accomplishments:**
220
- 1. [Accomplishment 1]
221
- 2. [Accomplishment 2]
222
- 3. [Accomplishment 3]
223
- 4. [Accomplishment 4]
224
-
225
- **Archive:** `.planning/milestones/v[X.Y]-ROADMAP.md`
226
- **Requirements:** `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
227
- **Tag:** `v[X.Y]`
228
- ```
229
-
230
- ## 9. Evolve SPEC.md
231
-
232
- Update SPEC.md to reflect the completed milestone:
233
-
234
- **Move shipped requirements:**
235
- - Move all Must Have requirements that were satisfied this milestone to the `### Validated (existing capabilities)` section
236
- - Format: `- [x] **[ID]**: [title] — [brief outcome note]`
237
-
238
- **Update Current State section:**
239
-
240
- ```markdown
241
- ## Current State
242
-
243
- - **Milestone:** v[X.Y] [Name] — SHIPPED [date]
244
- - **Phases:** [N]–[M] complete, all requirements verified ([N]/[N]), [test count] tests passing
245
- - **Archive:** `.planning/milestones/v[X.Y]-ROADMAP.md`
246
- - **Decisions:** [D1–DN] evidence-backed, all in [reference if applicable]
247
- - **Blockers:** None — [list any LATER-priority gaps if applicable]
248
- - **Next:** `/gsdd-new-milestone` to plan v[X.next] work
249
-
250
- ---
251
- *Last updated: [date] after v[X.Y] milestone completion*
252
- ```
253
-
254
- ## 10. Collapse ROADMAP.md
255
-
256
- Replace the active milestone phases in ROADMAP.md with a collapsed `<details>` block and add the milestone to the Milestones list:
257
-
258
- ```markdown
259
- # Roadmap: [Project Name]
260
-
261
- ## Milestones
262
-
263
- - ✅ **v[X.Y] [Name]** — Phases [N]–[M] (shipped [date])
264
-
265
- ## Phases
266
-
267
- <details>
268
- <summary>✅ v[X.Y] [Name] (Phases [N]–[M]) — SHIPPED [date]</summary>
269
-
270
- - [x] **Phase [N]: [Name]** — completed [date]
271
- - [x] **Phase [N+1]: [Name]** — completed [date]
272
- [...]
273
-
274
- Full details: [`.planning/milestones/v[X.Y]-ROADMAP.md`](milestones/v[X.Y]-ROADMAP.md)
275
-
276
- </details>
277
-
278
- ---
279
- *Created: [original creation date] | v[X.Y] archived: [today]*
280
- ```
281
-
282
- ## 11. Advisory: Git Tag
283
-
284
- Suggest a git tag for the milestone. Do not mandate it follow `config.json -> gitProtocol`.
285
-
286
- ```
287
- Advisory: Tag this milestone in git:
288
- git tag -a v[X.Y] -m "v[X.Y] [Name] — [one sentence summary]"
289
- git push origin v[X.Y] # if pushing to remote
290
- ```
291
-
292
- - Use only user-facing version identifiers and plain descriptions in tag messages, commit summaries, and PR text. Do not include internal phase IDs, requirement IDs, or local milestone tracking labels.
293
-
294
- </process>
295
-
296
- <success_criteria>
297
- - [ ] Readiness verified (phases complete + audit passed, or user chose to proceed with gaps)
298
- - [ ] Version confirmed
299
- - [ ] Stats gathered from SUMMARY.md files and git
300
- - [ ] Accomplishments extracted and reviewed
301
- - [ ] `.planning/milestones/v[X.Y]-ROADMAP.md` created with full phase details
302
- - [ ] `.planning/milestones/v[X.Y]-REQUIREMENTS.md` created with all requirement statuses
303
- - [ ] `.planning/MILESTONES.md` updated with new entry
304
- - [ ] SPEC.md Must Have requirements moved to Validated section
305
- - [ ] SPEC.md Current State updated to reflect shipped status
306
- - [ ] ROADMAP.md collapsed with `<details>` block pointing to archive
307
- - [ ] Advisory git tag suggestion presented
308
- </success_criteria>
309
-
310
- **MANDATORY: All archive files (v[X.Y]-ROADMAP.md, v[X.Y]-REQUIREMENTS.md), MILESTONES.md, SPEC.md, and ROADMAP.md must be written to disk before this workflow is complete. If any write fails, STOP and report the failure. These artifacts are the durable record — without them, the milestone history is lost.**
311
-
312
- <completion>
313
- Report to the user what was archived, then present the next step:
314
-
315
- ---
316
- **Completed:** Milestone v[X.Y] [Name] archived.
317
-
318
- Archived:
319
- - `.planning/milestones/v[X.Y]-ROADMAP.md` full phase details
320
- - `.planning/milestones/v[X.Y]-REQUIREMENTS.md` requirements at milestone completion
321
- - `.planning/MILESTONES.md` — updated milestone history
322
- - `.planning/SPEC.md` — requirements evolved, current state updated
323
- - `.planning/ROADMAP.md`active phases collapsed to `<details>`
324
-
325
- **Next step:** `/gsdd-new-milestone` — start the next milestone cycle
326
-
327
- Also available:
328
- - `/gsdd-progress` — check overall project status
329
- - `/gsdd-audit-milestone` re-audit before archiving (if you skipped the audit)
330
-
331
- Consider clearing context before starting the next workflow for best results.
332
- ---
333
- </completion>
36
+
37
+ If the preflight result is `blocked`, STOP and report the blocker instead of inferring milestone-close eligibility from workflow-local prose.
38
+
39
+ Treat the preflight as an authorization seam over shared repo truth only:
40
+ - it may authorize or reject milestone completion
41
+ - it does not mutate lifecycle state by itself
42
+ - owned writes remain the archive artifacts, `MILESTONES.md`, `.planning/SPEC.md`, and the retained `ROADMAP.md` collapse
43
+ </lifecycle_preflight>
44
+
45
+ <evidence_contract>
46
+ Milestone completion inherits the closure posture proven by the passed milestone audit.
47
+
48
+ Stable evidence kinds carried forward from audit:
49
+ - `code`
50
+ - `test`
51
+ - `runtime`
52
+ - `delivery`
53
+ - `human`
54
+
55
+ Read the audit frontmatter and preserve:
56
+ - `delivery_posture`
57
+ - `release_claim_posture`
58
+ - `evidence_contract.required_kinds`
59
+ - `evidence_contract.observed_kinds`
60
+ - `evidence_contract.missing_kinds`
61
+ - `release_claim_contract.unsupported_claims`
62
+ - `release_claim_contract.waivers`
63
+ - `release_claim_contract.deferrals`
64
+ - `release_claim_contract.contradiction_checks`
65
+
66
+ Shared closure rules:
67
+ - `repo_only` completion may proceed with repo-local closure evidence only; do not invent `runtime` or `delivery` proof
68
+ - `delivery_sensitive` completion must not proceed on code/prose-only evidence; the audit must already show required `code`, `test`, `runtime`, and `delivery` evidence with no missing required kinds
69
+ - if the audit omits the evidence contract or still has missing required kinds, STOP and route back to `/gsdd-audit-milestone` or `/gsdd-plan-milestone-gaps` instead of silently closing the milestone
70
+ - release claim postures are inherited from audit:
71
+ - `repo_closeout` permits repo-local milestone closure only and must not imply public support, delivery, runtime validation, generated-surface freshness, package publication, tags, or GitHub Releases
72
+ - `runtime_validated_closeout` may name only the runtime or surface with explicit `runtime` evidence
73
+ - `delivery_supported_closeout` requires the audit's `delivery_sensitive` bar plus concrete `delivery` evidence for the public/release/support claim
74
+ - inherited `delivery_posture` and `release_claim_posture` must be compatible: `repo_closeout` and `runtime_validated_closeout` use `repo_only`; `delivery_supported_closeout` uses `delivery_sensitive`
75
+ - waivers are valid only when they narrow the release claim or defer an unsupported claim. Deferrals must name the unsupported claim, missing evidence kind(s), and later workflow or milestone candidate when known. STOP if a waiver preserves a stronger claim while required evidence is missing.
76
+ - STOP if `release_claim_contract.unsupported_claims` remain without downgrade or deferral, if unsupported claims, invalid waivers, or failed contradiction checks remain, or if completion wording would claim more than the audit evidence supports. Failed contradiction checks are claim-scoped: generated-surface failures block only runtime/generated freshness claims, not unrelated `repo_closeout` completion.
77
+ - local-only `.planning/` proof can support repo closeout, but cannot become public release proof by itself.
78
+ </evidence_contract>
79
+
80
+ <process>
81
+
82
+ ## 1. Verify Readiness
83
+
84
+ Check:
85
+ - **Phase completion**: Are all ROADMAP.md phases for this milestone marked `[x]`? List any that are not.
86
+ - **Audit status**: Does a MILESTONE-AUDIT.md exist and have status `passed`? If it has status `gaps_found`, the milestone has open gaps.
87
+ - **Audit evidence posture**: Does the passed audit frontmatter include `delivery_posture` and an `evidence_contract` block with no missing required kinds?
88
+ - **Release claim posture**: Does the passed audit include compatible `delivery_posture`/`release_claim_posture` values and `release_claim_contract`, with unsupported claims either downgraded or deferred, no invalid waivers, and no failed claim-scoped contradiction checks?
89
+ - **Spent-branch guard**: Run `git branch --merged origin/main` (substitute `master` or the configured default branch from `config.json → gitProtocol.branch` if different) and verify HEAD is not a spent/already-merged branch. If the current branch already backs a merged PR, STOP - do not instruct any commit or tag operations. Prompt the user to check out a fresh active branch before continuing.
90
+ - **Integration-surface warning pass**: Inspect staged, unstaged, untracked, unpushed, and PR-less local truth separately from the milestone artifacts. Warn if the archive is being attempted from a mixed-scope or stale branch even when the milestone documents themselves look complete.
91
+
92
+ **If phases incomplete, audit not passed, the audit evidence contract is missing/insufficient, or the inherited release claim contract has unsupported claims, invalid waivers, missing/failed claim-scoped contradiction checks, incompatible posture metadata, or invalid posture metadata:**
93
+
94
+ STOP without archiving. Route to the narrowest corrective workflow instead:
95
+ 1. **Run audit first** — `/gsdd-audit-milestone` if audit is missing, stale, or missing required release-claim schema.
96
+ 2. **Close gaps first** — `/gsdd-plan-milestone-gaps` if audit found gaps or the release claim outruns available evidence.
97
+ 3. **Abort** — stop without archiving if the user does not want corrective work now.
98
+
99
+ **If all phases complete, audit passed, the audit evidence contract is satisfied, and the inherited release claim contract has no unsupported stronger claims:** Proceed.
100
+
101
+ ## 2. Determine Version
102
+
103
+ Parse the in-progress milestone version from ROADMAP.md (e.g., the `🚧` or active entry in the Milestones list). Confirm with user if unclear.
104
+
105
+ ## 3. Gather Stats
106
+
107
+ Extract from phase SUMMARY.md files and git:
108
+
109
+ - Phase count, plan count, task count (aggregate from SUMMARY files)
110
+ - Test count if discernible from SUMMARY files
111
+ - Start date (first phase completion date) and end date (today)
112
+ - Brief git stats: `git log --oneline --since="[start date]" | wc -l` for commit count
113
+ - Inherited closeout posture: `delivery_posture`, `release_claim_posture`, waivers, deferrals, and contradiction check result from the passed audit
114
+
115
+ Present a concise stats block for review.
116
+
117
+ ## 4. Extract Accomplishments
118
+
119
+ Read each phase SUMMARY.md in the milestone's phase range. Extract a one-liner from each phase describing the key delivery.
120
+
121
+ Present 4-8 accomplishments for review. Trim or adjust with user before writing to archive.
122
+
123
+ ## 5. Archive Roadmap
124
+
125
+ Create `.planning/milestones/v[X.Y]-ROADMAP.md` with full milestone details:
126
+
127
+ ```markdown
128
+ # Milestone v[X.Y]: [Name]
129
+
130
+ **Status:** ✅ COMPLETED [date]
131
+ **Phases:** [N][M]
132
+ **Total Plans:** [count]
133
+ **Suggested tag:** v[X.Y] (advisory only; do not imply this tag exists unless git confirms it)
134
+
135
+ ## Overview
136
+
137
+ [One paragraph describing what this milestone delivered and why it mattered.]
138
+
139
+ ## Phases
140
+
141
+ ### Phase [N]: [Name]
142
+
143
+ **Goal**: [goal from ROADMAP.md]
144
+ **Requirements**: [REQ-IDs]
145
+
146
+ Plans:
147
+ - [x] [plan summary from SUMMARY.md]
148
+
149
+ **Details:**
150
+ [Key implementation decisions and what was built]
151
+
152
+ **Success Criteria verified:**
153
+ 1. [criterion]
154
+ 2. [criterion]
155
+
156
+ ---
157
+
158
+ [Repeat for each phase]
159
+
160
+ ## Milestone Summary
161
+
162
+ **Key Decisions:**
163
+ - [Decision and rationale from phase summaries]
164
+
165
+ **Issues Resolved:**
166
+ - [What gaps/issues were closed this milestone]
167
+
168
+ **Issues Deferred (LATER):**
169
+ - [Any LATER-tagged items not addressed]
170
+
171
+ **Technical Debt Incurred:**
172
+ - [Any known shortcuts or deferred quality work]
173
+
174
+ ---
175
+
176
+ *For current project status, see `.planning/ROADMAP.md`*
177
+ ```
178
+
179
+ ## 6. Archive Requirements
180
+
181
+ Create `.planning/milestones/v[X.Y]-REQUIREMENTS.md`:
182
+
183
+ ```markdown
184
+ # Requirements Archive: v[X.Y] Milestone
185
+
186
+ **Archived:** [date]
187
+ **Milestone:** [name]
188
+ **Source:** `.planning/SPEC.md` requirements section at milestone completion
189
+
190
+ ---
191
+
192
+ ## v1 Must-Have Requirements (all satisfied)
193
+
194
+ | ID | Title | Status | Phase | Outcome |
195
+ |----|-------|--------|-------|---------|
196
+ | [ID] | [title] | ✅ verified | Phase [N] | [brief outcome] |
197
+
198
+ **Result: [N]/[N] requirements satisfied**
199
+
200
+ ---
201
+
202
+ ## Validated (pre-existing capabilities confirmed at milestone)
203
+
204
+ [Copy from SPEC.md Validated section]
205
+
206
+ ---
207
+
208
+ ## Nice to Have (v2 — deferred)
209
+
210
+ [Copy from SPEC.md Nice to Have section]
211
+
212
+ ---
213
+
214
+ *Source: `.planning/SPEC.md` as of [date]*
215
+ *Next milestone requirements: defined via `/gsdd-new-milestone`*
216
+ ```
217
+
218
+ ## 7. Move Audit File
219
+
220
+ If `.planning/v[X.Y]-MILESTONE-AUDIT.md` exists, note its location in the MILESTONES.md entry. (Leave the file in `.planning/` — it is already in the gitignored planning directory. No move required unless you prefer to co-locate it with the other archives.)
221
+
222
+ ## 8. Update MILESTONES.md
223
+
224
+ Append an entry to `.planning/MILESTONES.md`:
225
+
226
+ ```markdown
227
+ ## ✅ v[X.Y] [Name] ([date])
228
+
229
+ **Phases:** [N]–[M] | **Plans:** [count] | **Tasks:** [count] | **Tests:** [N] assertions, 0 failures
230
+
231
+ **Completed:** [One sentence summary of what the milestone closed.]
232
+
233
+ **Release claim posture:** [repo_closeout | runtime_validated_closeout | delivery_supported_closeout]
234
+ **Unsupported claims deferred:** [none or concise list]
235
+
236
+ **Key accomplishments:**
237
+ 1. [Accomplishment 1]
238
+ 2. [Accomplishment 2]
239
+ 3. [Accomplishment 3]
240
+ 4. [Accomplishment 4]
241
+
242
+ **Archive:** `.planning/milestones/v[X.Y]-ROADMAP.md`
243
+ **Requirements:** `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
244
+ **Suggested tag:** `v[X.Y]` (advisory; omit or mark not created unless git confirms it exists)
245
+ ```
246
+
247
+ ## 9. Evolve SPEC.md
248
+
249
+ Update SPEC.md to reflect the completed milestone:
250
+
251
+ **Move completed requirements:**
252
+ - Move all Must Have requirements that were satisfied this milestone to the `### Validated (existing capabilities)` section
253
+ - Format: `- [x] **[ID]**: [title] — [brief outcome note]`
254
+
255
+ **Update Current State section:**
256
+
257
+ ```markdown
258
+ ## Current State
259
+
260
+ - **Milestone:** v[X.Y] [Name] COMPLETED [date]
261
+ - **Phases:** [N]–[M] complete, all requirements verified ([N]/[N]), [test count] tests passing
262
+ - **Archive:** `.planning/milestones/v[X.Y]-ROADMAP.md`
263
+ - **Decisions:** [D1–DN] evidence-backed, all in [reference if applicable]
264
+ - **Blockers:** None — [list any LATER-priority gaps if applicable]
265
+ - **Next:** `/gsdd-new-milestone` to plan v[X.next] work
266
+
267
+ ---
268
+ *Last updated: [date] after v[X.Y] milestone completion*
269
+ ```
270
+
271
+ ## 10. Collapse ROADMAP.md
272
+
273
+ Replace the active milestone phases in ROADMAP.md with a collapsed `<details>` block and add the milestone to the Milestones list:
274
+
275
+ ```markdown
276
+ # Roadmap: [Project Name]
277
+
278
+ ## Milestones
279
+
280
+ - ✅ **v[X.Y] [Name]** — Phases [N]–[M] (completed [date])
281
+
282
+ ## Phases
283
+
284
+ <details>
285
+ <summary>✅ v[X.Y] [Name] (Phases [N]–[M]) — COMPLETED [date]</summary>
286
+
287
+ - [x] **Phase [N]: [Name]** — completed [date]
288
+ - [x] **Phase [N+1]: [Name]**completed [date]
289
+ [...]
290
+
291
+ Full details: [`.planning/milestones/v[X.Y]-ROADMAP.md`](milestones/v[X.Y]-ROADMAP.md)
292
+
293
+ </details>
294
+
295
+ ---
296
+ *Created: [original creation date] | v[X.Y] archived: [today]*
297
+ ```
298
+
299
+ ## 11. Advisory: Git Tag
300
+
301
+ Suggest a git tag for the milestone. Do not mandate it follow `config.json -> gitProtocol`.
302
+
303
+ ```
304
+ Advisory: Tag this milestone in git:
305
+ git tag -a v[X.Y] -m "v[X.Y] [Name] [one sentence summary]"
306
+ git push origin v[X.Y] # if pushing to remote
307
+ ```
308
+
309
+ - Use only user-facing version identifiers and plain descriptions in tag messages, commit summaries, and PR text. Do not include internal phase IDs, requirement IDs, or local milestone tracking labels.
310
+
311
+ </process>
312
+
313
+ <success_criteria>
314
+ - [ ] Readiness verified (phases complete, audit passed, evidence contract satisfied, and inherited release claim contract valid)
315
+ - [ ] Version confirmed
316
+ - [ ] Stats gathered from SUMMARY.md files and git
317
+ - [ ] Accomplishments extracted and reviewed
318
+ - [ ] `.planning/milestones/v[X.Y]-ROADMAP.md` created with full phase details
319
+ - [ ] `.planning/milestones/v[X.Y]-REQUIREMENTS.md` created with all requirement statuses
320
+ - [ ] `.planning/MILESTONES.md` updated with new entry
321
+ - [ ] SPEC.md Must Have requirements moved to Validated section
322
+ - [ ] SPEC.md Current State updated to reflect completed status
323
+ - [ ] ROADMAP.md collapsed with `<details>` block pointing to archive
324
+ - [ ] Advisory git tag suggestion presented
325
+ </success_criteria>
326
+
327
+ **MANDATORY: All archive files (v[X.Y]-ROADMAP.md, v[X.Y]-REQUIREMENTS.md), MILESTONES.md, SPEC.md, and ROADMAP.md must be written to disk before this workflow is complete. If any write fails, STOP and report the failure. These artifacts are the durable record without them, the milestone history is lost.**
328
+
329
+ <completion>
330
+ Report to the user what was archived, then present the next step:
331
+
332
+ ---
333
+ **Completed:** Milestone v[X.Y] [Name] archived.
334
+
335
+ Archived:
336
+ - `.planning/milestones/v[X.Y]-ROADMAP.md` — full phase details
337
+ - `.planning/milestones/v[X.Y]-REQUIREMENTS.md` — requirements at milestone completion
338
+ - `.planning/MILESTONES.md` — updated milestone history
339
+ - `.planning/SPEC.md` — requirements evolved, current state updated
340
+ - `.planning/ROADMAP.md` — active phases collapsed to `<details>`
341
+
342
+ **Next step:** `/gsdd-new-milestone` — start the next milestone cycle
343
+
344
+ Also available:
345
+ - `/gsdd-progress` — check overall project status
346
+ - `/gsdd-audit-milestone` — re-audit if source truth changed before archive
347
+
348
+ Consider clearing context before starting the next workflow for best results.
349
+ ---
350
+ </completion>