@bhargavvc/sdd-cc 1.30.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.ja-JP.md +144 -110
  2. package/README.ko-KR.md +143 -107
  3. package/README.md +183 -112
  4. package/README.pt-BR.md +90 -52
  5. package/README.zh-CN.md +141 -101
  6. package/agents/sdd-advisor-researcher.md +23 -0
  7. package/agents/sdd-ai-researcher.md +133 -0
  8. package/agents/sdd-code-fixer.md +516 -0
  9. package/agents/sdd-code-reviewer.md +355 -0
  10. package/agents/sdd-codebase-mapper.md +3 -3
  11. package/agents/sdd-debugger.md +17 -5
  12. package/agents/sdd-doc-verifier.md +201 -0
  13. package/agents/sdd-doc-writer.md +602 -0
  14. package/agents/sdd-domain-researcher.md +153 -0
  15. package/agents/sdd-eval-auditor.md +164 -0
  16. package/agents/sdd-eval-planner.md +154 -0
  17. package/agents/sdd-executor.md +87 -4
  18. package/agents/sdd-framework-selector.md +160 -0
  19. package/agents/sdd-intel-updater.md +314 -0
  20. package/agents/sdd-nyquist-auditor.md +1 -1
  21. package/agents/sdd-phase-researcher.md +71 -4
  22. package/agents/sdd-plan-checker.md +100 -6
  23. package/agents/sdd-planner.md +145 -206
  24. package/agents/sdd-project-researcher.md +25 -2
  25. package/agents/sdd-research-synthesizer.md +3 -3
  26. package/agents/sdd-roadmapper.md +6 -6
  27. package/agents/sdd-security-auditor.md +128 -0
  28. package/agents/sdd-ui-auditor.md +43 -3
  29. package/agents/sdd-ui-checker.md +5 -5
  30. package/agents/sdd-ui-researcher.md +27 -4
  31. package/agents/sdd-user-profiler.md +2 -2
  32. package/agents/sdd-verifier.md +142 -22
  33. package/bin/install.js +2151 -551
  34. package/commands/sdd/add-backlog.md +5 -5
  35. package/commands/sdd/add-tests.md +2 -2
  36. package/commands/sdd/ai-integration-phase.md +36 -0
  37. package/commands/sdd/analyze-dependencies.md +34 -0
  38. package/commands/sdd/audit-fix.md +33 -0
  39. package/commands/sdd/autonomous.md +7 -2
  40. package/commands/sdd/cleanup.md +5 -0
  41. package/commands/sdd/code-review-fix.md +52 -0
  42. package/commands/sdd/code-review.md +55 -0
  43. package/commands/sdd/complete-milestone.md +6 -6
  44. package/commands/sdd/debug.md +22 -9
  45. package/commands/sdd/discuss-phase.md +7 -2
  46. package/commands/sdd/do.md +1 -1
  47. package/commands/sdd/docs-update.md +48 -0
  48. package/commands/sdd/eval-review.md +32 -0
  49. package/commands/sdd/execute-phase.md +4 -0
  50. package/commands/sdd/explore.md +27 -0
  51. package/commands/sdd/fast.md +2 -2
  52. package/commands/sdd/from-sdd2.md +45 -0
  53. package/commands/sdd/help.md +2 -0
  54. package/commands/sdd/import.md +36 -0
  55. package/commands/sdd/intel.md +179 -0
  56. package/commands/sdd/join-discord.md +2 -1
  57. package/commands/sdd/manager.md +1 -0
  58. package/commands/sdd/map-codebase.md +3 -3
  59. package/commands/sdd/new-milestone.md +1 -1
  60. package/commands/sdd/new-project.md +5 -1
  61. package/commands/sdd/new-workspace.md +1 -1
  62. package/commands/sdd/next.md +2 -0
  63. package/commands/sdd/plan-milestone-gaps.md +2 -2
  64. package/commands/sdd/plan-phase.md +6 -1
  65. package/commands/sdd/plant-seed.md +1 -1
  66. package/commands/sdd/profile-user.md +1 -1
  67. package/commands/sdd/quick.md +5 -3
  68. package/commands/sdd/reapply-patches.md +230 -42
  69. package/commands/sdd/research-phase.md +3 -3
  70. package/commands/sdd/review-backlog.md +1 -0
  71. package/commands/sdd/review.md +6 -3
  72. package/commands/sdd/scan.md +26 -0
  73. package/commands/sdd/secure-phase.md +35 -0
  74. package/commands/sdd/ship.md +1 -1
  75. package/commands/sdd/thread.md +5 -5
  76. package/commands/sdd/undo.md +34 -0
  77. package/commands/sdd/verify-work.md +1 -1
  78. package/commands/sdd/workstreams.md +17 -11
  79. package/hooks/dist/sdd-check-update.js +33 -8
  80. package/hooks/dist/sdd-context-monitor.js +17 -8
  81. package/hooks/dist/sdd-phase-boundary.sh +27 -0
  82. package/hooks/dist/sdd-prompt-guard.js +1 -0
  83. package/hooks/dist/sdd-read-guard.js +82 -0
  84. package/hooks/dist/sdd-session-state.sh +33 -0
  85. package/hooks/dist/sdd-statusline.js +137 -15
  86. package/hooks/dist/sdd-validate-commit.sh +47 -0
  87. package/hooks/dist/sdd-workflow-guard.js +4 -4
  88. package/hooks/sdd-check-update.js +139 -0
  89. package/hooks/sdd-context-monitor.js +165 -0
  90. package/hooks/sdd-phase-boundary.sh +27 -0
  91. package/hooks/sdd-prompt-guard.js +97 -0
  92. package/hooks/sdd-read-guard.js +82 -0
  93. package/hooks/sdd-session-state.sh +33 -0
  94. package/hooks/sdd-statusline.js +241 -0
  95. package/hooks/sdd-validate-commit.sh +47 -0
  96. package/hooks/sdd-workflow-guard.js +94 -0
  97. package/package.json +3 -3
  98. package/scripts/build-hooks.js +18 -7
  99. package/scripts/prompt-injection-scan.sh +1 -0
  100. package/scripts/rebrand-gsd-to-sdd.sh +221 -220
  101. package/scripts/run-tests.cjs +5 -1
  102. package/scripts/sync-upstream.sh +1 -1
  103. package/sdd/bin/lib/commands.cjs +79 -17
  104. package/sdd/bin/lib/config.cjs +90 -48
  105. package/sdd/bin/lib/core.cjs +452 -87
  106. package/sdd/bin/lib/docs.cjs +267 -0
  107. package/sdd/bin/lib/frontmatter.cjs +381 -336
  108. package/sdd/bin/lib/init.cjs +110 -16
  109. package/sdd/bin/lib/intel.cjs +660 -0
  110. package/sdd/bin/lib/learnings.cjs +378 -0
  111. package/sdd/bin/lib/milestone.cjs +42 -11
  112. package/sdd/bin/lib/model-profiles.cjs +17 -15
  113. package/sdd/bin/lib/phase.cjs +367 -288
  114. package/sdd/bin/lib/profile-output.cjs +106 -10
  115. package/sdd/bin/lib/roadmap.cjs +146 -115
  116. package/sdd/bin/lib/schema-detect.cjs +238 -0
  117. package/sdd/bin/lib/sdd2-import.cjs +511 -0
  118. package/sdd/bin/lib/security.cjs +124 -3
  119. package/sdd/bin/lib/state.cjs +648 -264
  120. package/sdd/bin/lib/template.cjs +8 -4
  121. package/sdd/bin/lib/verify.cjs +209 -28
  122. package/sdd/bin/lib/workstream.cjs +7 -3
  123. package/sdd/bin/sdd-tools.cjs +184 -12
  124. package/sdd/contexts/dev.md +21 -0
  125. package/sdd/contexts/research.md +22 -0
  126. package/sdd/contexts/review.md +22 -0
  127. package/sdd/references/agent-contracts.md +79 -0
  128. package/sdd/references/ai-evals.md +156 -0
  129. package/sdd/references/ai-frameworks.md +186 -0
  130. package/sdd/references/artifact-types.md +113 -0
  131. package/sdd/references/common-bug-patterns.md +114 -0
  132. package/sdd/references/context-budget.md +49 -0
  133. package/sdd/references/continuation-format.md +25 -25
  134. package/sdd/references/domain-probes.md +125 -0
  135. package/sdd/references/few-shot-examples/plan-checker.md +73 -0
  136. package/sdd/references/few-shot-examples/verifier.md +109 -0
  137. package/sdd/references/gate-prompts.md +100 -0
  138. package/sdd/references/gates.md +70 -0
  139. package/sdd/references/git-integration.md +1 -1
  140. package/sdd/references/ios-scaffold.md +123 -0
  141. package/sdd/references/model-profile-resolution.md +2 -0
  142. package/sdd/references/model-profiles.md +24 -18
  143. package/sdd/references/planner-gap-closure.md +62 -0
  144. package/sdd/references/planner-reviews.md +39 -0
  145. package/sdd/references/planner-revision.md +87 -0
  146. package/sdd/references/planning-config.md +252 -0
  147. package/sdd/references/revision-loop.md +97 -0
  148. package/sdd/references/thinking-models-debug.md +44 -0
  149. package/sdd/references/thinking-models-execution.md +50 -0
  150. package/sdd/references/thinking-models-planning.md +62 -0
  151. package/sdd/references/thinking-models-research.md +50 -0
  152. package/sdd/references/thinking-models-verification.md +55 -0
  153. package/sdd/references/thinking-partner.md +96 -0
  154. package/sdd/references/ui-brand.md +4 -4
  155. package/sdd/references/universal-anti-patterns.md +63 -0
  156. package/sdd/references/verification-overrides.md +227 -0
  157. package/sdd/references/workstream-flag.md +56 -3
  158. package/sdd/templates/AI-SPEC.md +246 -0
  159. package/sdd/templates/DEBUG.md +1 -1
  160. package/sdd/templates/SECURITY.md +61 -0
  161. package/sdd/templates/UAT.md +4 -4
  162. package/sdd/templates/VALIDATION.md +4 -4
  163. package/sdd/templates/claude-md.md +32 -9
  164. package/sdd/templates/config.json +4 -0
  165. package/sdd/templates/debug-subagent-prompt.md +1 -1
  166. package/sdd/templates/dev-preferences.md +1 -1
  167. package/sdd/templates/discovery.md +2 -2
  168. package/sdd/templates/phase-prompt.md +1 -1
  169. package/sdd/templates/planner-subagent-prompt.md +3 -3
  170. package/sdd/templates/project.md +1 -1
  171. package/sdd/templates/research.md +1 -1
  172. package/sdd/templates/state.md +2 -2
  173. package/sdd/workflows/add-phase.md +8 -8
  174. package/sdd/workflows/add-tests.md +12 -9
  175. package/sdd/workflows/add-todo.md +5 -3
  176. package/sdd/workflows/ai-integration-phase.md +284 -0
  177. package/sdd/workflows/analyze-dependencies.md +96 -0
  178. package/sdd/workflows/audit-fix.md +157 -0
  179. package/sdd/workflows/audit-milestone.md +11 -11
  180. package/sdd/workflows/audit-uat.md +2 -2
  181. package/sdd/workflows/autonomous.md +195 -27
  182. package/sdd/workflows/check-todos.md +12 -10
  183. package/sdd/workflows/cleanup.md +2 -0
  184. package/sdd/workflows/code-review-fix.md +497 -0
  185. package/sdd/workflows/code-review.md +515 -0
  186. package/sdd/workflows/complete-milestone.md +56 -22
  187. package/sdd/workflows/diagnose-issues.md +10 -3
  188. package/sdd/workflows/discovery-phase.md +5 -3
  189. package/sdd/workflows/discuss-phase-assumptions.md +24 -6
  190. package/sdd/workflows/discuss-phase-power.md +291 -0
  191. package/sdd/workflows/discuss-phase.md +173 -21
  192. package/sdd/workflows/do.md +23 -21
  193. package/sdd/workflows/docs-update.md +1155 -0
  194. package/sdd/workflows/eval-review.md +155 -0
  195. package/sdd/workflows/execute-phase.md +594 -38
  196. package/sdd/workflows/execute-plan.md +67 -96
  197. package/sdd/workflows/explore.md +139 -0
  198. package/sdd/workflows/fast.md +5 -5
  199. package/sdd/workflows/forensics.md +2 -2
  200. package/sdd/workflows/health.md +4 -4
  201. package/sdd/workflows/help.md +122 -119
  202. package/sdd/workflows/import.md +276 -0
  203. package/sdd/workflows/inbox.md +387 -0
  204. package/sdd/workflows/insert-phase.md +7 -7
  205. package/sdd/workflows/list-phase-assumptions.md +4 -4
  206. package/sdd/workflows/list-workspaces.md +2 -2
  207. package/sdd/workflows/manager.md +35 -32
  208. package/sdd/workflows/map-codebase.md +7 -5
  209. package/sdd/workflows/milestone-summary.md +2 -2
  210. package/sdd/workflows/new-milestone.md +17 -9
  211. package/sdd/workflows/new-project.md +50 -25
  212. package/sdd/workflows/new-workspace.md +7 -5
  213. package/sdd/workflows/next.md +67 -11
  214. package/sdd/workflows/note.md +9 -7
  215. package/sdd/workflows/pause-work.md +75 -12
  216. package/sdd/workflows/plan-milestone-gaps.md +8 -8
  217. package/sdd/workflows/plan-phase.md +294 -42
  218. package/sdd/workflows/plant-seed.md +6 -3
  219. package/sdd/workflows/pr-branch.md +42 -14
  220. package/sdd/workflows/profile-user.md +9 -7
  221. package/sdd/workflows/progress.md +45 -45
  222. package/sdd/workflows/quick.md +195 -47
  223. package/sdd/workflows/remove-phase.md +6 -6
  224. package/sdd/workflows/remove-workspace.md +3 -1
  225. package/sdd/workflows/research-phase.md +2 -2
  226. package/sdd/workflows/resume-project.md +12 -12
  227. package/sdd/workflows/review.md +109 -9
  228. package/sdd/workflows/scan.md +102 -0
  229. package/sdd/workflows/secure-phase.md +166 -0
  230. package/sdd/workflows/session-report.md +2 -2
  231. package/sdd/workflows/settings.md +38 -12
  232. package/sdd/workflows/ship.md +21 -9
  233. package/sdd/workflows/stats.md +1 -1
  234. package/sdd/workflows/transition.md +23 -23
  235. package/sdd/workflows/ui-phase.md +15 -7
  236. package/sdd/workflows/ui-review.md +29 -4
  237. package/sdd/workflows/undo.md +314 -0
  238. package/sdd/workflows/update.md +171 -20
  239. package/sdd/workflows/validate-phase.md +6 -4
  240. package/sdd/workflows/verify-phase.md +210 -6
  241. package/sdd/workflows/verify-work.md +83 -9
  242. package/sdd/commands/sdd/workstreams.md +0 -63
