devflow-kit 3.2.0 → 3.4.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 +34 -0
- package/README.md +1 -1
- package/dist/agents/code.md +330 -0
- package/{src/assets → dist}/agents/design.md +11 -1
- package/{src/assets → dist}/agents/diagnose.md +17 -13
- package/dist/agents/git.md +29 -56
- package/{src/assets → dist}/agents/knowledge.md +8 -5
- package/{src/assets → dist}/agents/research.md +21 -2
- package/{src/assets → dist}/agents/review.md +18 -7
- package/{src/assets → dist}/agents/scrutinize.md +35 -11
- package/dist/agents/skim.md +148 -0
- package/{src/assets → dist}/agents/triage.md +8 -2
- package/dist/cli/commands/init.js +62 -0
- package/dist/cli/commands/learning.js +63 -8
- package/dist/cli/commands/uninstall.js +42 -1
- package/dist/commands/bug-analysis.md +30 -8
- package/dist/commands/code-review.md +142 -61
- package/dist/commands/debug.md +15 -13
- package/dist/commands/dynamic-build.md +176 -130
- package/dist/commands/dynamic-plan.md +31 -19
- package/dist/commands/dynamic-profile.md +27 -13
- package/dist/commands/dynamic-tickets.md +28 -14
- package/dist/commands/explore.md +16 -14
- package/dist/commands/implement.md +163 -158
- package/dist/commands/plan.md +37 -24
- package/dist/commands/release.md +69 -4
- package/dist/commands/research.md +33 -11
- package/dist/commands/resolve.md +61 -47
- package/dist/commands/self-review.md +50 -32
- package/dist/core/agent-models.js +53 -7
- package/dist/core/assets.js +55 -10
- package/dist/core/claude-md-audit.js +190 -0
- package/dist/core/feature-switch.js +20 -1
- package/dist/core/flags.js +28 -0
- package/dist/core/fs-atomic.js +8 -3
- package/dist/core/learning-tuning-config.js +8 -0
- package/dist/core/learning-variants.js +213 -0
- package/dist/core/manifest.js +62 -0
- package/dist/core/mds-variants.js +38 -1
- package/dist/core/plugins.js +78 -11
- package/{src/assets → dist/learning-off}/agents/code.md +77 -28
- package/dist/learning-off/agents/design.md +119 -0
- package/dist/learning-off/agents/diagnose.md +210 -0
- package/dist/learning-off/agents/knowledge.md +90 -0
- package/dist/learning-off/agents/research.md +149 -0
- package/dist/learning-off/agents/review.md +228 -0
- package/dist/learning-off/agents/scrutinize.md +117 -0
- package/{src/assets → dist/learning-off}/agents/skim.md +5 -10
- package/dist/learning-off/agents/triage.md +163 -0
- package/dist/learning-off/commands/bug-analysis.md +420 -0
- package/dist/learning-off/commands/code-review.md +525 -0
- package/dist/learning-off/commands/debug.md +294 -0
- package/dist/learning-off/commands/dynamic-build.md +1255 -0
- package/dist/learning-off/commands/dynamic-plan.md +424 -0
- package/dist/learning-off/commands/dynamic-profile.md +214 -0
- package/dist/learning-off/commands/dynamic-tickets.md +632 -0
- package/dist/learning-off/commands/explore.md +210 -0
- package/dist/learning-off/commands/implement.md +808 -0
- package/dist/learning-off/commands/plan.md +664 -0
- package/dist/learning-off/commands/release.md +310 -0
- package/dist/learning-off/commands/research.md +222 -0
- package/dist/learning-off/commands/resolve.md +837 -0
- package/dist/learning-off/commands/self-review.md +266 -0
- package/dist/skills/git/references/tracker/_contract.md +33 -0
- package/dist/skills/git/references/tracker/github/fetch-issue.md +2 -0
- package/dist/skills/git/references/tracker/github/fetch-issues-batch.md +2 -0
- package/dist/skills/git/references/tracker/github/gather-release-evidence.md +5 -1
- package/dist/skills/git/references/tracker/github/post-wave-report.md +2 -0
- package/dist/skills/git/references/tracker/github/setup-task.md +12 -0
- package/dist/skills/git/references/tracker/jira/associate-release.md +1 -1
- package/dist/skills/git/references/tracker/jira/fetch-issue.md +2 -0
- package/dist/skills/git/references/tracker/jira/fetch-issues-batch.md +2 -0
- package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +5 -1
- package/dist/skills/git/references/tracker/jira/post-wave-report.md +2 -0
- package/dist/skills/git/references/tracker/jira/setup-task.md +14 -2
- package/dist/skills/git/references/tracker/linear/associate-release.md +1 -1
- package/dist/skills/git/references/tracker/linear/fetch-issue.md +2 -0
- package/dist/skills/git/references/tracker/linear/fetch-issues-batch.md +2 -0
- package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +5 -1
- package/dist/skills/git/references/tracker/linear/post-wave-report.md +2 -0
- package/dist/skills/git/references/tracker/linear/setup-task.md +14 -2
- package/dist/targets/claude-code/installer.js +72 -36
- package/dist/targets/claude-code/language-stamp.js +185 -0
- package/dist/targets/claude-code/learning-install.js +489 -0
- package/package.json +1 -1
- package/src/assets/agents/code.mds +339 -0
- package/src/assets/agents/design.mds +149 -0
- package/src/assets/agents/diagnose.mds +225 -0
- package/src/assets/agents/evaluate.md +12 -25
- package/src/assets/agents/git.mds +29 -56
- package/src/assets/agents/knowledge.mds +125 -0
- package/src/assets/agents/learning.md +4 -6
- package/src/assets/agents/research.mds +176 -0
- package/src/assets/agents/review.mds +286 -0
- package/src/assets/agents/scrutinize.mds +132 -0
- package/src/assets/agents/simplify.md +20 -0
- package/src/assets/agents/skim.mds +161 -0
- package/src/assets/agents/synthesize.md +12 -0
- package/src/assets/agents/test.md +2 -2
- package/src/assets/agents/triage.mds +194 -0
- package/src/assets/agents/validate.md +15 -8
- package/src/assets/commands/_partials/_compliance.mds +5 -4
- package/src/assets/commands/_partials/_decisions.mds +31 -0
- package/src/assets/commands/_partials/_engine.mds +29 -24
- package/src/assets/commands/_partials/_knowledge.mds +26 -13
- package/src/assets/commands/_partials/_plan_contract.mds +1 -1
- package/src/assets/commands/_partials/_preamble.mds +33 -9
- package/src/assets/commands/_partials/_publication.mds +5 -4
- package/src/assets/commands/_partials/_settings.mds +13 -5
- package/src/assets/commands/_partials/_wave.mds +16 -6
- package/src/assets/commands/bug-analysis.mds +24 -2
- package/src/assets/commands/code-review.mds +148 -45
- package/src/assets/commands/debug.mds +17 -1
- package/src/assets/commands/dynamic-build.mds +144 -65
- package/src/assets/commands/dynamic-plan.mds +36 -6
- package/src/assets/commands/dynamic-profile.mds +9 -1
- package/src/assets/commands/dynamic-tickets.mds +16 -2
- package/src/assets/commands/explore.mds +27 -1
- package/src/assets/commands/implement.mds +171 -138
- package/src/assets/commands/plan.mds +47 -8
- package/src/assets/commands/{release.md → release.mds} +27 -24
- package/src/assets/commands/research.mds +28 -4
- package/src/assets/commands/resolve.mds +69 -17
- package/src/assets/commands/self-review.mds +43 -13
- package/src/assets/mds/tracker/_common.mds +1 -1
- package/src/assets/mds/tracker/_contract.mds +72 -0
- package/src/assets/mds/tracker/_github.mds +13 -2
- package/src/assets/mds/tracker/_jira.mds +17 -5
- package/src/assets/mds/tracker/_linear.mds +17 -5
- package/src/assets/mds/tracker/_mcp.mds +2 -2
- package/src/assets/mds/tracker/_steps.mds +97 -0
- package/src/assets/rules/context-economy.md +10 -0
- package/src/assets/rules/go.md +1 -0
- package/src/assets/rules/java.md +1 -0
- package/src/assets/rules/python.md +1 -0
- package/src/assets/rules/rust.md +1 -0
- package/src/assets/rules/typescript.md +1 -0
- package/src/assets/scripts/ci-wait.cjs +636 -0
- package/src/assets/scripts/claude-md-audit.cjs +611 -0
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +2 -3
- package/src/assets/scripts/hooks/background-memory-update +290 -9
- package/src/assets/scripts/hooks/json-helper.cjs +13 -5
- package/src/assets/scripts/hooks/json-parse +34 -10
- package/src/assets/scripts/hooks/session-start-context +315 -7
- package/src/assets/scripts/release-trace.cjs +27 -10
- package/src/assets/skills/accessibility/SKILL.md +1 -1
- package/src/assets/skills/apply-decisions/SKILL.md +12 -82
- package/src/assets/skills/apply-feature-knowledge/SKILL.md +9 -43
- package/src/assets/skills/architecture/SKILL.md +1 -1
- package/src/assets/skills/boundary-validation/SKILL.md +1 -1
- package/src/assets/skills/complexity/SKILL.md +1 -1
- package/src/assets/skills/compliance/SKILL.md +1 -1
- package/src/assets/skills/consistency/SKILL.md +1 -1
- package/src/assets/skills/database/SKILL.md +1 -1
- package/src/assets/skills/dependencies/SKILL.md +1 -1
- package/src/assets/skills/dependency-research/SKILL.md +3 -6
- package/src/assets/skills/design-review/SKILL.md +1 -1
- package/src/assets/skills/docs-framework/SKILL.md +1 -1
- package/src/assets/skills/documentation/SKILL.md +1 -1
- package/src/assets/skills/feature-knowledge/SKILL.md +43 -12
- package/src/assets/skills/gap-analysis/SKILL.md +1 -1
- package/src/assets/skills/git/SKILL.md +1 -1
- package/src/assets/skills/go/SKILL.md +1 -1
- package/src/assets/skills/java/SKILL.md +1 -1
- package/src/assets/skills/patterns/SKILL.md +1 -1
- package/src/assets/skills/performance/SKILL.md +1 -1
- package/src/assets/skills/python/SKILL.md +1 -1
- package/src/assets/skills/qa/SKILL.md +1 -3
- package/src/assets/skills/quality-gates/SKILL.md +10 -13
- package/src/assets/skills/quality-gates/references/report-template.md +20 -20
- package/src/assets/skills/react/SKILL.md +1 -1
- package/src/assets/skills/regression/SKILL.md +1 -1
- package/src/assets/skills/reliability/SKILL.md +1 -1
- package/src/assets/skills/research-codebase/SKILL.md +1 -1
- package/src/assets/skills/research-competitor/SKILL.md +1 -1
- package/src/assets/skills/research-external/SKILL.md +1 -1
- package/src/assets/skills/research-technology/SKILL.md +1 -1
- package/src/assets/skills/review-methodology/SKILL.md +1 -1
- package/src/assets/skills/rust/SKILL.md +1 -1
- package/src/assets/skills/security/SKILL.md +1 -1
- package/src/assets/skills/software-design/SKILL.md +1 -1
- package/src/assets/skills/test-driven-development/SKILL.md +9 -29
- package/src/assets/skills/testing/SKILL.md +1 -1
- package/src/assets/skills/typescript/SKILL.md +1 -1
- package/src/assets/skills/ui-design/SKILL.md +1 -1
- package/src/assets/skills/worktree-support/SKILL.md +3 -55
- package/src/assets/skills/worktree-support/references/discovery.md +48 -0
- package/src/assets/skills/worktree-support/references/roots.md +2 -2
|
@@ -4,6 +4,7 @@ output-dir: dist/commands
|
|
|
4
4
|
---
|
|
5
5
|
@import { knowledge_writeback } from "./_partials/_knowledge.mds"
|
|
6
6
|
@import { decisions_load } from "./_partials/_decisions.mds"
|
|
7
|
+
@import "./_partials/_settings.mds" as settings
|
|
7
8
|
# Explore Command
|
|
8
9
|
|
|
9
10
|
Explore a codebase area by spawning parallel agents for flow tracing, dependency mapping, and pattern analysis. Findings are synthesized into structured output with file:line references, with optional feature knowledge created as a byproduct.
|
|
@@ -31,21 +32,34 @@ $ARGUMENTS
|
|
|
31
32
|
|
|
32
33
|
## Phases
|
|
33
34
|
|
|
35
|
+
<!-- learning:on -->
|
|
34
36
|
### Phase 1: Load Decisions (Orchestrator-Local)
|
|
37
|
+
<!-- learning:off -->
|
|
38
|
+
### Phase 1: Resolve Settings
|
|
39
|
+
<!-- learning:end -->
|
|
35
40
|
|
|
41
|
+
<!-- learning:on -->
|
|
36
42
|
**Produces:** DECISIONS_CONTEXT
|
|
37
43
|
|
|
38
|
-
|
|
44
|
+
<!-- learning:end -->
|
|
45
|
+
{{settings.settings_resolve()}}
|
|
39
46
|
|
|
47
|
+
{{decisions_load()}}
|
|
48
|
+
<!-- learning:on -->
|
|
40
49
|
The orchestrator uses `DECISIONS_CONTEXT` locally when framing exploration — prior decisions and pitfalls suggest specific areas to investigate. Follow `devflow:apply-decisions` to Read full entry bodies on demand. **Do NOT pass `DECISIONS_CONTEXT` to Explore sub-agents** — decisions context stays in the orchestrator, not in the investigation workers.
|
|
41
50
|
|
|
51
|
+
<!-- learning:end -->
|
|
42
52
|
**No up-front feature knowledge load** — explore investigation workers read code directly to avoid confirmation bias. Feature knowledge is only created as a write-back at the end, after exploration is complete.
|
|
43
53
|
|
|
44
54
|
### Phase 2: Orient
|
|
45
55
|
|
|
46
56
|
**Produces:** ORIENT_OUTPUT
|
|
47
57
|
|
|
58
|
+
<!-- learning:on -->
|
|
59
|
+
Spawn `Agent(subagent_type="Skim")` with `LEARNING` from the settings line, to get codebase overview relevant to the exploration question:
|
|
60
|
+
<!-- learning:off -->
|
|
48
61
|
Spawn `Agent(subagent_type="Skim")` to get codebase overview relevant to the exploration question:
|
|
62
|
+
<!-- learning:end -->
|
|
49
63
|
|
|
50
64
|
- File structure and module boundaries in the target area
|
|
51
65
|
- Entry points and key abstractions
|
|
@@ -91,7 +105,11 @@ Present findings to user. Use AskUserQuestion to offer focused follow-up explora
|
|
|
91
105
|
|
|
92
106
|
### Phase 6: Suggest Feature Knowledge Creation (Conditional)
|
|
93
107
|
|
|
108
|
+
<!-- learning:on -->
|
|
94
109
|
**Requires:** MERGED_FINDINGS, DECISIONS_CONTEXT
|
|
110
|
+
<!-- learning:off -->
|
|
111
|
+
**Requires:** MERGED_FINDINGS
|
|
112
|
+
<!-- learning:end -->
|
|
95
113
|
**Produces:** FEATURE_KNOWLEDGE_STATUS (created | skipped)
|
|
96
114
|
|
|
97
115
|
1. Check if matching feature knowledge already exists by reading `{worktree}/.devflow/features/index.md` (or globbing frontmatter if absent). If covered → skip
|
|
@@ -125,7 +143,11 @@ Structured exploration findings with concrete code references:
|
|
|
125
143
|
```
|
|
126
144
|
/explore (orchestrator)
|
|
127
145
|
│
|
|
146
|
+
<!-- learning:on -->
|
|
128
147
|
├─ Phase 1: Load Decisions (Orchestrator-Local)
|
|
148
|
+
<!-- learning:off -->
|
|
149
|
+
├─ Phase 1: Resolve Settings
|
|
150
|
+
<!-- learning:end -->
|
|
129
151
|
│
|
|
130
152
|
├─ Phase 2: Orient
|
|
131
153
|
│ └─ Skim agent (codebase overview)
|
|
@@ -146,7 +168,11 @@ Structured exploration findings with concrete code references:
|
|
|
146
168
|
|
|
147
169
|
1. **Structure over browsing** - Every claim must cite file:line references
|
|
148
170
|
2. **Parallel execution** - All explorers run simultaneously for speed
|
|
171
|
+
<!-- learning:on -->
|
|
149
172
|
3. **Knowledge-informed** - Prior decisions guide where to look; NO pre-loaded feature knowledge in sub-agents (avoids confirmation bias)
|
|
173
|
+
<!-- learning:off -->
|
|
174
|
+
3. **Knowledge-informed** - NO pre-loaded feature knowledge in sub-agents (avoids confirmation bias)
|
|
175
|
+
<!-- learning:end -->
|
|
150
176
|
4. **User-driven depth** - Present findings, then offer drill-down into specific areas
|
|
151
177
|
|
|
152
178
|
## Error Handling
|
|
@@ -10,6 +10,7 @@ output-dir: dist/commands
|
|
|
10
10
|
@import { test_plan_line } from "./_partials/_plan_contract.mds"
|
|
11
11
|
@import { publication_gate } from "./_partials/_publication.mds"
|
|
12
12
|
@import "./_partials/_compliance.mds" as compliance
|
|
13
|
+
@import "./_partials/_settings.mds" as settings
|
|
13
14
|
# Implement Command
|
|
14
15
|
|
|
15
16
|
Orchestrate a single task through implementation by spawning specialized agents. The orchestrator only spawns agents and passes context - all work is done by agents.
|
|
@@ -50,14 +51,18 @@ When the user explicitly asks to re-validate, re-check, or re-run quality gates
|
|
|
50
51
|
1. **Branch safety check**: If on a protected branch (main, master, develop, etc.), run Phase 1 to create/switch to a work branch. If already on a work branch, skip Phase 1.
|
|
51
52
|
2. **Skip Phase 2** — no Code agent needed, user already made changes.
|
|
52
53
|
3. **Detect FILES_CHANGED**: `git diff --name-only {base_branch}...HEAD`
|
|
53
|
-
4. **Run Phases 3-8** — full
|
|
54
|
+
4. **Run Phases 3-8** — Simplify, Self-Review, Alignment, the one full Validate, QA Testing and the conditional Re-Validate, on the detected changes.
|
|
54
55
|
5. **Proceed to Phase 10** (Create PR), **Phase 10b** (Evidence) and **Phase 11** (Report).
|
|
55
56
|
|
|
56
57
|
If the user prompt does NOT match re-validation, proceed with the full pipeline below.
|
|
57
58
|
|
|
58
59
|
### Phase 1: Setup
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
<!-- learning:on -->
|
|
62
|
+
**Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
|
|
63
|
+
<!-- learning:off -->
|
|
64
|
+
**Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, PR_DESCRIPTION_GUIDANCE, ISSUE_NUMBER, EVIDENCE_POLICY, ISSUE_REQUIRED, APPLY_CONVENTIONS, REQUIRE_NON_AUTHOR_APPROVAL, PR_EXCEPTIONS, TEST_PLAN, EVIDENCE_FILE, PR_TEST_PLAN_BLOCK, REVIEW_PUBLICATION
|
|
65
|
+
<!-- learning:end -->
|
|
61
66
|
|
|
62
67
|
Record the current branch name as `BASE_BRANCH` - this will be the PR target.
|
|
63
68
|
|
|
@@ -167,13 +172,16 @@ node "$HOME/.devflow/scripts/verify-evidence.cjs" render --plan "{worktree}/.dev
|
|
|
167
172
|
|
|
168
173
|
- `EVIDENCE_FILE` — `{worktree}/.devflow/docs/evidence-{branch_slug}.md`, its `## Evidence Exceptions` section now a byte copy of `PR_EXCEPTIONS` (absent when that is `(none)`).
|
|
169
174
|
|
|
175
|
+
{{settings.settings_resolve()}}
|
|
176
|
+
|
|
170
177
|
{{publication_gate()}}
|
|
171
178
|
Phase 10b passes the resolved value to `update-pr-evidence`, which decides what each value means for the evidence comment. From the same line: {{compliance.compliance_frameworks()}} Pass it to every Code spawn.
|
|
172
179
|
|
|
173
180
|
{{decisions_load()}}
|
|
181
|
+
<!-- learning:on -->
|
|
182
|
+
Pass `DECISIONS_CONTEXT` to Code agent (Phase 2) and Scrutinize agent (Phase 4).
|
|
174
183
|
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
<!-- learning:end -->
|
|
177
185
|
{{knowledge_load()}}
|
|
178
186
|
|
|
179
187
|
### Phase 2: Implement
|
|
@@ -199,7 +207,8 @@ Based on Setup context (plan document, issue body, or conversation context), use
|
|
|
199
207
|
|
|
200
208
|
```
|
|
201
209
|
Agent(subagent_type="Code"):
|
|
202
|
-
"
|
|
210
|
+
"OPERATION: implement
|
|
211
|
+
TASK_ID: {task-id}
|
|
203
212
|
TASK_DESCRIPTION: {description}
|
|
204
213
|
BASE_BRANCH: {base branch}
|
|
205
214
|
EXECUTION_PLAN: {full plan from setup context}
|
|
@@ -207,7 +216,9 @@ PATTERNS: {patterns from plan document or empty}
|
|
|
207
216
|
CREATE_PR: true
|
|
208
217
|
DOMAIN: {detected domain or 'fullstack'}
|
|
209
218
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
219
|
+
<!-- learning:on -->
|
|
210
220
|
DECISIONS_CONTEXT: {decisions_context}
|
|
221
|
+
<!-- learning:end -->
|
|
211
222
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
|
|
212
223
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
213
224
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
@@ -220,12 +231,13 @@ PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}"
|
|
|
220
231
|
|
|
221
232
|
**SEQUENTIAL_CODE_AGENTS** (for HIGH/CRITICAL context risk):
|
|
222
233
|
|
|
223
|
-
Spawn Code agents one at a time
|
|
234
|
+
Spawn Code agents one at a time. Each appends its own phase section to the handoff file, and the next reads only the section before it:
|
|
224
235
|
|
|
225
236
|
**Phase 1 Code agent:**
|
|
226
237
|
```
|
|
227
238
|
Agent(subagent_type="Code"):
|
|
228
|
-
"
|
|
239
|
+
"OPERATION: implement
|
|
240
|
+
TASK_ID: {task-id}
|
|
229
241
|
TASK_DESCRIPTION: {phase 1 description}
|
|
230
242
|
BASE_BRANCH: {base branch}
|
|
231
243
|
EXECUTION_PLAN: {phase 1 steps}
|
|
@@ -233,7 +245,9 @@ PATTERNS: {patterns from plan document or empty}
|
|
|
233
245
|
CREATE_PR: false
|
|
234
246
|
DOMAIN: {phase 1 domain, e.g., 'backend'}
|
|
235
247
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
248
|
+
<!-- learning:on -->
|
|
236
249
|
DECISIONS_CONTEXT: {decisions_context}
|
|
250
|
+
<!-- learning:end -->
|
|
237
251
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
|
|
238
252
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
239
253
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
@@ -245,7 +259,8 @@ HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
|
|
|
245
259
|
**Phase 2+ Code agents** (after prior phase completes):
|
|
246
260
|
```
|
|
247
261
|
Agent(subagent_type="Code"):
|
|
248
|
-
"
|
|
262
|
+
"OPERATION: implement
|
|
263
|
+
TASK_ID: {task-id}
|
|
249
264
|
TASK_DESCRIPTION: {phase N description}
|
|
250
265
|
BASE_BRANCH: {base branch}
|
|
251
266
|
EXECUTION_PLAN: {phase N steps}
|
|
@@ -255,7 +270,9 @@ DOMAIN: {phase N domain, e.g., 'frontend'}
|
|
|
255
270
|
PRIOR_PHASE_SUMMARY: {summary from previous Code agent}
|
|
256
271
|
FILES_FROM_PRIOR_PHASE: {list of files created}
|
|
257
272
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
273
|
+
<!-- learning:on -->
|
|
258
274
|
DECISIONS_CONTEXT: {decisions_context}
|
|
275
|
+
<!-- learning:end -->
|
|
259
276
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
|
|
260
277
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
261
278
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
@@ -266,7 +283,7 @@ HANDOFF_REQUIRED: {true if not last phase}
|
|
|
266
283
|
HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
|
|
267
284
|
```
|
|
268
285
|
|
|
269
|
-
**Handoff Protocol**: Each sequential Code agent receives the prior Code agent's implementation summary via PRIOR_PHASE_SUMMARY and FILES_FROM_PRIOR_PHASE. The Code agent's built-in branch orientation step handles git log scanning, file reading, and pattern discovery automatically.
|
|
286
|
+
**Handoff Protocol**: Each sequential Code agent receives the prior Code agent's implementation summary via PRIOR_PHASE_SUMMARY and FILES_FROM_PRIOR_PHASE. The Code agent's built-in branch orientation step handles git log scanning, file reading, and pattern discovery automatically. Each Code agent with HANDOFF_REQUIRED=true appends its own `## Phase {N} Implementation Summary` section, at most 8,192 bytes, to `{worktree}/.devflow/docs/handoff-{branch_slug}.md` (survives context compaction), never rewriting an earlier section and keeping any `## Evidence Exceptions` section byte-identical; the next Code agent reads only the section of the phase immediately before its own through HANDOFF_FILE. The orchestrator writes no phase section. Delete `{worktree}/.devflow/docs/handoff-{branch_slug}.md` once the PR exists — after the final Code agent, which creates it, completes (cleanup).
|
|
270
287
|
|
|
271
288
|
---
|
|
272
289
|
|
|
@@ -276,7 +293,8 @@ Spawn multiple Code agents **in a single message**, each with independent subtas
|
|
|
276
293
|
|
|
277
294
|
```
|
|
278
295
|
Agent(subagent_type="Code"): # Code agent 1
|
|
279
|
-
"
|
|
296
|
+
"OPERATION: implement
|
|
297
|
+
TASK_ID: {task-id}-part1
|
|
280
298
|
TASK_DESCRIPTION: {independent subtask 1}
|
|
281
299
|
BASE_BRANCH: {base branch}
|
|
282
300
|
EXECUTION_PLAN: {subtask 1 steps}
|
|
@@ -284,14 +302,17 @@ PATTERNS: {patterns}
|
|
|
284
302
|
CREATE_PR: false
|
|
285
303
|
DOMAIN: {subtask 1 domain}
|
|
286
304
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
305
|
+
<!-- learning:on -->
|
|
287
306
|
DECISIONS_CONTEXT: {decisions_context}
|
|
307
|
+
<!-- learning:end -->
|
|
288
308
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
|
|
289
309
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
290
310
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
291
311
|
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}"
|
|
292
312
|
|
|
293
313
|
Agent(subagent_type="Code"): # Code agent 2 (same message)
|
|
294
|
-
"
|
|
314
|
+
"OPERATION: implement
|
|
315
|
+
TASK_ID: {task-id}-part2
|
|
295
316
|
TASK_DESCRIPTION: {independent subtask 2}
|
|
296
317
|
BASE_BRANCH: {base branch}
|
|
297
318
|
EXECUTION_PLAN: {subtask 2 steps}
|
|
@@ -299,7 +320,9 @@ PATTERNS: {patterns}
|
|
|
299
320
|
CREATE_PR: false
|
|
300
321
|
DOMAIN: {subtask 2 domain}
|
|
301
322
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
323
|
+
<!-- learning:on -->
|
|
302
324
|
DECISIONS_CONTEXT: {decisions_context}
|
|
325
|
+
<!-- learning:end -->
|
|
303
326
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}
|
|
304
327
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
305
328
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
@@ -312,110 +335,48 @@ ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}"
|
|
|
312
335
|
- Different files/modules with no imports between them
|
|
313
336
|
- Each subtask is self-contained
|
|
314
337
|
|
|
315
|
-
### Phase 3:
|
|
316
|
-
|
|
317
|
-
**Produces:** VALIDATION_RESULT
|
|
318
|
-
**Requires:** FILES_CHANGED
|
|
319
|
-
|
|
320
|
-
After Code agent completes, spawn Validate agent to verify correctness:
|
|
321
|
-
|
|
322
|
-
```
|
|
323
|
-
Agent(subagent_type="Validate"):
|
|
324
|
-
"FILES_CHANGED: {list of files from Code agent output}
|
|
325
|
-
VALIDATION_SCOPE: full
|
|
326
|
-
Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
**If FAIL:**
|
|
330
|
-
1. Extract failure details from Validate agent output
|
|
331
|
-
2. Increment `validation_retry_count`
|
|
332
|
-
3. If `validation_retry_count <= 2`:
|
|
333
|
-
- Spawn Code agent with fix context:
|
|
334
|
-
```
|
|
335
|
-
Agent(subagent_type="Code"):
|
|
336
|
-
"TASK_ID: {task-id}
|
|
337
|
-
TASK_DESCRIPTION: Fix validation failures
|
|
338
|
-
OPERATION: validation-fix
|
|
339
|
-
VALIDATION_FAILURES: {parsed failures from Validate agent}
|
|
340
|
-
SCOPE: Fix only the listed failures, no other changes
|
|
341
|
-
CREATE_PR: false
|
|
342
|
-
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
343
|
-
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
344
|
-
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
345
|
-
```
|
|
346
|
-
- Loop back to Phase 3 (re-validate)
|
|
347
|
-
4. If `validation_retry_count > 2`: Report failures to user and halt
|
|
348
|
-
|
|
349
|
-
**If PASS:** append a `gate:validate` claim, then continue to Phase 4.
|
|
350
|
-
|
|
351
|
-
**Evidence claims** are lines appended to the `## Claims` section of `EVIDENCE_FILE` — the file's last section, created when absent. Append only: never edit or remove a claim; the last valid one per target wins. Each line takes exactly one of these shapes, where `<head>` is the 40-hex `HEAD:` the agent's report shows:
|
|
352
|
-
|
|
353
|
-
```
|
|
354
|
-
- gate:validate PASS sha:<head> by:validate
|
|
355
|
-
- TP-<n> <PASS|FAIL|SKIP> sha:<head> by:test exit:<0-255>
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
- `gate:validate` — after a Phase 3 or Phase 6 PASS.
|
|
359
|
-
- `TP-<n>` — after every Phase 8 run, one line per `### Test Plan Evidence` row whose TP is in `TEST_PLAN`, with the row's outcome; the line ends at `by:test` when the row's Exit is not a number from 0 to 255.
|
|
360
|
-
- Append nothing from a report whose `HEAD:` is not a single 40-hex SHA — a reported before/after change included — and say so in the Phase 11 report.
|
|
361
|
-
|
|
362
|
-
### Phase 4: Simplify
|
|
338
|
+
### Phase 3: Simplify
|
|
363
339
|
|
|
364
340
|
**Produces:** SIMPLIFY_OUTPUT
|
|
365
341
|
**Requires:** FILES_CHANGED
|
|
366
342
|
|
|
367
|
-
After
|
|
343
|
+
After the Code agent completes, spawn Simplify agent to polish the code. The Phase 6 Validate covers its commits.
|
|
368
344
|
|
|
369
345
|
```
|
|
370
346
|
Agent(subagent_type="Simplify"):
|
|
371
347
|
"Simplify recently implemented code
|
|
372
348
|
Task: {task description}
|
|
373
349
|
FILES_CHANGED: {list of files from Code agent output}
|
|
374
|
-
Focus on code modified by Code agent, apply project standards, enhance clarity
|
|
350
|
+
Focus on code modified by Code agent, apply project standards, enhance clarity
|
|
351
|
+
Commit any improvements with a conventional-commit message."
|
|
375
352
|
```
|
|
376
353
|
|
|
377
|
-
### Phase
|
|
354
|
+
### Phase 4: Self-Review
|
|
378
355
|
|
|
379
356
|
**Produces:** SCRUTINIZE_OUTPUT
|
|
380
357
|
**Requires:** FILES_CHANGED
|
|
381
358
|
|
|
382
|
-
After Simplify agent completes, spawn Scrutinize agent as
|
|
359
|
+
After Simplify agent completes, spawn Scrutinize agent as the quality gate:
|
|
383
360
|
|
|
384
361
|
```
|
|
385
362
|
Agent(subagent_type="Scrutinize"):
|
|
386
363
|
"TASK_DESCRIPTION: {task description}
|
|
387
364
|
FILES_CHANGED: {list of files from Code agent output}
|
|
365
|
+
<!-- learning:on -->
|
|
388
366
|
DECISIONS_CONTEXT: {decisions_context}
|
|
389
|
-
|
|
367
|
+
<!-- learning:end -->
|
|
368
|
+
FEATURE_KNOWLEDGE: {feature_knowledge_rules}
|
|
390
369
|
Evaluate 9 pillars, fix P0/P1 issues, report status"
|
|
391
370
|
```
|
|
392
371
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
### Phase 6: Re-Validate (if Scrutinize agent made changes)
|
|
396
|
-
|
|
397
|
-
**Produces:** REVALIDATION_RESULT
|
|
398
|
-
**Requires:** SCRUTINIZE_OUTPUT
|
|
399
|
-
|
|
400
|
-
If Scrutinize agent made code changes (status: FIXED), spawn Validate agent to verify:
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
Agent(subagent_type="Validate"):
|
|
404
|
-
"FILES_CHANGED: {files modified by Scrutinize agent}
|
|
405
|
-
VALIDATION_SCOPE: changed-only
|
|
406
|
-
Verify Scrutinize agent's fixes didn't break anything."
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
**If FAIL:** Report to user - Scrutinize agent broke tests, needs manual intervention.
|
|
410
|
-
|
|
411
|
-
**If PASS:** append a `gate:validate` claim (Phase 3's **Evidence claims**), then continue to Phase 7.
|
|
372
|
+
Scrutinize agent reports `### Status: PASS | FIXED | BLOCKED`. **If BLOCKED:** report to user and halt. **If PASS or FIXED:** continue to Phase 5. A FIXED status commits fixes and starts no Validate of its own: the Phase 6 run covers them.
|
|
412
373
|
|
|
413
|
-
### Phase
|
|
374
|
+
### Phase 5: Alignment Check
|
|
414
375
|
|
|
415
376
|
**Produces:** ALIGNMENT_RESULT
|
|
416
377
|
**Requires:** FILES_CHANGED, EXECUTION_PLAN
|
|
417
378
|
|
|
418
|
-
After Scrutinize agent passes
|
|
379
|
+
After Scrutinize agent passes, spawn Evaluate agent to validate alignment. Evaluate agent receives `FEATURE_KNOWLEDGE_RULES` as acceptance context only; pattern and anti-pattern judgments belong to Scrutinize agent:
|
|
419
380
|
|
|
420
381
|
```
|
|
421
382
|
Agent(subagent_type="Evaluate"):
|
|
@@ -423,11 +384,11 @@ Agent(subagent_type="Evaluate"):
|
|
|
423
384
|
EXECUTION_PLAN: {execution plan from Phase 1}
|
|
424
385
|
FILES_CHANGED: {list of files from Code agent output}
|
|
425
386
|
ACCEPTANCE_CRITERIA: {extracted criteria if available}
|
|
426
|
-
FEATURE_KNOWLEDGE: {
|
|
387
|
+
FEATURE_KNOWLEDGE: {feature_knowledge_rules}
|
|
427
388
|
Validate alignment with request and plan. Report ALIGNED or MISALIGNED with details."
|
|
428
389
|
```
|
|
429
390
|
|
|
430
|
-
**If ALIGNED:** Continue to Phase
|
|
391
|
+
**If ALIGNED:** Continue to Phase 6
|
|
431
392
|
|
|
432
393
|
**If MISALIGNED:**
|
|
433
394
|
1. Extract misalignment details from Evaluate agent output
|
|
@@ -436,32 +397,78 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
|
|
|
436
397
|
- Spawn Code agent to fix misalignments:
|
|
437
398
|
```
|
|
438
399
|
Agent(subagent_type="Code"):
|
|
439
|
-
"
|
|
400
|
+
"OPERATION: alignment-fix
|
|
401
|
+
TASK_ID: {task-id}
|
|
440
402
|
TASK_DESCRIPTION: Fix alignment issues
|
|
441
|
-
OPERATION: alignment-fix
|
|
442
403
|
MISALIGNMENTS: {structured misalignments from Evaluate agent}
|
|
443
404
|
SCOPE: Fix only the listed misalignments, no other changes
|
|
444
405
|
CREATE_PR: false
|
|
406
|
+
<!-- learning:on -->
|
|
407
|
+
DECISIONS_CONTEXT: {decisions_context}
|
|
408
|
+
<!-- learning:end -->
|
|
445
409
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
446
410
|
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
447
411
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
448
412
|
```
|
|
449
|
-
-
|
|
413
|
+
- Loop back to Phase 5 (re-check alignment). The fix is not validated here: the Phase 6 run covers it.
|
|
414
|
+
4. If `alignment_fix_count > 2`: Report misalignments to user for decision
|
|
415
|
+
|
|
416
|
+
### Phase 6: Validate
|
|
417
|
+
|
|
418
|
+
**Produces:** VALIDATION_RESULT, VALIDATED_HEAD
|
|
419
|
+
**Requires:** BASE_BRANCH
|
|
420
|
+
|
|
421
|
+
Validate takes the one full-suite slot, after every commit it must cover: Code, Simplify, Scrutinize and the alignment fixes. After Evaluate agent passes, spawn Validate agent. `FILES_CHANGED` is the branch diff, because the Code agent's own list misses the Simplify, Scrutinize and fix commits (`{base}` is `BASE_BRANCH`):
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
Agent(subagent_type="Validate"):
|
|
425
|
+
"FILES_CHANGED: {output of `git diff --name-only {base}...HEAD`}
|
|
426
|
+
VALIDATION_SCOPE: full
|
|
427
|
+
Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
**If FAIL:**
|
|
431
|
+
1. Extract failure details from Validate agent output
|
|
432
|
+
2. Increment `validation_retry_count`
|
|
433
|
+
3. If `validation_retry_count <= 2`:
|
|
434
|
+
- Spawn Code agent with fix context:
|
|
450
435
|
```
|
|
451
|
-
Agent(subagent_type="
|
|
452
|
-
"
|
|
453
|
-
|
|
436
|
+
Agent(subagent_type="Code"):
|
|
437
|
+
"OPERATION: validation-fix
|
|
438
|
+
TASK_ID: {task-id}
|
|
439
|
+
TASK_DESCRIPTION: Fix validation failures
|
|
440
|
+
VALIDATION_FAILURES: {parsed failures from Validate agent}
|
|
441
|
+
SCOPE: Fix only the listed failures, no other changes
|
|
442
|
+
CREATE_PR: false
|
|
443
|
+
<!-- learning:on -->
|
|
444
|
+
DECISIONS_CONTEXT: {decisions_context}
|
|
445
|
+
<!-- learning:end -->
|
|
446
|
+
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
447
|
+
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
448
|
+
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
454
449
|
```
|
|
455
|
-
-
|
|
456
|
-
|
|
457
|
-
|
|
450
|
+
- Loop back to Phase 6 (re-validate at the new HEAD, full scope)
|
|
451
|
+
4. If `validation_retry_count > 2`: Report failures to user and halt
|
|
452
|
+
|
|
453
|
+
**If PASS:** append a `gate:validate` claim, run `git rev-parse HEAD` and record the result as `VALIDATED_HEAD`, then continue to Phase 7.
|
|
458
454
|
|
|
459
|
-
|
|
455
|
+
**Evidence claims** are lines appended to the `## Claims` section of `EVIDENCE_FILE` — the file's last section, created when absent. Append only: never edit or remove a claim; the last valid one per target wins. Each line takes exactly one of these shapes, where `<head>` is the 40-hex `HEAD:` the agent's report shows:
|
|
456
|
+
|
|
457
|
+
```
|
|
458
|
+
- gate:validate PASS sha:<head> by:validate
|
|
459
|
+
- TP-<n> <PASS|FAIL|SKIP> sha:<head> by:test exit:<0-255>
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
- `gate:validate` — after a Phase 6 or Phase 8 PASS.
|
|
463
|
+
- `TP-<n>` — after every Phase 7 run, one line per `### Test Plan Evidence` row whose TP is in `TEST_PLAN`, with the row's outcome; the line ends at `by:test` when the row's Exit is not a number from 0 to 255.
|
|
464
|
+
- Append nothing from a report whose `HEAD:` is not a single 40-hex SHA — a reported before/after change included — and say so in the Phase 11 report.
|
|
465
|
+
|
|
466
|
+
### Phase 7: QA Testing
|
|
460
467
|
|
|
461
468
|
**Produces:** QA_RESULT
|
|
462
|
-
**Requires:** FILES_CHANGED, EXECUTION_PLAN, TEST_PLAN
|
|
469
|
+
**Requires:** FILES_CHANGED, EXECUTION_PLAN, TEST_PLAN, VALIDATED_HEAD
|
|
463
470
|
|
|
464
|
-
After
|
|
471
|
+
After Phase 6 passes, spawn Test agent for scenario-based acceptance testing:
|
|
465
472
|
|
|
466
473
|
```
|
|
467
474
|
Agent(subagent_type="Test"):
|
|
@@ -473,9 +480,9 @@ TEST_PLAN: {the TP lines of the evidence file's ## Test Plan section, or (none)}
|
|
|
473
480
|
Design and execute scenario-based acceptance tests. Report PASS or FAIL with evidence."
|
|
474
481
|
```
|
|
475
482
|
|
|
476
|
-
After every Test agent run — PASS or FAIL, first run or retry — append its TP claims (Phase
|
|
483
|
+
After every Test agent run — PASS or FAIL, first run or retry — append its TP claims (Phase 6's **Evidence claims**).
|
|
477
484
|
|
|
478
|
-
**If PASS:** Continue to Phase
|
|
485
|
+
**If PASS:** Continue to Phase 8
|
|
479
486
|
|
|
480
487
|
**If FAIL:**
|
|
481
488
|
1. Extract failure details from Test agent output
|
|
@@ -484,25 +491,39 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
|
|
|
484
491
|
- Spawn Code agent to fix QA failures:
|
|
485
492
|
```
|
|
486
493
|
Agent(subagent_type="Code"):
|
|
487
|
-
"
|
|
494
|
+
"OPERATION: qa-fix
|
|
495
|
+
TASK_ID: {task-id}
|
|
488
496
|
TASK_DESCRIPTION: Fix QA test failures
|
|
489
|
-
OPERATION: qa-fix
|
|
490
497
|
QA_FAILURES: {structured failures from Test agent}
|
|
491
498
|
SCOPE: Fix only the listed failures, no other changes
|
|
492
499
|
CREATE_PR: false
|
|
500
|
+
<!-- learning:on -->
|
|
501
|
+
DECISIONS_CONTEXT: {decisions_context}
|
|
502
|
+
<!-- learning:end -->
|
|
493
503
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
494
504
|
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
495
505
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
496
506
|
```
|
|
497
|
-
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
507
|
+
- Loop back to Phase 7 (re-run Test agent). The fix is not validated here: Phase 8 covers it.
|
|
508
|
+
4. If `qa_retry_count > 2`: Report QA failures to user for decision. The run stops at the report (Phase 11), so Phases 8 and 9 do not run.
|
|
509
|
+
|
|
510
|
+
### Phase 8: Re-Validate (only if a qa-fix committed)
|
|
511
|
+
|
|
512
|
+
**Produces:** REVALIDATION_RESULT
|
|
513
|
+
**Requires:** QA_RESULT, VALIDATED_HEAD
|
|
514
|
+
|
|
515
|
+
Run this phase only if a qa-fix committed (`git rev-parse HEAD` differs from `VALIDATED_HEAD`); otherwise skip it and continue to Phase 9. Spawn Validate agent over what changed since the Phase 6 run:
|
|
516
|
+
|
|
517
|
+
```
|
|
518
|
+
Agent(subagent_type="Validate"):
|
|
519
|
+
"FILES_CHANGED: {output of `git diff --name-only VALIDATED_HEAD..HEAD`}
|
|
520
|
+
VALIDATION_SCOPE: changed-only
|
|
521
|
+
Verify the qa-fix commits did not break anything."
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**If FAIL:** Report the failures to user and halt.
|
|
525
|
+
|
|
526
|
+
**If PASS:** append a `gate:validate` claim (Phase 6's **Evidence claims**), then continue to Phase 9.
|
|
506
527
|
|
|
507
528
|
### Phase 9: CI Status Gate
|
|
508
529
|
|
|
@@ -511,14 +532,26 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
|
|
|
511
532
|
|
|
512
533
|
Strategy-conditional: run when the PR already exists — **SINGLE_CODE_AGENT** and **SEQUENTIAL_CODE_AGENTS** (the Phase 2 Code agent with `CREATE_PR: true` creates it); skip for **PARALLEL_CODE_AGENTS** (its unified PR is created in Phase 10).
|
|
513
534
|
|
|
535
|
+
**Push first, outside the gate block.** The gate reads CI for the pushed head, and the Simplify, Scrutinize and fix commits reach the PR only by a push. Push once — never force, and no retry:
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
git push origin HEAD; echo "exit=$?"
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
`exit=0` continues to the gate. Any other result, a rejected non-fast-forward push included, records `TRACEABILITY: DEGRADED (ci push failed)` for the Phase 11 report, reports "CI status unknown — verify manually before merging" and proceeds to Phase 10 without waiting. `PR_NUMBER` is the number in `PR_URL`.
|
|
542
|
+
|
|
514
543
|
<!-- PATTERN: ci-status-gate -->
|
|
515
|
-
1.
|
|
544
|
+
1. Wait: run `cd {worktree} && HEAD_SHA=$(git rev-parse HEAD) && node "$HOME/.devflow/scripts/ci-wait.cjs" --pr {PR_NUMBER} --head "$HEAD_SHA"` through the Bash tool with `timeout: 600000`. Each run is one wait of at most 570 seconds and prints one line, `CI <STATUS> pr=… head=… failing=… pending=… waited=…` (INDETERMINATE adds `reason=…`). A missing or unparseable line, a status outside the six below, or a non-zero exit is INDETERMINATE.
|
|
516
545
|
2. **If PASSING** → proceed to Phase 10.
|
|
517
546
|
3. **If NO_PR or NO_CI** → skip: "No PR/CI configured, skipping CI validation." Proceed to Phase 10.
|
|
518
|
-
4. **If PENDING**
|
|
519
|
-
5. **If INDETERMINATE**
|
|
520
|
-
|
|
521
|
-
|
|
547
|
+
4. **If PENDING** and fewer than 3 waits have run → wait again (step 1). After the third wait → report "CI still running — verify manually before merging" and proceed.
|
|
548
|
+
5. **If INDETERMINATE** and fewer than 3 waits have run → wait again (step 1). After the third wait → report "CI status unknown — verify manually before merging" and proceed.
|
|
549
|
+
<!-- learning:on -->
|
|
550
|
+
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Code")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_FRAMEWORKS`, `CI_FAILURES`, `DECISIONS_CONTEXT` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Code agent fetches the full names and reads the logs itself and this command reads none. After a fix, push with the command above and, if a wait remains, wait again (step 1); a failed push records `TRACEABILITY: DEGRADED (ci push failed)`, reports "CI status unknown — verify manually before merging" and stops waiting. After the second fix still FAILING → report the failing checks and proceed.
|
|
551
|
+
<!-- learning:off -->
|
|
552
|
+
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Code")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_FRAMEWORKS`, `CI_FAILURES` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Code agent fetches the full names and reads the logs itself and this command reads none. After a fix, push with the command above and, if a wait remains, wait again (step 1); a failed push records `TRACEABILITY: DEGRADED (ci push failed)`, reports "CI status unknown — verify manually before merging" and stops waiting. After the second fix still FAILING → report the failing checks and proceed.
|
|
553
|
+
<!-- learning:end -->
|
|
554
|
+
7. **Budget**: at most 3 waits and 2 fixes in all. When one is spent, report the current status and proceed.
|
|
522
555
|
<!-- /PATTERN: ci-status-gate -->
|
|
523
556
|
|
|
524
557
|
### Phase 10: Create PR
|
|
@@ -532,9 +565,9 @@ Strategy-conditional: run when the PR already exists — **SINGLE_CODE_AGENT** a
|
|
|
532
565
|
|
|
533
566
|
```
|
|
534
567
|
Agent(subagent_type="Code"):
|
|
535
|
-
"
|
|
568
|
+
"OPERATION: pr-create
|
|
569
|
+
TASK_ID: {task-id}
|
|
536
570
|
TASK_DESCRIPTION: Create the unified PR for the parallel implementation
|
|
537
|
-
OPERATION: pr-create
|
|
538
571
|
BASE_BRANCH: {base branch}
|
|
539
572
|
CREATE_PR: true
|
|
540
573
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
@@ -584,7 +617,7 @@ Display completion summary with phase status, PR info, and next steps.
|
|
|
584
617
|
|
|
585
618
|
Show the test plan's evidence from Phase 10b: `Test plan: {VERIFIED-CI + ATTESTED-LOCAL}/{total} verified (VERIFIED-CI {n}, ATTESTED-LOCAL {n})`, read from the `EVIDENCE` line and never inferred, then its `**Body**:` / `**Comment**:` line verbatim. Without an `EVIDENCE` line, show `Test plan: evidence unavailable`; with no test plan, `Test plan: missing`.
|
|
586
619
|
|
|
587
|
-
If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or Phase 10b's push recorded one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
|
|
620
|
+
If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or Phase 9's push or Phase 10b's push recorded one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
|
|
588
621
|
|
|
589
622
|
If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lines in the report.
|
|
590
623
|
|
|
@@ -609,30 +642,30 @@ If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lin
|
|
|
609
642
|
│ ├─ SEQUENTIAL_CODE_AGENTS (15%): N Code agents with handoff summaries
|
|
610
643
|
│ └─ PARALLEL_CODE_AGENTS (5%): N Code agents in single message (rare)
|
|
611
644
|
│
|
|
612
|
-
├─ Phase 3:
|
|
613
|
-
│ └─ Validate agent (build, typecheck, lint, test)
|
|
614
|
-
│ └─ If FAIL: Code agent fix loop (max 2 retries) → re-validate
|
|
615
|
-
│ └─ If PASS: gate:validate claim → evidence file
|
|
616
|
-
│
|
|
617
|
-
├─ Phase 4: Simplify
|
|
645
|
+
├─ Phase 3: Simplify
|
|
618
646
|
│ └─ Simplify agent (refines code clarity and consistency)
|
|
619
647
|
│
|
|
620
|
-
├─ Phase
|
|
621
|
-
│ └─ Scrutinize agent (
|
|
648
|
+
├─ Phase 4: Self-Review
|
|
649
|
+
│ └─ Scrutinize agent (quality gate, fixes P0/P1; status PASS | FIXED | BLOCKED)
|
|
622
650
|
│
|
|
623
|
-
├─ Phase
|
|
624
|
-
│ └─ Validate agent (verify Scrutinize agent fixes)
|
|
625
|
-
│
|
|
626
|
-
├─ Phase 7: Alignment Check
|
|
651
|
+
├─ Phase 5: Alignment Check
|
|
627
652
|
│ └─ Evaluate agent (validates alignment - reports only, no fixes)
|
|
628
|
-
│ └─ If MISALIGNED: Code agent fix loop (max 2 iterations) →
|
|
653
|
+
│ └─ If MISALIGNED: Code agent fix loop (max 2 iterations) → re-check alignment
|
|
654
|
+
│
|
|
655
|
+
├─ Phase 6: Validate (the one full-suite slot)
|
|
656
|
+
│ └─ Validate agent (build, typecheck, lint, test over the branch diff)
|
|
657
|
+
│ └─ If FAIL: Code agent fix loop (max 2 retries) → re-validate at the new HEAD
|
|
658
|
+
│ └─ If PASS: record VALIDATED_HEAD, gate:validate claim → evidence file
|
|
629
659
|
│
|
|
630
|
-
├─ Phase
|
|
660
|
+
├─ Phase 7: QA Testing
|
|
631
661
|
│ └─ Test agent (scenario-based acceptance tests, TEST_PLAN) → one claim per TP row → evidence file
|
|
632
|
-
│ └─ If FAIL: Code agent fix loop (max 2 retries) →
|
|
662
|
+
│ └─ If FAIL: Code agent fix loop (max 2 retries) → re-test
|
|
663
|
+
│
|
|
664
|
+
├─ Phase 8: Re-Validate (only if a qa-fix committed)
|
|
665
|
+
│ └─ Validate agent (changed-only over VALIDATED_HEAD..HEAD) → gate:validate claim
|
|
633
666
|
│
|
|
634
667
|
├─ Phase 9: CI Status Gate (SINGLE_CODE_AGENT + SEQUENTIAL_CODE_AGENTS; skipped for PARALLEL_CODE_AGENTS)
|
|
635
|
-
│ └─
|
|
668
|
+
│ └─ Push the branch, then ci-wait.cjs (inline, one wait ≤ 570 s) → Code agent on FAILING (3 waits + 2 fixes)
|
|
636
669
|
│
|
|
637
670
|
├─ Phase 10: Create PR (if needed)
|
|
638
671
|
│ └─ SINGLE_CODE_AGENT: already created by the Phase 2 Code agent
|
|
@@ -651,7 +684,7 @@ If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lin
|
|
|
651
684
|
|
|
652
685
|
## Principles
|
|
653
686
|
|
|
654
|
-
1. **Orchestration only** - Command spawns agents, never does work itself
|
|
687
|
+
1. **Orchestration only** - Command spawns agents, never does work itself; the inline calls are the bounded plumbing the charter allows: the Phase 9 and Phase 10b pushes, the Phase 9 ci-wait call and the evidence script checks
|
|
655
688
|
2. **Plan-first** - Plan documents from `/plan` skip exploration/planning overhead entirely
|
|
656
689
|
3. **Coherence-first** - Single Code agent produces more consistent code (default ~80% of tasks)
|
|
657
690
|
4. **Agent ownership** - Each agent owns its output completely
|
|
@@ -661,7 +694,7 @@ If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lin
|
|
|
661
694
|
8. **Strict delegation** - Never perform agent work in main session. "Spawn X" means call Agent tool with X, not do X's work yourself
|
|
662
695
|
9. **Validate agent owns validation** - Never run `npm test`, `npm run build`, or similar in main session; always delegate to Validate agent
|
|
663
696
|
10. **Code agent owns fixes** - Never implement fixes in main session; spawn Code agent for validation failures and alignment fixes
|
|
664
|
-
11. **Loop limits** - Max 2 validation retries, max 2 alignment fix iterations before escalating to user
|
|
697
|
+
11. **Loop limits** - Max 2 validation retries, max 2 alignment fix iterations, max 2 QA retries before escalating to user; the CI gate allows at most 3 waits and 2 fixes
|
|
665
698
|
12. **CI awareness** - CI status is checked before merge for SINGLE_CODE_AGENT and SEQUENTIAL_CODE_AGENTS, whose PR exists from Phase 2; skipped for PARALLEL_CODE_AGENTS, whose PR is created in Phase 10; test-plan evidence (Phase 10b) is recorded under every strategy once the PR exists
|
|
666
699
|
|
|
667
700
|
## Error Handling
|