@ktpartners/dgs-platform 2.9.0 → 3.3.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.
- package/CHANGELOG.md +197 -0
- package/README.md +34 -2
- package/agents/dgs-executor.md +124 -3
- package/agents/dgs-idea-researcher.md +447 -0
- package/agents/dgs-plan-checker.md +61 -3
- package/agents/dgs-planner.md +51 -8
- package/bin/install.js +44 -0
- package/commands/dgs/abandon-quick.md +28 -0
- package/commands/dgs/add-tests.md +2 -2
- package/commands/dgs/audit-milestone.md +4 -3
- package/commands/dgs/capture-principle.md +11 -11
- package/commands/dgs/cleanup.md +2 -2
- package/commands/dgs/complete-milestone.md +11 -11
- package/commands/dgs/complete-quick.md +28 -0
- package/commands/dgs/create-milestone-job.md +2 -2
- package/commands/dgs/debug.md +3 -3
- package/commands/dgs/develop-idea.md +1 -1
- package/commands/dgs/diff-report.md +124 -0
- package/commands/dgs/fast.md +3 -1
- package/commands/dgs/health.md +1 -1
- package/commands/dgs/map-codebase.md +6 -6
- package/commands/dgs/new-milestone.md +5 -5
- package/commands/dgs/new-project.md +8 -21
- package/commands/dgs/package-scan.md +43 -0
- package/commands/dgs/plan-milestone-gaps.md +1 -1
- package/commands/dgs/progress.md +3 -3
- package/commands/dgs/quick-abandon.md +8 -0
- package/commands/dgs/quick-complete.md +8 -0
- package/commands/dgs/quick.md +10 -3
- package/commands/dgs/research-idea.md +3 -2
- package/commands/dgs/research-phase.md +3 -3
- package/commands/dgs/switch-project.md +14 -1
- package/commands/dgs/write-spec.md +3 -3
- package/deliver-great-systems/bin/dgs-tools.cjs +401 -32
- package/deliver-great-systems/bin/lib/audit-tolerance.cjs +77 -0
- package/deliver-great-systems/bin/lib/audit-tolerance.test.cjs +101 -0
- package/deliver-great-systems/bin/lib/commands.cjs +626 -46
- package/deliver-great-systems/bin/lib/commands.test.cjs +451 -0
- package/deliver-great-systems/bin/lib/commit-verify.test.cjs +236 -0
- package/deliver-great-systems/bin/lib/config.cjs +80 -6
- package/deliver-great-systems/bin/lib/config.test.cjs +309 -0
- package/deliver-great-systems/bin/lib/context.cjs +120 -0
- package/deliver-great-systems/bin/lib/core.cjs +35 -14
- package/deliver-great-systems/bin/lib/core.test.cjs +79 -1
- package/deliver-great-systems/bin/lib/execution.cjs +49 -17
- package/deliver-great-systems/bin/lib/fast-routing.cjs +199 -0
- package/deliver-great-systems/bin/lib/fast-routing.test.cjs +108 -0
- package/deliver-great-systems/bin/lib/final-commit-precondition.test.cjs +87 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/bundler-audit-gemfile.json +21 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/gate-parity-expected.md +186 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/gate-parity-runresult.json +235 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/govulncheck-import.json +3 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/npm-audit-v10.json +37 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/osv-clean.json +3 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/osv-vulns.json +77 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/pip-audit-requirements.json +28 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/snyk-lodash.json +30 -0
- package/deliver-great-systems/bin/lib/fixtures/package-scan/snyk-workspaces.json +55 -0
- package/deliver-great-systems/bin/lib/flat-migration.test.cjs +396 -0
- package/deliver-great-systems/bin/lib/frontmatter.cjs +1 -1
- package/deliver-great-systems/bin/lib/governance.cjs +211 -0
- package/deliver-great-systems/bin/lib/governance.test.cjs +339 -0
- package/deliver-great-systems/bin/lib/health-untracked-phase.test.cjs +269 -0
- package/deliver-great-systems/bin/lib/ideas.cjs +206 -91
- package/deliver-great-systems/bin/lib/ideas.test.cjs +244 -1
- package/deliver-great-systems/bin/lib/init.cjs +357 -61
- package/deliver-great-systems/bin/lib/init.test.cjs +625 -8
- package/deliver-great-systems/bin/lib/jobs.cjs +131 -25
- package/deliver-great-systems/bin/lib/jobs.test.cjs +193 -74
- package/deliver-great-systems/bin/lib/migration.cjs +409 -1
- package/deliver-great-systems/bin/lib/migration.test.cjs +158 -1
- package/deliver-great-systems/bin/lib/milestone.cjs +154 -31
- package/deliver-great-systems/bin/lib/milestone.test.cjs +203 -0
- package/deliver-great-systems/bin/lib/package-adapters.cjs +530 -0
- package/deliver-great-systems/bin/lib/package-adapters.test.cjs +618 -0
- package/deliver-great-systems/bin/lib/package-ecosystems.cjs +350 -0
- package/deliver-great-systems/bin/lib/package-ecosystems.test.cjs +348 -0
- package/deliver-great-systems/bin/lib/package-runner.cjs +199 -0
- package/deliver-great-systems/bin/lib/package-runner.test.cjs +198 -0
- package/deliver-great-systems/bin/lib/package-scan-provenance.cjs +56 -0
- package/deliver-great-systems/bin/lib/package-scan-provenance.test.cjs +103 -0
- package/deliver-great-systems/bin/lib/package-scan-report.cjs +1140 -0
- package/deliver-great-systems/bin/lib/package-scan-report.test.cjs +1963 -0
- package/deliver-great-systems/bin/lib/package-scan-skill.cjs +96 -0
- package/deliver-great-systems/bin/lib/package-scan-skill.test.cjs +136 -0
- package/deliver-great-systems/bin/lib/package-scan.cjs +919 -0
- package/deliver-great-systems/bin/lib/package-scan.test.cjs +2147 -0
- package/deliver-great-systems/bin/lib/phase.cjs +146 -3
- package/deliver-great-systems/bin/lib/phase.test.cjs +420 -0
- package/deliver-great-systems/bin/lib/plan-number-validity.test.cjs +48 -0
- package/deliver-great-systems/bin/lib/projects.cjs +65 -10
- package/deliver-great-systems/bin/lib/projects.test.cjs +198 -2
- package/deliver-great-systems/bin/lib/quick.cjs +739 -0
- package/deliver-great-systems/bin/lib/quick.test.cjs +730 -0
- package/deliver-great-systems/bin/lib/repos.cjs +37 -13
- package/deliver-great-systems/bin/lib/review.cjs +1821 -0
- package/deliver-great-systems/bin/lib/roadmap.cjs +34 -13
- package/deliver-great-systems/bin/lib/specs.cjs +3 -81
- package/deliver-great-systems/bin/lib/state-transition-gate.test.cjs +160 -0
- package/deliver-great-systems/bin/lib/state.cjs +147 -55
- package/deliver-great-systems/bin/lib/summary-frontmatter.cjs +54 -0
- package/deliver-great-systems/bin/lib/summary-frontmatter.test.cjs +78 -0
- package/deliver-great-systems/bin/lib/sweep-scope.test.cjs +263 -0
- package/deliver-great-systems/bin/lib/sync.cjs +75 -0
- package/deliver-great-systems/bin/lib/verify.cjs +198 -7
- package/deliver-great-systems/bin/lib/verify.test.cjs +82 -0
- package/deliver-great-systems/bin/lib/wave-0-template-rename.test.cjs +40 -0
- package/deliver-great-systems/bin/lib/worktrees.cjs +790 -0
- package/deliver-great-systems/bin/lib/worktrees.test.cjs +963 -0
- package/deliver-great-systems/references/agent-step-reliability.md +60 -0
- package/deliver-great-systems/references/conflict-resolution.md +4 -0
- package/deliver-great-systems/references/context-tiers.md +4 -0
- package/deliver-great-systems/references/package-scan-config.md +151 -0
- package/deliver-great-systems/references/questioning.md +0 -30
- package/deliver-great-systems/references/spec-review-loop.md +1 -2
- package/deliver-great-systems/references/workflow-conventions.md +29 -0
- package/deliver-great-systems/skills/dgs-tests/package-scan.md +44 -0
- package/deliver-great-systems/templates/REVIEW.md +35 -0
- package/deliver-great-systems/templates/VALIDATION.md +1 -1
- package/deliver-great-systems/templates/claude-md.md +27 -0
- package/deliver-great-systems/templates/package-scan-report.md +108 -0
- package/deliver-great-systems/templates/project.md +6 -170
- package/deliver-great-systems/templates/summary.md +3 -1
- package/deliver-great-systems/workflows/abandon-quick.md +89 -0
- package/deliver-great-systems/workflows/add-idea.md +3 -3
- package/deliver-great-systems/workflows/add-phase.md +5 -0
- package/deliver-great-systems/workflows/add-tests.md +14 -0
- package/deliver-great-systems/workflows/add-todo.md +1 -0
- package/deliver-great-systems/workflows/approve-spec.md +25 -4
- package/deliver-great-systems/workflows/audit-milestone.md +66 -10
- package/deliver-great-systems/workflows/audit-phase.md +15 -5
- package/deliver-great-systems/workflows/cancel-job.md +2 -2
- package/deliver-great-systems/workflows/check-todos.md +2 -3
- package/deliver-great-systems/workflows/codereview.md +103 -9
- package/deliver-great-systems/workflows/complete-milestone.md +218 -24
- package/deliver-great-systems/workflows/complete-quick.md +106 -0
- package/deliver-great-systems/workflows/consolidate-ideas.md +1 -1
- package/deliver-great-systems/workflows/create-milestone-job.md +4 -4
- package/deliver-great-systems/workflows/develop-idea.md +11 -11
- package/deliver-great-systems/workflows/diagnose-issues.md +14 -0
- package/deliver-great-systems/workflows/discuss-idea.md +1 -1
- package/deliver-great-systems/workflows/discuss-phase.md +3 -2
- package/deliver-great-systems/workflows/execute-phase.md +209 -33
- package/deliver-great-systems/workflows/execute-plan.md +22 -22
- package/deliver-great-systems/workflows/help.md +53 -20
- package/deliver-great-systems/workflows/import-spec.md +65 -7
- package/deliver-great-systems/workflows/init-product.md +45 -167
- package/deliver-great-systems/workflows/new-milestone.md +140 -33
- package/deliver-great-systems/workflows/new-project.md +60 -331
- package/deliver-great-systems/workflows/package-scan.md +59 -0
- package/deliver-great-systems/workflows/plan-phase.md +79 -1
- package/deliver-great-systems/workflows/progress-all.md +133 -0
- package/deliver-great-systems/workflows/quick-abandon.md +89 -0
- package/deliver-great-systems/workflows/quick-complete.md +106 -0
- package/deliver-great-systems/workflows/quick.md +328 -26
- package/deliver-great-systems/workflows/refine-spec.md +1 -1
- package/deliver-great-systems/workflows/research-idea.md +77 -139
- package/deliver-great-systems/workflows/resume-project.md +2 -2
- package/deliver-great-systems/workflows/run-job.md +29 -43
- package/deliver-great-systems/workflows/settings.md +13 -77
- package/deliver-great-systems/workflows/validate-phase.md +39 -1
- package/deliver-great-systems/workflows/verify-work.md +14 -0
- package/deliver-great-systems/workflows/write-spec.md +11 -13
- package/hooks/dist/dgs-enforce-discipline.js +196 -0
- package/package.json +1 -1
- package/scripts/build-hooks.js +1 -0
|
@@ -89,7 +89,7 @@ Also check for prior research document:
|
|
|
89
89
|
```bash
|
|
90
90
|
# Derive slug from filename (strip id prefix and .md suffix)
|
|
91
91
|
SLUG=$(echo "${filename}" | sed 's/^[0-9]*-//' | sed 's/\.md$//')
|
|
92
|
-
RESEARCH_DOC="${project_root}/docs/ideas
|
|
92
|
+
RESEARCH_DOC="${project_root}/docs/ideas/${SLUG}-research.md"
|
|
93
93
|
```
|
|
94
94
|
If the research document file exists, read it for prior research context.
|
|
95
95
|
|
|
@@ -281,7 +281,7 @@ Per CONTEXT.md: idea body is NOT updated on partial save.
|
|
|
281
281
|
<step name="discussion_commit">
|
|
282
282
|
Commit the updated idea file immediately after discussion:
|
|
283
283
|
```bash
|
|
284
|
-
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: discuss idea #${id} — ${title}" --files ${project_root}/ideas/${
|
|
284
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: discuss idea #${id} — ${title}" --files ${project_root}/ideas/${filename}
|
|
285
285
|
```
|
|
286
286
|
|
|
287
287
|
**If `partial = true`** (user exited mid-discussion):
|
|
@@ -392,10 +392,10 @@ Create (or overwrite) the research document.
|
|
|
392
392
|
|
|
393
393
|
Ensure directory exists:
|
|
394
394
|
```bash
|
|
395
|
-
mkdir -p ${project_root}/docs/ideas
|
|
395
|
+
mkdir -p ${project_root}/docs/ideas
|
|
396
396
|
```
|
|
397
397
|
|
|
398
|
-
Write the research document to `${project_root}/docs/ideas
|
|
398
|
+
Write the research document to `${project_root}/docs/ideas/${SLUG}-research.md` using the Write tool.
|
|
399
399
|
|
|
400
400
|
Document structure:
|
|
401
401
|
```markdown
|
|
@@ -456,7 +456,7 @@ Build the entry JSON:
|
|
|
456
456
|
"summary": "{Actionable summary paragraph}",
|
|
457
457
|
"keyFindings": "- {finding 1}\n- {finding 2}\n- {finding 3}",
|
|
458
458
|
"recommendation": "{Strong recommendation or neutral options presentation}",
|
|
459
|
-
"documentLink": "${project_root}/docs/ideas
|
|
459
|
+
"documentLink": "${project_root}/docs/ideas/${SLUG}-research.md",
|
|
460
460
|
"outcome": "{Recommended next step: 'Ready for spec', 'Needs more discussion', 'Not feasible', etc.}"
|
|
461
461
|
}
|
|
462
462
|
```
|
|
@@ -472,7 +472,7 @@ Parse the JSON result to confirm success.
|
|
|
472
472
|
<step name="research_commit">
|
|
473
473
|
Commit both the research document and the updated idea file:
|
|
474
474
|
```bash
|
|
475
|
-
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: research idea #${id} -- ${title}" --files ${project_root}/docs/ideas
|
|
475
|
+
node ~/.claude/deliver-great-systems/bin/dgs-tools.cjs commit "docs: research idea #${id} -- ${title}" --files ${project_root}/docs/ideas/${SLUG}-research.md ${project_root}/ideas/${filename}
|
|
476
476
|
```
|
|
477
477
|
</step>
|
|
478
478
|
|
|
@@ -490,8 +490,8 @@ Research: ${recommendation}
|
|
|
490
490
|
Next step: ${contextAwareNextStep}
|
|
491
491
|
|
|
492
492
|
Files:
|
|
493
|
-
- ${project_root}/ideas/${
|
|
494
|
-
- ${project_root}/docs/ideas
|
|
493
|
+
- ${project_root}/ideas/${filename}
|
|
494
|
+
- ${project_root}/docs/ideas/${SLUG}-research.md
|
|
495
495
|
```
|
|
496
496
|
|
|
497
497
|
**If only discussion ran** (research skipped by decision routing, user choice, or partial exit):
|
|
@@ -503,7 +503,7 @@ Decision: ${decision}
|
|
|
503
503
|
Next step: ${contextAwareNextStep}
|
|
504
504
|
|
|
505
505
|
Files:
|
|
506
|
-
- ${project_root}/ideas/${
|
|
506
|
+
- ${project_root}/ideas/${filename}
|
|
507
507
|
```
|
|
508
508
|
|
|
509
509
|
**If only research ran** (user chose "Just research" in assess_history):
|
|
@@ -516,8 +516,8 @@ Research: ${recommendation}
|
|
|
516
516
|
Next step: ${contextAwareNextStep}
|
|
517
517
|
|
|
518
518
|
Files:
|
|
519
|
-
- ${project_root}/ideas/${
|
|
520
|
-
- ${project_root}/docs/ideas
|
|
519
|
+
- ${project_root}/ideas/${filename}
|
|
520
|
+
- ${project_root}/docs/ideas/${SLUG}-research.md
|
|
521
521
|
```
|
|
522
522
|
|
|
523
523
|
**Context-aware next step logic:**
|
|
@@ -33,6 +33,20 @@ TIER_FILES=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" contex
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Store the file list for passing to debug sub-agents in `<files_to_read>` blocks.
|
|
36
|
+
|
|
37
|
+
**Worktree-aware code directory resolution (resolveCodeContext):**
|
|
38
|
+
|
|
39
|
+
For each registered code repo, resolve the correct working directory. When a milestone or quick worktree is active, debug investigation must target the worktree directory, not the main checkout, so the debugger examines the correct code and can reproduce issues in the right context.
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
// In the agent's execution context, use resolveCodeContext to determine the code directory:
|
|
43
|
+
const { resolveCodeContext } = require('./bin/lib/context.cjs');
|
|
44
|
+
const ctx = resolveCodeContext(planningRoot, repoName);
|
|
45
|
+
// ctx.type: 'main' | 'milestone' | 'quick'
|
|
46
|
+
// ctx.directory: absolute path to the correct working directory
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Pass `ctx.directory` to debug sub-agents so they investigate code in the correct location.
|
|
36
50
|
</step>
|
|
37
51
|
|
|
38
52
|
<step name="parse_gaps">
|
|
@@ -86,7 +86,7 @@ IDEA_DOCS_DIR="${IDEA_DIR}/docs"
|
|
|
86
86
|
If a flat structure is used (ideas stored as files, not directories), derive from the filename:
|
|
87
87
|
```bash
|
|
88
88
|
IDEA_SLUG=$(echo "${filename}" | sed 's/^[0-9]*-//' | sed 's/\.md$//')
|
|
89
|
-
IDEA_DOCS_DIR="$(dirname "$(dirname "${path}")")/docs/ideas
|
|
89
|
+
IDEA_DOCS_DIR="$(dirname "$(dirname "${path}")")/docs/ideas/${IDEA_SLUG}"
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
Check both paths. Use whichever exists.
|
|
@@ -183,7 +183,8 @@ Read prior phase context to avoid re-asking decided questions and maintain consi
|
|
|
183
183
|
**Step 1: Project-level files**
|
|
184
184
|
|
|
185
185
|
Project-level files (PROJECT.md, REQUIREMENTS.md, STATE.md, ROADMAP.md, REPOS.md, and codebase docs) are already loaded via the planning-tier `load-tier` call in the initialize step. Extract from those:
|
|
186
|
-
- **
|
|
186
|
+
- **docs/product/PRODUCT-SUMMARY.md** — Vision, principles, non-negotiables (product-level)
|
|
187
|
+
- **PROJECT.md** — Project identity (thin skeleton: name + one-liner)
|
|
187
188
|
- **REQUIREMENTS.md** — Acceptance criteria, constraints, must-haves vs nice-to-haves
|
|
188
189
|
- **STATE.md** — Current progress, any flags or session notes
|
|
189
190
|
|
|
@@ -204,7 +205,7 @@ Structure the extracted information:
|
|
|
204
205
|
```
|
|
205
206
|
<prior_decisions>
|
|
206
207
|
## Project-Level
|
|
207
|
-
- [Key principle or constraint from
|
|
208
|
+
- [Key principle or constraint from docs/product/PRODUCT-SUMMARY.md]
|
|
208
209
|
- [Requirement that affects this phase from REQUIREMENTS.md]
|
|
209
210
|
|
|
210
211
|
## From Prior Phases
|
|
@@ -9,7 +9,7 @@ Orchestrator coordinates, not executes. Each subagent loads the full execute-pla
|
|
|
9
9
|
</core_principle>
|
|
10
10
|
|
|
11
11
|
<hard_boundary>
|
|
12
|
-
**CRITICAL SCOPE CONSTRAINT:** You execute ONLY the single phase specified in $ARGUMENTS. After that phase
|
|
12
|
+
**CRITICAL SCOPE CONSTRAINT:** You execute ONLY the single phase specified in $ARGUMENTS. After that phase finishes (plans executed, verification done, roadmap updated), you MUST STOP. Do NOT read the roadmap to discover subsequent phases. Do NOT execute transition.md unless `--auto` flag is present. Do NOT advance to phase N+1. Violating this boundary causes duplicate work and corrupts job state.
|
|
13
13
|
</hard_boundary>
|
|
14
14
|
|
|
15
15
|
<required_reading>
|
|
@@ -27,7 +27,7 @@ INIT=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" init execute
|
|
|
27
27
|
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `base_branch`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `author`, `phase_req_ids`, `sync_push`, `sync_pull`, `cadence_push`, `cadence_pull`.
|
|
30
|
+
Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `base_branch`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `author`, `phase_req_ids`, `sync_push`, `sync_pull`, `cadence_push`, `cadence_pull`, `milestone_slug`, `milestone_version`, `milestone_name`.
|
|
31
31
|
|
|
32
32
|
**Load execution tier context:**
|
|
33
33
|
|
|
@@ -119,34 +119,122 @@ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" sync workflow-pull
|
|
|
119
119
|
- If No: skip pull, continue
|
|
120
120
|
</step>
|
|
121
121
|
|
|
122
|
-
<step name="
|
|
123
|
-
Check
|
|
122
|
+
<step name="handle_worktree">
|
|
123
|
+
Check if this phase is part of a milestone with code repos registered in REPOS.md.
|
|
124
124
|
|
|
125
|
-
**
|
|
125
|
+
**If no REPOS.md or no code repos:** Skip worktree creation entirely. Log: `No code repos registered — skipping worktree setup.` Continue to validate_phase.
|
|
126
|
+
|
|
127
|
+
**If REPOS.md has code repos and `milestone_slug` is present:**
|
|
128
|
+
|
|
129
|
+
Use `milestone_slug` from init JSON (already sanitized).
|
|
130
|
+
|
|
131
|
+
**1. Check for existing worktree:**
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
WORKTREE_LIST=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" worktrees list 2>/dev/null)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Parse the JSON array. Look for an entry matching `milestone_slug`.
|
|
138
|
+
|
|
139
|
+
**If worktree exists with `setup_complete: true` for all repos:**
|
|
140
|
+
```
|
|
141
|
+
Using existing milestone worktree for ${MILESTONE_SLUG}
|
|
142
|
+
```
|
|
143
|
+
Skip to step 3 (set active_context).
|
|
144
|
+
|
|
145
|
+
**If worktree exists but `setup_complete: false` for any repo:**
|
|
146
|
+
```
|
|
147
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
148
|
+
║ ERROR ║
|
|
149
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
150
|
+
|
|
151
|
+
Worktree setup incomplete for milestone '${MILESTONE_SLUG}'.
|
|
152
|
+
Repo(s) with failed setup need manual intervention.
|
|
153
|
+
|
|
154
|
+
**To fix:** dgs-tools worktrees setup ${MILESTONE_SLUG}
|
|
155
|
+
Then re-run: /dgs:execute-phase ${PHASE}
|
|
156
|
+
```
|
|
157
|
+
**STOP.** Do not proceed with phase execution.
|
|
158
|
+
|
|
159
|
+
**If no worktree exists:**
|
|
160
|
+
|
|
161
|
+
**2. Create milestone worktree:**
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
CREATE_RESULT=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" worktrees create "${MILESTONE_SLUG}" --type milestone)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Parse JSON output. Check each repo:
|
|
168
|
+
- If all repos have `setup_complete: true` (or no setup command): continue.
|
|
169
|
+
- If any repo has `setup_complete: false`:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
173
|
+
║ ERROR ║
|
|
174
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
175
|
+
|
|
176
|
+
Setup failed for one or more repos during worktree creation.
|
|
177
|
+
Phase cannot start until setup succeeds.
|
|
178
|
+
|
|
179
|
+
**To fix:** dgs-tools worktrees setup ${MILESTONE_SLUG}
|
|
180
|
+
Then re-run: /dgs:execute-phase ${PHASE}
|
|
181
|
+
```
|
|
182
|
+
**STOP.** Do not proceed.
|
|
183
|
+
|
|
184
|
+
Note: The worktree directory and branch are kept (not removed) so the user can fix and re-run setup.
|
|
185
|
+
|
|
186
|
+
**3. Set active_context and capture worktree repos:**
|
|
126
187
|
|
|
127
|
-
**"phase" or "milestone":** Use pre-computed `branch_name` from init for the product folder:
|
|
128
188
|
```bash
|
|
129
|
-
|
|
189
|
+
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" config-local-set execution.active_context "${MILESTONE_SLUG}"
|
|
130
190
|
```
|
|
131
191
|
|
|
132
|
-
|
|
192
|
+
Read the worktree repos map from config.local.json so it can be passed to executor agents:
|
|
133
193
|
|
|
134
|
-
|
|
194
|
+
```bash
|
|
195
|
+
WORKTREE_REPOS=$(node -e "
|
|
196
|
+
const fs = require('fs');
|
|
197
|
+
const cfg = JSON.parse(fs.readFileSync('config.local.json', 'utf-8'));
|
|
198
|
+
const project = cfg.current_project;
|
|
199
|
+
const repos = (cfg.projects && cfg.projects[project] && cfg.projects[project].worktrees && cfg.projects[project].worktrees['${MILESTONE_SLUG}'] && cfg.projects[project].worktrees['${MILESTONE_SLUG}'].repos) || {};
|
|
200
|
+
process.stdout.write(JSON.stringify(repos));
|
|
201
|
+
")
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Store `$WORKTREE_REPOS` (JSON object mapping repoName -> worktreePath) for use in executor prompts.
|
|
205
|
+
|
|
206
|
+
**4. Verify worktree health:**
|
|
135
207
|
|
|
136
|
-
|
|
208
|
+
For each code repo registered in REPOS.md, verify the worktree is healthy:
|
|
137
209
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
210
|
+
```bash
|
|
211
|
+
HEALTH=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" worktrees health "${MILESTONE_SLUG}" 2>/dev/null || echo '{"healthy":true,"issues":[]}')
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
If the `worktrees health` subcommand is not available, perform inline checks:
|
|
215
|
+
|
|
216
|
+
For each repo in the worktree:
|
|
217
|
+
```bash
|
|
218
|
+
# Check branch
|
|
219
|
+
BRANCH=$(git -C "${WORKTREE_PATH}" rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
220
|
+
# Check clean state
|
|
221
|
+
STATUS=$(git -C "${WORKTREE_PATH}" status --porcelain 2>/dev/null)
|
|
222
|
+
```
|
|
142
223
|
|
|
143
|
-
If
|
|
224
|
+
If branch is wrong or uncommitted changes exist, **warn** but continue (quick sanity check, not a full health audit):
|
|
144
225
|
```
|
|
145
|
-
|
|
146
|
-
|
|
226
|
+
⚠ Worktree health warning for ${REPO_NAME}:
|
|
227
|
+
- Expected branch: milestone/${MILESTONE_SLUG}, actual: ${BRANCH}
|
|
228
|
+
- Has uncommitted changes
|
|
229
|
+
Continuing anyway — review worktree state after execution.
|
|
147
230
|
```
|
|
148
231
|
|
|
149
|
-
|
|
232
|
+
**5. Do NOT clear active_context after phase completion.**
|
|
233
|
+
|
|
234
|
+
The milestone worktree persists across all phases within the milestone until `complete-milestone` is run. active_context is NOT cleared in the post-execution steps of this workflow.
|
|
235
|
+
|
|
236
|
+
**Note on backward compatibility:**
|
|
237
|
+
The old `branching_strategy` check and `createRepoBranches` code path is removed. If `branching_strategy` is set to "phase" or "milestone" in an older config, the worktree path runs instead.
|
|
150
238
|
</step>
|
|
151
239
|
|
|
152
240
|
<step name="validate_phase">
|
|
@@ -202,7 +290,34 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
202
290
|
- Bad: "Executing terrain generation plan"
|
|
203
291
|
- Good: "Procedural terrain generator using Perlin noise — creates height maps, biome zones, and collision meshes. Required before vehicle physics can interact with ground."
|
|
204
292
|
|
|
205
|
-
2. **
|
|
293
|
+
2. **Execute plans for this wave:**
|
|
294
|
+
|
|
295
|
+
**If `NON_INTERACTIVE` is true (job mode — inline execution):**
|
|
296
|
+
|
|
297
|
+
The Task tool is not available in nested Task contexts (run-job spawns execute-phase, which would otherwise spawn dgs-executor — Claude Code structural limitation). Run plans inline within the current orchestrator context instead.
|
|
298
|
+
|
|
299
|
+
For each plan in the wave, **in document order** (plans within a wave still execute in the order they appear in the wave's plan list — even if `parallelization` is true, inline mode runs them sequentially because there is no parallel-Task harness):
|
|
300
|
+
|
|
301
|
+
a. Read `~/.claude/deliver-great-systems/workflows/execute-plan.md` and follow its steps inline for this plan, supplying:
|
|
302
|
+
- The plan path: `{phase_dir}/{plan_id}-PLAN.md`
|
|
303
|
+
- The state path: ${state_path} (resolved by init)
|
|
304
|
+
- The phase context file (if present): `{phase_dir}/{padded_phase}-CONTEXT.md`
|
|
305
|
+
- Project conventions: `./CLAUDE.md` (if exists) and `.claude/skills/` or `.agents/skills/` (if either exists)
|
|
306
|
+
- Tier files from $TIER_FILES (computed in initialize step)
|
|
307
|
+
- Author: ${author}
|
|
308
|
+
- Worktree context: when $WORKTREE_REPOS is non-empty, treat the worktree directories as the repo cwds for all task commits and file operations (do NOT use the main checkout paths).
|
|
309
|
+
|
|
310
|
+
b. Treat segmented plans (Pattern B in execute-plan.md `parse_segments`) as Pattern C / main-context for inline mode — i.e. execute every task in the orchestrator's current context. Do NOT spawn nested Tasks. Checkpoint tasks (`type="checkpoint:*"`) are auto-resolved per the `checkpoint_handling` step's `NON_INTERACTIVE`-true rules (human-verify → auto-approve, decision → first option, human-action → FAIL the step).
|
|
311
|
+
|
|
312
|
+
c. Preserve all execute-plan semantics: atomic per-task commits via `dgs-tools.cjs commit`, deviation handling per `<deviation_rules>` (Rules 1–3 auto, Rule 4 logged as deviation since no user is available — record under "Deferred Issues" in SUMMARY.md), authentication gates (in job mode, treat any auth gate as a hard failure — log and halt the wave), and run all of: `record_start_time`, `parse_segments`, `load_prompt`, `preflight_check`, `execute`, `record_completion_time`, `generate_user_setup`, `create_summary`, `update_current_position`, `extract_decisions_and_issues`, `update_session_continuity`, `issues_review_gate`, `finalize_plan`, `update_codebase_map`.
|
|
313
|
+
|
|
314
|
+
d. **Skip the `offer_next` step from execute-plan.md.** Wave/phase advancement is the responsibility of this `execute_waves` step in execute-phase.md, not the inline plan loop.
|
|
315
|
+
|
|
316
|
+
e. After each plan completes, run the same spot-checks defined in step 4 below (SUMMARY.md exists, git commits present, no `## Self-Check: FAILED` marker). If a plan fails the spot-check, log `[INLINE-EXEC] Plan {plan_id} failed spot-check -- halting wave` and halt the wave (do NOT continue to subsequent plans in the same wave).
|
|
317
|
+
|
|
318
|
+
f. After all plans in the wave complete successfully, fall through to step 4 (Report completion).
|
|
319
|
+
|
|
320
|
+
**If `NON_INTERACTIVE` is false (interactive mode — Task spawning):**
|
|
206
321
|
|
|
207
322
|
Pass paths only — executors read files themselves with their fresh 200k context.
|
|
208
323
|
This keeps orchestrator context lean (~10-15%).
|
|
@@ -217,6 +332,13 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
217
332
|
Commit each task atomically. Create SUMMARY.md. Update STATE.md and ROADMAP.md.
|
|
218
333
|
</objective>
|
|
219
334
|
|
|
335
|
+
${WORKTREE_REPOS && WORKTREE_REPOS !== '{}' ? `
|
|
336
|
+
<worktree_context>
|
|
337
|
+
This phase is executing in a git worktree. Work in these directories — do NOT use the main checkout paths:
|
|
338
|
+
${Object.entries(JSON.parse(WORKTREE_REPOS)).map(([name, dir]) => '- ' + name + ': ' + dir).join('\n ')}
|
|
339
|
+
</worktree_context>
|
|
340
|
+
` : ''}
|
|
341
|
+
|
|
220
342
|
<execution_context>
|
|
221
343
|
@~/.claude/deliver-great-systems/workflows/execute-plan.md
|
|
222
344
|
@~/.claude/deliver-great-systems/templates/summary.md
|
|
@@ -292,11 +414,28 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
292
414
|
|
|
293
415
|
If `CODEREVIEW` is not `true`: skip silently, proceed to next step.
|
|
294
416
|
|
|
295
|
-
**
|
|
296
|
-
|
|
297
|
-
|
|
417
|
+
**Derive code repo path:**
|
|
418
|
+
|
|
419
|
+
The gate's git log and the spawned codereview subagent must run against the **code repo** (where task commits live), not the planning repo. Derive `CODE_REPO_PATH` from `$WORKTREE_REPOS` (populated in `handle_worktree`, step 3):
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
CODE_REPO_PATH=$(WORKTREE_REPOS="$WORKTREE_REPOS" node -e "
|
|
423
|
+
const repos = JSON.parse(process.env.WORKTREE_REPOS || '{}');
|
|
424
|
+
const names = Object.keys(repos);
|
|
425
|
+
if (names.length === 0) { process.stdout.write(''); }
|
|
426
|
+
else { process.stdout.write(repos[names[0]]); }
|
|
427
|
+
")
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
If `CODE_REPO_PATH` is empty (no milestone worktree registered — e.g. phase executed without a worktree), skip the codereview gate entirely for this wave with the message:
|
|
431
|
+
```
|
|
432
|
+
No code repo registered for this phase — skipping code review for wave.
|
|
433
|
+
```
|
|
434
|
+
and proceed to the next step.
|
|
435
|
+
|
|
436
|
+
**Multi-repo note:** when `WORKTREE_REPOS` has more than one entry, this uses the first entry. Multi-repo codereview is a known limitation (TODO: loop over entries once a real multi-repo project exists).
|
|
298
437
|
|
|
299
|
-
|
|
438
|
+
The codereview workflow is non-interactive by design — it auto-fixes low-risk issues and logs CRITICAL/HIGH findings as deviations to SUMMARY.md rather than prompting. It runs in both interactive and job modes.
|
|
300
439
|
|
|
301
440
|
For each plan that completed successfully in this wave:
|
|
302
441
|
|
|
@@ -311,7 +450,7 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
311
450
|
|
|
312
451
|
Compute diff reference for the plan's task commits:
|
|
313
452
|
```bash
|
|
314
|
-
FIRST_TASK_COMMIT=$(git log --oneline --grep="feat(${PHASE}-${PLAN}):" --grep="fix(${PHASE}-${PLAN}):" --grep="test(${PHASE}-${PLAN}):" --grep="refactor(${PHASE}-${PLAN}):" --reverse | head -1 | cut -d' ' -f1)
|
|
453
|
+
FIRST_TASK_COMMIT=$(git -C "${CODE_REPO_PATH}" log --oneline --grep="feat(${PHASE}-${PLAN}):" --grep="fix(${PHASE}-${PLAN}):" --grep="test(${PHASE}-${PLAN}):" --grep="refactor(${PHASE}-${PLAN}):" --reverse | head -1 | cut -d' ' -f1)
|
|
315
454
|
```
|
|
316
455
|
|
|
317
456
|
If FIRST_TASK_COMMIT is empty (no task commits found), skip codereview for this plan with message: "No task commits found for {phase}-{plan}, skipping code review."
|
|
@@ -328,7 +467,10 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
|
|
|
328
467
|
- PLAN: ${PLAN}
|
|
329
468
|
- PLAN_PATH: ${phase_dir}/{phase}-{plan}-PLAN.md
|
|
330
469
|
- PHASE_DIR: ${phase_dir}
|
|
470
|
+
- CODE_REPO_PATH: ${CODE_REPO_PATH}
|
|
331
471
|
- DIFF_REF: ${FIRST_TASK_COMMIT}^..HEAD
|
|
472
|
+
- PROJECT_ROOT: ${project_root}
|
|
473
|
+
- PLANNING_ROOT: $(pwd)
|
|
332
474
|
",
|
|
333
475
|
model="{executor_model}"
|
|
334
476
|
)
|
|
@@ -488,6 +630,42 @@ node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs(phase-
|
|
|
488
630
|
<step name="verify_phase_goal">
|
|
489
631
|
Verify phase achieved its GOAL, not just completed tasks.
|
|
490
632
|
|
|
633
|
+
**If `NON_INTERACTIVE` is true (job mode — inline verification):**
|
|
634
|
+
|
|
635
|
+
The Task tool is not available in nested Task contexts (run-job → execute-phase → would otherwise spawn dgs-verifier). Perform verification inline within the current orchestrator context.
|
|
636
|
+
|
|
637
|
+
Inline verification procedure:
|
|
638
|
+
|
|
639
|
+
a. **Load phase context:**
|
|
640
|
+
- Phase goal: read from `${roadmap_path}` for phase `${PHASE_NUMBER}`.
|
|
641
|
+
- Phase requirement IDs: `${phase_req_ids}` (from init JSON).
|
|
642
|
+
- Phase directory: `${phase_dir}`.
|
|
643
|
+
|
|
644
|
+
b. **Read all plan SUMMARY.md files** in `${phase_dir}` matching `*-SUMMARY.md`. Cross-reference each SUMMARY's `requirements_completed` frontmatter against `${phase_req_ids}`. Every requirement ID listed in the phase MUST be accounted for in at least one SUMMARY.
|
|
645
|
+
|
|
646
|
+
c. **Read each PLAN.md** in `${phase_dir}` matching `*-PLAN.md` and extract the `must_haves` frontmatter (truths, artifacts, key_links).
|
|
647
|
+
|
|
648
|
+
d. **Check must_haves against the actual codebase:**
|
|
649
|
+
- For each artifact: confirm the file exists on disk (use $WORKTREE_REPOS to resolve repo paths when present; otherwise resolve via REPOS.md). If `min_lines` is specified, verify line count.
|
|
650
|
+
- For each key_link: grep the `from` file for the `pattern`. If pattern is missing, the link is unverified.
|
|
651
|
+
- For each truth: best-effort verification via grep / file existence; truths that require human UAT are marked `human_needed`.
|
|
652
|
+
|
|
653
|
+
e. **Cross-reference REQUIREMENTS.md:** every ID in `${phase_req_ids}` MUST appear in REQUIREMENTS.md with a status reflecting completion. Flag any ID missing from REQUIREMENTS.md as a gap.
|
|
654
|
+
|
|
655
|
+
f. **Determine status:**
|
|
656
|
+
- `passed` — all artifacts present, all key_links found, all truths automatically verified, all requirement IDs accounted for.
|
|
657
|
+
- `human_needed` — automated checks pass but ≥1 truth requires human UAT.
|
|
658
|
+
- `gaps_found` — ≥1 artifact missing, key_link unverified, requirement ID unaccounted for, or truth fails automated verification.
|
|
659
|
+
|
|
660
|
+
g. **Write `${phase_dir}/${PHASE_NUMBER}-VERIFICATION.md`** with frontmatter including `status:` (one of `passed` / `human_needed` / `gaps_found`), `phase:`, `verified_by: ${author}`, `verified_at: <ISO-8601 timestamp>`, and a `mode: inline` marker (so audits can distinguish inline from Task-based verification). Body sections: must-haves checklist (per plan), requirement-ID cross-check table, gaps list (if any), human_verification list (if status is `human_needed`).
|
|
661
|
+
|
|
662
|
+
h. Commit the VERIFICATION.md file:
|
|
663
|
+
```bash
|
|
664
|
+
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs(phase-${PHASE_NUMBER}): inline verification" --files ${phase_dir}/${PHASE_NUMBER}-VERIFICATION.md
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
**If `NON_INTERACTIVE` is false (interactive mode — Task spawning):**
|
|
668
|
+
|
|
491
669
|
```
|
|
492
670
|
Task(
|
|
493
671
|
prompt="Verify phase {phase_number} goal achievement.
|
|
@@ -570,10 +748,10 @@ Gap closure cycle: `/dgs:plan-phase {X} --gaps` reads VERIFICATION.md → create
|
|
|
570
748
|
</step>
|
|
571
749
|
|
|
572
750
|
<step name="update_roadmap">
|
|
573
|
-
**Mark phase
|
|
751
|
+
**Mark phase done, commit tracking files, and push — all atomically:**
|
|
574
752
|
|
|
575
753
|
```bash
|
|
576
|
-
|
|
754
|
+
FINALIZE=$(node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" phase finalize "${PHASE_NUMBER}" --push)
|
|
577
755
|
```
|
|
578
756
|
|
|
579
757
|
The CLI handles:
|
|
@@ -582,14 +760,12 @@ The CLI handles:
|
|
|
582
760
|
- Updating plan count to final
|
|
583
761
|
- Advancing STATE.md to next phase
|
|
584
762
|
- Updating REQUIREMENTS.md traceability
|
|
763
|
+
- **Committing** ROADMAP.md, STATE.md, REQUIREMENTS.md, and `${phase_dir}/*-VERIFICATION.md` in a single atomic commit
|
|
764
|
+
- Pushing (if sync_push=auto) in the same call
|
|
585
765
|
|
|
586
|
-
Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`.
|
|
587
|
-
|
|
588
|
-
```bash
|
|
589
|
-
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" commit "docs(phase-{X}): complete phase execution" --push --files ${roadmap_path} ${state_path} ${requirements_path} ${phase_dir}/*-VERIFICATION.md
|
|
590
|
-
```
|
|
766
|
+
Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`, `committed`, `hash`, `pushed`.
|
|
591
767
|
|
|
592
|
-
Parse the
|
|
768
|
+
Parse the result JSON. If `needs_push` is true (sync_push is "prompt" mode), handle push prompting via the existing sync_after step. If `pushed` is true, the push already happened atomically with the commit — skip the sync_after push for this commit (avoid double-push). If `pushed` is false and `push_result` exists, log the push warning but do not halt.
|
|
593
769
|
</step>
|
|
594
770
|
|
|
595
771
|
<step name="sync_after">
|
|
@@ -683,7 +859,7 @@ Read and follow `~/.claude/deliver-great-systems/workflows/transition.md`, passi
|
|
|
683
859
|
|
|
684
860
|
**HARD STOP.** The workflow ends here. Do NOT read transition.md. Do NOT read ROADMAP.md. Do NOT execute any additional phases.
|
|
685
861
|
|
|
686
|
-
**Use ONLY the `is_last_phase`, `next_phase`, and `next_phase_name` values from the `phase
|
|
862
|
+
**Use ONLY the `is_last_phase`, `next_phase`, and `next_phase_name` values from the `phase finalize` result in the update_roadmap step.** Do NOT read the roadmap or any other file to determine remaining phases — the CLI already computed this.
|
|
687
863
|
|
|
688
864
|
If `is_last_phase` is `false`:
|
|
689
865
|
```
|
|
@@ -318,6 +318,15 @@ TASK_COMMIT=$(git rev-parse --short HEAD)
|
|
|
318
318
|
TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}")
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
+
**6. Post-commit dirty sweep:** After recording the task commit hash, run `git status --porcelain` in every gitCwd the task touched. Resolve gitCwds via the task's `<repos>` tag + REPOS.md (one `resolveRepoRelativePath(cwd, repoName, '.', repos).repoAbsPath` per distinct repo); if the task has no `<repos>` tag, the single gitCwd is the planning root (or the `repo-cwd` override when set). The `dirty_after` field in the commit JSON result from `dgs-tools.cjs commit` already surfaces the list for the repo the commit ran in.
|
|
322
|
+
|
|
323
|
+
Classify each dirty path:
|
|
324
|
+
|
|
325
|
+
- **SWEEP** (`*.tfvars`/`*.tf` fmt reflows, pure whitespace verified by `git diff -w -- <path>` being empty, type-only narrowings in `*.ts`/`*.tsx` confined to type-position tokens on existing declaration lines — type annotations, `as`-casts, generic params; NOT statement-structure keywords like `const`/`await`/`import`): stage and commit as `chore({phase}-{plan}-reflow): verify-step side effects` with one bullet per file. Log under "Post-verify reflows" in SUMMARY.md.
|
|
326
|
+
- **FAIL** (added/removed statements, new imports, new function bodies, or any logic change in files NOT listed in the plan's `files_modified` frontmatter): halt. Record under "Deferred Issues" with a `git diff` excerpt. Treat as a blocking issue and auto-fix per the existing fix-attempt-limit policy (3 attempts then document and continue).
|
|
327
|
+
|
|
328
|
+
Default to SWEEP — false negatives lose work.
|
|
329
|
+
|
|
321
330
|
</task_commit>
|
|
322
331
|
|
|
323
332
|
<step name="checkpoint_protocol">
|
|
@@ -392,7 +401,7 @@ If user_setup exists: create `{phase}-USER-SETUP.md` using template `~/.claude/d
|
|
|
392
401
|
<step name="create_summary">
|
|
393
402
|
Create `{phase}-{plan}-SUMMARY.md` at `${phase_dir}/`. Use `~/.claude/deliver-great-systems/templates/summary.md`.
|
|
394
403
|
|
|
395
|
-
**Frontmatter:** phase, plan, subsystem, tags | requires/provides/affects | tech-stack.added/patterns | key-files.created/modified | key-decisions |
|
|
404
|
+
**Frontmatter:** phase, plan, subsystem, tags | requires/provides/affects | tech-stack.added/patterns | key-files.created/modified | key-decisions | requirements_completed (**MUST** copy `requirements` array from PLAN.md frontmatter verbatim — pre-commit precondition `dgs-tools final-commit-precondition` aborts the executor on mismatch per REL-08) | duration ($DURATION), completed ($PLAN_END_TIME date).
|
|
396
405
|
|
|
397
406
|
Include `executed_by: ${author}` (from init JSON) in frontmatter — records who triggered this execution.
|
|
398
407
|
|
|
@@ -452,25 +461,10 @@ Keep STATE.md under 150 lines.
|
|
|
452
461
|
If SUMMARY "Issues Encountered" ≠ "None": yolo → log and continue. Interactive → present issues, wait for acknowledgment.
|
|
453
462
|
</step>
|
|
454
463
|
|
|
455
|
-
<step name="
|
|
456
|
-
|
|
457
|
-
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" roadmap update-plan-progress "${PHASE}"
|
|
458
|
-
```
|
|
459
|
-
Counts PLAN vs SUMMARY files on disk. Updates progress table row with correct count and status (`In Progress` or `Complete` with date).
|
|
460
|
-
</step>
|
|
461
|
-
|
|
462
|
-
<step name="update_requirements">
|
|
463
|
-
Mark completed requirements from the PLAN.md frontmatter `requirements:` field:
|
|
464
|
+
<step name="finalize_plan">
|
|
465
|
+
**Update state/roadmap/requirements and commit plan metadata atomically.**
|
|
464
466
|
|
|
465
|
-
|
|
466
|
-
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" requirements mark-complete ${REQ_IDS}
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
Extract requirement IDs from the plan's frontmatter (e.g., `requirements: [AUTH-01, AUTH-02]`). If no requirements field, skip.
|
|
470
|
-
</step>
|
|
471
|
-
|
|
472
|
-
<step name="git_commit_metadata">
|
|
473
|
-
**Multi-repo guard:** If any task used `commit --multi-repo` and returned `success: false`, display a warning before committing planning metadata:
|
|
467
|
+
**Multi-repo guard:** If any task used `commit --multi-repo` and returned `success: false`, display a warning before finalizing:
|
|
474
468
|
|
|
475
469
|
```
|
|
476
470
|
Warning: Some repo commits failed. Planning metadata will still be committed to track partial progress.
|
|
@@ -479,11 +473,17 @@ Check SUMMARY.md status field for per-repo details.
|
|
|
479
473
|
|
|
480
474
|
The planning metadata commit proceeds regardless (to track partial progress), but the warning ensures visibility. The SUMMARY.md `status: partial` field records which repos failed.
|
|
481
475
|
|
|
482
|
-
Task code already committed per-task. Commit plan metadata:
|
|
483
|
-
|
|
484
476
|
```bash
|
|
485
|
-
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs"
|
|
477
|
+
node "$HOME/.claude/deliver-great-systems/bin/dgs-tools.cjs" plan finalize "${PHASE}" "${PLAN}"
|
|
486
478
|
```
|
|
479
|
+
|
|
480
|
+
The CLI handles (in one atomic call):
|
|
481
|
+
- `roadmap update-plan-progress` (progress table, status, date, checkbox)
|
|
482
|
+
- `requirements mark-complete` (from PLAN.md `requirements:` frontmatter — auto-extracted)
|
|
483
|
+
- `state update-progress` (global progress bar, idempotent with `record_metrics`)
|
|
484
|
+
- Commits `{phase}-{plan}-PLAN.md`, `{phase}-{plan}-SUMMARY.md`, `STATE.md`, `ROADMAP.md`, `REQUIREMENTS.md` with message `docs({phase}-{plan}): complete {plan-name} plan`
|
|
485
|
+
|
|
486
|
+
The plan name is auto-extracted from the PLAN.md `plan_name` frontmatter field (fallback: "execution"). To override, add `--plan-name "<name>"` to the call.
|
|
487
487
|
</step>
|
|
488
488
|
|
|
489
489
|
<step name="update_codebase_map">
|