@@ -20,8 +20,15 @@ Your job: Goal-backward verification. Start from what the phase SHOULD deliver,
20
20
  If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
21
21
 
22
22
  **Critical mindset:** Do NOT trust SUMMARY.md claims. SUMMARYs document what Claude SAID it did. You verify what ACTUALLY exists in the code. These often differ.
23
+
23
24
  </role>
24
25
 
26
+ <required_reading>
27
+ @~/.claude/sdd/references/verification-overrides.md
28
+ @~/.claude/sdd/references/gates.md
29
+ </required_reading>
30
+
31
+ This agent implements the **Escalation Gate** pattern (surfaces unresolvable gaps to the developer for decision).
25
32
  <project_context>
26
33
  Before verifying, discover project context:
27
34
 
@@ -53,6 +60,12 @@ Then verify each level against the actual codebase.
53
60
 
54
61
  <verification_process>
55
62
 
63
+ At verification decision points, apply structured reasoning:
64
+ @~/.claude/sdd/references/thinking-models-verification.md
65
+
66
+ At verification decision points, reference calibration examples:
67
+ @~/.claude/sdd/references/few-shot-examples/verifier.md
68
+
56
69
  ## Step 0: Check for Previous Verification
57
70
 
58
71
  ```bash
@@ -88,13 +101,21 @@ Extract phase goal from ROADMAP.md — this is the outcome to verify, not the ta
88
101
 
89
102
  In re-verification mode, must-haves come from Step 0.
90
103
 
91
- **Option A: Must-haves in PLAN frontmatter**
104
+ **Step 2a: Always load ROADMAP Success Criteria**
105
+
106
+ ```bash
107
+ PHASE_DATA=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" roadmap get-phase "$PHASE_NUM" --raw)
108
+ ```
109
+
110
+ Parse the `success_criteria` array from the JSON output. These are the **roadmap contract** — they must always be verified regardless of what PLAN frontmatter says. Store them as `roadmap_truths`.
111
+
112
+ **Step 2b: Load PLAN frontmatter must-haves (if present)**
92
113
 
93
114
  ```bash
