devflow-kit 3.7.0 → 3.8.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 (184) hide show
  1. package/CHANGELOG.md +359 -1
  2. package/README.md +11 -11
  3. package/dist/agents/code.md +2 -4
  4. package/dist/agents/design.md +1 -1
  5. package/dist/agents/fix.md +6 -7
  6. package/dist/agents/git.md +1 -1
  7. package/dist/agents/harden.md +1 -1
  8. package/dist/agents/refactor.md +2 -4
  9. package/dist/agents/review.md +4 -4
  10. package/dist/agents/skim.md +2 -2
  11. package/dist/agents/triage.md +2 -2
  12. package/dist/cli/commands/capture.js +1 -1
  13. package/dist/cli/commands/curation-move-io.js +102 -0
  14. package/dist/cli/commands/curation-move-step.js +374 -0
  15. package/dist/cli/commands/{learning.js → curation.js} +302 -99
  16. package/dist/cli/commands/gate-level-prompts.js +426 -0
  17. package/dist/cli/commands/gates.js +34 -11
  18. package/dist/cli/commands/init-seed.js +11 -8
  19. package/dist/cli/commands/init.js +240 -54
  20. package/dist/cli/commands/memory.js +2 -2
  21. package/dist/cli/commands/prompt-io.js +37 -0
  22. package/dist/cli/commands/uninstall.js +81 -9
  23. package/dist/cli.js +2 -2
  24. package/dist/commands/bug-analysis.md +24 -35
  25. package/dist/commands/code-review.md +32 -36
  26. package/dist/commands/debug.md +4 -4
  27. package/dist/commands/dynamic-build.md +25 -24
  28. package/dist/commands/dynamic-plan.md +4 -4
  29. package/dist/commands/dynamic-profile.md +4 -4
  30. package/dist/commands/dynamic-tickets.md +4 -4
  31. package/dist/commands/explore.md +5 -5
  32. package/dist/commands/implement.md +52 -81
  33. package/dist/commands/plan.md +5 -5
  34. package/dist/commands/release.md +4 -4
  35. package/dist/commands/research.md +5 -5
  36. package/dist/commands/resolve.md +28 -30
  37. package/dist/commands/self-review.md +4 -12
  38. package/dist/core/assets.js +20 -20
  39. package/dist/core/curate-tuning-config.js +5 -6
  40. package/dist/core/curation-move-notice.js +84 -0
  41. package/dist/core/curation-move-skip.js +36 -0
  42. package/dist/core/curation-move.js +35 -0
  43. package/dist/core/curation-queue-cleanup.js +134 -0
  44. package/dist/core/curation-store.js +98 -0
  45. package/dist/core/{learning-variants.js → curation-variants.js} +65 -41
  46. package/dist/core/echo-value.js +11 -5
  47. package/dist/core/evidence-policy.js +1 -1
  48. package/dist/core/feature-switch.js +95 -19
  49. package/dist/core/fs-atomic.js +1 -1
  50. package/dist/core/gate-level.js +10 -2
  51. package/dist/core/git.js +16 -14
  52. package/dist/core/ledger-root.js +82 -22
  53. package/dist/core/linked-path.js +4 -4
  54. package/dist/core/manifest-lock.js +238 -0
  55. package/dist/core/manifest.js +58 -14
  56. package/dist/core/migrations.js +1 -13
  57. package/dist/core/observations.js +2 -2
  58. package/dist/core/plugins.js +15 -15
  59. package/dist/core/pool.js +26 -0
  60. package/dist/core/project-paths.js +103 -34
  61. package/dist/core/queue-drain.js +2 -2
  62. package/dist/core/tracked-areas.js +35 -0
  63. package/dist/core/tracker.js +1 -1
  64. package/dist/{learning-off → curation-off}/agents/code.md +2 -4
  65. package/dist/{learning-off → curation-off}/agents/fix.md +6 -7
  66. package/dist/{learning-off → curation-off}/agents/refactor.md +2 -4
  67. package/dist/{learning-off → curation-off}/agents/review.md +3 -3
  68. package/dist/{learning-off → curation-off}/agents/triage.md +1 -1
  69. package/dist/{learning-off → curation-off}/commands/bug-analysis.md +20 -31
  70. package/dist/{learning-off → curation-off}/commands/code-review.md +29 -33
  71. package/dist/{learning-off → curation-off}/commands/debug.md +1 -1
  72. package/dist/{learning-off → curation-off}/commands/dynamic-build.md +22 -21
  73. package/dist/{learning-off → curation-off}/commands/explore.md +1 -1
  74. package/dist/{learning-off → curation-off}/commands/implement.md +49 -78
  75. package/dist/{learning-off → curation-off}/commands/plan.md +1 -1
  76. package/dist/{learning-off → curation-off}/commands/resolve.md +25 -27
  77. package/dist/{learning-off → curation-off}/commands/self-review.md +1 -9
  78. package/dist/hud/components/{learning-counts.js → curation-counts.js} +36 -17
  79. package/dist/hud/config.js +1 -1
  80. package/dist/hud/index.js +6 -6
  81. package/dist/hud/render.js +3 -3
  82. package/dist/skills/git/references/pr/validate-branch.md +8 -5
  83. package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +13 -5
  84. package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +13 -5
  85. package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +13 -5
  86. package/dist/targets/claude-code/{learning-install.js → curation-install.js} +85 -65
  87. package/dist/targets/claude-code/installer.js +15 -15
  88. package/dist/targets/claude-code/language-stamp.js +5 -5
  89. package/dist/targets/claude-code/post-install.js +2 -2
  90. package/dist/targets/claude-code/tracker-servers.js +1 -1
  91. package/package.json +3 -2
  92. package/src/assets/agents/_partials/_code.mds +11 -11
  93. package/src/assets/agents/code.mds +2 -2
  94. package/src/assets/agents/curate.md +8 -8
  95. package/src/assets/agents/debug.mds +6 -6
  96. package/src/assets/agents/design.mds +18 -18
  97. package/src/assets/agents/fix.mds +6 -5
  98. package/src/assets/agents/git.mds +1 -1
  99. package/src/assets/agents/harden.mds +7 -7
  100. package/src/assets/agents/knowledge.mds +23 -23
  101. package/src/assets/agents/refactor.mds +2 -2
  102. package/src/assets/agents/research.mds +15 -15
  103. package/src/assets/agents/review.mds +43 -43
  104. package/src/assets/agents/skim.mds +11 -11
  105. package/src/assets/agents/triage.mds +22 -22
  106. package/src/assets/agents/validate.md +13 -26
  107. package/src/assets/commands/_partials/_decisions.mds +13 -13
  108. package/src/assets/commands/_partials/_engine.mds +8 -8
  109. package/src/assets/commands/_partials/_knowledge.mds +29 -15
  110. package/src/assets/commands/_partials/_preamble.mds +4 -4
  111. package/src/assets/commands/_partials/_settings.mds +2 -2
  112. package/src/assets/commands/_partials/_wave.mds +7 -7
  113. package/src/assets/commands/bug-analysis.mds +37 -48
  114. package/src/assets/commands/code-review.mds +46 -50
  115. package/src/assets/commands/debug.mds +14 -14
  116. package/src/assets/commands/dynamic-build.mds +38 -37
  117. package/src/assets/commands/dynamic-plan.mds +22 -22
  118. package/src/assets/commands/dynamic-profile.mds +2 -2
  119. package/src/assets/commands/dynamic-tickets.mds +8 -8
  120. package/src/assets/commands/explore.mds +20 -20
  121. package/src/assets/commands/implement.mds +77 -98
  122. package/src/assets/commands/plan.mds +27 -27
  123. package/src/assets/commands/release.mds +12 -12
  124. package/src/assets/commands/research.mds +19 -19
  125. package/src/assets/commands/resolve.mds +56 -50
  126. package/src/assets/commands/self-review.mds +20 -20
  127. package/src/assets/mds/git/_ops.mds +3 -1
  128. package/src/assets/mds/git/_ops_pr.mds +1 -1
  129. package/src/assets/mds/git/_ops_steps.mds +10 -4
  130. package/src/assets/mds/git/_pr.mds +7 -4
  131. package/src/assets/rules/quality.md +1 -0
  132. package/src/assets/scripts/hooks/background-memory-update +2 -2
  133. package/src/assets/scripts/hooks/capture-prompt +12 -12
  134. package/src/assets/scripts/hooks/capture-question +11 -11
  135. package/src/assets/scripts/hooks/capture-turn +12 -12
  136. package/src/assets/scripts/hooks/{learning-lock → curation-lock} +2 -2
  137. package/src/assets/scripts/hooks/curation-move +293 -0
  138. package/src/assets/scripts/hooks/ensure-devflow-init +45 -13
  139. package/src/assets/scripts/hooks/ensure-proxy +4 -4
  140. package/src/assets/scripts/hooks/ensure-root-gitignore +4 -4
  141. package/src/assets/scripts/hooks/git-marker +81 -0
  142. package/src/assets/scripts/hooks/json-helper.cjs +134 -51
  143. package/src/assets/scripts/hooks/json-parse +1 -1
  144. package/src/assets/scripts/hooks/lib/curation-move.cjs +1582 -0
  145. package/src/assets/scripts/hooks/lib/{learning-store.cjs → curation-store.cjs} +242 -118
  146. package/src/assets/scripts/hooks/lib/decisions-format.cjs +3 -3
  147. package/src/assets/scripts/hooks/lib/mkdir-lock.cjs +24 -7
  148. package/src/assets/scripts/hooks/lib/project-paths.cjs +132 -39
  149. package/src/assets/scripts/hooks/lib/render-decisions.cjs +34 -22
  150. package/src/assets/scripts/hooks/lib/tracked-areas.cjs +259 -0
  151. package/src/assets/scripts/hooks/memory-worker +1 -1
  152. package/src/assets/scripts/hooks/pre-compact-memory +6 -16
  153. package/src/assets/scripts/hooks/queue-append +228 -103
  154. package/src/assets/scripts/hooks/resolve-project-root +2 -2
  155. package/src/assets/scripts/hooks/session-start-context +143 -69
  156. package/src/assets/scripts/hooks/session-start-memory +3 -43
  157. package/src/assets/scripts/lib/project-config.cjs +12 -5
  158. package/src/assets/scripts/resolve-base.cjs +1043 -0
  159. package/src/assets/scripts/resolve-settings.cjs +42 -18
  160. package/src/assets/skills/agent-references/SKILL.md +5 -2
  161. package/src/assets/skills/agent-references/references/commands/implement-levels.md +27 -0
  162. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +6 -4
  163. package/src/assets/skills/agent-references/references/commands/resolve-levels.md +24 -0
  164. package/src/assets/skills/apply-decisions/SKILL.md +1 -1
  165. package/src/assets/skills/docs-framework/SKILL.md +7 -7
  166. package/src/assets/skills/docs-framework/references/patterns.md +3 -4
  167. package/src/assets/skills/quality-gates/SKILL.md +1 -1
  168. package/src/assets/skills/worktree-support/references/roots.md +2 -2
  169. package/templates/lint-pack/.lint-pack.conf +86 -0
  170. package/templates/lint-pack/README.md +190 -0
  171. package/templates/lint-pack/lint-pack.sh +905 -0
  172. package/dist/core/learning-queue-cleanup.js +0 -27
  173. package/dist/core/learning-store.js +0 -61
  174. /package/dist/{learning-off → curation-off}/agents/debug.md +0 -0
  175. /package/dist/{learning-off → curation-off}/agents/design.md +0 -0
  176. /package/dist/{learning-off → curation-off}/agents/harden.md +0 -0
  177. /package/dist/{learning-off → curation-off}/agents/knowledge.md +0 -0
  178. /package/dist/{learning-off → curation-off}/agents/research.md +0 -0
  179. /package/dist/{learning-off → curation-off}/agents/skim.md +0 -0
  180. /package/dist/{learning-off → curation-off}/commands/dynamic-plan.md +0 -0
  181. /package/dist/{learning-off → curation-off}/commands/dynamic-profile.md +0 -0
  182. /package/dist/{learning-off → curation-off}/commands/dynamic-tickets.md +0 -0
  183. /package/dist/{learning-off → curation-off}/commands/release.md +0 -0
  184. /package/dist/{learning-off → curation-off}/commands/research.md +0 -0
