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.
- package/CHANGELOG.md +359 -1
- package/README.md +11 -11
- package/dist/agents/code.md +2 -4
- package/dist/agents/design.md +1 -1
- package/dist/agents/fix.md +6 -7
- package/dist/agents/git.md +1 -1
- package/dist/agents/harden.md +1 -1
- package/dist/agents/refactor.md +2 -4
- package/dist/agents/review.md +4 -4
- package/dist/agents/skim.md +2 -2
- package/dist/agents/triage.md +2 -2
- package/dist/cli/commands/capture.js +1 -1
- package/dist/cli/commands/curation-move-io.js +102 -0
- package/dist/cli/commands/curation-move-step.js +374 -0
- package/dist/cli/commands/{learning.js → curation.js} +302 -99
- package/dist/cli/commands/gate-level-prompts.js +426 -0
- package/dist/cli/commands/gates.js +34 -11
- package/dist/cli/commands/init-seed.js +11 -8
- package/dist/cli/commands/init.js +240 -54
- package/dist/cli/commands/memory.js +2 -2
- package/dist/cli/commands/prompt-io.js +37 -0
- package/dist/cli/commands/uninstall.js +81 -9
- package/dist/cli.js +2 -2
- package/dist/commands/bug-analysis.md +24 -35
- package/dist/commands/code-review.md +32 -36
- package/dist/commands/debug.md +4 -4
- package/dist/commands/dynamic-build.md +25 -24
- package/dist/commands/dynamic-plan.md +4 -4
- package/dist/commands/dynamic-profile.md +4 -4
- package/dist/commands/dynamic-tickets.md +4 -4
- package/dist/commands/explore.md +5 -5
- package/dist/commands/implement.md +52 -81
- package/dist/commands/plan.md +5 -5
- package/dist/commands/release.md +4 -4
- package/dist/commands/research.md +5 -5
- package/dist/commands/resolve.md +28 -30
- package/dist/commands/self-review.md +4 -12
- package/dist/core/assets.js +20 -20
- package/dist/core/curate-tuning-config.js +5 -6
- package/dist/core/curation-move-notice.js +84 -0
- package/dist/core/curation-move-skip.js +36 -0
- package/dist/core/curation-move.js +35 -0
- package/dist/core/curation-queue-cleanup.js +134 -0
- package/dist/core/curation-store.js +98 -0
- package/dist/core/{learning-variants.js → curation-variants.js} +65 -41
- package/dist/core/echo-value.js +11 -5
- package/dist/core/evidence-policy.js +1 -1
- package/dist/core/feature-switch.js +95 -19
- package/dist/core/fs-atomic.js +1 -1
- package/dist/core/gate-level.js +10 -2
- package/dist/core/git.js +16 -14
- package/dist/core/ledger-root.js +82 -22
- package/dist/core/linked-path.js +4 -4
- package/dist/core/manifest-lock.js +238 -0
- package/dist/core/manifest.js +58 -14
- package/dist/core/migrations.js +1 -13
- package/dist/core/observations.js +2 -2
- package/dist/core/plugins.js +15 -15
- package/dist/core/pool.js +26 -0
- package/dist/core/project-paths.js +103 -34
- package/dist/core/queue-drain.js +2 -2
- package/dist/core/tracked-areas.js +35 -0
- package/dist/core/tracker.js +1 -1
- package/dist/{learning-off → curation-off}/agents/code.md +2 -4
- package/dist/{learning-off → curation-off}/agents/fix.md +6 -7
- package/dist/{learning-off → curation-off}/agents/refactor.md +2 -4
- package/dist/{learning-off → curation-off}/agents/review.md +3 -3
- package/dist/{learning-off → curation-off}/agents/triage.md +1 -1
- package/dist/{learning-off → curation-off}/commands/bug-analysis.md +20 -31
- package/dist/{learning-off → curation-off}/commands/code-review.md +29 -33
- package/dist/{learning-off → curation-off}/commands/debug.md +1 -1
- package/dist/{learning-off → curation-off}/commands/dynamic-build.md +22 -21
- package/dist/{learning-off → curation-off}/commands/explore.md +1 -1
- package/dist/{learning-off → curation-off}/commands/implement.md +49 -78
- package/dist/{learning-off → curation-off}/commands/plan.md +1 -1
- package/dist/{learning-off → curation-off}/commands/resolve.md +25 -27
- package/dist/{learning-off → curation-off}/commands/self-review.md +1 -9
- package/dist/hud/components/{learning-counts.js → curation-counts.js} +36 -17
- package/dist/hud/config.js +1 -1
- package/dist/hud/index.js +6 -6
- package/dist/hud/render.js +3 -3
- package/dist/skills/git/references/pr/validate-branch.md +8 -5
- package/dist/skills/git/references/tracker/github/ensure-pr-ready.md +13 -5
- package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +13 -5
- package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +13 -5
- package/dist/targets/claude-code/{learning-install.js → curation-install.js} +85 -65
- package/dist/targets/claude-code/installer.js +15 -15
- package/dist/targets/claude-code/language-stamp.js +5 -5
- package/dist/targets/claude-code/post-install.js +2 -2
- package/dist/targets/claude-code/tracker-servers.js +1 -1
- package/package.json +3 -2
- package/src/assets/agents/_partials/_code.mds +11 -11
- package/src/assets/agents/code.mds +2 -2
- package/src/assets/agents/curate.md +8 -8
- package/src/assets/agents/debug.mds +6 -6
- package/src/assets/agents/design.mds +18 -18
- package/src/assets/agents/fix.mds +6 -5
- package/src/assets/agents/git.mds +1 -1
- package/src/assets/agents/harden.mds +7 -7
- package/src/assets/agents/knowledge.mds +23 -23
- package/src/assets/agents/refactor.mds +2 -2
- package/src/assets/agents/research.mds +15 -15
- package/src/assets/agents/review.mds +43 -43
- package/src/assets/agents/skim.mds +11 -11
- package/src/assets/agents/triage.mds +22 -22
- package/src/assets/agents/validate.md +13 -26
- package/src/assets/commands/_partials/_decisions.mds +13 -13
- package/src/assets/commands/_partials/_engine.mds +8 -8
- package/src/assets/commands/_partials/_knowledge.mds +29 -15
- package/src/assets/commands/_partials/_preamble.mds +4 -4
- package/src/assets/commands/_partials/_settings.mds +2 -2
- package/src/assets/commands/_partials/_wave.mds +7 -7
- package/src/assets/commands/bug-analysis.mds +37 -48
- package/src/assets/commands/code-review.mds +46 -50
- package/src/assets/commands/debug.mds +14 -14
- package/src/assets/commands/dynamic-build.mds +38 -37
- package/src/assets/commands/dynamic-plan.mds +22 -22
- package/src/assets/commands/dynamic-profile.mds +2 -2
- package/src/assets/commands/dynamic-tickets.mds +8 -8
- package/src/assets/commands/explore.mds +20 -20
- package/src/assets/commands/implement.mds +77 -98
- package/src/assets/commands/plan.mds +27 -27
- package/src/assets/commands/release.mds +12 -12
- package/src/assets/commands/research.mds +19 -19
- package/src/assets/commands/resolve.mds +56 -50
- package/src/assets/commands/self-review.mds +20 -20
- package/src/assets/mds/git/_ops.mds +3 -1
- package/src/assets/mds/git/_ops_pr.mds +1 -1
- package/src/assets/mds/git/_ops_steps.mds +10 -4
- package/src/assets/mds/git/_pr.mds +7 -4
- package/src/assets/rules/quality.md +1 -0
- package/src/assets/scripts/hooks/background-memory-update +2 -2
- package/src/assets/scripts/hooks/capture-prompt +12 -12
- package/src/assets/scripts/hooks/capture-question +11 -11
- package/src/assets/scripts/hooks/capture-turn +12 -12
- package/src/assets/scripts/hooks/{learning-lock → curation-lock} +2 -2
- package/src/assets/scripts/hooks/curation-move +293 -0
- package/src/assets/scripts/hooks/ensure-devflow-init +45 -13
- package/src/assets/scripts/hooks/ensure-proxy +4 -4
- package/src/assets/scripts/hooks/ensure-root-gitignore +4 -4
- package/src/assets/scripts/hooks/git-marker +81 -0
- package/src/assets/scripts/hooks/json-helper.cjs +134 -51
- package/src/assets/scripts/hooks/json-parse +1 -1
- package/src/assets/scripts/hooks/lib/curation-move.cjs +1582 -0
- package/src/assets/scripts/hooks/lib/{learning-store.cjs → curation-store.cjs} +242 -118
- package/src/assets/scripts/hooks/lib/decisions-format.cjs +3 -3
- package/src/assets/scripts/hooks/lib/mkdir-lock.cjs +24 -7
- package/src/assets/scripts/hooks/lib/project-paths.cjs +132 -39
- package/src/assets/scripts/hooks/lib/render-decisions.cjs +34 -22
- package/src/assets/scripts/hooks/lib/tracked-areas.cjs +259 -0
- package/src/assets/scripts/hooks/memory-worker +1 -1
- package/src/assets/scripts/hooks/pre-compact-memory +6 -16
- package/src/assets/scripts/hooks/queue-append +228 -103
- package/src/assets/scripts/hooks/resolve-project-root +2 -2
- package/src/assets/scripts/hooks/session-start-context +143 -69
- package/src/assets/scripts/hooks/session-start-memory +3 -43
- package/src/assets/scripts/lib/project-config.cjs +12 -5
- package/src/assets/scripts/resolve-base.cjs +1043 -0
- package/src/assets/scripts/resolve-settings.cjs +42 -18
- package/src/assets/skills/agent-references/SKILL.md +5 -2
- package/src/assets/skills/agent-references/references/commands/implement-levels.md +27 -0
- package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +6 -4
- package/src/assets/skills/agent-references/references/commands/resolve-levels.md +24 -0
- package/src/assets/skills/apply-decisions/SKILL.md +1 -1
- package/src/assets/skills/docs-framework/SKILL.md +7 -7
- package/src/assets/skills/docs-framework/references/patterns.md +3 -4
- package/src/assets/skills/quality-gates/SKILL.md +1 -1
- package/src/assets/skills/worktree-support/references/roots.md +2 -2
- package/templates/lint-pack/.lint-pack.conf +86 -0
- package/templates/lint-pack/README.md +190 -0
- package/templates/lint-pack/lint-pack.sh +905 -0
- package/dist/core/learning-queue-cleanup.js +0 -27
- package/dist/core/learning-store.js +0 -61
- /package/dist/{learning-off → curation-off}/agents/debug.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/design.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/harden.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/knowledge.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/research.md +0 -0
- /package/dist/{learning-off → curation-off}/agents/skim.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/dynamic-plan.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/dynamic-profile.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/dynamic-tickets.md +0 -0
- /package/dist/{learning-off → curation-off}/commands/release.md +0 -0
- /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.
|
|
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
|
|
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 `{
|
|
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
|
-
-
|
|
73
|
-
- Verify reachable: `git cat-file -t {sha}`
|
|
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
|
-
- **
|
|
77
|
-
-
|
|
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
|
|
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
|
|
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
|
-
#
|
|
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
|
|
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
|
|
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
|
-
<!--
|
|
171
|
+
<!-- curation:on -->
|
|
173
172
|
**Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PLAN_CONTEXT, ACCEPTANCE_RULES
|
|
174
|
-
<!--
|
|
173
|
+
<!-- curation:off -->
|
|
175
174
|
**Produces:** FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PLAN_CONTEXT, ACCEPTANCE_RULES
|
|
176
|
-
<!--
|
|
175
|
+
<!-- curation:end -->
|
|
177
176
|
|
|
178
|
-
<!--
|
|
177
|
+
<!-- curation:on -->
|
|
179
178
|
#### Decisions Index
|
|
180
179
|
|
|
181
180
|
{{settings.settings_resolve()}}
|
|
182
181
|
|
|
183
|
-
<!--
|
|
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
|
-
<!--
|
|
213
|
+
<!-- curation:on -->
|
|
215
214
|
**Requires:** DIFF_RANGE, ANALYSIS_DIR, ACTIVE_FOCUSES, STATIC_FINDINGS, ACCEPTANCE_RULES, PLAN_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE
|
|
216
|
-
<!--
|
|
215
|
+
<!-- curation:off -->
|
|
217
216
|
**Requires:** DIFF_RANGE, ANALYSIS_DIR, ACTIVE_FOCUSES, STATIC_FINDINGS, ACCEPTANCE_RULES, PLAN_CONTEXT, FEATURE_KNOWLEDGE
|
|
218
|
-
<!--
|
|
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
|
-
<!--
|
|
230
|
+
<!-- curation:on -->
|
|
232
231
|
DECISIONS_CONTEXT: {DECISIONS_CONTEXT}
|
|
233
|
-
<!--
|
|
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
|
-
<!--
|
|
236
|
+
<!-- curation:on -->
|
|
238
237
|
Follow devflow:apply-decisions to Read full ADR/PF bodies on demand.
|
|
239
|
-
<!--
|
|
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.
|
|
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
|
-
│
|
|
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
|
-
<!--
|
|
314
|
+
<!-- curation:on -->
|
|
319
315
|
│ ├─ index.md (pre-rendered) → DECISIONS_CONTEXT
|
|
320
|
-
<!--
|
|
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
|
-
│
|
|
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
|
-
<!--
|
|
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
|
-
<!--
|
|
368
|
+
<!-- curation:off -->
|
|
380
369
|
- [ ] Phase 3: Context Loading → FEATURE_KNOWLEDGE loaded (or `(none)`), PLAN_CONTEXT and ACCEPTANCE_RULES captured (or `(none)`)
|
|
381
|
-
<!--
|
|
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.
|
|
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**:
|
|
38
|
-
3. **If only 1 reviewable worktree**: proceed as single-worktree flow
|
|
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
|
|
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.
|
|
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
|
-
-
|
|
114
|
-
- Verify reachable: `git -C {worktree} cat-file -t {sha}`
|
|
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
|
-
- **
|
|
118
|
-
-
|
|
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
|
-
<!--
|
|
282
|
+
<!-- curation:on -->
|
|
281
283
|
### Phase 1b: Load Decisions Index
|
|
282
|
-
<!--
|
|
284
|
+
<!-- curation:off -->
|
|
283
285
|
### Phase 1b: Load Context
|
|
284
|
-
<!--
|
|
286
|
+
<!-- curation:end -->
|
|
285
287
|
|
|
286
|
-
<!--
|
|
288
|
+
<!-- curation:on -->
|
|
287
289
|
**Produces:** DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, COMPLIANCE_FRAMEWORKS (carried from Step 0b)
|
|
288
|
-
<!--
|
|
290
|
+
<!-- curation:off -->
|
|
289
291
|
**Produces:** FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, COMPLIANCE_FRAMEWORKS (carried from Step 0b)
|
|
290
|
-
<!--
|
|
292
|
+
<!-- curation:end -->
|
|
291
293
|
|
|
292
294
|
{{decisions_load()}}
|
|
293
|
-
<!--
|
|
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
|
-
<!--
|
|
298
|
+
<!-- curation:end -->
|
|
297
299
|
{{knowledge_load()}}
|
|
298
300
|
|
|
299
|
-
<!--
|
|
301
|
+
<!-- curation:on -->
|
|
300
302
|
Pass `FEATURE_KNOWLEDGE` to all Review agents alongside `DECISIONS_CONTEXT`.
|
|
301
|
-
<!--
|
|
303
|
+
<!-- curation:off -->
|
|
302
304
|
Pass `FEATURE_KNOWLEDGE` to all Review agents.
|
|
303
|
-
<!--
|
|
305
|
+
<!-- curation:end -->
|
|
304
306
|
|
|
305
307
|
### Phase 2: Run Reviews (Parallel)
|
|
306
308
|
|
|
307
309
|
**Produces:** REVIEW_FOCUS_OUTPUTS
|
|
308
|
-
<!--
|
|
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
|
-
<!--
|
|
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
|
-
<!--
|
|
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:
|
|
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
|
-
<!--
|
|
357
|
+
<!-- curation:on -->
|
|
356
358
|
DECISIONS_CONTEXT: {decisions_context}
|
|
357
|
-
<!--
|
|
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
|
-
<!--
|
|
365
|
+
<!-- curation:on -->
|
|
364
366
|
Follow devflow:apply-decisions to scan the index and Read full ADR/PF bodies on demand.
|
|
365
|
-
<!--
|
|
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**:
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
440
|
-
│ │ └─ Write diff.patch and diff-{focus}.patch
|
|
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
|
|
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
|
|
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;
|
|
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
|
-
<!--
|
|
37
|
+
<!-- curation:on -->
|
|
38
38
|
### Phase 1: Load Decisions Index (Orchestrator-Local)
|
|
39
|
-
<!--
|
|
39
|
+
<!-- curation:off -->
|
|
40
40
|
### Phase 1: Resolve Settings
|
|
41
|
-
<!--
|
|
41
|
+
<!-- curation:end -->
|
|
42
42
|
|
|
43
|
-
<!--
|
|
43
|
+
<!-- curation:on -->
|
|
44
44
|
**Produces:** DECISIONS_CONTEXT
|
|
45
45
|
|
|
46
|
-
<!--
|
|
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
|
-
<!--
|
|
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
|
-
<!--
|
|
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
|
-
<!--
|
|
65
|
+
<!-- curation:on -->
|
|
66
66
|
**Requires:** DECISIONS_CONTEXT
|
|
67
|
-
<!--
|
|
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
|
-
<!--
|
|
214
|
+
<!-- curation:on -->
|
|
215
215
|
DECISIONS_CONTEXT: {decisions_context}
|
|
216
|
-
<!--
|
|
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
|
-
<!--
|
|
230
|
+
<!-- curation:on -->
|
|
231
231
|
├─ Phase 1: Load Decisions Index (Orchestrator-Local)
|
|
232
|
-
<!--
|
|
232
|
+
<!-- curation:off -->
|
|
233
233
|
├─ Phase 1: Resolve Settings
|
|
234
|
-
<!--
|
|
234
|
+
<!-- curation:end -->
|
|
235
235
|
│ └─ No up-front feature knowledge load (avoids confirmation bias in investigators)
|
|
236
236
|
│
|
|
237
237
|
├─ Phase 2: Context gathering
|