94
115
  grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
95
116
  ```
96
117
 
97
- If found, extract and use:
118
+ If found, extract:
98
119
 
99
120
  ```yaml
100
121
  must_haves:
@@ -110,25 +131,20 @@ must_haves:
110
131
  via: "fetch in useEffect"
111
132
  ```
112
133
 
113
- **Option B: Use Success Criteria from ROADMAP.md**
134
+ **Step 2c: Merge must-haves**
114
135
 
115
- If no must_haves in frontmatter, check for Success Criteria:
136
+ Combine all sources into a single must-haves list:
116
137
 
117
- ```bash
118
- PHASE_DATA=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" roadmap get-phase "$PHASE_NUM" --raw)
119
- ```
138
+ 1. **Start with `roadmap_truths`** from Step 2a (these are non-negotiable)
139
+ 2. **Merge PLAN frontmatter truths** from Step 2b (these add plan-specific detail)
140
+ 3. **Deduplicate:** If a PLAN truth clearly restates a roadmap SC, keep the roadmap SC wording (it's the contract)
141
+ 4. **If neither 2a nor 2b produced any truths**, fall back to Option C below
120
142
 
121
- Parse the `success_criteria` array from the JSON output. If non-empty:
122
- 1. **Use each Success Criterion directly as a truth** (they are already observable, testable behaviors)
123
- 2. **Derive artifacts:** For each truth, "What must EXIST?" — map to concrete file paths
124
- 3. **Derive key links:** For each artifact, "What must be CONNECTED?" — this is where stubs hide
125
- 4. **Document must-haves** before proceeding
126
-
127
- Success Criteria from ROADMAP.md are the contract — they take priority over Goal-derived truths.
143
+ **CRITICAL:** PLAN frontmatter must-haves must NOT reduce scope. If ROADMAP.md defines 5 Success Criteria but the plan only lists 3 in must_haves, all 5 must still be verified. The plan can ADD must-haves but never subtract roadmap SCs.
128
144
 
129
145
  **Option C: Derive from phase goal (fallback)**
130
146
 
131
- If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
147
+ If no Success Criteria in ROADMAP AND no must_haves in frontmatter:
132
148
 
133
149
  1. **State the goal** from ROADMAP.md
134
150
  2. **Derive truths:** "What must be TRUE?" — list 3-7 observable, testable behaviors
@@ -151,7 +167,42 @@ For each truth:
151
167
  1. Identify supporting artifacts
152
168
  2. Check artifact status (Step 4)
153
169
  3. Check wiring status (Step 5)
154
- 4. Determine truth status
170
+ 4. **Before marking FAIL:** Check for override (Step 3b)
171
+ 5. Determine truth status
172
+
173
+ ## Step 3b: Check Verification Overrides
174
+
175
+ Before marking any must-have as FAILED, check the VERIFICATION.md frontmatter for an `overrides:` entry that matches this must-have.
176
+
177
+ **Override check procedure:**
178
+
179
+ 1. Parse `overrides:` array from VERIFICATION.md frontmatter (if present)
180
+ 2. For each override entry, normalize both the override `must_have` and the current truth to lowercase, strip punctuation, collapse whitespace
181
+ 3. Split into tokens and compute intersection — match if 80% token overlap in either direction
182
+ 4. Key technical terms (file paths, component names, API endpoints) have higher weight
183
+
184
+ **If override found:**
185
+ - Mark as `PASSED (override)` instead of FAIL
186
+ - Evidence: `Override: {reason} — accepted by {accepted_by} on {accepted_at}`
187
+ - Count toward passing score, not failing score
188
+
189
+ **If no override found:**
190
+ - Mark as FAILED as normal
191
+ - Consider suggesting an override if the failure looks intentional (alternative implementation exists)
192
+
193
+ **Suggesting overrides:** When a must-have FAILs but evidence shows an alternative implementation that achieves the same intent, include an override suggestion in the report:
194
+
195
+ ```markdown
196
+ **This looks intentional.** To accept this deviation, add to VERIFICATION.md frontmatter:
197
+
198
+ ```yaml
199
+ overrides:
200
+ - must_have: "{must-have text}"
201
+ reason: "{why this deviation is acceptable}"
202
+ accepted_by: "{name}"
203
+ accepted_at: "{ISO timestamp}"
204
+ ```
205
+ ```
155
206
 
156
207
  ## Step 4: Verify Artifacts (Three Levels)
157
208
 
@@ -442,17 +493,54 @@ npm test -- --grep "$PHASE_TEST_PATTERN" 2>&1 | grep -q "passing"
442
493
 
443
494
  ## Step 9: Determine Overall Status
444
495
 
445
- **Status: passed** All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns.
496
+ Classify status using this decision tree IN ORDER (most restrictive first):
497
+
498
+ 1. IF any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker anti-pattern found:
499
+ → **status: gaps_found**
500
+
501
+ 2. IF Step 8 produced ANY human verification items (section is non-empty):
502
+ → **status: human_needed**
503
+ (Even if all truths are VERIFIED and score is N/N — human items take priority)
446
504
 
447
- **Status: gaps_found** One or more truths FAILED, artifacts MISSING/STUB, key links NOT_WIRED, or blocker anti-patterns found.
505
+ 3. IF all truths VERIFIED, all artifacts pass, all links WIRED, no blockers, AND no human verification items:
506
+ → **status: passed**
448
507
 
449
- **Status: human_needed** All automated checks pass but items flagged for human verification.
508
+ **passed is ONLY valid when the human verification section is empty.** If you identified items requiring human testing in Step 8, status MUST be human_needed.
450
509
 
451
510
  **Score:** `verified_truths / total_truths`
452
511
 
512
+ ## Step 9b: Filter Deferred Items
513
+
514
+ Before reporting gaps, check if any identified gaps are explicitly addressed in later phases of the current milestone. This prevents false-positive gap reports for items intentionally scheduled for future work.
515
+
516
+ **Load the full milestone roadmap:**
517
+
518
+ ```bash
519
+ ROADMAP_DATA=$(node "$HOME/.claude/sdd/bin/sdd-tools.cjs" roadmap analyze --raw)
520
+ ```
521
+
522
+ Parse the JSON to extract all phases. Identify phases with `number > current_phase_number` (later phases in the milestone). For each later phase, extract its `goal` and `success_criteria`.
523
+
524
+ **For each potential gap identified in Step 9:**
525
+
526
+ 1. Check if the gap's failed truth or missing item is covered by a later phase's goal or success criteria
527
+ 2. **Match criteria:** The gap's concern appears in a later phase's goal text, success criteria text, or the later phase's name clearly suggests it covers this area of work
528
+ 3. If a match is found → move the gap to the `deferred` list, recording which phase addresses it and the matching evidence (goal text or success criterion)
529
+ 4. If the gap does not match any later phase → keep it as a real `gap`
530
+
531
+ **Important:** Be conservative when matching. Only defer a gap when there is clear, specific evidence in a later phase's roadmap section. Vague or tangential matches should NOT cause a gap to be deferred — when in doubt, keep it as a real gap.
532
+
533
+ **Deferred items do NOT affect the status determination.** After filtering, recalculate:
534
+
535
+ - If the gaps list is now empty and no human verification items exist → `passed`
536
+ - If the gaps list is now empty but human verification items exist → `human_needed`
537
+ - If the gaps list still has items → `gaps_found`
538
+
453
539
  ## Step 10: Structure Gap Output (If Gaps Found)
454
540
 
455
- Structure gaps in YAML frontmatter for `/sdd:plan-phase --gaps`:
541
+ Before writing VERIFICATION.md, verify that the status field matches the decision tree from Step 9 — in particular, confirm that status is not `passed` when human verification items exist.
542
+
543
+ Structure gaps in YAML frontmatter for `/sdd-plan-phase --gaps`:
456
544
 
457
545
  ```yaml