@@ -9,7 +9,7 @@ output-dir: dist/commands
9
9
  @import "./_partials/_settings.mds" as settings
10
10
  # Bug Analysis Command
11
11
 
12
- Run a proactive bug analysis on the current branch by combining static analysis tools with parallel semantic analyzers, then synthesizing results into an actionable bug report. Supports incremental analysis, timestamped report directories, and `/resolve` compatibility.
12
+ Run a proactive bug analysis on the current branch by combining static analysis tools with parallel semantic analyzers, then synthesizing results into an actionable bug report.
13
13
 
14
14
  ## Usage
15
15
 
@@ -47,16 +47,16 @@ Agent(subagent_type="Git", run_in_background=false):
47
47
  PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK verbatim, or (none)}
48
48
  APPLY_CONVENTIONS: {APPLY_CONVENTIONS}
49
49
  Validate branch, commit if needed, push, create PR if needed.
50
- Return: branch, base_branch, branch-slug, PR#"
50
+ Return: branch, base_branch, base_ref, branch-slug, PR#"
51
51
  ```
52
52
 
53
- **Extract from response:** `branch`, `base_branch`, `branch_slug`, `pr_number`.
53
+ **Extract from response:** `branch`, `base_branch`, `base_ref`, `branch_slug`, `pr_number`. Stop with cause and fix when the Base line reads (rejected) or `branch_slug` does not match the slug pattern above; name the Git agent's fix, never your own, and for the slug the allowed characters, never its value.
54
54
 
55
55
  **Fetch PR body** (after extracting `pr_number`):
56
56
  ```bash
