devflow-kit 3.5.0 → 3.6.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 +98 -0
- package/README.md +4 -4
- package/dist/agents/{diagnose.md → debug.md} +4 -4
- package/dist/agents/{code-fix.md → fix.md} +2 -2
- package/dist/agents/{scrutinize.md → harden.md} +6 -6
- package/dist/agents/{code-edit.md → refactor.md} +3 -3
- package/dist/cli/agents-view/render.js +1 -1
- package/dist/cli/commands/init.js +3 -3
- package/dist/cli/commands/learning.js +12 -12
- package/dist/cli/commands/legacy-hooks.js +1 -1
- package/dist/cli/commands/uninstall.js +111 -5
- package/dist/commands/bug-analysis.md +19 -15
- package/dist/commands/code-review.md +13 -22
- package/dist/commands/debug.md +15 -15
- package/dist/commands/dynamic-build.md +51 -55
- package/dist/commands/dynamic-plan.md +11 -9
- package/dist/commands/dynamic-profile.md +7 -5
- package/dist/commands/dynamic-tickets.md +11 -9
- package/dist/commands/explore.md +13 -13
- package/dist/commands/implement.md +58 -127
- package/dist/commands/plan.md +19 -41
- package/dist/commands/release.md +9 -5
- package/dist/commands/research.md +12 -8
- package/dist/commands/resolve.md +42 -86
- package/dist/commands/self-review.md +42 -42
- package/dist/core/agent-models.js +47 -11
- package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
- package/dist/core/learning-queue-cleanup.js +1 -1
- package/dist/core/migrations.js +63 -44
- package/dist/core/plugins.js +14 -12
- package/dist/core/project-paths.js +3 -3
- package/dist/hud/codex-usage.js +247 -0
- package/dist/hud/components/codex-quota.js +37 -0
- package/dist/hud/components/usage-quota.js +1 -1
- package/dist/hud/config.js +1 -0
- package/dist/hud/index.js +16 -3
- package/dist/hud/render.js +3 -1
- package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
- package/dist/learning-off/agents/{code-fix.md → fix.md} +2 -2
- package/dist/learning-off/agents/{scrutinize.md → harden.md} +6 -6
- package/dist/learning-off/agents/{code-edit.md → refactor.md} +3 -3
- package/dist/learning-off/commands/bug-analysis.md +9 -9
- package/dist/learning-off/commands/code-review.md +2 -15
- package/dist/learning-off/commands/debug.md +4 -8
- package/dist/learning-off/commands/dynamic-build.md +45 -51
- package/dist/learning-off/commands/dynamic-plan.md +5 -5
- package/dist/learning-off/commands/dynamic-profile.md +1 -1
- package/dist/learning-off/commands/dynamic-tickets.md +5 -5
- package/dist/learning-off/commands/explore.md +2 -6
- package/dist/learning-off/commands/implement.md +46 -119
- package/dist/learning-off/commands/plan.md +8 -33
- package/dist/learning-off/commands/release.md +4 -2
- package/dist/learning-off/commands/research.md +2 -2
- package/dist/learning-off/commands/resolve.md +31 -79
- package/dist/learning-off/commands/self-review.md +30 -34
- package/dist/skills/git/references/pr/check-merge-readiness.md +2 -0
- package/dist/skills/git/references/pr/update-pr-evidence.md +4 -6
- package/dist/targets/claude-code/installer.js +117 -84
- package/dist/targets/claude-code/tracker-servers.js +1 -1
- package/package.json +1 -1
- package/src/assets/agents/_partials/_code.mds +2 -2
- package/src/assets/agents/code.mds +2 -2
- package/src/assets/agents/{learning.md → curate.md} +4 -4
- package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
- package/src/assets/agents/evaluate.md +4 -4
- package/src/assets/agents/{code-fix.mds → fix.mds} +5 -5
- package/src/assets/agents/{scrutinize.mds → harden.mds} +6 -6
- package/src/assets/agents/{simplify.md → polish.md} +4 -4
- package/src/assets/agents/{code-edit.mds → refactor.mds} +6 -6
- package/src/assets/agents/test.md +2 -2
- package/src/assets/commands/_partials/_compliance.mds +1 -1
- package/src/assets/commands/_partials/_decisions.mds +26 -6
- package/src/assets/commands/_partials/_engine.mds +15 -15
- package/src/assets/commands/_partials/_evidence_policy.mds +0 -17
- package/src/assets/commands/_partials/_knowledge.mds +14 -9
- package/src/assets/commands/_partials/_preamble.mds +4 -2
- package/src/assets/commands/_partials/_roster.mds +4 -4
- package/src/assets/commands/bug-analysis.mds +7 -7
- package/src/assets/commands/code-review.mds +1 -14
- package/src/assets/commands/debug.mds +2 -2
- package/src/assets/commands/dynamic-build.mds +26 -32
- package/src/assets/commands/implement.mds +45 -102
- package/src/assets/commands/plan.mds +7 -37
- package/src/assets/commands/release.mds +5 -1
- package/src/assets/commands/resolve.mds +28 -76
- package/src/assets/commands/self-review.mds +27 -27
- package/src/assets/mds/git/_pr.mds +6 -6
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
- package/src/assets/scripts/hooks/capture-prompt +1 -1
- package/src/assets/scripts/hooks/capture-question +1 -1
- package/src/assets/scripts/hooks/capture-turn +1 -1
- package/src/assets/scripts/hooks/json-helper.cjs +2 -2
- package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
- package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -4
- package/src/assets/scripts/hooks/preamble +1 -1
- package/src/assets/scripts/hooks/session-start-context +58 -45
- package/src/assets/scripts/verify-evidence.cjs +726 -9
- package/src/assets/skills/agent-references/SKILL.md +9 -5
- package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +35 -0
- package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +15 -0
- package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +1 -1
- package/src/assets/skills/apply-decisions/SKILL.md +6 -4
- package/src/assets/skills/docs-framework/SKILL.md +3 -3
- package/src/assets/skills/qa/SKILL.md +1 -1
- package/src/assets/skills/quality-gates/SKILL.md +7 -7
- package/src/assets/skills/quality-gates/references/report-template.md +7 -7
- /package/src/assets/skills/agent-references/references/{learning → curate}/maintain.md +0 -0
|
@@ -5,7 +5,7 @@ output-dir: dist/commands
|
|
|
5
5
|
@import { knowledge_load, knowledge_writeback } from "./_partials/_knowledge.mds"
|
|
6
6
|
@import { decisions_load } from "./_partials/_decisions.mds"
|
|
7
7
|
@import { docs_root } from "./_partials/_docs_root.mds"
|
|
8
|
-
@import { evidence_policy
|
|
8
|
+
@import { evidence_policy } from "./_partials/_evidence_policy.mds"
|
|
9
9
|
@import { issue_ref_grammar, issue_capture_contract } from "./_partials/_tracker.mds"
|
|
10
10
|
@import { test_plan_line } from "./_partials/_plan_contract.mds"
|
|
11
11
|
@import { publication_gate } from "./_partials/_publication.mds"
|
|
@@ -46,15 +46,7 @@ $ARGUMENTS
|
|
|
46
46
|
|
|
47
47
|
### Re-validation Continuation Path
|
|
48
48
|
|
|
49
|
-
When the user explicitly asks to re-validate, re-check, or re-run quality gates after making their own changes:
|
|
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.
|
|
52
|
-
2. **Skip Phase 2** — no Code agent needed, user already made changes.
|
|
53
|
-
3. **Detect FILES_CHANGED**: `git diff --name-only {base_branch}...HEAD`
|
|
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.
|
|
55
|
-
5. **Proceed to Phase 9** (Open PR), **Phase 11** (Evidence) and **Phase 12** (Report).
|
|
56
|
-
|
|
57
|
-
If the user prompt does NOT match re-validation, proceed with the full pipeline below.
|
|
49
|
+
When the user explicitly asks to re-validate, re-check, or re-run quality gates after making their own changes, resolve `${CLAUDE_CONFIG_DIR:-$HOME/.claude}` in Bash, Read `<that directory>/skills/devflow:agent-references/references/commands/implement-revalidate.md` with the Read tool and follow it. Otherwise proceed with the full pipeline below.
|
|
58
50
|
|
|
59
51
|
### Phase 1: Setup
|
|
60
52
|
|
|
@@ -135,13 +127,7 @@ visible, a silently discarded request is not.
|
|
|
135
127
|
|
|
136
128
|
{{issue_capture_contract()}}
|
|
137
129
|
|
|
138
|
-
**Ticket link, only when `ISSUE_REQUIRED` is `true`:** when the capture above holds no `ISSUE_PR_LINK` (absent, or `(none)`),
|
|
139
|
-
- **Record an exception** — the user gives the reason as free text. Render it with the grammar below, as kind `ticket-link`; when the rendered reason is empty, ask for it once more, and stop as below if it is empty again.
|
|
140
|
-
- **Stop** — report `BLOCKED (no ticket link)`, name the branch setup-task created (`TASK_ID`) and `BASE_BRANCH` so it can be reused or removed, and give the remedy: create or link the tracker issue and re-run `/implement` with its reference, or — for a team that does not want ticket links — commit `.devflow/project.json` as `{"version":1,"evidence":"standard"}` on the default branch; a machine with compliance enabled still resolves `required` whatever that file says. Spawn nothing further.
|
|
141
|
-
|
|
142
|
-
{{evidence_exception()}}
|
|
143
|
-
|
|
144
|
-
**Record the exception at once**, before any Code spawn: write the rendered section as the `## Evidence Exceptions` section of `{worktree}/.devflow/docs/handoff-{branch_slug}.md`, creating the file if absent, and set `PR_EXCEPTIONS` to that section. The file is its one home until the PR exists: every later write to the file keeps the section byte-identical, the Phase 9 Git spawn passes it verbatim as `PR_EXCEPTIONS`, and the file is deleted only once the PR exists — after Phase 9, under every strategy. With no exception recorded, `PR_EXCEPTIONS` is `(none)`.
|
|
130
|
+
**Ticket link, only when `ISSUE_REQUIRED` is `true`:** when the capture above holds no `ISSUE_PR_LINK` (absent, or `(none)`), resolve `${CLAUDE_CONFIG_DIR:-$HOME/.claude}` in Bash, Read `<that directory>/skills/devflow:agent-references/references/commands/implement-evidence-asks.md` with the Read tool (once per run), then run its ticket link ask and **Record the exception at once** as it directs, before any Code spawn. `PR_EXCEPTIONS` is `(none)` until an exception is recorded.
|
|
145
131
|
|
|
146
132
|
**Test plan.** Before any Code spawn, give the task a test plan in the evidence file `{worktree}/.devflow/docs/evidence-{branch_slug}.md` (`EVIDENCE_FILE`) — unlike the handoff file, it stays after the PR exists. It holds up to three sections, in this order and nothing else: `## Test Plan`; `## Evidence Exceptions`, a byte copy of `PR_EXCEPTIONS` present only while that is not `(none)`; and `## Claims`, always last, so every claim is appended at the end of the file. Create the file if absent; if it exists, replace its `## Test Plan` and `## Evidence Exceptions` sections and keep `## Claims` byte-identical.
|
|
147
133
|
|
|
@@ -157,9 +143,7 @@ node "$HOME/.devflow/scripts/verify-evidence.cjs" check tp "{worktree}/.devflow/
|
|
|
157
143
|
|
|
158
144
|
`exit=0` passes. On any other result, rewrite the section once — the script names the failing line and its code on stderr — and check again. Still failing, or no line to write, means the test plan is **missing**: drop the `## Test Plan` section from the file.
|
|
159
145
|
|
|
160
|
-
**Missing test plan, only when `EVIDENCE_POLICY` is `required`:** when the check above leaves the test plan missing,
|
|
161
|
-
- **Record an exception** — the user gives the reason as free text. Render it with the exception grammar above, as kind `test-plan`; when the rendered reason is empty, ask for it once more, and stop as below if it is empty again. Add the rendered line to the `## Evidence Exceptions` section of `{worktree}/.devflow/docs/handoff-{branch_slug}.md` — after any `ticket-link` line, creating the section and the file when absent — and set `PR_EXCEPTIONS` to that section, under the same rules as the record above.
|
|
162
|
-
- **Stop** — report `BLOCKED (no test plan)`, name `TASK_ID` and `BASE_BRANCH` so the branch can be reused or removed, and give the remedy: state the acceptance criteria in the task, the issue or a `/plan` document (its `## Test Plan` section is copied) and re-run `/implement`, or — for a team that does not want test plans enforced — commit `.devflow/project.json` as `{"version":1,"evidence":"standard"}` on the default branch; a machine with compliance enabled still resolves `required` whatever that file says. Spawn nothing further.
|
|
146
|
+
**Missing test plan, only when `EVIDENCE_POLICY` is `required`:** when the check above leaves the test plan missing, Read the evidence-asks reference as in the ticket link step (when this run has not) and run its missing test plan ask before any Code spawn.
|
|
163
147
|
|
|
164
148
|
When `EVIDENCE_POLICY` is `standard`, a missing test plan is never asked about: carry `Test plan: missing` to the Phase 12 report.
|
|
165
149
|
|
|
@@ -176,15 +160,15 @@ node "$HOME/.devflow/scripts/verify-evidence.cjs" render --plan "{worktree}/.dev
|
|
|
176
160
|
{{settings.settings_resolve()}}
|
|
177
161
|
|
|
178
162
|
{{publication_gate()}}
|
|
179
|
-
Phase 11 passes the resolved value to
|
|
163
|
+
Phase 11 passes the resolved value to the evidence script (`publish`), which decides what each value means for the evidence comment. From the same line: {{compliance.compliance_frameworks()}}
|
|
180
164
|
|
|
181
165
|
{{compliance.compliance_inject()}}
|
|
182
166
|
|
|
183
|
-
Pass `COMPLIANCE_DIRECTIVE` to every Code and
|
|
167
|
+
Pass `COMPLIANCE_DIRECTIVE` to every Code and Fix spawn, on a line of its own.
|
|
184
168
|
|
|
185
169
|
{{decisions_load()}}
|
|
186
170
|
<!-- learning:on -->
|
|
187
|
-
Pass `DECISIONS_CONTEXT` to Code agent (Phase 2) and
|
|
171
|
+
Pass `DECISIONS_CONTEXT` to Code agent (Phase 2) and Harden agent (Phase 4).
|
|
188
172
|
|
|
189
173
|
<!-- learning:end -->
|
|
190
174
|
{{knowledge_load()}}
|
|
@@ -311,16 +295,16 @@ DECISIONS_CONTEXT: {decisions_context}
|
|
|
311
295
|
- Different files/modules with no imports between them
|
|
312
296
|
- Each subtask is self-contained
|
|
313
297
|
|
|
314
|
-
### Phase 3:
|
|
298
|
+
### Phase 3: Polish
|
|
315
299
|
|
|
316
|
-
**Produces:**
|
|
300
|
+
**Produces:** POLISH_OUTPUT
|
|
317
301
|
**Requires:** FILES_CHANGED
|
|
318
302
|
|
|
319
|
-
After the Code agent completes, spawn
|
|
303
|
+
After the Code agent completes, spawn Polish agent to polish the code. The Phase 6 Validate covers its commits.
|
|
320
304
|
|
|
321
305
|
```
|
|
322
|
-
Agent(subagent_type="
|
|
323
|
-
"
|
|
306
|
+
Agent(subagent_type="Polish"):
|
|
307
|
+
"Polish recently implemented code
|
|
324
308
|
Task: {task description}
|
|
325
309
|
FILES_CHANGED: {list of files from Code agent output}
|
|
326
310
|
Focus on code modified by Code agent, apply project standards, enhance clarity
|
|
@@ -329,13 +313,13 @@ Commit any improvements with a conventional-commit message."
|
|
|
329
313
|
|
|
330
314
|
### Phase 4: Self-Review
|
|
331
315
|
|
|
332
|
-
**Produces:**
|
|
316
|
+
**Produces:** HARDEN_OUTPUT
|
|
333
317
|
**Requires:** FILES_CHANGED
|
|
334
318
|
|
|
335
|
-
After
|
|
319
|
+
After Polish agent completes, spawn Harden agent as the quality gate:
|
|
336
320
|
|
|
337
321
|
```
|
|
338
|
-
Agent(subagent_type="
|
|
322
|
+
Agent(subagent_type="Harden"):
|
|
339
323
|
"TASK_DESCRIPTION: {task description}
|
|
340
324
|
FILES_CHANGED: {list of files from Code agent output}
|
|
341
325
|
<!-- learning:on -->
|
|
@@ -345,14 +329,14 @@ FEATURE_KNOWLEDGE: {feature_knowledge_rules}
|
|
|
345
329
|
Evaluate 9 pillars, fix P0/P1 issues, report status"
|
|
346
330
|
```
|
|
347
331
|
|
|
348
|
-
|
|
332
|
+
Harden 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.
|
|
349
333
|
|
|
350
334
|
### Phase 5: Alignment Check
|
|
351
335
|
|
|
352
336
|
**Produces:** ALIGNMENT_RESULT
|
|
353
337
|
**Requires:** FILES_CHANGED, EXECUTION_PLAN
|
|
354
338
|
|
|
355
|
-
After
|
|
339
|
+
After Harden 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 Harden agent:
|
|
356
340
|
|
|
357
341
|
```
|
|
358
342
|
Agent(subagent_type="Evaluate"):
|
|
@@ -370,9 +354,9 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
|
|
|
370
354
|
1. Extract misalignment details from Evaluate agent output
|
|
371
355
|
2. Increment `alignment_fix_count`
|
|
372
356
|
3. If `alignment_fix_count <= 2`:
|
|
373
|
-
- Spawn
|
|
357
|
+
- Spawn Fix agent to fix misalignments:
|
|
374
358
|
```
|
|
375
|
-
Agent(subagent_type="
|
|
359
|
+
Agent(subagent_type="Fix"):
|
|
376
360
|
"OPERATION: alignment-fix
|
|
377
361
|
TASK_ID: {task-id}
|
|
378
362
|
TASK_DESCRIPTION: Fix alignment issues
|
|
@@ -391,7 +375,7 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
|
|
|
391
375
|
**Produces:** VALIDATION_RESULT, VALIDATED_HEAD
|
|
392
376
|
**Requires:** BASE_BRANCH
|
|
393
377
|
|
|
394
|
-
Validate takes the one full-suite slot, after every commit it must cover: Code,
|
|
378
|
+
Validate takes the one full-suite slot, after every commit it must cover: Code, Polish, Harden 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 Polish, Harden and fix commits (`{base}` is `BASE_BRANCH`):
|
|
395
379
|
|
|
396
380
|
```
|
|
397
381
|
Agent(subagent_type="Validate"):
|
|
@@ -404,9 +388,9 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
|
404
388
|
1. Extract failure details from Validate agent output
|
|
405
389
|
2. Increment `validation_retry_count`
|
|
406
390
|
3. If `validation_retry_count <= 2`:
|
|
407
|
-
- Spawn
|
|
391
|
+
- Spawn Fix agent with fix context:
|
|
408
392
|
```
|
|
409
|
-
Agent(subagent_type="
|
|
393
|
+
Agent(subagent_type="Fix"):
|
|
410
394
|
"OPERATION: validation-fix
|
|
411
395
|
TASK_ID: {task-id}
|
|
412
396
|
TASK_DESCRIPTION: Fix validation failures
|
|
@@ -458,9 +442,9 @@ After every Test agent run — PASS or FAIL, first run or retry — append its T
|
|
|
458
442
|
1. Extract failure details from Test agent output
|
|
459
443
|
2. Increment `qa_retry_count`
|
|
460
444
|
3. If `qa_retry_count <= 2`:
|
|
461
|
-
- Spawn
|
|
445
|
+
- Spawn Fix agent to fix QA failures:
|
|
462
446
|
```
|
|
463
|
-
Agent(subagent_type="
|
|
447
|
+
Agent(subagent_type="Fix"):
|
|
464
448
|
"OPERATION: qa-fix
|
|
465
449
|
TASK_ID: {task-id}
|
|
466
450
|
TASK_DESCRIPTION: Fix QA test failures
|
|
@@ -515,7 +499,7 @@ COMMIT_UNCOMMITTED: false
|
|
|
515
499
|
Open the pull request for this branch and return the pre-flight summary."
|
|
516
500
|
```
|
|
517
501
|
|
|
518
|
-
`COMMIT_UNCOMMITTED: false` keeps the Git agent from committing a stray file: the Code,
|
|
502
|
+
`COMMIT_UNCOMMITTED: false` keeps the Git agent from committing a stray file: the Code, Polish, Harden and Fix agents commit their own work. Capture the `- **PR**: #{number}` line of its `### Branch` as `PR_NUMBER`, its `### Uncommitted files` list and its `TRACEABILITY: DEGRADED ({reason})` lines for the Phase 12 report. If it returns `### Status: BLOCKED` or no PR number, report its reason to the user and stop at the report (Phase 12); Phases 10 and 11 do not run.
|
|
519
503
|
|
|
520
504
|
### Phase 10: CI Status Gate
|
|
521
505
|
|
|
@@ -524,7 +508,7 @@ Open the pull request for this branch and return the pre-flight summary."
|
|
|
524
508
|
|
|
525
509
|
Run under every strategy: Phase 9 opened the PR.
|
|
526
510
|
|
|
527
|
-
**Push first, outside the gate block.** The gate reads CI for the pushed head, and the
|
|
511
|
+
**Push first, outside the gate block.** The gate reads CI for the pushed head, and the Polish, Harden and Fix commits reach the PR only by a push. Push once — never force, and no retry:
|
|
528
512
|
|
|
529
513
|
```bash
|
|
530
514
|
git push origin HEAD; echo "exit=$?"
|
|
@@ -539,9 +523,9 @@ git push origin HEAD; echo "exit=$?"
|
|
|
539
523
|
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.
|
|
540
524
|
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.
|
|
541
525
|
<!-- learning:on -->
|
|
542
|
-
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="
|
|
526
|
+
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Fix")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_DIRECTIVE` (when it is not empty), `CI_FAILURES`, `DECISIONS_CONTEXT` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Fix 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.
|
|
543
527
|
<!-- learning:off -->
|
|
544
|
-
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="
|
|
528
|
+
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Fix")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_DIRECTIVE` (when it is not empty), `CI_FAILURES` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Fix 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.
|
|
545
529
|
<!-- learning:end -->
|
|
546
530
|
7. **Budget**: at most 3 waits and 2 fixes in all. When one is spent, report the current status and proceed.
|
|
547
531
|
<!-- /PATTERN: ci-status-gate -->
|
|
@@ -553,25 +537,21 @@ git push origin HEAD; echo "exit=$?"
|
|
|
553
537
|
|
|
554
538
|
Run once, after Phase 10, under every strategy: the PR exists by now, opened in Phase 9. The re-validation path has no CI gate and runs this phase straight after Phase 9. Skip it only when Phase 9 stopped the run. A `ci` TP reads `INDETERMINATE` only when the CI gate could not tell or did not run.
|
|
555
539
|
|
|
556
|
-
**Push first.** Every claim is keyed to the HEAD an agent reported, and a
|
|
540
|
+
**Push first.** Every claim is keyed to the HEAD an agent reported, and a Harden or Fix agent may have committed without pushing; a claim whose SHA is not in the PR reads `UNVERIFIED`. So push the branch once before the script — never force, and no retry:
|
|
557
541
|
|
|
558
542
|
```bash
|
|
559
543
|
git push origin HEAD; echo "exit=$?"
|
|
560
544
|
```
|
|
561
545
|
|
|
562
|
-
`exit=0` continues to the
|
|
546
|
+
`exit=0` continues to the script. Any other result, a rejected non-fast-forward push included, does not block: record `TRACEABILITY: DEGRADED (evidence push failed)` for the Phase 12 report and run the script anyway.
|
|
563
547
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
EVIDENCE_FILE: .devflow/docs/evidence-{branch_slug}.md
|
|
569
|
-
REVIEW_PUBLICATION: {REVIEW_PUBLICATION resolved in Phase 1, or auto}
|
|
570
|
-
WORKTREE_PATH: {worktree}
|
|
571
|
-
Update the PR's test-plan block and post its evidence comment."
|
|
548
|
+
**Then refresh, inline.** The refresh is plumbing, so no Git agent runs it: `verify-evidence.cjs publish` is the whole `update-pr-evidence` operation — verify, the scrubbed block edit with its read-back, the scrubbed evidence comment — in one call. Use the Bash tool with `timeout: 180000`:
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
cd "{worktree}" && node "$HOME/.devflow/scripts/verify-evidence.cjs" publish --pr {PR_NUMBER} --evidence ".devflow/docs/evidence-{branch_slug}.md" --publication {REVIEW_PUBLICATION resolved in Phase 1, or auto}; echo "exit=$?"
|
|
572
552
|
```
|
|
573
553
|
|
|
574
|
-
|
|
554
|
+
Drop the `--evidence` pair when that file does not exist or its path does not match `^[A-Za-z0-9._/-]{1,255}$`. `{PR_NUMBER}` is digits only, and the publication value is `auto`, `full`, `off` or `stub`. Capture its stdout as `EVIDENCE_RESULT`: the `## PR Evidence` block — its `EVIDENCE` line and its `**Body**:` / `**Comment**:` line — and any `TRACEABILITY: DEGRADED ({reason})` lines after it (exit 0), or the one line `TRACEABILITY: DEGRADED (evidence unavailable)` (exit 2). Empty stdout or any other exit is `TRACEABILITY: DEGRADED (evidence unavailable)`. It never blocks: whatever it returns, continue to Phase 12.
|
|
575
555
|
|
|
576
556
|
### Phase 12: Report
|
|
577
557
|
|
|
@@ -581,7 +561,7 @@ Display completion summary with phase status, PR info, and next steps.
|
|
|
581
561
|
|
|
582
562
|
Show the test plan's evidence from Phase 11: `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`.
|
|
583
563
|
|
|
584
|
-
If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or Phase 10's push or Phase 11's
|
|
564
|
+
If any Git agent output emitted `TRACEABILITY: DEGRADED ({reason})` lines during the run, or Phase 10's push, Phase 11's push or Phase 11's script output carried one, surface them verbatim in the report under a `### Traceability` subsection so the user can act on them.
|
|
585
565
|
|
|
586
566
|
If Phase 9 listed uncommitted files, show them as a `### Uncommitted files` subsection: the user commits them or discards them.
|
|
587
567
|
|
|
@@ -598,68 +578,31 @@ If Phase 1 recorded an evidence exception, show its `## Evidence Exceptions` lin
|
|
|
598
578
|
│ └─ Branch safety → skip Phase 2 → detect FILES_CHANGED → Phases 3-8 → Phase 9, 11, 12
|
|
599
579
|
│
|
|
600
580
|
├─ Phase 1: Setup
|
|
601
|
-
│ └─ Plan document parsing (if .md path provided) - extracts execution plan, strategy, frontmatter issue
|
|
602
|
-
│ └─ Git agent (operation: setup-task) - creates feature branch, fetches issue
|
|
603
|
-
│ └─ Ticket-link ask (no linked ticket, issue required) - record a self-attested exception or stop
|
|
604
|
-
│ └─ Test plan (evidence file) - copy or author TP lines, check them, render the PR block; missing under a required policy: record a test-plan exception or stop
|
|
605
|
-
│
|
|
606
581
|
├─ Phase 2: Implement (3-strategy framework)
|
|
607
|
-
|
|
608
|
-
│ ├─ SEQUENTIAL_CODE_AGENTS (15%): N Code agents with handoff summaries
|
|
609
|
-
│ └─ PARALLEL_CODE_AGENTS (5%): N Code agents in single message (rare)
|
|
610
|
-
│
|
|
611
|
-
├─ Phase 3: Simplify
|
|
612
|
-
│ └─ Simplify agent (refines code clarity and consistency)
|
|
613
|
-
│
|
|
582
|
+
├─ Phase 3: Polish
|
|
614
583
|
├─ Phase 4: Self-Review
|
|
615
|
-
│ └─ Scrutinize agent (quality gate, fixes P0/P1; status PASS | FIXED | BLOCKED)
|
|
616
|
-
│
|
|
617
584
|
├─ Phase 5: Alignment Check
|
|
618
|
-
│ └─ Evaluate agent (validates alignment - reports only, no fixes)
|
|
619
|
-
│ └─ If MISALIGNED: Code-fix agent loop (max 2 iterations) → re-check alignment
|
|
620
|
-
│
|
|
621
585
|
├─ Phase 6: Validate (the one full-suite slot)
|
|
622
|
-
│ └─ Validate agent (build, typecheck, lint, test over the branch diff)
|
|
623
|
-
│ └─ If FAIL: Code-fix agent loop (max 2 retries) → re-validate at the new HEAD
|
|
624
|
-
│ └─ If PASS: record VALIDATED_HEAD, gate:validate claim → evidence file
|
|
625
|
-
│
|
|
626
586
|
├─ Phase 7: QA Testing
|
|
627
|
-
│ └─ Test agent (scenario-based acceptance tests, TEST_PLAN) → one claim per TP row → evidence file
|
|
628
|
-
│ └─ If FAIL: Code-fix agent loop (max 2 retries) → re-test
|
|
629
|
-
│
|
|
630
587
|
├─ Phase 8: Re-Validate (only if a qa-fix committed)
|
|
631
|
-
│ └─ Validate agent (changed-only over VALIDATED_HEAD..HEAD) → gate:validate claim
|
|
632
|
-
│
|
|
633
588
|
├─ Phase 9: Open PR (every strategy, outside the strategy branches)
|
|
634
|
-
│ └─ Git agent (operation: ensure-pr-ready) - commits nothing (COMMIT_UNCOMMITTED: false), pushes, opens the PR with the pasted link line, exceptions and test-plan block, D11-scrubbed body
|
|
635
|
-
│
|
|
636
589
|
├─ Phase 10: CI Status Gate (every strategy)
|
|
637
|
-
│ └─ Push the branch, then ci-wait.cjs (inline, one wait ≤ 570 s) → Code-fix agent on FAILING (3 waits + 2 fixes)
|
|
638
|
-
│
|
|
639
590
|
├─ Phase 11: Evidence (every strategy, once the PR exists)
|
|
640
|
-
│ └─ Push the branch (never force; a failure is DEGRADED, not a stop)
|
|
641
|
-
│ └─ Git agent (update-pr-evidence) - test-plan block + evidence comment; never blocks
|
|
642
|
-
│
|
|
643
591
|
├─ Phase 12: Report
|
|
644
592
|
│
|
|
645
593
|
└─ Feature Knowledge Write-Back (Conditional)
|
|
646
|
-
└─ Knowledge agent (if documented area changed AND knowledge enabled)
|
|
647
594
|
```
|
|
648
595
|
|
|
649
596
|
## Principles
|
|
650
597
|
|
|
651
|
-
1. **Orchestration only** - Command spawns agents, never does work itself; the inline calls are the bounded plumbing the charter allows: the Phase 10 and Phase 11 pushes, the Phase 10 ci-wait call and the evidence script checks
|
|
652
|
-
2. **
|
|
653
|
-
3. **
|
|
654
|
-
4. **
|
|
655
|
-
5. **
|
|
656
|
-
6. **
|
|
657
|
-
7. **
|
|
658
|
-
8. **
|
|
659
|
-
9. **Validate agent owns validation** - Never run `npm test`, `npm run build`, or similar in main session; always delegate to Validate agent
|
|
660
|
-
10. **Code-fix agent owns fixes** - Never implement fixes in main session; spawn Code-fix agent for validation failures and alignment fixes
|
|
661
|
-
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
|
|
662
|
-
12. **CI awareness** - CI status is checked before merge under every strategy, once Phase 9 has opened the PR; test-plan evidence (Phase 11) is recorded under every strategy once the PR exists
|
|
598
|
+
1. **Orchestration only** - Command spawns agents, never does work itself; the inline calls are the bounded plumbing the charter allows: the Phase 10 and Phase 11 pushes, the Phase 10 ci-wait call, the Phase 11 evidence publish call and the evidence script checks
|
|
599
|
+
2. **Agent ownership** - Each agent owns its output completely
|
|
600
|
+
3. **Honest reporting** - Display agent outputs directly
|
|
601
|
+
4. **Strict delegation** - Never perform agent work in main session. "Spawn X" means call Agent tool with X, not do X's work yourself
|
|
602
|
+
5. **Validate agent owns validation** - Never run `npm test`, `npm run build`, or similar in main session; always delegate to Validate agent
|
|
603
|
+
6. **Fix agent owns fixes** - Never implement fixes in main session; spawn Fix agent for validation failures and alignment fixes
|
|
604
|
+
7. **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
|
|
605
|
+
8. **CI awareness** - CI status is checked before merge under every strategy, once Phase 9 has opened the PR; test-plan evidence (Phase 11) is recorded under every strategy once the PR exists
|
|
663
606
|
|
|
664
607
|
## Error Handling
|
|
665
608
|
|
|
@@ -143,7 +143,7 @@ Return codebase context for requirements analysis."
|
|
|
143
143
|
|
|
144
144
|
{{decisions_load()}}
|
|
145
145
|
<!-- learning:on -->
|
|
146
|
-
This produces a compact index of active ADR/PF entries. Pass the Skim agent context to all subsequent agents. Pass `DECISIONS_CONTEXT` to the Design agents of the gap-analysis phase — prior decisions constrain design, known pitfalls inform gap analysis. Design agents use `devflow:apply-decisions` to Read full entry bodies on demand.
|
|
146
|
+
This produces a compact index of active ADR/PF entries. Pass the Skim agent context to all subsequent agents. Pass `DECISIONS_CONTEXT` to the Design agents of the gap-analysis phase as one shared slice — prior decisions constrain design, known pitfalls inform gap analysis. Design agents use `devflow:apply-decisions` to Read full entry bodies on demand.
|
|
147
147
|
|
|
148
148
|
<!-- learning:end -->
|
|
149
149
|
{{knowledge_load()}}
|
|
@@ -406,8 +406,9 @@ Use AskUserQuestion to present:
|
|
|
406
406
|
|
|
407
407
|
User can:
|
|
408
408
|
- **Accept** — proceed to output phases
|
|
409
|
-
- **Revise** — re-run phases 10-12 with new constraints
|
|
409
|
+
- **Revise** — when fewer than 2 revisions have run, re-run phases 10-12 with new constraints. Budget: at most 2 revisions, counted over the whole run
|
|
410
410
|
- **Cancel** — stop gracefully, no artifact written
|
|
411
|
+
- **Restart /plan with these constraints** — offered in place of Revise once 2 revisions have run: stop gracefully, write no artifact, and print the constraints given so far for a fresh `/plan` run
|
|
411
412
|
|
|
412
413
|
**MANDATORY**: Do not write design artifact until Gate 2 is confirmed.
|
|
413
414
|
|
|
@@ -546,68 +547,37 @@ Display completion summary:
|
|
|
546
547
|
│
|
|
547
548
|
├─ Block 1: Requirements Discovery
|
|
548
549
|
│ ├─ Phase 1: GATE 0 - Requirements Discovery ⛔ MANDATORY
|
|
550
|
+
│ │ ├─ Git agent (fetch-issue / fetch-issues-batch) - issue mode only
|
|
549
551
|
│ │ └─ AskUserQuestion: Validate interpretation
|
|
550
552
|
<!-- learning:on -->
|
|
551
553
|
│ ├─ Phase 2: Orient + Load Decisions
|
|
552
554
|
<!-- learning:off -->
|
|
553
555
|
│ ├─ Phase 2: Orient
|
|
554
556
|
<!-- learning:end -->
|
|
555
|
-
<!-- learning:on -->
|
|
556
|
-
│ │ ├─ Skim agent (codebase context)
|
|
557
|
-
│ │ └─ Read index.md → DECISIONS_CONTEXT
|
|
558
|
-
<!-- learning:off -->
|
|
559
|
-
│ │ └─ Skim agent (codebase context)
|
|
560
|
-
<!-- learning:end -->
|
|
561
557
|
│ ├─ Phase 3: Explore Requirements (PARALLEL)
|
|
562
|
-
│ │ ├─ Explore: User perspective
|
|
563
|
-
│ │ ├─ Explore: Similar features
|
|
564
|
-
│ │ ├─ Explore: Constraints
|
|
565
|
-
│ │ └─ Explore: Failure modes
|
|
566
558
|
│ └─ Phase 4: Synthesize Exploration
|
|
567
|
-
│ └─ Synthesize agent (mode: exploration)
|
|
568
559
|
│
|
|
569
560
|
├─ Block 2: Gap Analysis
|
|
570
561
|
│ ├─ Phase 5: Gap Analysis (PARALLEL)
|
|
571
|
-
│ │ ├─ Design agent: completeness
|
|
572
|
-
│ │ ├─ Design agent: architecture
|
|
573
|
-
│ │ ├─ Design agent: security
|
|
574
|
-
│ │ ├─ Design agent: performance
|
|
575
|
-
│ │ ├─ Design agent: compliance (only when COMPLIANCE_ACTIVE)
|
|
576
|
-
│ │ ├─ Design agent: consistency (multi-issue only)
|
|
577
|
-
│ │ └─ Design agent: dependencies (multi-issue only)
|
|
578
562
|
│ └─ Phase 6: Synthesize Gap Analysis
|
|
579
|
-
│ └─ Synthesize agent (mode: design)
|
|
580
563
|
│
|
|
581
564
|
├─ Block 3: Scope Approval
|
|
582
565
|
│ └─ Phase 7: GATE 1 - Validate Scope + Gaps ⛔ MANDATORY
|
|
583
|
-
│ └─ AskUserQuestion: Confirm scope and gap resolutions
|
|
584
566
|
│
|
|
585
567
|
├─ Block 4: Implementation Design
|
|
586
568
|
│ ├─ Phase 8: Explore Implementation (PARALLEL)
|
|
587
|
-
│ │ ├─ Explore: Architecture
|
|
588
|
-
│ │ ├─ Explore: Integration
|
|
589
|
-
│ │ ├─ Explore: Reusable code
|
|
590
|
-
│ │ └─ Explore: Edge cases
|
|
591
569
|
│ ├─ Phase 9: Synthesize Implementation Exploration
|
|
592
|
-
│ │ └─ Synthesize agent (mode: exploration)
|
|
593
570
|
│ ├─ Phase 10: Plan Implementation (PARALLEL)
|
|
594
|
-
│ │ ├─ Plan: Implementation steps
|
|
595
|
-
│ │ ├─ Plan: Testing strategy
|
|
596
|
-
│ │ └─ Plan: Execution strategy
|
|
597
571
|
│ └─ Phase 11: Synthesize Planning
|
|
598
|
-
│ └─ Synthesize agent (mode: planning)
|
|
599
572
|
│
|
|
600
573
|
├─ Block 5: Design Review + Approval
|
|
601
574
|
│ ├─ Phase 12: Design Review
|
|
602
|
-
│ │ └─ Design agent (mode: design-review)
|
|
603
575
|
│ └─ Phase 13: GATE 2 - Confirm Plan + Design Review ⛔ MANDATORY
|
|
604
|
-
│ └─
|
|
576
|
+
│ └─ Revise ≤ 2 → back to Phase 10; after 2: Accept / Cancel / Restart /plan
|
|
605
577
|
│
|
|
606
578
|
├─ Block 6: Output
|
|
607
579
|
│ └─ Phase 14: Output
|
|
608
|
-
│
|
|
609
|
-
│ ├─ Create tracker issue (optional)
|
|
610
|
-
│ └─ Report summary + next step
|
|
580
|
+
│ └─ Git agent (ensure-traceable-issue) - create or enrich tracker issue (optional)
|
|
611
581
|
│
|
|
612
582
|
```
|
|
613
583
|
|
|
@@ -624,6 +594,6 @@ Display completion summary:
|
|
|
624
594
|
## Error Handling
|
|
625
595
|
|
|
626
596
|
- If any agent fails, report the phase, agent type, and error
|
|
627
|
-
- If user selects "Revise" at Gate 2, loop back to Phase 10 with user's constraints
|
|
597
|
+
- If user selects "Revise" at Gate 2 and fewer than 2 revisions have run, loop back to Phase 10 with user's constraints; after the second revision Gate 2 offers Accept, Cancel or "Restart /plan with these constraints" only
|
|
628
598
|
- If user selects "Cancel" at any gate, stop gracefully without writing artifact
|
|
629
599
|
- If `{worktree}/.devflow/docs/design/` does not exist, create it in Phase 14
|
|
@@ -3,7 +3,7 @@ description: Release project using adaptive learned configuration
|
|
|
3
3
|
output-dir: dist/commands
|
|
4
4
|
---
|
|
5
5
|
@import { evidence_policy } from "./_partials/_evidence_policy.mds"
|
|
6
|
-
@import { decisions_gate, decisions_locate } from "./_partials/_decisions.mds"
|
|
6
|
+
@import { decisions_gate, decisions_locate, decisions_slice } from "./_partials/_decisions.mds"
|
|
7
7
|
@import { knowledge_load } from "./_partials/_knowledge.mds"
|
|
8
8
|
@import "./_partials/_settings.mds" as settings
|
|
9
9
|
|
|
@@ -70,6 +70,8 @@ Read `.release/RELEASE-FLOW.md`:
|
|
|
70
70
|
|
|
71
71
|
Read `{ledger}/.devflow/learning/index.md`. If the file is absent or empty, set `DECISIONS_CONTEXT` to `(none)`; otherwise use the file content as `DECISIONS_CONTEXT`.
|
|
72
72
|
|
|
73
|
+
{{decisions_slice()}}
|
|
74
|
+
|
|
73
75
|
<!-- learning:end -->
|
|
74
76
|
{{knowledge_load()}}
|
|
75
77
|
|
|
@@ -163,10 +165,12 @@ Arm 1 or 2 ⇒ ask once, via AskUserQuestion: "{u} untraced commits{, coverage u
|
|
|
163
165
|
## Traceability exceptions
|
|
164
166
|
- `untraced` <sha12> (<author>) self-attested by @<login> at <utc>: <reason>
|
|
165
167
|
- `coverage` <bound-hit|trace-unavailable|gather-indeterminate|untraced-beyond-list> self-attested by @<login> at <utc>: <reason>
|
|
168
|
+
|
|
166
169
|
Exempt (not attested): release <n> · revert <n> · bot <n> — <sha12>, …
|
|
167
170
|
```
|
|
168
171
|
|
|
169
172
|
- One `untraced` line per listed untraced commit (≤100), its `<sha12>` and `<author>` copied from that `### TRACE_MAP` line. One `coverage` line per arm-1 cause — `bound-hit` for `bound:hit`, `gather-indeterminate` for status `INDETERMINATE` or none of the five, `trace-unavailable` for any other — plus `untraced-beyond-list` when an `…and <n> more` line closes the untraced list. The `Exempt` line counts each exempt kind (its listed lines plus its `…and <n> more`) and names every listed exempt SHA.
|
|
173
|
+
- A blank line separates the last bullet from the `Exempt` line, so Markdown renders that line as its own paragraph and not inside the bullet. Compose the block with that blank line every time.
|
|
170
174
|
- `@<login>` is `@` followed by the output of `gh api user --jq .login` when that output matches `^[A-Za-z0-9][A-Za-z0-9-]{0,38}$`. On any other output, or a failed call, it is `(login unavailable)` instead, with no `@`.
|
|
171
175
|
- `<utc>` is the output of `date -u +%Y-%m-%dT%H:%M:%SZ`.
|
|
172
176
|
- `<reason>` is the user's own words, made inert: replace every character outside printable ASCII (newlines and tabs included) with a space, remove every `<`, `>`, `` ` ``, `[`, `]`, `\`, `/`, `#`, `@`, `&` and `$`, collapse runs of spaces, trim, keep the first 200 characters, and trim again. A reason that is empty after this is no reason.
|