458
546
  gaps:
@@ -472,6 +560,17 @@ gaps:
472
560
  - `artifacts`: Files with issues
473
561
  - `missing`: Specific things to add/fix
474
562
 
563
+ If Step 9b identified deferred items, add a `deferred` section after `gaps`:
564
+
565
+ ```yaml
566
+ deferred: # Items addressed in later phases — not actionable gaps
567
+ - truth: "Observable truth not yet met"
568
+ addressed_in: "Phase 5"
569
+ evidence: "Phase 5 success criteria: 'Implement RuntimeConfigC FFI bindings'"
570
+ ```
571
+
572
+ Deferred items are informational only — they do not require closure plans.
573
+
475
574
  **Group related gaps by concern** — if multiple truths fail from the same root cause, note this to help the planner create focused plans.
476
575
 
477
576
  </verification_process>
@@ -490,6 +589,12 @@ phase: XX-name
490
589
  verified: YYYY-MM-DDTHH:MM:SSZ
491
590
  status: passed | gaps_found | human_needed
492
591
  score: N/M must-haves verified
592
+ overrides_applied: 0 # Count of PASSED (override) items included in score
593
+ overrides: # Only if overrides exist — carried forward or newly added
594
+ - must_have: "Must-have text that was overridden"
595
+ reason: "Why deviation is acceptable"
596
+ accepted_by: "username"
597
+ accepted_at: "ISO timestamp"
493
598
  re_verification: # Only if previous VERIFICATION.md existed