57
57
  PR_DESCRIPTION=$(gh pr view {pr_number} --json body --jq '.body' 2>/dev/null || echo "(none)")
58
58
  ```
59
- If `pr_number` is absent or the command fails, set `PR_DESCRIPTION` to `(none)`.
59
+ If `pr_number` is absent, set `PR_DESCRIPTION` to `(none)`.
60
60
 
61
61
  ### Phase 2: Static Analysis
62
62
 
@@ -67,14 +67,15 @@ If `pr_number` is absent or the command fails, set `PR_DESCRIPTION` to `(none)`.
67
67
  **Produces:** DIFF_RANGE, ANALYSIS_DIR
68
68
  **Requires:** BRANCH_INFO
69
69
 
70
- 1. Check `{worktree}/.devflow/docs/bug-analysis/{branch-slug}/.last-analysis-head`:
70
+ 1. Check `{gd}/devflow/bug-analysis/{branch-slug}/.last-analysis-head`, `{gd}` being what `git -C "{worktree}" rev-parse --absolute-git-dir` prints:
71
71
  - **If exists AND `--full` NOT set:**
72
- - Read the SHA from the file
73
- - Verify reachable: `git cat-file -t {sha}` — if exit code non-zero (rebase invalidated SHA), fall through to full
72
+ - The stored analysis head is checked as a commit ID: use it only when it is exactly 40 or 64 lowercase hex, else take the full-range path
73
+ - Verify reachable: `git -C "{worktree}" cat-file -t {sha}` must print `commit`; if not (rebase invalidated SHA), take the full-range path
74
74
  - If SHA == current HEAD → "No new commits since last analysis. Use --full for a full re-analysis." Stop.
75
75
  - Set `DIFF_RANGE` to `{sha}...HEAD`
76
- - **If not exists, unreachable SHA, or `--full`:**
77
- - Set `DIFF_RANGE` to `{base_branch}...HEAD`
76
+ - **Full-range path (no marker, or `--full`):**
77
+ - Stop as for a (rejected) Base line unless `base_ref` is 40 or 64 hex.
78
+ - Set `DIFF_RANGE` to `{base_ref}...HEAD`
78
79
  2. Generate timestamp: `YYYY-MM-DD_HHMM`. If directory already exists (same-minute collision), append seconds (`YYYY-MM-DD_HHMMSS`).
79
80
  3. Create timestamped analysis directory: `mkdir -p "{worktree}/.devflow/docs/bug-analysis/{branch-slug}/{timestamp}/"`
80
81
  4. Set `ANALYSIS_DIR` to that path.
@@ -87,7 +88,7 @@ If `pr_number` is absent or the command fails, set `PR_DESCRIPTION` to `(none)`.
87
88
  CHANGED_FILES=$(git diff --name-only {DIFF_RANGE})
88
89
  ```
89
90
 
90
- Store result as `CHANGED_FILES` — used throughout Steps 2d and Phase 4 to avoid repeated git invocations and ensure consistency.
91
+ Store as `CHANGED_FILES`; Steps 2d and Phase 4 read it. A non-zero diff exit stops.
91
92
 
92
93
  If output is empty → "No changes to analyze." Stop.
93
94
 
@@ -116,7 +117,7 @@ Skip if `--no-static` flag provided or all tools unavailable.
116
117
 
117
118
  Run available tools on the changed files (from `CHANGED_FILES` computed in Step 2b).
118
119
 
119
- **Semgrep and Snyk run in parallel** — launch both in the background, then wait for both before proceeding to CodeQL. CodeQL is conditional and sequential (it needs Semgrep/Snyk results to decide whether to run).
120
+ **Semgrep and Snyk run in parallel** — launch both in the background, then wait for both before proceeding to CodeQL. CodeQL is conditional and sequential.
120
121
 
121
122
  **Semgrep** (if available):
122
123
  ```bash
@@ -127,11 +128,9 @@ Parse SARIF output → extract findings.
127
128
 
128
129
  **Snyk Code** (if available):
129
130
  ```bash
130
- # Run a single project-level scan; filter SARIF results programmatically to CHANGED_FILES before LLM processing.
131
- # Per-file invocation via xargs would invoke snyk O(n) times and --file is for dependency scanning, not source code.
131
+ # One project-level scan (a per-file xargs run would invoke snyk O(n) times; --file is for dependency scans).
132
132
  SNYK_SARIF=$(timeout 300 snyk code test --sarif 2>/dev/null)
133
- # Programmatic filter: keep only results whose file path appears in CHANGED_FILES.
134
- # This is defense-in-depth — filtering at the data layer before the LLM agent sees any output.
133
+ # Programmatic filter: keep only results whose file path is in CHANGED_FILES — defense-in-depth, before the LLM agent sees any output.
135
134
  SNYK_FILTERED=$(echo "$SNYK_SARIF" | jq --argjson files "$(echo "$CHANGED_FILES" | jq -R . | jq -s .)" \
136
135
  '.runs[].results |= map(select(.locations[].physicalLocation.artifactLocation.uri as $uri | $files | index($uri) != null))' \
137
136
  2>/dev/null || echo "$SNYK_SARIF")
