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
|
@@ -45,14 +45,14 @@ When the user explicitly asks to re-validate, re-check, or re-run quality gates
|
|
|
45
45
|
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.
|
|
46
46
|
2. **Skip Phase 2** — no Code agent needed, user already made changes.
|
|
47
47
|
3. **Detect FILES_CHANGED**: `git diff --name-only {base_branch}...HEAD`
|
|
48
|
-
4. **Run Phases 3-8** — full
|
|
48
|
+
4. **Run Phases 3-8** — Simplify, Self-Review, Alignment, the one full Validate, QA Testing and the conditional Re-Validate, on the detected changes.
|
|
49
49
|
5. **Proceed to Phase 10** (Create PR), **Phase 10b** (Evidence) and **Phase 11** (Report).
|
|
50
50
|
|
|
51
51
|
If the user prompt does NOT match re-validation, proceed with the full pipeline below.
|
|
52
52
|
|
|
53
53
|
### Phase 1: Setup
|
|
54
54
|
|
|
55
|
-
**Produces:** TASK_ID, BASE_BRANCH, EXECUTION_PLAN, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, 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
|
|
55
|
+
**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
|
|
56
56
|
|
|
57
57
|
Record the current branch name as `BASE_BRANCH` - this will be the PR target.
|
|
58
58
|
|
|
@@ -207,7 +207,7 @@ Accept the output only when it is exactly two lines: `exit=0` last and, before i
|
|
|
207
207
|
|
|
208
208
|
The accepted line is the only source of these values: the script alone folds the committed `.devflow/project.json`, the personal `.devflow/config.json` and the machine manifest.
|
|
209
209
|
|
|
210
|
-
**Resolve `REVIEW_PUBLICATION` per worktree:** take `REVIEW_PUBLICATION` from that worktree's settings line
|
|
210
|
+
**Resolve `REVIEW_PUBLICATION` per worktree:** take `REVIEW_PUBLICATION` from that worktree's settings line — the line resolved above for `{root}`, the worktree's root, by the settings block when this run has not yet resolved that root; multi-worktree repos may resolve different values per worktree. The line already caps the personal choice at the team's (D-PUBLICATION-CEILING), so it is `off`, `auto` or `full`, and `off` when the line was unresolvable.
|
|
211
211
|
|
|
212
212
|
**Evidence stub:** only when `EVIDENCE_POLICY` is `required`, a resolved `off` becomes `stub`, so a counts-only record still reaches the PR. `stub` is never a config value: the settings line never carries it.
|
|
213
213
|
|
|
@@ -216,6 +216,8 @@ Phase 10b passes the resolved value to `update-pr-evidence`, which decides what
|
|
|
216
216
|
|
|
217
217
|
### Load DECISIONS_CONTEXT
|
|
218
218
|
|
|
219
|
+
When the settings line says `LEARNING=off`, set `DECISIONS_CONTEXT` to `(none)` and skip this step, locating no ledger and reading no index.
|
|
220
|
+
|
|
219
221
|
The decisions ledger belongs to the repository, not to one checkout: in a linked worktree it lives in the main worktree, and a session started in a subdirectory reads the copy at the repository root. Locate it with ONE git call, run from the start directory — `WORKTREE_PATH` if provided, otherwise cwd (`devflow:worktree-support`):
|
|
220
222
|
|
|
221
223
|
```bash
|
|
@@ -243,7 +245,7 @@ The index is one direct file read, written at render time by `render-decisions.c
|
|
|
243
245
|
|
|
244
246
|
When `DECISIONS_CONTEXT` is not `(none)`, follow `devflow:apply-decisions` to scan the index, identify plausibly-relevant entries, Read full entry bodies on demand, and cite verbatim IDs in downstream agent prompts and reasoning.
|
|
245
247
|
|
|
246
|
-
Pass to Code agent (Phase 2) and Scrutinize agent (Phase
|
|
248
|
+
Pass `DECISIONS_CONTEXT` to Code agent (Phase 2) and Scrutinize agent (Phase 4).
|
|
247
249
|
|
|
248
250
|
### Load Feature Knowledge
|
|
249
251
|
|
|
@@ -273,22 +275,32 @@ Glob `{worktree}/.devflow/features/*/KNOWLEDGE.md`. For each file found, read on
|
|
|
273
275
|
|
|
274
276
|
Match the current task area and description against each index line (or frontmatter `description` + `directories` on fallback). Select entries whose documented area overlaps the current task. This is a relevance judgment — prefer specificity over breadth.
|
|
275
277
|
|
|
276
|
-
**Step 4 — Read selected
|
|
278
|
+
**Step 4 — Read each selected KB's Rules:**
|
|
279
|
+
|
|
280
|
+
For each selected entry, `{kb}` is `{worktree}/.devflow/features/{slug}/KNOWLEDGE.md`:
|
|
277
281
|
|
|
278
|
-
|
|
282
|
+
1. List its `##` headings with line numbers through Bash: `command grep -n '^## ' "{kb}"`. This only locates sections; the text of a KB comes from the Read view alone.
|
|
283
|
+
2. Read the `## Rules` range (its line to the next heading) with the Read tool, using `offset` and `limit`, and choose the one to three bullets most relevant to the current task. The choice is yours, made per KB.
|
|
284
|
+
3. If the KB has no `## Rules` section, choose one to three entries from its `## Anti-Patterns` or `## Gotchas` range the same way, and label them by that section's name instead of an ID.
|
|
279
285
|
|
|
280
|
-
**
|
|
286
|
+
When a KB contradicts the code you observe, **trust the code** — the code is the freshness mechanism; the KB may lag behind. A missing Rules section, a missing heading list and `(none)` are legitimate states, not errors.
|
|
281
287
|
|
|
282
|
-
|
|
288
|
+
**Step 5 — Set FEATURE_KNOWLEDGE and FEATURE_KNOWLEDGE_RULES:**
|
|
289
|
+
|
|
290
|
+
Write one block per selected KB. Paste each bullet verbatim from the Read view, never from a shell view. The path is relative to the checkout root; an agent resolves it under `WORKTREE_PATH` when one is provided.
|
|
283
291
|
|
|
284
292
|
```
|
|
285
293
|
--- Feature knowledge: {slug} ---
|
|
286
|
-
{
|
|
294
|
+
KB: .devflow/features/{slug}/KNOWLEDGE.md
|
|
295
|
+
Rules:
|
|
296
|
+
- **KB-AP-2** {bullet text, verbatim}
|
|
297
|
+
- **KB-INV-1** {bullet text, verbatim}
|
|
298
|
+
Headings: L5 Rules · L40 Overview · L62 Anti-Patterns · L118 Key Files
|
|
287
299
|
```
|
|
288
300
|
|
|
289
|
-
If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set
|
|
301
|
+
A KB with no Rules section labels its entries `Rules ({section name}):` and gives them no ID. `FEATURE_KNOWLEDGE` is these blocks; `FEATURE_KNOWLEDGE_RULES` is the same blocks without the `Headings:` line. Both come from this one selection, and each spawn names the variable its recipient takes. If no KBs exist, no KBs are relevant, or `.devflow/features/` is absent, set both to `(none)`.
|
|
290
302
|
|
|
291
|
-
**One git call, then direct
|
|
303
|
+
**One git call, then direct reads — no `.cjs` script.** After resolving `{worktree}`, this step is 1 index read (or N frontmatter reads on fallback), plus one heading listing and one Rules read per selected KB, bounded by KB count.
|
|
292
304
|
|
|
293
305
|
### Phase 2: Implement
|
|
294
306
|
|
|
@@ -313,7 +325,8 @@ Based on Setup context (plan document, issue body, or conversation context), use
|
|
|
313
325
|
|
|
314
326
|
```
|
|
315
327
|
Agent(subagent_type="Code"):
|
|
316
|
-
"
|
|
328
|
+
"OPERATION: implement
|
|
329
|
+
TASK_ID: {task-id}
|
|
317
330
|
TASK_DESCRIPTION: {description}
|
|
318
331
|
BASE_BRANCH: {base branch}
|
|
319
332
|
EXECUTION_PLAN: {full plan from setup context}
|
|
@@ -334,12 +347,13 @@ PR_TEST_PLAN_BLOCK: {PR_TEST_PLAN_BLOCK from Phase 1 verbatim, or (none)}"
|
|
|
334
347
|
|
|
335
348
|
**SEQUENTIAL_CODE_AGENTS** (for HIGH/CRITICAL context risk):
|
|
336
349
|
|
|
337
|
-
Spawn Code agents one at a time
|
|
350
|
+
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:
|
|
338
351
|
|
|
339
352
|
**Phase 1 Code agent:**
|
|
340
353
|
```
|
|
341
354
|
Agent(subagent_type="Code"):
|
|
342
|
-
"
|
|
355
|
+
"OPERATION: implement
|
|
356
|
+
TASK_ID: {task-id}
|
|
343
357
|
TASK_DESCRIPTION: {phase 1 description}
|
|
344
358
|
BASE_BRANCH: {base branch}
|
|
345
359
|
EXECUTION_PLAN: {phase 1 steps}
|
|
@@ -359,7 +373,8 @@ HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
|
|
|
359
373
|
**Phase 2+ Code agents** (after prior phase completes):
|
|
360
374
|
```
|
|
361
375
|
Agent(subagent_type="Code"):
|
|
362
|
-
"
|
|
376
|
+
"OPERATION: implement
|
|
377
|
+
TASK_ID: {task-id}
|
|
363
378
|
TASK_DESCRIPTION: {phase N description}
|
|
364
379
|
BASE_BRANCH: {base branch}
|
|
365
380
|
EXECUTION_PLAN: {phase N steps}
|
|
@@ -380,7 +395,7 @@ HANDOFF_REQUIRED: {true if not last phase}
|
|
|
380
395
|
HANDOFF_FILE: {worktree}/.devflow/docs/handoff-{branch_slug}.md"
|
|
381
396
|
```
|
|
382
397
|
|
|
383
|
-
**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.
|
|
398
|
+
**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).
|
|
384
399
|
|
|
385
400
|
---
|
|
386
401
|
|
|
@@ -390,7 +405,8 @@ Spawn multiple Code agents **in a single message**, each with independent subtas
|
|
|
390
405
|
|
|
391
406
|
```
|
|
392
407
|
Agent(subagent_type="Code"): # Code agent 1
|
|
393
|
-
"
|
|
408
|
+
"OPERATION: implement
|
|
409
|
+
TASK_ID: {task-id}-part1
|
|
394
410
|
TASK_DESCRIPTION: {independent subtask 1}
|
|
395
411
|
BASE_BRANCH: {base branch}
|
|
396
412
|
EXECUTION_PLAN: {subtask 1 steps}
|
|
@@ -405,7 +421,8 @@ ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
|
405
421
|
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}"
|
|
406
422
|
|
|
407
423
|
Agent(subagent_type="Code"): # Code agent 2 (same message)
|
|
408
|
-
"
|
|
424
|
+
"OPERATION: implement
|
|
425
|
+
TASK_ID: {task-id}-part2
|
|
409
426
|
TASK_DESCRIPTION: {independent subtask 2}
|
|
410
427
|
BASE_BRANCH: {base branch}
|
|
411
428
|
EXECUTION_PLAN: {subtask 2 steps}
|
|
@@ -426,110 +443,46 @@ ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}"
|
|
|
426
443
|
- Different files/modules with no imports between them
|
|
427
444
|
- Each subtask is self-contained
|
|
428
445
|
|
|
429
|
-
### Phase 3:
|
|
430
|
-
|
|
431
|
-
**Produces:** VALIDATION_RESULT
|
|
432
|
-
**Requires:** FILES_CHANGED
|
|
433
|
-
|
|
434
|
-
After Code agent completes, spawn Validate agent to verify correctness:
|
|
435
|
-
|
|
436
|
-
```
|
|
437
|
-
Agent(subagent_type="Validate"):
|
|
438
|
-
"FILES_CHANGED: {list of files from Code agent output}
|
|
439
|
-
VALIDATION_SCOPE: full
|
|
440
|
-
Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
**If FAIL:**
|
|
444
|
-
1. Extract failure details from Validate agent output
|
|
445
|
-
2. Increment `validation_retry_count`
|
|
446
|
-
3. If `validation_retry_count <= 2`:
|
|
447
|
-
- Spawn Code agent with fix context:
|
|
448
|
-
```
|
|
449
|
-
Agent(subagent_type="Code"):
|
|
450
|
-
"TASK_ID: {task-id}
|
|
451
|
-
TASK_DESCRIPTION: Fix validation failures
|
|
452
|
-
OPERATION: validation-fix
|
|
453
|
-
VALIDATION_FAILURES: {parsed failures from Validate agent}
|
|
454
|
-
SCOPE: Fix only the listed failures, no other changes
|
|
455
|
-
CREATE_PR: false
|
|
456
|
-
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
457
|
-
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
458
|
-
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
459
|
-
```
|
|
460
|
-
- Loop back to Phase 3 (re-validate)
|
|
461
|
-
4. If `validation_retry_count > 2`: Report failures to user and halt
|
|
462
|
-
|
|
463
|
-
**If PASS:** append a `gate:validate` claim, then continue to Phase 4.
|
|
464
|
-
|
|
465
|
-
**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:
|
|
466
|
-
|
|
467
|
-
```
|
|
468
|
-
- gate:validate PASS sha:<head> by:validate
|
|
469
|
-
- TP-<n> <PASS|FAIL|SKIP> sha:<head> by:test exit:<0-255>
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
- `gate:validate` — after a Phase 3 or Phase 6 PASS.
|
|
473
|
-
- `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.
|
|
474
|
-
- 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.
|
|
475
|
-
|
|
476
|
-
### Phase 4: Simplify
|
|
446
|
+
### Phase 3: Simplify
|
|
477
447
|
|
|
478
448
|
**Produces:** SIMPLIFY_OUTPUT
|
|
479
449
|
**Requires:** FILES_CHANGED
|
|
480
450
|
|
|
481
|
-
After
|
|
451
|
+
After the Code agent completes, spawn Simplify agent to polish the code. The Phase 6 Validate covers its commits.
|
|
482
452
|
|
|
483
453
|
```
|
|
484
454
|
Agent(subagent_type="Simplify"):
|
|
485
455
|
"Simplify recently implemented code
|
|
486
456
|
Task: {task description}
|
|
487
457
|
FILES_CHANGED: {list of files from Code agent output}
|
|
488
|
-
Focus on code modified by Code agent, apply project standards, enhance clarity
|
|
458
|
+
Focus on code modified by Code agent, apply project standards, enhance clarity
|
|
459
|
+
Commit any improvements with a conventional-commit message."
|
|
489
460
|
```
|
|
490
461
|
|
|
491
|
-
### Phase
|
|
462
|
+
### Phase 4: Self-Review
|
|
492
463
|
|
|
493
464
|
**Produces:** SCRUTINIZE_OUTPUT
|
|
494
465
|
**Requires:** FILES_CHANGED
|
|
495
466
|
|
|
496
|
-
After Simplify agent completes, spawn Scrutinize agent as
|
|
467
|
+
After Simplify agent completes, spawn Scrutinize agent as the quality gate:
|
|
497
468
|
|
|
498
469
|
```
|
|
499
470
|
Agent(subagent_type="Scrutinize"):
|
|
500
471
|
"TASK_DESCRIPTION: {task description}
|
|
501
472
|
FILES_CHANGED: {list of files from Code agent output}
|
|
502
473
|
DECISIONS_CONTEXT: {decisions_context}
|
|
503
|
-
FEATURE_KNOWLEDGE: {
|
|
474
|
+
FEATURE_KNOWLEDGE: {feature_knowledge_rules}
|
|
504
475
|
Evaluate 9 pillars, fix P0/P1 issues, report status"
|
|
505
476
|
```
|
|
506
477
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
### Phase 6: Re-Validate (if Scrutinize agent made changes)
|
|
510
|
-
|
|
511
|
-
**Produces:** REVALIDATION_RESULT
|
|
512
|
-
**Requires:** SCRUTINIZE_OUTPUT
|
|
513
|
-
|
|
514
|
-
If Scrutinize agent made code changes (status: FIXED), spawn Validate agent to verify:
|
|
515
|
-
|
|
516
|
-
```
|
|
517
|
-
Agent(subagent_type="Validate"):
|
|
518
|
-
"FILES_CHANGED: {files modified by Scrutinize agent}
|
|
519
|
-
VALIDATION_SCOPE: changed-only
|
|
520
|
-
Verify Scrutinize agent's fixes didn't break anything."
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
**If FAIL:** Report to user - Scrutinize agent broke tests, needs manual intervention.
|
|
524
|
-
|
|
525
|
-
**If PASS:** append a `gate:validate` claim (Phase 3's **Evidence claims**), then continue to Phase 7.
|
|
478
|
+
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.
|
|
526
479
|
|
|
527
|
-
### Phase
|
|
480
|
+
### Phase 5: Alignment Check
|
|
528
481
|
|
|
529
482
|
**Produces:** ALIGNMENT_RESULT
|
|
530
483
|
**Requires:** FILES_CHANGED, EXECUTION_PLAN
|
|
531
484
|
|
|
532
|
-
After Scrutinize agent passes
|
|
485
|
+
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:
|
|
533
486
|
|
|
534
487
|
```
|
|
535
488
|
Agent(subagent_type="Evaluate"):
|
|
@@ -537,11 +490,11 @@ Agent(subagent_type="Evaluate"):
|
|
|
537
490
|
EXECUTION_PLAN: {execution plan from Phase 1}
|
|
538
491
|
FILES_CHANGED: {list of files from Code agent output}
|
|
539
492
|
ACCEPTANCE_CRITERIA: {extracted criteria if available}
|
|
540
|
-
FEATURE_KNOWLEDGE: {
|
|
493
|
+
FEATURE_KNOWLEDGE: {feature_knowledge_rules}
|
|
541
494
|
Validate alignment with request and plan. Report ALIGNED or MISALIGNED with details."
|
|
542
495
|
```
|
|
543
496
|
|
|
544
|
-
**If ALIGNED:** Continue to Phase
|
|
497
|
+
**If ALIGNED:** Continue to Phase 6
|
|
545
498
|
|
|
546
499
|
**If MISALIGNED:**
|
|
547
500
|
1. Extract misalignment details from Evaluate agent output
|
|
@@ -550,32 +503,74 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
|
|
|
550
503
|
- Spawn Code agent to fix misalignments:
|
|
551
504
|
```
|
|
552
505
|
Agent(subagent_type="Code"):
|
|
553
|
-
"
|
|
506
|
+
"OPERATION: alignment-fix
|
|
507
|
+
TASK_ID: {task-id}
|
|
554
508
|
TASK_DESCRIPTION: Fix alignment issues
|
|
555
|
-
OPERATION: alignment-fix
|
|
556
509
|
MISALIGNMENTS: {structured misalignments from Evaluate agent}
|
|
557
510
|
SCOPE: Fix only the listed misalignments, no other changes
|
|
558
511
|
CREATE_PR: false
|
|
512
|
+
DECISIONS_CONTEXT: {decisions_context}
|
|
559
513
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
560
514
|
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
561
515
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
562
516
|
```
|
|
563
|
-
-
|
|
517
|
+
- Loop back to Phase 5 (re-check alignment). The fix is not validated here: the Phase 6 run covers it.
|
|
518
|
+
4. If `alignment_fix_count > 2`: Report misalignments to user for decision
|
|
519
|
+
|
|
520
|
+
### Phase 6: Validate
|
|
521
|
+
|
|
522
|
+
**Produces:** VALIDATION_RESULT, VALIDATED_HEAD
|
|
523
|
+
**Requires:** BASE_BRANCH
|
|
524
|
+
|
|
525
|
+
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`):
|
|
526
|
+
|
|
527
|
+
```
|
|
528
|
+
Agent(subagent_type="Validate"):
|
|
529
|
+
"FILES_CHANGED: {output of `git diff --name-only {base}...HEAD`}
|
|
530
|
+
VALIDATION_SCOPE: full
|
|
531
|
+
Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
**If FAIL:**
|
|
535
|
+
1. Extract failure details from Validate agent output
|
|
536
|
+
2. Increment `validation_retry_count`
|
|
537
|
+
3. If `validation_retry_count <= 2`:
|
|
538
|
+
- Spawn Code agent with fix context:
|
|
564
539
|
```
|
|
565
|
-
Agent(subagent_type="
|
|
566
|
-
"
|
|
567
|
-
|
|
540
|
+
Agent(subagent_type="Code"):
|
|
541
|
+
"OPERATION: validation-fix
|
|
542
|
+
TASK_ID: {task-id}
|
|
543
|
+
TASK_DESCRIPTION: Fix validation failures
|
|
544
|
+
VALIDATION_FAILURES: {parsed failures from Validate agent}
|
|
545
|
+
SCOPE: Fix only the listed failures, no other changes
|
|
546
|
+
CREATE_PR: false
|
|
547
|
+
DECISIONS_CONTEXT: {decisions_context}
|
|
548
|
+
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
549
|
+
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
550
|
+
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
568
551
|
```
|
|
569
|
-
-
|
|
570
|
-
|
|
571
|
-
4. If `alignment_fix_count > 2`: Report misalignments to user for decision
|
|
552
|
+
- Loop back to Phase 6 (re-validate at the new HEAD, full scope)
|
|
553
|
+
4. If `validation_retry_count > 2`: Report failures to user and halt
|
|
572
554
|
|
|
573
|
-
|
|
555
|
+
**If PASS:** append a `gate:validate` claim, run `git rev-parse HEAD` and record the result as `VALIDATED_HEAD`, then continue to Phase 7.
|
|
556
|
+
|
|
557
|
+
**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:
|
|
558
|
+
|
|
559
|
+
```
|
|
560
|
+
- gate:validate PASS sha:<head> by:validate
|
|
561
|
+
- TP-<n> <PASS|FAIL|SKIP> sha:<head> by:test exit:<0-255>
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
- `gate:validate` — after a Phase 6 or Phase 8 PASS.
|
|
565
|
+
- `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.
|
|
566
|
+
- 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.
|
|
567
|
+
|
|
568
|
+
### Phase 7: QA Testing
|
|
574
569
|
|
|
575
570
|
**Produces:** QA_RESULT
|
|
576
|
-
**Requires:** FILES_CHANGED, EXECUTION_PLAN, TEST_PLAN
|
|
571
|
+
**Requires:** FILES_CHANGED, EXECUTION_PLAN, TEST_PLAN, VALIDATED_HEAD
|
|
577
572
|
|
|
578
|
-
After
|
|
573
|
+
After Phase 6 passes, spawn Test agent for scenario-based acceptance testing:
|
|
579
574
|
|
|
580
575
|
```
|
|
581
576
|
Agent(subagent_type="Test"):
|
|
@@ -587,9 +582,9 @@ TEST_PLAN: {the TP lines of the evidence file's ## Test Plan section, or (none)}
|
|
|
587
582
|
Design and execute scenario-based acceptance tests. Report PASS or FAIL with evidence."
|
|
588
583
|
```
|
|
589
584
|
|
|
590
|
-
After every Test agent run — PASS or FAIL, first run or retry — append its TP claims (Phase
|
|
585
|
+
After every Test agent run — PASS or FAIL, first run or retry — append its TP claims (Phase 6's **Evidence claims**).
|
|
591
586
|
|
|
592
|
-
**If PASS:** Continue to Phase
|
|
587
|
+
**If PASS:** Continue to Phase 8
|
|
593
588
|
|
|
594
589
|
**If FAIL:**
|
|
595
590
|
1. Extract failure details from Test agent output
|
|
@@ -598,25 +593,37 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
|
|
|
598
593
|
- Spawn Code agent to fix QA failures:
|
|
599
594
|
```
|
|
600
595
|
Agent(subagent_type="Code"):
|
|
601
|
-
"
|
|
596
|
+
"OPERATION: qa-fix
|
|
597
|
+
TASK_ID: {task-id}
|
|
602
598
|
TASK_DESCRIPTION: Fix QA test failures
|
|
603
|
-
OPERATION: qa-fix
|
|
604
599
|
QA_FAILURES: {structured failures from Test agent}
|
|
605
600
|
SCOPE: Fix only the listed failures, no other changes
|
|
606
601
|
CREATE_PR: false
|
|
602
|
+
DECISIONS_CONTEXT: {decisions_context}
|
|
607
603
|
ISSUE_NUMBER: {ISSUE_ID captured in Phase 1, or (none)}
|
|
608
604
|
ISSUE_PR_LINK: {ISSUE_PR_LINK captured in Phase 1, or (none)}
|
|
609
605
|
COMPLIANCE_FRAMEWORKS: {COMPLIANCE_FRAMEWORKS}"
|
|
610
606
|
```
|
|
611
|
-
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
607
|
+
- Loop back to Phase 7 (re-run Test agent). The fix is not validated here: Phase 8 covers it.
|
|
608
|
+
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.
|
|
609
|
+
|
|
610
|
+
### Phase 8: Re-Validate (only if a qa-fix committed)
|
|
611
|
+
|
|
612
|
+
**Produces:** REVALIDATION_RESULT
|
|
613
|
+
**Requires:** QA_RESULT, VALIDATED_HEAD
|
|
614
|
+
|
|
615
|
+
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:
|
|
616
|
+
|
|
617
|
+
```
|
|
618
|
+
Agent(subagent_type="Validate"):
|
|
619
|
+
"FILES_CHANGED: {output of `git diff --name-only VALIDATED_HEAD..HEAD`}
|
|
620
|
+
VALIDATION_SCOPE: changed-only
|
|
621
|
+
Verify the qa-fix commits did not break anything."
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
**If FAIL:** Report the failures to user and halt.
|
|
625
|
+
|
|
626
|
+
**If PASS:** append a `gate:validate` claim (Phase 6's **Evidence claims**), then continue to Phase 9.
|
|
620
627
|
|
|
621
628
|
### Phase 9: CI Status Gate
|
|
622
629
|
|
|
@@ -625,14 +632,22 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
|
|
|
625
632
|
|
|
626
633
|
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).
|
|
627
634
|
|
|
635
|
+
**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:
|
|
636
|
+
|
|
637
|
+
```bash
|
|
638
|
+
git push origin HEAD; echo "exit=$?"
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
`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`.
|
|
642
|
+
|
|
628
643
|
<!-- PATTERN: ci-status-gate -->
|
|
629
|
-
1.
|
|
644
|
+
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.
|
|
630
645
|
2. **If PASSING** → proceed to Phase 10.
|
|
631
646
|
3. **If NO_PR or NO_CI** → skip: "No PR/CI configured, skipping CI validation." Proceed to Phase 10.
|
|
632
|
-
4. **If PENDING**
|
|
633
|
-
5. **If INDETERMINATE**
|
|
634
|
-
6. **If FAILING** → report failing checks. Spawn `Agent(subagent_type="Code")` with `COMPLIANCE_FRAMEWORKS`
|
|
635
|
-
7. **
|
|
647
|
+
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.
|
|
648
|
+
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.
|
|
649
|
+
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.
|
|
650
|
+
7. **Budget**: at most 3 waits and 2 fixes in all. When one is spent, report the current status and proceed.
|
|
636
651
|
<!-- /PATTERN: ci-status-gate -->
|
|
637
652
|
|
|
638
653
|
### Phase 10: Create PR
|
|
@@ -646,9 +661,9 @@ Strategy-conditional: run when the PR already exists — **SINGLE_CODE_AGENT** a
|
|
|
646
661
|
|
|
647
662
|
```
|
|
648
663
|
Agent(subagent_type="Code"):
|
|
649
|
-
"
|
|
664
|
+
"OPERATION: pr-create
|
|
665
|
+
TASK_ID: {task-id}
|
|
650
666
|
TASK_DESCRIPTION: Create the unified PR for the parallel implementation
|
|
651
|
-
OPERATION: pr-create
|
|
652
667
|
BASE_BRANCH: {base branch}
|
|
653
668
|
CREATE_PR: true
|
|
654
669
|
PR_DESCRIPTION_GUIDANCE: {pr_description_guidance}
|
|
@@ -698,7 +713,7 @@ Display completion summary with phase status, PR info, and next steps.
|
|
|
698
713
|
|
|
699
714
|
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`.
|
|
700
715
|
|
|
701
|
-
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.
|
|
716
|
+
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.
|
|
702
717
|
|
|
703
718
|
If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lines in the report.
|
|
704
719
|
|
|
@@ -712,24 +727,14 @@ git -C "{start}" rev-parse --show-toplevel
|
|
|
712
727
|
|
|
713
728
|
and use its one-line output. If the command fails (outside a git repository), `{worktree}` is the start directory itself. All paths below are relative to `{worktree}`.
|
|
714
729
|
|
|
715
|
-
**Step 1 — Check the opt-out gate, with `{root}` = `{worktree}`:**
|
|
716
|
-
|
|
717
|
-
**Resolve the settings line** once per worktree root, reusing a line this run already resolved for the same root. `{root}` is the worktree the values are for — the repository root when the run has one worktree:
|
|
718
|
-
|
|
719
|
-
```bash
|
|
720
|
-
node "$HOME/.devflow/scripts/resolve-settings.cjs" "{root}" 2>/dev/null; echo "exit=$?"
|
|
721
|
-
```
|
|
722
|
-
|
|
723
|
-
Accept the output only when it is exactly two lines: `exit=0` last and, before it, one line of the form `TRACKER=<github|jira|linear> TRACKER_SOURCE=<project|personal|machine|default> TRACKER_WARN=<none|mismatch|invalid> SITE=<none|https://<host>> KEY=<none|<key>> REVIEW_PUBLICATION=<off|auto|full> COMPLIANCE=<off|generic|<id>[,<id>…]> MEMORY=<on|off> LEARNING=<on|off> KNOWLEDGE=<on|off>` — these fields, in this order, nothing else, where `<host>` is a lowercase dotted host name alone, `<key>` is 2–10 of `A-Z`, `0-9` and `_` starting with a letter, and each `<id>` is one of `gdpr`, `hipaa`, `pci-dss`, `soc2`, `iso-27001`, `sox`. **Anything else** (a non-zero exit, no line, extra text, or a missing, reordered or unlisted field or value) ⇒ use `TRACKER=github TRACKER_SOURCE=default TRACKER_WARN=invalid SITE=none KEY=none REVIEW_PUBLICATION=off COMPLIANCE=generic MEMORY=on LEARNING=on KNOWLEDGE=off` instead.
|
|
724
|
-
|
|
725
|
-
The accepted line is the only source of these values: the script alone folds the committed `.devflow/project.json`, the personal `.devflow/config.json` and the machine manifest.
|
|
730
|
+
**Step 1 — Check the opt-out gate, with `{root}` = `{worktree}`:** take the settings line resolved above for that root, resolving it with the settings block when this run has not yet.
|
|
726
731
|
|
|
727
732
|
If the settings line says `KNOWLEDGE=off`, skip write-back entirely. The machine switch (`devflow knowledge --disable`), the repository and the personal settings can each turn knowledge off, and none can turn it back on (D-FEATURES-NARROW-ONLY). The fail-closed line says `KNOWLEDGE=off` too, so an unresolvable line skips write-back.
|
|
728
733
|
|
|
729
734
|
**Step 2 — Evaluate whether write-back is warranted:**
|
|
730
735
|
|
|
731
736
|
Only proceed if **at least one** of these is true:
|
|
732
|
-
- This workflow changed files in a directory that is documented by an existing feature knowledge base (a documented area changed).
|
|
737
|
+
- This workflow changed files in a directory that is documented by an existing feature knowledge base (a documented area changed). Knowledge bases are written through at that point, never on a background schedule.
|
|
733
738
|
- This workflow surfaced durable, cross-cutting knowledge about a codebase area that would help future agents working in the same area — patterns, anti-patterns, integration points, gotchas not visible from a single file read.
|
|
734
739
|
|
|
735
740
|
**Never spawn unconditionally.** If neither condition is met, skip write-back silently.
|
|
@@ -752,7 +757,7 @@ Write the knowledge base to:
|
|
|
752
757
|
Then update the index cache by performing a read-modify-write on:
|
|
753
758
|
{worktree}/.devflow/features/index.md
|
|
754
759
|
|
|
755
|
-
Index line format: `- **{slug}** — {areas} — {Use-when description}`
|
|
760
|
+
Index line format: `- **{slug}** — {areas} — {Use-when description}` — at most 300 characters, the description at most 220; reword a longer one, never cut it.
|
|
756
761
|
|
|
757
762
|
If the line for this slug already exists in index.md, replace it. If it does not exist, append it. If index.md does not exist, create it with just this line.
|
|
758
763
|
|
|
@@ -786,30 +791,30 @@ When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files
|
|
|
786
791
|
│ ├─ SEQUENTIAL_CODE_AGENTS (15%): N Code agents with handoff summaries
|
|
787
792
|
│ └─ PARALLEL_CODE_AGENTS (5%): N Code agents in single message (rare)
|
|
788
793
|
│
|
|
789
|
-
├─ Phase 3:
|
|
790
|
-
│ └─ Validate agent (build, typecheck, lint, test)
|
|
791
|
-
│ └─ If FAIL: Code agent fix loop (max 2 retries) → re-validate
|
|
792
|
-
│ └─ If PASS: gate:validate claim → evidence file
|
|
793
|
-
│
|
|
794
|
-
├─ Phase 4: Simplify
|
|
794
|
+
├─ Phase 3: Simplify
|
|
795
795
|
│ └─ Simplify agent (refines code clarity and consistency)
|
|
796
796
|
│
|
|
797
|
-
├─ Phase
|
|
798
|
-
│ └─ Scrutinize agent (
|
|
797
|
+
├─ Phase 4: Self-Review
|
|
798
|
+
│ └─ Scrutinize agent (quality gate, fixes P0/P1; status PASS | FIXED | BLOCKED)
|
|
799
799
|
│
|
|
800
|
-
├─ Phase
|
|
801
|
-
│ └─ Validate agent (verify Scrutinize agent fixes)
|
|
802
|
-
│
|
|
803
|
-
├─ Phase 7: Alignment Check
|
|
800
|
+
├─ Phase 5: Alignment Check
|
|
804
801
|
│ └─ Evaluate agent (validates alignment - reports only, no fixes)
|
|
805
|
-
│ └─ If MISALIGNED: Code agent fix loop (max 2 iterations) →
|
|
802
|
+
│ └─ If MISALIGNED: Code agent fix loop (max 2 iterations) → re-check alignment
|
|
803
|
+
│
|
|
804
|
+
├─ Phase 6: Validate (the one full-suite slot)
|
|
805
|
+
│ └─ Validate agent (build, typecheck, lint, test over the branch diff)
|
|
806
|
+
│ └─ If FAIL: Code agent fix loop (max 2 retries) → re-validate at the new HEAD
|
|
807
|
+
│ └─ If PASS: record VALIDATED_HEAD, gate:validate claim → evidence file
|
|
806
808
|
│
|
|
807
|
-
├─ Phase
|
|
809
|
+
├─ Phase 7: QA Testing
|
|
808
810
|
│ └─ Test agent (scenario-based acceptance tests, TEST_PLAN) → one claim per TP row → evidence file
|
|
809
|
-
│ └─ If FAIL: Code agent fix loop (max 2 retries) →
|
|
811
|
+
│ └─ If FAIL: Code agent fix loop (max 2 retries) → re-test
|
|
812
|
+
│
|
|
813
|
+
├─ Phase 8: Re-Validate (only if a qa-fix committed)
|
|
814
|
+
│ └─ Validate agent (changed-only over VALIDATED_HEAD..HEAD) → gate:validate claim
|
|
810
815
|
│
|
|
811
816
|
├─ Phase 9: CI Status Gate (SINGLE_CODE_AGENT + SEQUENTIAL_CODE_AGENTS; skipped for PARALLEL_CODE_AGENTS)
|
|
812
|
-
│ └─
|
|
817
|
+
│ └─ Push the branch, then ci-wait.cjs (inline, one wait ≤ 570 s) → Code agent on FAILING (3 waits + 2 fixes)
|
|
813
818
|
│
|
|
814
819
|
├─ Phase 10: Create PR (if needed)
|
|
815
820
|
│ └─ SINGLE_CODE_AGENT: already created by the Phase 2 Code agent
|
|
@@ -828,7 +833,7 @@ When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files
|
|
|
828
833
|
|
|
829
834
|
## Principles
|
|
830
835
|
|
|
831
|
-
1. **Orchestration only** - Command spawns agents, never does work itself
|
|
836
|
+
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
|
|
832
837
|
2. **Plan-first** - Plan documents from `/plan` skip exploration/planning overhead entirely
|
|
833
838
|
3. **Coherence-first** - Single Code agent produces more consistent code (default ~80% of tasks)
|
|
834
839
|
4. **Agent ownership** - Each agent owns its output completely
|
|
@@ -838,7 +843,7 @@ When the Knowledge agent reports `KB_COMMIT: skipped (detached HEAD)`, the files
|
|
|
838
843
|
8. **Strict delegation** - Never perform agent work in main session. "Spawn X" means call Agent tool with X, not do X's work yourself
|
|
839
844
|
9. **Validate agent owns validation** - Never run `npm test`, `npm run build`, or similar in main session; always delegate to Validate agent
|
|
840
845
|
10. **Code agent owns fixes** - Never implement fixes in main session; spawn Code agent for validation failures and alignment fixes
|
|
841
|
-
11. **Loop limits** - Max 2 validation retries, max 2 alignment fix iterations before escalating to user
|
|
846
|
+
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
|
|
842
847
|
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
|
|
843
848
|
|
|
844
849
|
## Error Handling
|