494
599
  previous_status: gaps_found
495
600
  previous_score: 2/5
@@ -506,6 +611,10 @@ gaps: # Only if status: gaps_found
506
611
  issue: "What's wrong"
507
612
  missing:
508
613
  - "Specific thing to add/fix"
614
+ deferred: # Only if deferred items exist (Step 9b)
615
+ - truth: "Observable truth addressed in a later phase"
616
+ addressed_in: "Phase N"
617
+ evidence: "Matching goal or success criteria text"
509
618
  human_verification: # Only if status: human_needed
510
619
  - test: "What to do"
511
620
  expected: "What should happen"
@@ -530,6 +639,15 @@ human_verification: # Only if status: human_needed
530
639
 
531
640
  **Score:** {N}/{M} truths verified
532
641
 
642
+ ### Deferred Items
643
+
644
+ Items not yet met but explicitly addressed in later milestone phases.
645
+ Only include this section if deferred items exist (from Step 9b).
646
+
647
+ | # | Item | Addressed In | Evidence |
648
+ |---|------|-------------|----------|
649
+ | 1 | {truth} | Phase {N} | {matching goal or success criteria} |
650
+
533
651
  ### Required Artifacts
534
652
 
535
653
  | Artifact | Expected | Status | Details |
@@ -597,7 +715,7 @@ All must-haves verified. Phase goal achieved. Ready to proceed.
597
715
  1. **{Truth 1}** — {reason}