@@ -157,7 +156,7 @@ trap - EXIT INT TERM
157
156
  ```
158
157
  Parse `CODEQL_SARIF` → extract findings. If database creation fails, `CODEQL_EXIT` is non-zero — skip CodeQL findings and note it. The `trap` guarantees cleanup on SIGTERM/SIGINT/EXIT so orphaned temp directories do not accumulate across interrupted sessions.
159
158
 
160
- **Normalize** all findings to unified table, cap at top 50 by severity. Truncate each Description entry to 200 characters maximum to bound the serialized size of `STATIC_FINDINGS`:
159
+ **Normalize** all findings to unified table, cap at top 50 by severity. Truncate each Description entry to 200 characters maximum:
161
160
 
162
161
  | Tool | File:Line | CWE | Severity | Title | Description |
163
162
  |------|-----------|-----|----------|-------|-------------|
@@ -169,18 +168,18 @@ If no tool produced findings: set `STATIC_FINDINGS` to `(none)`.
169
168
 
170
169
  ### Phase 3: Context Loading
171
170
 
172
- <!-- learning:on -->
171
+ <!-- curation:on -->
173
172
  **Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PLAN_CONTEXT, ACCEPTANCE_RULES
174
- <!-- learning:off -->
173
+ <!-- curation:off -->
175
174
  **Produces:** FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PLAN_CONTEXT, ACCEPTANCE_RULES
176
- <!-- learning:end -->
175
+ <!-- curation:end -->
177
176
 
178
- <!-- learning:on -->
177
+ <!-- curation:on -->
179
178
  #### Decisions Index
180
179
 
181
180
  {{settings.settings_resolve()}}
182
181
 
183
- <!-- learning:end -->
182
+ <!-- curation:end -->
184
183
  {{decisions_load()}}
185
184
  #### Feature Knowledge
186
185
 
@@ -211,11 +210,11 @@ Determine which focus analyzers to run using `CHANGED_FILES` (already computed i
211
210
  ### Phase 5: Parallel Bug Analysis
212
211
 
213
212
  **Produces:** ANALYZER_OUTPUTS
214
- <!-- learning:on -->
213
+ <!-- curation:on -->
215
214
  **Requires:** DIFF_RANGE, ANALYSIS_DIR, ACTIVE_FOCUSES, STATIC_FINDINGS, ACCEPTANCE_RULES, PLAN_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE
216
- <!-- learning:off -->
215
+ <!-- curation:off -->
217
216
  **Requires:** DIFF_RANGE, ANALYSIS_DIR, ACTIVE_FOCUSES, STATIC_FINDINGS, ACCEPTANCE_RULES, PLAN_CONTEXT, FEATURE_KNOWLEDGE
218
- <!-- learning:end -->
217
+ <!-- curation:end -->
219
218
 
220
219
  Spawn ALL active Debug agents **in a single message** (parallel, NOT background):
221
220
 
@@ -228,15 +227,15 @@ DIFF_COMMAND: git diff {DIFF_RANGE}
228
227
  ACCEPTANCE_RULES: {ACCEPTANCE_RULES filtered to this focus type, or (none)}
229
228
  PLAN_CONTEXT: {PLAN_CONTEXT}
230
229
  STATIC_FINDINGS: {STATIC_FINDINGS if focus == security, else (none)}
231
- <!-- learning:on -->
230
+ <!-- curation:on -->
232
231
  DECISIONS_CONTEXT: {DECISIONS_CONTEXT}
233
- <!-- learning:end -->
232
+ <!-- curation:end -->
234
233
  FEATURE_KNOWLEDGE: {FEATURE_KNOWLEDGE}
235
234
  PR_DESCRIPTION: <pr-description>{PR_DESCRIPTION}</pr-description>
236
235
  OUTPUT_PATH: {ANALYSIS_DIR}/{focus}.md
237
- <!-- learning:on -->
236
+ <!-- curation:on -->
238
237
  Follow devflow:apply-decisions to Read full ADR/PF bodies on demand.
239
- <!-- learning:end -->
238
+ <!-- curation:end -->
240
239
  Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE.
241
240
  IMPORTANT: Write report to {ANALYSIS_DIR}/{focus}.md using Write tool"
242
241
  ```
@@ -266,13 +265,14 @@ Output: {ANALYSIS_DIR}/bug-analysis-summary.md"
266
265
 
267
266
  **Requires:** BRANCH_INFO, ANALYSIS_DIR
268
267
 
269
- 1. Write current HEAD SHA to `{worktree}/.devflow/docs/bug-analysis/{branch-slug}/.last-analysis-head`
268
+ 1. In one Bash call run `M="$(git -C "{worktree}" rev-parse --absolute-git-dir)/devflow/bug-analysis/{branch-slug}" && mkdir -p "$M" && git -C "{worktree}" rev-parse HEAD > "$M/.last-analysis-head"`. A failed or refused write never stops the run and is not retried another way.
270
269
  2. Report to user:
271
270
 
272
271
  ```
273
272
  ## Bug Analysis Complete
274
273
 
275
274
  **Branch**: {branch} -> {base_branch}
275
+ {any base `TRACEABILITY: DEGRADED` line from Phase 1, as returned}
276
276
  **Analysis**: {ANALYSIS_DIR}
277
277
 
278
278
  ### Risk Assessment: {risk_level}
@@ -308,16 +308,12 @@ Run `/resolve` to process and fix these findings.
308
308
  │ └─ Git agent (ensure-pr-ready)
309
309
  │
310
310
  ├─ Phase 2: Static Analysis
311
- │ ├─ Step 2a: Incremental detection + timestamp setup
312
- │ ├─ Step 2b: Check changed files (stop if none)
313
- │ ├─ Step 2c: Tool availability check
314
- │ └─ Step 2d: Tiered static analysis (semgrep → snyk → codeql)
315
- │ Write static-findings.md
311
+ │ └─ 2a incremental range, 2b changed files (stop if none), 2c tools, 2d semgrep → snyk → codeql
316
312
  │
317
313
  ├─ Phase 3: Context Loading
318
- <!-- learning:on -->
314
+ <!-- curation:on -->
319
315
  │ ├─ index.md (pre-rendered) → DECISIONS_CONTEXT
320
- <!-- learning:end -->
316
+ <!-- curation:end -->
321
317
  │ ├─ Feature knowledge load → FEATURE_KNOWLEDGE
322
318
  │ └─ {worktree}/.devflow/docs/design/*.md → PLAN_CONTEXT + ACCEPTANCE_RULES
323
319
  │
@@ -325,10 +321,7 @@ Run `/resolve` to process and fix these findings.
325
321
  │ └─ Detect active focuses (security + functional always; integration + usability conditional)
326
322
  │
327
323
  ├─ Phase 5: Bug Analysis (PARALLEL)
328
- │ ├─ Debug agent: security (+ STATIC_FINDINGS)
329
- │ ├─ Debug agent: functional
330
- │ ├─ Debug agent: integration (conditional)
331
- │ └─ Debug agent: usability (conditional)
324
+ │ └─ Debug agent per active focus (security also reads STATIC_FINDINGS)
332
325
  │
333
326
  ├─ Phase 6: Synthesis
334
327
  │ └─ Synthesize agent (mode: bug-analysis)
@@ -344,16 +337,12 @@ Run `/resolve` to process and fix these findings.
344
337
  |------|----------|
345
338
  | No new commits since last analysis | Stop: "No new commits since last analysis. Use --full for a full re-analysis." |
346
339
  | Rebase invalidates `.last-analysis-head` SHA | `git cat-file -t` check fails → fallback to full diff |
347
- | Zero changed files in DIFF_RANGE | Stop: "No changes to analyze." |
340
+ | Zero changed files in DIFF_RANGE with exit 0 | Stop: "No changes to analyze." |
348
341
  | Same-minute analysis collision | `mkdir` with seconds suffix (`YYYY-MM-DD_HHMMSS`) |
349
342
  | All static tools unavailable | Warn, proceed with semantic-only analysis |
350
343
  | `--no-static` flag | Skip Phase 2c and 2d entirely; `STATIC_FINDINGS=(none)` |
351
344
  | `--full` flag | Bypass incremental detection (Step 2a), run full diff from base |
352
345
  | CodeQL database creation fails | Skip CodeQL, note in output, continue with other tools |
353
- | Static tool produces no findings | `STATIC_FINDINGS=(none)` — normal, proceed with semantic analysis |
354
- | No plan artifact found | `PLAN_CONTEXT=(none)`, `ACCEPTANCE_RULES=(none)` — proceed without acceptance criteria |
355
- | `integration` focus skipped | Not spawned when only 1 directory changed |
356
- | `usability` focus skipped | Not spawned when no UI files changed |
357
346
 
358
347
  ## Resolve Compatibility
359
348
 
@@ -374,11 +363,11 @@ Before reporting results, verify every phase was executed:
374
363
 
375
364
  - [ ] Phase 1: Pre-flight → BRANCH_INFO captured, PR_DESCRIPTION fetched (or `(none)`)
376
365
  - [ ] Phase 2: Static Analysis → STATIC_FINDINGS captured (or `(none)` if skipped/no tools/no findings); ANALYSIS_DIR created; CHANGED_FILES populated
377
- <!-- learning:on -->
366
+ <!-- curation:on -->
378
367
  - [ ] Phase 3: Context Loading → DECISIONS_CONTEXT captured, FEATURE_KNOWLEDGE loaded (or `(none)`), PLAN_CONTEXT and ACCEPTANCE_RULES captured (or `(none)`)
379
- <!-- learning:off -->
368
+ <!-- curation:off -->
380
369
  - [ ] Phase 3: Context Loading → FEATURE_KNOWLEDGE loaded (or `(none)`), PLAN_CONTEXT and ACCEPTANCE_RULES captured (or `(none)`)
381
- <!-- learning:end -->
370
+ <!-- curation:end -->
382
371
  - [ ] Phase 4: File Analysis → ACTIVE_FOCUSES determined (security + functional always present)
383
372
  - [ ] Phase 5: Parallel Bug Analysis → ANALYZER_OUTPUTS captured per active focus; all reports written to ANALYSIS_DIR
384
373
  - [ ] Phase 6: Synthesis → BUG_ANALYSIS_SUMMARY written to `{ANALYSIS_DIR}/bug-analysis-summary.md`
@@ -10,7 +10,7 @@ output-dir: dist/commands
10
10
  @import "./_partials/_settings.mds" as settings
11
11
  # Code Review Command
12
12
 
13
- Run a comprehensive code review of the current branch by spawning parallel review agents, then synthesizing results into PR comments. Supports incremental reviews, timestamped report directories, and multi-worktree auto-discovery.
13
+ Run a comprehensive code review of the current branch by spawning parallel review agents, then synthesizing results into PR comments.
14
14
 
15
15
  ## Usage
16
16
 
@@ -34,8 +34,8 @@ Run a comprehensive code review of the current branch by spawning parallel revie
34
34
  - **More than one listed:** Invoke the `devflow:worktree-support` skill, then Read its `references/discovery.md` from the skill's base directory for the full 7-step algorithm; the canonical protected branch list stays in the skill. Parse the list, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit
35
35
  - **Exactly one listed:** load neither the skill nor the reference — that worktree is the only candidate, and Step 0c's Git agent validates its branch
36
36
  2. **If `--path` flag provided:** use only that worktree, skip discovery
37
- **`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop.
38
- 3. **If only 1 reviewable worktree**: proceed as single-worktree flow — zero behavior change
37
+ **`--path` validation**: the path must be a directory in `git worktree list` output; if not, report an error and stop.
38
+ 3. **If only 1 reviewable worktree**: proceed as single-worktree flow
39
39
  4. **If multiple reviewable worktrees:** report "Found N worktrees with reviewable branches: {list with paths and branches}" and proceed with multi-worktree flow
40
40
 
41
41
  #### Step 0b: Resolve the compliance lens and gate level
@@ -84,20 +84,20 @@ PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
84
84
  PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK verbatim, or (none)}
85
85
  APPLY_CONVENTIONS: {APPLY_CONVENTIONS}
86
86
  Validate branch, commit if needed, push, create PR if needed.
87
- Return: branch, base_branch, branch-slug, PR#"
87
+ Return: branch, base_branch, base_ref, branch-slug, PR#"
88
88
  ```
89
89
 
90
90
  In multi-worktree mode, spawn all pre-flight agents **in a single message**.
91
91
 
92
92
  **If BLOCKED:** In single-worktree mode, stop and report. In multi-worktree mode, report the failure but continue with other worktrees.
93
93
 
94
- **Extract from response:** `branch`, `base_branch`, `branch_slug`, `pr_number` per worktree.
94
+ **Extract from response:** `branch`, `base_branch`, `base_ref`, `branch_slug`, `pr_number` per worktree. Stop with cause and fix when the Base line reads (rejected) or `branch_slug` does not match the slug pattern above; name the Git agent's fix, never your own, and for the slug the allowed characters, never its value. In multi-worktree mode this blocks only that worktree.
95
95
 
96
96
  **Fetch PR body** (after extracting `pr_number`):
97
97
  ```bash
98
98
  PR_DESCRIPTION=$(gh pr view {pr_number} --json body --jq '.body' 2>/dev/null || echo "(none)")