598
716
  - Missing: {what needs to be added}
599
717
 
600
- Structured gaps in VERIFICATION.md frontmatter for `/sdd:plan-phase --gaps`.
718
+ Structured gaps in VERIFICATION.md frontmatter for `/sdd-plan-phase --gaps`.
601
719
 
602
720
  {If human_needed:}
603
721
  ### Human Verification Required
@@ -618,7 +736,7 @@ Automated checks passed. Awaiting human verification.
618
736
 
619
737
  **DO NOT skip key link verification.** 80% of stubs hide here — pieces exist but aren't connected.
620
738
 
621
- **Structure gaps in YAML frontmatter** for `/sdd:plan-phase --gaps`.
739
+ **Structure gaps in YAML frontmatter** for `/sdd-plan-phase --gaps`.
622
740
 
623
741
  **DO flag for human verification when uncertain** (visual, real-time, external service).
624
742
 
@@ -693,7 +811,9 @@ return <div>No messages</div> // Always shows "no messages"
693
811
  - [ ] Behavioral spot-checks run on runnable code (or skipped with reason)
694
812
  - [ ] Human verification items identified
695
813
  - [ ] Overall status determined
814
+ - [ ] Deferred items filtered against later milestone phases (Step 9b)
696
815
  - [ ] Gaps structured in YAML frontmatter (if gaps_found)
816
+ - [ ] Deferred items structured in YAML frontmatter (if deferred items exist)
697
817
  - [ ] Re-verification metadata included (if previous existed)
698
818
  - [ ] VERIFICATION.md created with complete report
699
819
  - [ ] Results returned to orchestrator (NOT committed)