99
99
  ```
100
- If `pr_number` is absent or the command fails, set `PR_DESCRIPTION` to `(none)`.
100
+ If `pr_number` is absent, set `PR_DESCRIPTION` to `(none)`.
101
101
 
102
102
  #### Step 0d: Incremental Detection & Timestamp Setup
103
103
 
@@ -107,15 +107,16 @@ If `pr_number` is absent or the command fails, set `PR_DESCRIPTION` to `(none)`.
107
107
  For each worktree:
108
108
 
109
109
  1. Generate timestamp: `YYYY-MM-DD_HHMM`. If directory already exists (same-minute collision), append seconds (`YYYY-MM-DD_HHMMSS`).
110
- 2. Create timestamped review directory: `mkdir -p {worktree}/.devflow/docs/reviews/{branch-slug}/{timestamp}/`
111
- 3. Check if `{worktree}/.devflow/docs/reviews/{branch-slug}/.last-review-head` exists:
110
+ 2. Check if `{gd}/devflow/reviews/{branch-slug}/.last-review-head` exists, `{gd}` being what `git -C "{worktree}" rev-parse --absolute-git-dir` prints:
112
111
  - **If yes AND `--full` NOT set:**
113
- - Read the SHA from the file
114
- - Verify reachable: `git -C {worktree} cat-file -t {sha}` (handles rebases — if unreachable, fallback to full)
112
+ - The stored review head is checked as a commit ID: use it only when it is exactly 40 or 64 lowercase hex, else take the full-range path
113
+ - Verify reachable: `git -C "{worktree}" cat-file -t {sha}` must print `commit` (else take the full-range path)
115
114
  - Check if SHA == current HEAD → if so, skip review: "No new commits since last review. Use --full for a full re-review."
116
115
  - Set `DIFF_RANGE` to `{last-review-sha}...HEAD`
117
- - **If no (first review), or `--full`:**
118
- - Set `DIFF_RANGE` to `{base_branch}...HEAD`
116
+ - **Full-range path (no marker, or `--full`):**
117
+ - Stop as for a (rejected) Base line unless `base_ref` is 40 or 64 hex.
118
+ - Set `DIFF_RANGE` to `{base_ref}...HEAD`
119
+ 3. Create timestamped review directory: `mkdir -p {worktree}/.devflow/docs/reviews/{branch-slug}/{timestamp}/`
119
120
 
120
121
  #### Step 0e-i: Load Prior Resolution and Count Cycles
121
122
 
@@ -182,10 +183,11 @@ List the changed paths into `{REVIEW_DIR}/paths.txt` and print only the line cou
182
183
 
183
184
  ```bash
184
185
  git -C "{WORKTREE_PATH}" diff --name-only --no-renames {DIFF_RANGE} > "{REVIEW_DIR}/paths.txt"
186
+ echo "exit=$?"
185
187
  wc -l < "{REVIEW_DIR}/paths.txt"
186
188
  ```
187
189
 
188
- Read `paths.txt` once when the count is about 40 or fewer, and in ranges of about 40 lines (Read with offset and limit) when it is more.
190
+ The `exit=` line is the diff's. A non-zero diff exit stops. Read `paths.txt` once when the count is about 40 or fewer, and in ranges of about 40 lines (Read with offset and limit) when it is more.
189
191
 
190
192
  Set `DIFF_CLASS` by these rules, in order; the first that decides wins:
191
193
 
@@ -259,7 +261,7 @@ Write `diff.patch` once per worktree, by redirect:
259
261
  git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE} > "{REVIEW_DIR}/diff.patch"
260
262
  ```
261
263
 
262
- It holds the whole diff of `DIFF_RANGE`. On a `code` diff, add one patch for each language focus in REVIEW_FOCUS_LIST, by the same command with quoted pathspecs from this table:
264
+ It holds the whole diff of `DIFF_RANGE`. A non-zero exit of any patch write stops. On a `code` diff, add one patch for each language focus in REVIEW_FOCUS_LIST, by the same command with quoted pathspecs from this table:
263
265
 
264
266
  ```bash
265
267
  git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE} -- '<pathspec>' ... > "{REVIEW_DIR}/diff-{focus}.patch"
@@ -277,39 +279,39 @@ git -C "{WORKTREE_PATH}" diff --no-color --no-ext-diff --no-textconv {DIFF_RANGE
277
279
 
278
280
  The core, database, dependencies, documentation and compliance focuses, and every reduced-class focus, read `diff.patch`. A language focus sees only its own extensions and reaches anything else through `DIFF_RANGE`. Set `DIFF_FILES` to the files written. They live in `REVIEW_DIR`, under the gitignored `.devflow/` tree, with `paths.txt`: never committed, posted or passed to the Git agent.
279
281
 
280
- <!-- learning:on -->
282
+ <!-- curation:on -->
281
283
  ### Phase 1b: Load Decisions Index
282
- <!-- learning:off -->
284
+ <!-- curation:off -->
283
285
  ### Phase 1b: Load Context
284
- <!-- learning:end -->
286
+ <!-- curation:end -->
285
287
 
286
- <!-- learning:on -->
288
+ <!-- curation:on -->
287
289
  **Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, COMPLIANCE_FRAMEWORKS (carried from Step 0b)
288
- <!-- learning:off -->
290
+ <!-- curation:off -->
289
291
  **Produces:** FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, COMPLIANCE_FRAMEWORKS (carried from Step 0b)
290
- <!-- learning:end -->
292
+ <!-- curation:end -->
291
293
 
292
294
  {{decisions_load()}}
293
- <!-- learning:on -->
295
+ <!-- curation:on -->
294
296
  This produces a compact index of active ADR/PF entries. Pass `DECISIONS_CONTEXT` to all Review agents as one shared slice, cut over the diff's files. Review agents use `devflow:apply-decisions` to Read full entry bodies on demand.
295
297
 
296
- <!-- learning:end -->
298
+ <!-- curation:end -->
297
299
  {{knowledge_load()}}
298
300
 
299
- <!-- learning:on -->
301
+ <!-- curation:on -->
300
302
  Pass `FEATURE_KNOWLEDGE` to all Review agents alongside `DECISIONS_CONTEXT`.
301
- <!-- learning:off -->
303
+ <!-- curation:off -->
302
304
  Pass `FEATURE_KNOWLEDGE` to all Review agents.
303
- <!-- learning:end -->
305
+ <!-- curation:end -->
304
306
 
305
307
  ### Phase 2: Run Reviews (Parallel)
306
308
 
307
309
  **Produces:** REVIEW_FOCUS_OUTPUTS
308
- <!-- learning:on -->
310
+ <!-- curation:on -->
309
311
  **Requires:** DIFF_RANGE, REVIEW_DIR, TIMESTAMP, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, PR_DESCRIPTION, PRIOR_RESOLUTIONS, REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
310
- <!-- learning:off -->
312
+ <!-- curation:off -->
311
313
  **Requires:** DIFF_RANGE, REVIEW_DIR, TIMESTAMP, FEATURE_KNOWLEDGE, PR_DESCRIPTION, PRIOR_RESOLUTIONS, REVIEW_FOCUS_LIST, DIFF_CLASS, DIFF_FILES
312
- <!-- learning:end -->
314
+ <!-- curation:end -->
313
315
 
314
316
  Spawn Review agents **in a single message**, one per focus in REVIEW_FOCUS_LIST (max 20 per worktree):
315
317
 
@@ -339,7 +341,7 @@ Spawn Review agents **in a single message**, one per focus in REVIEW_FOCUS_LIST
339
341
  | documentation | conditional | devflow:documentation | diff.patch |
340
342
  | compliance | diff-driven | devflow:compliance | diff.patch |
341
343
 
342
- Review agent count: at `full`, `code` runs 8 core +1-12; `standard` runs up to 2 fewer; lean `code` runs 3-4; a reduced class or a mix runs 2-6.
344
+ Review agent count: `code` runs 8 core +1-12 at `full`, up to 2 fewer at `standard`, 3-4 at lean; a reduced class or a mix runs 2-6.
343
345
 
344
346
  {{compliance_focus_inject()}}
345
347
 
@@ -352,22 +354,22 @@ PR: #{pr_number}, Base: {base_branch}
352
354
  WORKTREE_PATH: {worktree_path} (omit if cwd)
353
355
  DIFF_FILE: {diff_file} (absolute: {REVIEW_DIR}/diff.patch, or {REVIEW_DIR}/diff-{focus}.patch for a language focus, per the table)
354
356
  DIFF_RANGE: {DIFF_RANGE} (information only)
355
- <!-- learning:on -->
357
+ <!-- curation:on -->
356
358
  DECISIONS_CONTEXT: {decisions_context}
357
- <!-- learning:end -->
359
+ <!-- curation:end -->
358
360
  FEATURE_KNOWLEDGE: {feature_knowledge}
359
361
  PR_DESCRIPTION: <pr-description>{pr_description}</pr-description>
360
362
  PRIOR_RESOLUTIONS: <prior-resolution-summary>{prior_resolutions}</prior-resolution-summary>
361
363
  {COMPLIANCE_FOCUS_DIRECTIVE} (compliance focus only)
362
364
  If PRIOR_RESOLUTIONS is not (none), follow Cross-Cycle Awareness in review.md.
363
- <!-- learning:on -->
365
+ <!-- curation:on -->
364
366
  Follow devflow:apply-decisions to scan the index and Read full ADR/PF bodies on demand.
365
- <!-- learning:end -->
367
+ <!-- curation:end -->
366
368
  Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE — feature-specific patterns and anti-patterns inform findings.
367
369
  IMPORTANT: Write report to {worktree_path}/.devflow/docs/reviews/{branch-slug}/{timestamp}/{focus}.md using Write tool"
368
370
  ```
369
371
 
370
- In multi-worktree mode, process worktrees **sequentially**: complete Phases 1-4 for one worktree before starting the next, so Review spawns never pile up.
372
+ In multi-worktree mode, process worktrees **sequentially**: Phases 1-4 for one worktree, then the next.
371
373
 
372
374
  ### Phase 3: Synthesis → Review Comment (Sequential)
373
375
 
@@ -410,34 +412,29 @@ Posts the consolidated review-summary comment (marker-deduped by the operation o
410
412
  **Requires:** BRANCH_INFO, REVIEW_DIR
411
413
 
412
414
  Per worktree, after successful completion:
413
- 1. Write current HEAD SHA to `{worktree_path}/.devflow/docs/reviews/{branch-slug}/.last-review-head`
415
+ 1. In one Bash call run `M="$(git -C "{worktree_path}" rev-parse --absolute-git-dir)/devflow/reviews/{branch-slug}" && mkdir -p "$M" && git -C "{worktree_path}" rev-parse HEAD > "$M/.last-review-head"`. A failed or refused write never stops the run and is not retried another way.
414
416
  2. Display results from all agents:
415
417
  - Merge recommendation (from Synthesize agent)
416
418
  - Issue counts by category (🔴 blocking / ⚠️ should-fix / ℹ️ pre-existing)
417
419
  - Review comment status: POSTED / POSTED+TRUNCATED (body exceeded 60k after redaction) / SKIPPED (D7 dedup) / DEGRADED (from Git)
418
420
  - Publication status: FULL (private repo) | FULL (config override) | STUB (public repository) | OFF (publication disabled by config) | STUB (visibility undeterminable) | STUB (evidence policy) (from Git agent)
421
+ - Any base `TRACEABILITY: DEGRADED` line from Step 0c, as returned
419
422
  - Artifact paths
420
423
 
421
424
  ## Architecture
422
425
 
423
426
  ```
424
- /code-review (orchestrator - spawns agents only)
427
+ /code-review
425
428
  │
426
- ├─ Phase 0: Worktree Discovery & Pre-flight
427
- │ ├─ Step 0a: git worktree list → filter reviewable
429
+ ├─ Phase 0: Worktree Discovery & Pre-flight, Steps 0a-0f (Git agent per worktree, parallel)
428
430
  │ ├─ Step 0b: Resolve the compliance lens and gate level
429
- │ ├─ Step 0c: Git agent (ensure-pr-ready) per worktree [parallel]
430
- │ ├─ Step 0d: Incremental detection + timestamp setup per worktree
431
- │ ├─ Step 0e-i: Load prior resolution-summary.md
432
- │ ├─ Step 0e-ii: Convergence assessment (warn only)
433
- │ └─ Step 0f: Resolve REVIEW_PUBLICATION per worktree (publication gate)
434
431
  │
435
- ├─ Per worktree (SEQUENTIAL — one worktree at a time):
432
+ ├─ Per worktree (SEQUENTIAL):
436
433
  │ │
437
434
  │ ├─ Phase 1: Analyze changed files
438
435
  │ │ ├─ Classify the diff (paths.txt → DIFF_CLASS)
439
- │ │ ├─ Choose the focuses (code: file types + the language stamp; all: the gate level)
440
- │ │ └─ Write diff.patch and diff-{focus}.patch, by redirect
436
+ │ │ ├─ Choose the focuses
437
+ │ │ └─ Write diff.patch and diff-{focus}.patch
441
438
  │ │
442
439
  │ ├─ Phase 2: Reviews (PARALLEL within worktree), one per REVIEW_FOCUS_LIST focus
443
440
  │ │ ├─ code: core (diff.patch), language (diff-{focus}.patch), conditional
@@ -455,7 +452,7 @@ Per worktree, after successful completion:
455
452
  | Case | Handling |
456
453
  |------|----------|
457
454
  | `--full` in multi-worktree mode | Applies to all worktrees (global modifier). It sets the diff range, never the gate level |
458
- | Review comment already posted | Git agent matches its own marker on the `{cycle, timestamp}` pair → skip silently (D7); a re-review in the same cycle (different timestamp) posts its own comment. The marker's format belongs to the operation; this caller passes the pair and never restates the literal |
455
+ | Review comment already posted | Git agent matches its own marker on the `{cycle, timestamp}` pair → skip silently (D7); a re-review in the same cycle (different timestamp) posts its own comment. The marker's format belongs to the operation |
459
456
  | Docs-only diff | Its Step 1.1 set, narrowed by level |
460
457
  | Tests-only diff | Its Step 1.1 set, narrowed by level |
461
458
  | Lockfile-only diff | Its Step 1.1 set, narrowed by level |
@@ -464,7 +461,6 @@ Per worktree, after successful completion:
464
461
  | A file moved across classes | `--no-renames` lists both paths, so a code path makes the diff `code` |
465
462
  | Path listing above about 40 lines | Read in ranges (Step 1.1) |
466
463
  | Language files changed, plugin not installed | The focus is absent from the stamped line: not spawned |
467
- | Public repo (`auto` mode) | Git agent probes visibility, posts counts-only STUB comment; full report stays local |
468
464
  | `reviewPublication: off` | Git agent skips posting the review comment (OFF) — except that, only when `EVIDENCE_POLICY` is `required`, Step 0f passes `stub` and a counts-only STUB comment posts |
469
465
 
470
466
  ## Backwards Compatibility
@@ -473,8 +469,8 @@ Per worktree, after successful completion:
473
469
 
474
470
  ## Principles
475
471
 
476
- 1. **Orchestration only** - Command spawns agents, doesn't do git/review work itself. The exceptions are the read-only Phase 0 probes (`git worktree list`, `git -C ... branch --show-current`, `git -C ... cat-file -t`), the bounded Phase 1 path listing (a redirect into `paths.txt`, a `wc -l` count and ranged reads) and the redirect-only patch writes (`diff.patch`, `diff-{focus}.patch`). Redirect-only writes print nothing, so no diff content reaches this thread
472
+ 1. **Orchestration only** - Command spawns agents, doesn't do git/review work itself. The exceptions are the read-only Phase 0 probes (`git worktree list`, `git -C ... branch --show-current`, `git -C ... cat-file -t`, `git -C ... rev-parse`), the bounded Phase 1 path listing and the writes (`diff.patch`, `diff-{focus}.patch`, the marker and its `mkdir -p`). These writes print nothing
477
473
  2. **Parallel, not background** - Multiple agents in one message, but `run_in_background=false` so phases complete before proceeding
478
- 3. **Git agent for git work** - All git operations go through Git agent, except the exceptions named in Principle 1; redirect-only writes print nothing
474
+ 3. **Git agent for git work** - All git operations go through Git agent, except the exceptions named in Principle 1; its writes print nothing
479
475
  4. **Honest reporting** - Display agent outputs directly
480
476
  5. **Incremental by default** - Only review new changes unless `--full` specified
@@ -34,16 +34,16 @@ $ARGUMENTS
34
34
 
35
35
  ## Phases
36
36
 
37
- <!-- learning:on -->
37
+ <!-- curation:on -->
38
38
  ### Phase 1: Load Decisions Index (Orchestrator-Local)
39
- <!-- learning:off -->
39
+ <!-- curation:off -->
40
40
  ### Phase 1: Resolve Settings
41
- <!-- learning:end -->
41
+ <!-- curation:end -->
42
42
 
43
- <!-- learning:on -->
43
+ <!-- curation:on -->
44
44
  **Produces:** DECISIONS_CONTEXT
45
45
 
46
- <!-- learning:end -->
46
+ <!-- curation:end -->
47
47
  {{settings.settings_resolve()}}
48
48
 
49
49
  From the same line: {{compliance.compliance_frameworks()}}
@@ -53,18 +53,18 @@ From the same line: {{compliance.compliance_frameworks()}}
53
53
  Phase 7 passes `COMPLIANCE_DIRECTIVE` to the Code agent that implements the fix, on a line of its own.
54
54
 
55
55
  {{decisions_load()}}
56
- <!-- learning:on -->
56
+ <!-- curation:on -->
57
57
  The orchestrator uses `DECISIONS_CONTEXT` locally when generating hypotheses (Phase 2) — prior pitfalls and decisions can suggest specific root causes to investigate. Follow `devflow:apply-decisions` to Read full entry bodies on demand. **Do NOT pass `DECISIONS_CONTEXT` to Explore investigators** — decisions context stays in the orchestrator; investigators examine code directly.
58
58
 
59
- <!-- learning:end -->
59
+ <!-- curation:end -->
60
60
  **No up-front feature knowledge load** — debug investigation workers read code directly to avoid confirmation bias. Feature knowledge is only written back at the end if the investigation surfaced durable, cross-cutting knowledge.
61
61
 
62
62
  ### Phase 2: Context Gathering
63
63
 
64
64
  **Produces:** HYPOTHESES, BUG_CONTEXT
65
- <!-- learning:on -->
65
+ <!-- curation:on -->
66
66
  **Requires:** DECISIONS_CONTEXT
67
- <!-- learning:end -->
67
+ <!-- curation:end -->
68
68
 
69
69
  If `COMMAND_INPUT` opens with a candidate issue reference, fetch the issue:
70
70
 
@@ -211,9 +211,9 @@ Ask user via AskUserQuestion: "Want me to implement this fix?"
211
211
  TASK_DESCRIPTION: Implement the fix for this root cause: {bug description}
212
212
  EXECUTION_PLAN: {Root Cause, Key Findings and Recommended Fix from Phase 6, with their file:line references}
213
213
  PUSH: false
214
- <!-- learning:on -->
214
+ <!-- curation:on -->
215
215
  DECISIONS_CONTEXT: {decisions_context}
216
- <!-- learning:end -->
216
+ <!-- curation:end -->
217
217
  FEATURE_KNOWLEDGE: (none)
218
218
  {COMPLIANCE_DIRECTIVE}"
219
219
  ```
@@ -227,11 +227,11 @@ Ask user via AskUserQuestion: "Want me to implement this fix?"
227
227
  ```
228
228
  /debug (orchestrator)
229
229
  │
230
- <!-- learning:on -->
230
+ <!-- curation:on -->
231
231
  ├─ Phase 1: Load Decisions Index (Orchestrator-Local)
232
- <!-- learning:off -->
232
+ <!-- curation:off -->
233
233
  ├─ Phase 1: Resolve Settings
234
- <!-- learning:end -->
234
+ <!-- curation:end -->
235
235
  │ └─ No up-front feature knowledge load (avoids confirmation bias in investigators)
236
236
  │
237
237
  ├─ Phase 2: Context gathering