devflow-kit 3.5.0 → 3.7.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 +178 -1
- package/README.md +10 -6
- package/dist/agents/code.md +7 -11
- package/dist/agents/{diagnose.md → debug.md} +4 -4
- package/dist/agents/{code-fix.md → fix.md} +7 -8
- package/dist/agents/{scrutinize.md → harden.md} +6 -6
- package/dist/agents/{code-edit.md → refactor.md} +8 -9
- package/dist/agents/review.md +2 -0
- package/dist/cli/agents-view/render.js +1 -1
- package/dist/cli/commands/gates.js +276 -0
- package/dist/cli/commands/init-seed.js +9 -1
- package/dist/cli/commands/init.js +34 -11
- package/dist/cli/commands/learning.js +12 -12
- package/dist/cli/commands/legacy-hooks.js +1 -1
- package/dist/cli/commands/memory.js +18 -0
- package/dist/cli/commands/uninstall.js +111 -5
- package/dist/cli.js +2 -0
- package/dist/commands/bug-analysis.md +21 -17
- package/dist/commands/code-review.md +65 -66
- package/dist/commands/debug.md +17 -17
- package/dist/commands/dynamic-build.md +104 -116
- package/dist/commands/dynamic-plan.md +13 -11
- package/dist/commands/dynamic-profile.md +9 -7
- package/dist/commands/dynamic-tickets.md +13 -11
- package/dist/commands/explore.md +15 -15
- package/dist/commands/implement.md +80 -154
- package/dist/commands/plan.md +34 -66
- package/dist/commands/release.md +11 -7
- package/dist/commands/research.md +14 -10
- package/dist/commands/resolve.md +44 -88
- package/dist/commands/self-review.md +44 -44
- package/dist/core/agent-models.js +47 -11
- package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
- package/dist/core/echo-value.js +42 -0
- package/dist/core/evidence-policy.js +17 -5
- package/dist/core/gate-level.js +213 -0
- package/dist/core/learning-queue-cleanup.js +1 -1
- package/dist/core/manifest.js +26 -10
- package/dist/core/migrations.js +63 -44
- package/dist/core/model-discovery.js +7 -1
- package/dist/core/plugins.js +14 -12
- package/dist/core/project-paths.js +3 -3
- package/dist/core/tracker.js +5 -33
- 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/code.md +7 -11
- package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
- package/dist/learning-off/agents/{code-fix.md → fix.md} +7 -8
- package/dist/learning-off/agents/{scrutinize.md → harden.md} +6 -6
- package/dist/learning-off/agents/{code-edit.md → refactor.md} +8 -9
- package/dist/learning-off/agents/review.md +2 -0
- package/dist/learning-off/commands/bug-analysis.md +9 -9
- package/dist/learning-off/commands/code-review.md +54 -59
- package/dist/learning-off/commands/debug.md +6 -10
- package/dist/learning-off/commands/dynamic-build.md +98 -112
- 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 +4 -8
- package/dist/learning-off/commands/implement.md +68 -146
- package/dist/learning-off/commands/plan.md +23 -58
- 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 +33 -81
- package/dist/learning-off/commands/self-review.md +32 -36
- 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/skills/git/references/tracker/github/ensure-pr-ready.md +7 -9
- package/dist/skills/git/references/tracker/jira/ensure-pr-ready.md +7 -15
- package/dist/skills/git/references/tracker/linear/ensure-pr-ready.md +7 -15
- package/dist/targets/claude-code/installer.js +117 -84
- package/dist/targets/claude-code/learning-install.js +15 -3
- package/dist/targets/claude-code/tracker-servers.js +1 -1
- package/package.json +1 -1
- package/src/assets/agents/_partials/_code.mds +7 -8
- package/src/assets/agents/code.mds +4 -7
- package/src/assets/agents/{learning.md → curate.md} +8 -10
- 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/review.mds +2 -0
- package/src/assets/agents/synthesize.md +2 -2
- 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/_partials/_settings.mds +2 -2
- package/src/assets/commands/_partials/_wave.mds +10 -17
- package/src/assets/commands/bug-analysis.mds +7 -7
- package/src/assets/commands/code-review.mds +51 -56
- package/src/assets/commands/debug.mds +2 -2
- package/src/assets/commands/dynamic-build.mds +67 -74
- package/src/assets/commands/implement.mds +65 -127
- package/src/assets/commands/plan.mds +21 -61
- 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/_ops_steps.mds +3 -3
- package/src/assets/mds/git/_pr.mds +6 -6
- package/src/assets/mds/tracker/_common.mds +23 -12
- package/src/assets/mds/tracker/_github.mds +2 -9
- package/src/assets/mds/tracker/_jira.mds +2 -15
- package/src/assets/mds/tracker/_linear.mds +2 -15
- package/src/assets/scripts/ci-wait.cjs +22 -4
- package/src/assets/scripts/claude-md-audit.cjs +66 -51
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
- package/src/assets/scripts/hooks/background-memory-update +404 -95
- 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 +13 -2
- package/src/assets/scripts/hooks/json-parse +18 -3
- 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/memory-permission +358 -0
- package/src/assets/scripts/hooks/preamble +1 -1
- package/src/assets/scripts/hooks/session-start-context +60 -47
- package/src/assets/scripts/hooks/session-start-memory +26 -5
- package/src/assets/scripts/lib/project-config.cjs +19 -4
- package/src/assets/scripts/resolve-settings.cjs +200 -32
- package/src/assets/scripts/verify-evidence.cjs +726 -9
- package/src/assets/skills/agent-references/SKILL.md +14 -6
- package/src/assets/skills/agent-references/references/commands/code-review-levels.md +19 -0
- 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/commands/plan-levels.md +40 -0
- package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +1 -1
- package/src/assets/skills/agent-references/references/synthesize/planning.md +9 -22
- package/src/assets/skills/agent-references/references/synthesize/review.md +11 -11
- 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
|
@@ -14,8 +14,6 @@ output-dir: dist/commands
|
|
|
14
14
|
|
|
15
15
|
Orchestrate design planning from requirements discovery through gap analysis to implementation design. Produces a machine-readable design artifact consumed by `/implement`.
|
|
16
16
|
|
|
17
|
-
The orchestrator only spawns agents and gates — all analytical work is done by agents.
|
|
18
|
-
|
|
19
17
|
## Usage
|
|
20
18
|
|
|
21
19
|
```
|
|
@@ -43,8 +41,6 @@ $ARGUMENTS
|
|
|
43
41
|
|
|
44
42
|
## Clarification Gates
|
|
45
43
|
|
|
46
|
-
**MANDATORY**: Three gates that must complete before proceeding.
|
|
47
|
-
|
|
48
44
|
| Gate | Phase | Purpose |
|
|
49
45
|
|------|-------|---------|
|
|
50
46
|
| Gate 0 | Phase 1 | Requirements discovery before exploration |
|
|
@@ -115,9 +111,9 @@ If the user says "skip" or "just proceed" — skip remaining questions, present
|
|
|
115
111
|
<!-- learning:end -->
|
|
116
112
|
|
|
117
113
|
<!-- learning:on -->
|
|
118
|
-
**Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
|
|
114
|
+
**Produces:** SKIM_CONTEXT, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, GATE_LEVEL
|
|
119
115
|
<!-- learning:off -->
|
|
120
|
-
**Produces:** SKIM_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES
|
|
116
|
+
**Produces:** SKIM_CONTEXT, FEATURE_KNOWLEDGE, FEATURE_KNOWLEDGE_RULES, GATE_LEVEL
|
|
121
117
|
<!-- learning:end -->
|
|
122
118
|
**Requires:** CONFIRMED_SCOPE
|
|
123
119
|
|
|
@@ -143,7 +139,7 @@ Return codebase context for requirements analysis."
|
|
|
143
139
|
|
|
144
140
|
{{decisions_load()}}
|
|
145
141
|
<!-- 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.
|
|
142
|
+
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
143
|
|
|
148
144
|
<!-- learning:end -->
|
|
149
145
|
{{knowledge_load()}}
|
|
@@ -154,10 +150,16 @@ Pass `FEATURE_KNOWLEDGE` to Explore and Design agents. Pass `DECISIONS_CONTEXT`
|
|
|
154
150
|
Pass `FEATURE_KNOWLEDGE` to Explore and Design agents.
|
|
155
151
|
<!-- learning:end -->
|
|
156
152
|
|
|
153
|
+
**Gate level.** At `standard` or `lean`, once per run, run `d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"` in Bash and Read `<that directory>/skills/devflow:agent-references/references/commands/plan-levels.md` with the Read tool, and apply it to Phases 3-14.
|
|
154
|
+
|
|
155
|
+
- No row or rule overrides the next two lines.
|
|
156
|
+
- If the Read fails, or a row is missing or malformed, set `GATE_LEVEL` to `full` and say `level reference unreadable: full applied`.
|
|
157
|
+
- Security runs as its own Design spawn, and the design review runs, at every level and on every Revise pass.
|
|
158
|
+
|
|
157
159
|
#### Phase 3: Explore Requirements (Parallel)
|
|
158
160
|
|
|
159
161
|
**Produces:** EXPLORE_OUTPUTS
|
|
160
|
-
**Requires:** SKIM_CONTEXT
|
|
162
|
+
**Requires:** SKIM_CONTEXT, GATE_LEVEL
|
|
161
163
|
|
|
162
164
|
Spawn 4 `Agent(subagent_type="Explore")` agents **in a single message**, each with Skim agent context and `FEATURE_KNOWLEDGE: {feature_knowledge}` (from Phase 2). Include the instruction: "The FEATURE_KNOWLEDGE is a baseline — VALIDATE, EXTEND, and CORRECT it. For anything it already covers, cite its KB IDs (`{slug} KB-AP-n`) instead of restating the text. Focus on areas the feature knowledge doesn't cover and changes since it was last updated." Ask each agent for a final report of at most about 1,500 tokens: findings with file:line references, not file dumps.
|
|
163
165
|
|
|
@@ -173,8 +175,6 @@ Spawn 4 `Agent(subagent_type="Explore")` agents **in a single message**, each wi
|
|
|
173
175
|
**Produces:** EXPLORATION_SYNTHESIS
|
|
174
176
|
**Requires:** EXPLORE_OUTPUTS
|
|
175
177
|
|
|
176
|
-
**WAIT** for Phase 3 to complete.
|
|
177
|
-
|
|
178
178
|
```
|
|
179
179
|
Agent(subagent_type="Synthesize"):
|
|
180
180
|
"Synthesize EXPLORATION outputs for: {feature/issues}
|
|
@@ -237,7 +237,7 @@ DECISIONS_CONTEXT: {decisions_context}
|
|
|
237
237
|
<!-- learning:end -->
|
|
238
238
|
FEATURE_KNOWLEDGE: {feature_knowledge}
|
|
239
239
|
{COMPLIANCE_FOCUS_DIRECTIVE} (compliance focus only)
|
|
240
|
-
|
|
240
|
+
Run `d="${CLAUDE_CONFIG_DIR:-}"; case "$d" in /*) ;; *) d="$HOME/.claude" ;; esac; printf '%s\n' "$d"` in Bash, then Read `<that directory>/skills/devflow:gap-analysis/references/compliance.md` with the Read tool and apply it as your focus patterns. (compliance focus only)
|
|
241
241
|
Artifacts:
|
|
242
242
|
Feature/Issues: {feature description or issue bodies}
|
|
243
243
|
Exploration synthesis: {Phase 4 output}
|
|
@@ -255,8 +255,6 @@ Cite evidence from provided artifacts."
|
|
|
255
255
|
**Produces:** GAP_SYNTHESIS
|
|
256
256
|
**Requires:** GAP_OUTPUTS
|
|
257
257
|
|
|
258
|
-
**WAIT** for Phase 5 to complete.
|
|
259
|
-
|
|
260
258
|
```
|
|
261
259
|
Agent(subagent_type="Synthesize"):
|
|
262
260
|
"Synthesize GAP ANALYSIS outputs for: {feature/issues}
|
|
@@ -317,8 +315,6 @@ Spawn 4 `Agent(subagent_type="Explore")` agents **in a single message**, each wi
|
|
|
317
315
|
**Produces:** IMPL_EXPLORATION_SYNTHESIS
|
|
318
316
|
**Requires:** IMPL_EXPLORE_OUTPUTS
|
|
319
317
|
|
|
320
|
-
**WAIT** for Phase 8 to complete.
|
|
321
|
-
|
|
322
318
|
```
|
|
323
319
|
Agent(subagent_type="Synthesize"):
|
|
324
320
|
"Synthesize IMPLEMENTATION EXPLORATION outputs for: {feature/issues}
|
|
@@ -332,7 +328,7 @@ Combine into: patterns to follow, integration points, reusable code, edge cases"
|
|
|
332
328
|
**Produces:** PLAN_OUTPUTS
|
|
333
329
|
**Requires:** IMPL_EXPLORATION_SYNTHESIS, GAP_SYNTHESIS
|
|
334
330
|
|
|
335
|
-
Spawn 3 Plan agents **in a single message**, each with implementation exploration synthesis. Ask each agent for a final report of at most about 1,500 tokens: the plan itself, not a restatement of the exploration.
|
|
331
|
+
Spawn 3 `Agent(subagent_type="Plan")` agents **in a single message**, each with implementation exploration synthesis. Ask each agent for a final report of at most about 1,500 tokens: the plan itself, not a restatement of the exploration.
|
|
336
332
|
|
|
337
333
|
| Focus | Output |
|
|
338
334
|
|-------|--------|
|
|
@@ -347,8 +343,6 @@ Implementation steps planner: include explicit gap mitigations (from Phase 6) in
|
|
|
347
343
|
**Produces:** PLANNING_SYNTHESIS
|
|
348
344
|
**Requires:** PLAN_OUTPUTS
|
|
349
345
|
|
|
350
|
-
**WAIT** for Phase 10 to complete.
|
|
351
|
-
|
|
352
346
|
```
|
|
353
347
|
Agent(subagent_type="Synthesize"):
|
|
354
348
|
"Synthesize PLANNING outputs for: {feature/issues}
|
|
@@ -406,8 +400,9 @@ Use AskUserQuestion to present:
|
|
|
406
400
|
|
|
407
401
|
User can:
|
|
408
402
|
- **Accept** — proceed to output phases
|
|
409
|
-
- **Revise** — re-run phases 10-12 with new constraints
|
|
403
|
+
- **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
404
|
- **Cancel** — stop gracefully, no artifact written
|
|
405
|
+
- **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
406
|
|
|
412
407
|
**MANDATORY**: Do not write design artifact until Gate 2 is confirmed.
|
|
413
408
|
|
|
@@ -535,6 +530,7 @@ Display completion summary:
|
|
|
535
530
|
- Issue URL (if created or enriched) — and any `TRACEABILITY: DEGRADED ({reason})` lines from the Git agent
|
|
536
531
|
- Gap analysis summary (N blocking, M should-address)
|
|
537
532
|
- Design review summary (N anti-patterns found, M mitigated in plan)
|
|
533
|
+
- Gate level: {GATE_LEVEL}, with any level note
|
|
538
534
|
- Suggested next step: `/implement {artifact-path}` or `/implement #{issue-number}`
|
|
539
535
|
|
|
540
536
|
---
|
|
@@ -546,84 +542,48 @@ Display completion summary:
|
|
|
546
542
|
│
|
|
547
543
|
├─ Block 1: Requirements Discovery
|
|
548
544
|
│ ├─ Phase 1: GATE 0 - Requirements Discovery ⛔ MANDATORY
|
|
545
|
+
│ │ ├─ Git agent (fetch-issue / fetch-issues-batch) - issue mode only
|
|
549
546
|
│ │ └─ AskUserQuestion: Validate interpretation
|
|
550
547
|
<!-- learning:on -->
|
|
551
548
|
│ ├─ Phase 2: Orient + Load Decisions
|
|
552
549
|
<!-- learning:off -->
|
|
553
550
|
│ ├─ Phase 2: Orient
|
|
554
551
|
<!-- 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
552
|
│ ├─ Phase 3: Explore Requirements (PARALLEL)
|
|
562
|
-
│ │ ├─ Explore: User perspective
|
|
563
|
-
│ │ ├─ Explore: Similar features
|
|
564
|
-
│ │ ├─ Explore: Constraints
|
|
565
|
-
│ │ └─ Explore: Failure modes
|
|
566
553
|
│ └─ Phase 4: Synthesize Exploration
|
|
567
|
-
│ └─ Synthesize agent (mode: exploration)
|
|
568
554
|
│
|
|
569
555
|
├─ Block 2: Gap Analysis
|
|
570
556
|
│ ├─ 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
557
|
│ └─ Phase 6: Synthesize Gap Analysis
|
|
579
|
-
│ └─ Synthesize agent (mode: design)
|
|
580
558
|
│
|
|
581
559
|
├─ Block 3: Scope Approval
|
|
582
560
|
│ └─ Phase 7: GATE 1 - Validate Scope + Gaps ⛔ MANDATORY
|
|
583
|
-
│ └─ AskUserQuestion: Confirm scope and gap resolutions
|
|
584
561
|
│
|
|
585
562
|
├─ Block 4: Implementation Design
|
|
586
563
|
│ ├─ Phase 8: Explore Implementation (PARALLEL)
|
|
587
|
-
│ │ ├─ Explore: Architecture
|
|
588
|
-
│ │ ├─ Explore: Integration
|
|
589
|
-
│ │ ├─ Explore: Reusable code
|
|
590
|
-
│ │ └─ Explore: Edge cases
|
|
591
564
|
│ ├─ Phase 9: Synthesize Implementation Exploration
|
|
592
|
-
│ │ └─ Synthesize agent (mode: exploration)
|
|
593
565
|
│ ├─ Phase 10: Plan Implementation (PARALLEL)
|
|
594
|
-
│ │ ├─ Plan: Implementation steps
|
|
595
|
-
│ │ ├─ Plan: Testing strategy
|
|
596
|
-
│ │ └─ Plan: Execution strategy
|
|
597
566
|
│ └─ Phase 11: Synthesize Planning
|
|
598
|
-
│ └─ Synthesize agent (mode: planning)
|
|
599
567
|
│
|
|
600
568
|
├─ Block 5: Design Review + Approval
|
|
601
569
|
│ ├─ Phase 12: Design Review
|
|
602
|
-
│ │ └─ Design agent (mode: design-review)
|
|
603
570
|
│ └─ Phase 13: GATE 2 - Confirm Plan + Design Review ⛔ MANDATORY
|
|
604
|
-
│ └─
|
|
571
|
+
│ └─ Revise ≤ 2 → back to Phase 10; after 2: Accept / Cancel / Restart /plan
|
|
605
572
|
│
|
|
606
573
|
├─ Block 6: Output
|
|
607
574
|
│ └─ Phase 14: Output
|
|
608
|
-
│
|
|
609
|
-
│ ├─ Create tracker issue (optional)
|
|
610
|
-
│ └─ Report summary + next step
|
|
575
|
+
│ └─ Git agent (ensure-traceable-issue) - create or enrich tracker issue (optional)
|
|
611
576
|
│
|
|
612
577
|
```
|
|
613
578
|
|
|
614
579
|
## Principles
|
|
615
580
|
|
|
616
|
-
1. **
|
|
617
|
-
2. **
|
|
618
|
-
3. **Parallel execution** — Explore phases and gap analysis run in parallel; synthesis phases wait
|
|
619
|
-
4. **Evidence-based gaps** — Every gap cites specific text; no speculation
|
|
620
|
-
5. **Scope ruthlessly** — Small, focused plans ship faster; gate 1 enforces scope discipline
|
|
621
|
-
6. **Strict delegation** — Never synthesize, analyze, or plan in main session; always spawn agents
|
|
622
|
-
7. **Design artifacts are machine-readable** — `/implement` can consume the YAML frontmatter directly
|
|
581
|
+
1. **Scope ruthlessly** — Small, focused plans ship faster; gate 1 enforces scope discipline
|
|
582
|
+
2. **Strict delegation** — Never synthesize, analyze, or plan in main session; always spawn agents
|
|
623
583
|
|
|
624
584
|
## Error Handling
|
|
625
585
|
|
|
626
586
|
- 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
|
|
587
|
+
- 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
588
|
- If user selects "Cancel" at any gate, stop gracefully without writing artifact
|
|
629
589
|
- 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.
|
|
@@ -122,7 +122,7 @@ Resolve this per worktree — unlike the evidence policy above, the settings lin
|
|
|
122
122
|
|
|
123
123
|
{{compliance.compliance_inject()}}
|
|
124
124
|
|
|
125
|
-
Set it per worktree, from that worktree's lens, and pass that worktree's `COMPLIANCE_DIRECTIVE` to each of its Code and
|
|
125
|
+
Set it per worktree, from that worktree's lens, and pass that worktree's `COMPLIANCE_DIRECTIVE` to each of its Code and Fix spawns, on a line of its own.
|
|
126
126
|
|
|
127
127
|
**Mint `RESOLUTION_TS` once per run:** `date -u +%Y-%m-%dT%H:%M:%SZ`. Every worktree reuses it — the resolution comment's dedup marker is searched per PR, so one run key keeps a retry of this run deduplicated while the next /resolve on the same PR posts. Phase 5 writes it as the summary's `**Date**:` and Phase 9b-2 passes it, so the local file and the posted marker agree.
|
|
128
128
|
|
|
@@ -274,7 +274,7 @@ Collect from each Code agent:
|
|
|
274
274
|
**Produces:** RESOLUTION_FILE (early write for compaction safety)
|
|
275
275
|
**Requires:** TRIAGE_RESULTS, CODE_AGENT_RESULTS, TARGET_DIR, TARGET_DIR_REL, BRANCH_INFO, RESOLUTION_TS
|
|
276
276
|
|
|
277
|
-
**Immediately write `resolution-summary.md`** to `{TARGET_DIR}` using the Write tool. Do this now — not in Phase 9 — while results are fresh in context. This ensures the record is persisted even if later phases (
|
|
277
|
+
**Immediately write `resolution-summary.md`** to `{TARGET_DIR}` using the Write tool. Do this now — not in Phase 9 — while results are fresh in context. This ensures the record is persisted even if later phases (Polish, Verification Gate, CI gate, Tech Debt) trigger context compaction.
|
|
278
278
|
|
|
279
279
|
Set `Tracked` for FIX_SEPARATE and TECH_DEBT items to `(pending)` — to be backfilled after Phase 9 manage-debt (or `TRACEABILITY: DEGRADED ({reason})` if manage-debt degrades).
|
|
280
280
|
|
|
@@ -282,19 +282,19 @@ DUPLICATE issues are listed **only** in `## Duplicates` — never in `## Fixed I
|
|
|
282
282
|
|
|
283
283
|
Use the template from the Output Artifact section below.
|
|
284
284
|
|
|
285
|
-
### Phase 6:
|
|
285
|
+
### Phase 6: Polish
|
|
286
286
|
|
|
287
|
-
**Produces:**
|
|
287
|
+
**Produces:** POLISH_RESULT
|
|
288
288
|
**Requires:** CODE_AGENT_RESULTS
|
|
289
289
|
|
|
290
|
-
If any fixes were made, spawn
|
|
290
|
+
If any fixes were made, spawn Polish agent to refine the changed code:
|
|
291
291
|
|
|
292
292
|
```
|
|
293
|
-
Agent(subagent_type="
|
|
293
|
+
Agent(subagent_type="Polish", run_in_background=false):
|
|
294
294
|
"TASK_DESCRIPTION: Issue resolution fixes
|
|
295
295
|
WORKTREE_PATH: {worktree_path} (omit if cwd)
|
|
296
296
|
FILES_CHANGED: {list of files modified by Code agents}
|
|
297
|
-
|
|
297
|
+
Polish and refine the fixes for clarity and consistency
|
|
298
298
|
Commit any improvements with a conventional-commit message."
|
|
299
299
|
```
|
|
300
300
|
|
|
@@ -320,9 +320,9 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
|
320
320
|
1. Extract failure details from Validate agent output
|
|
321
321
|
2. Increment `validation_retry_count`
|
|
322
322
|
3. If `validation_retry_count <= 2`:
|
|
323
|
-
- Spawn
|
|
323
|
+
- Spawn Fix agent with fix context:
|
|
324
324
|
```
|
|
325
|
-
Agent(subagent_type="
|
|
325
|
+
Agent(subagent_type="Fix"):
|
|
326
326
|
"OPERATION: validation-fix
|
|
327
327
|
TASK_ID: resolve-{batch-id}-valfix-{count}
|
|
328
328
|
VALIDATION_FAILURES: {parsed failures from Validate agent}
|
|
@@ -342,7 +342,7 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
|
|
|
342
342
|
Record `## Verification` outcome in resolution-summary.md (runs unconditionally after the validation loop exits):
|
|
343
343
|
- Rewrite the `## Verification` section with | Command | Result | table + `Final gate: PASS | FAILED after N attempts`
|
|
344
344
|
|
|
345
|
-
Push all commits to remote once (Code and
|
|
345
|
+
Push all commits to remote once (Code and Fix agents ran with PUSH: false — runs whether the gate PASSED or FAILED, so the branch is always visible before Phase 9 or CI runs):
|
|
346
346
|
```bash
|
|
347
347
|
git -C {worktree} push
|
|
348
348
|
```
|
|
@@ -381,9 +381,9 @@ Phase 7 has pushed already, so this is a no-op unless the head moved since. `exi
|
|
|
381
381
|
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.
|
|
382
382
|
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.
|
|
383
383
|
<!-- learning:on -->
|
|
384
|
-
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="
|
|
384
|
+
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.
|
|
385
385
|
<!-- learning:off -->
|
|
386
|
-
6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="
|
|
386
|
+
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.
|
|
387
387
|
<!-- learning:end -->
|
|
388
388
|
7. **Budget**: at most 3 waits and 2 fixes in all, per worktree. When one is spent, report the current status and proceed.
|
|
389
389
|
<!-- /PATTERN: ci-status-gate -->
|
|
@@ -494,19 +494,13 @@ Capture the Git agent's `**Publication**:` and `**Status**:` lines as `PR_COMMEN
|
|
|
494
494
|
|
|
495
495
|
**Step 9b-3: Refresh the test-plan evidence**
|
|
496
496
|
|
|
497
|
-
Run this step only when Step 9b-0 ran — the head moved — and its `EVIDENCE` line did not read `total:0` with `exceptions:none` (nothing to record); otherwise record `EVIDENCE_REFRESH` as `SKIPPED ({reason})`.
|
|
497
|
+
Run this step only when Step 9b-0 ran — the head moved — and its `EVIDENCE` line did not read `total:0` with `exceptions:none` (nothing to record); otherwise record `EVIDENCE_REFRESH` as `SKIPPED ({reason})`. Run the script inline — it is the whole `update-pr-evidence` operation, with no Git agent spawn — through the Bash tool with `timeout: 180000`:
|
|
498
498
|
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
"OPERATION: update-pr-evidence
|
|
502
|
-
PR_NUMBER: {pr_number}
|
|
503
|
-
EVIDENCE_FILE: {TARGET_DIR_REL}/evidence.md
|
|
504
|
-
REVIEW_PUBLICATION: {9b-2's publication mode}
|
|
505
|
-
WORKTREE_PATH: {worktree_path} (omit if cwd)
|
|
506
|
-
Refresh the PR's test-plan block and post its evidence comment."
|
|
499
|
+
```bash
|
|
500
|
+
cd {worktree} && node "$HOME/.devflow/scripts/verify-evidence.cjs" publish --pr {pr_number} --evidence "{TARGET_DIR_REL}/evidence.md" --publication {9b-2's publication mode}; echo "exit=$?"
|
|
507
501
|
```
|
|
508
502
|
|
|
509
|
-
|
|
503
|
+
Drop the `--evidence` pair when Step 9b-0 appended no claim. Run it only when `TARGET_DIR_REL` matches `^[A-Za-z0-9._/-]+$` — it carries the branch name, which a fork author picks — and `{pr_number}` is digits only; treat any other value as a failed run. The publication value is the mode 9b-2 reported on its `**Publication**:` line — `FULL…` → `full`, `STUB…` → `stub`, `OFF…` → `off` — else `{REVIEW_PUBLICATION}` as resolved in Step 0d. Capture its stdout as `EVIDENCE_REFRESH`: the `## PR Evidence` block's `EVIDENCE` line and its `**Body**:` / `**Comment**:` line, with any `TRACEABILITY: DEGRADED ({reason})` lines after them (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.
|
|
510
504
|
|
|
511
505
|
### Phase 9c: Merge Readiness (Report-only)
|
|
512
506
|
|
|
@@ -515,19 +509,17 @@ Omit the `EVIDENCE_FILE` line when Step 9b-0 appended no claim. `REVIEW_PUBLICAT
|
|
|
515
509
|
|
|
516
510
|
Run this phase only when `REQUIRE_NON_AUTHOR_APPROVAL` is `true`; otherwise skip it and report it as SKIPPED.
|
|
517
511
|
|
|
518
|
-
|
|
512
|
+
Run the script inline — it is the whole `check-merge-readiness` operation, with no Git agent spawn — through the Bash tool with `timeout: 180000`:
|
|
519
513
|
|
|
514
|
+
```bash
|
|
515
|
+
cd {worktree} && node "$HOME/.devflow/scripts/verify-evidence.cjs" readiness --pr {pr_number} --require-non-author-approval true; echo "exit=$?"
|
|
520
516
|
```
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
PR_NUMBER: {pr_number}
|
|
524
|
-
REQUIRE_NON_AUTHOR_APPROVAL: {REQUIRE_NON_AUTHOR_APPROVAL}
|
|
525
|
-
WORKTREE_PATH: {worktree_path} (omit if cwd)"
|
|
526
|
-
```
|
|
517
|
+
|
|
518
|
+
Pass `--require-non-author-approval true`: `REQUIRE_NON_AUTHOR_APPROVAL` is `true` here, or this phase would not run. `{pr_number}` is digits only. Its stdout is the `## Merge Readiness` block (exit 0), or the same block with `**Status**: DEGRADED ({reason})` and a `TRACEABILITY: DEGRADED ({reason})` line after it (exit 2); empty stdout or any other exit is `TRACEABILITY: DEGRADED (readiness unavailable)`.
|
|
527
519
|
|
|
528
520
|
Include merge readiness verdict (READY / NOT_READY / DEGRADED) and its `- Test plan:` detail line in Phase 10 report. Never block on this result — report-only.
|
|
529
521
|
|
|
530
|
-
If
|
|
522
|
+
If the script prints a `TRACEABILITY: DEGRADED` line: warn, proceed to Phase 10.
|
|
531
523
|
|
|
532
524
|
### Phase 10: Report
|
|
533
525
|
|
|
@@ -592,48 +584,24 @@ In multi-worktree mode, report results per worktree with aggregate summary.
|
|
|
592
584
|
/resolve (orchestrator - spawns agents only)
|
|
593
585
|
│
|
|
594
586
|
├─ Phase 0: Worktree Discovery & Pre-flight
|
|
595
|
-
│ ├─ Step 0a: git worktree list → filter resolvable
|
|
596
|
-
│ ├─ Step 0b: Git agent (validate-branch) per worktree [parallel] ← + DIFF_FILES
|
|
597
|
-
│ ├─ Step 0c: Target latest review directory per worktree
|
|
598
|
-
<!-- learning:on -->
|
|
599
|
-
│ └─ Step 0d: Load project decisions → DECISIONS_CONTEXT + EVIDENCE_POLICY + REVIEW_PUBLICATION
|
|
600
|
-
<!-- learning:off -->
|
|
601
|
-
│ └─ Step 0d: Load project context → EVIDENCE_POLICY + REVIEW_PUBLICATION
|
|
602
|
-
<!-- learning:end -->
|
|
603
|
-
│
|
|
604
587
|
├─ Phase 1: Parse issues from TARGET_DIR + extract confidence %
|
|
605
|
-
│
|
|
606
588
|
├─ Phase 1b: Fetch external threads (evidence policy required)
|
|
607
|
-
│ └─ Git agent (fetch-review-threads) → THREAD_MAP
|
|
608
|
-
│
|
|
609
589
|
├─ Phase 2: Global Triage [Triage agent, opus, single agent]
|
|
610
|
-
│ └─ ALL issues → verdict ledger by disposition (incl. DUPLICATE with duplicate_of)
|
|
611
|
-
│
|
|
612
590
|
├─ Phase 3: Batch FIX_NOW issues (skip if empty; DUPLICATE issues never dispatched)
|
|
613
|
-
│ └─ same-file sequential, distinct-file parallel, max 5/batch
|
|
614
|
-
│
|
|
615
591
|
├─ Phase 4: Fix [Code agent × N, OPERATION: issue-fix, PUSH: false]
|
|
616
|
-
│ └─ Returns Verification block per batch
|
|
617
|
-
│
|
|
618
592
|
├─ Phase 5: Write resolution-summary.md (compaction safety; Tracked = "(pending)" or "(pending — TRACEABILITY: DEGRADED)" if manage-debt degrades)
|
|
619
|
-
|
|
620
|
-
├─ Phase
|
|
621
|
-
│
|
|
622
|
-
├─ Phase 7: Verification Gate [Validate agent, haiku] + push + Code-fix agent validation-fix loop ≤2
|
|
623
|
-
│
|
|
593
|
+
├─ Phase 6: Polish [Polish agent]
|
|
594
|
+
├─ Phase 7: Verification Gate [Validate agent, haiku] + push + Fix agent validation-fix loop ≤2
|
|
624
595
|
├─ Phase 8: CI Status Gate (conditional — skipped if no fixes or verification FAILED)
|
|
625
|
-
│ └─ push, then ci-wait.cjs (inline, one wait ≤ 570 s) → Code-fix agent on FAILING (3 waits + 2 fixes per worktree)
|
|
626
|
-
│
|
|
627
596
|
├─ Phase 9: Git agent (manage-debt) — FIX_SEPARATE + TECH_DEBT → backfill Tracked={ISSUE_REF} (or TRACEABILITY: DEGRADED on failure)
|
|
628
|
-
│ SEQUENTIAL across worktrees
|
|
629
597
|
│
|
|
630
598
|
├─ Phase 9b: Thread resolution + resolution comment
|
|
631
599
|
│ ├─ Step 9b-0: verify-evidence.cjs --stale-out → ≤1 Test agent on the stale TPs (wrapped) — only after this run's push
|
|
632
600
|
│ ├─ Step 9b-1: Git agent (resolve-review-threads) — evidence policy required
|
|
633
601
|
│ ├─ Step 9b-2: Git agent (post-resolution-summary, REVIEW_PUBLICATION) — always-on
|
|
634
|
-
│ └─ Step 9b-3:
|
|
602
|
+
│ └─ Step 9b-3: verify-evidence.cjs publish (inline, no Git spawn) — only when the head moved
|
|
635
603
|
│
|
|
636
|
-
├─ Phase 9c:
|
|
604
|
+
├─ Phase 9c: verify-evidence.cjs readiness (inline, no Git spawn) — non-author approval required, report-only
|
|
637
605
|
│
|
|
638
606
|
└─ Phase 10: Display results (resolution-summary.md written in Phase 5)
|
|
639
607
|
```
|
|
@@ -647,21 +615,11 @@ In multi-worktree mode, report results per worktree with aggregate summary.
|
|
|
647
615
|
| Fix attempt fails | Revert changes, mark BLOCKED, continue others |
|
|
648
616
|
| Issue dependencies | Sequential chain, skip dependents if predecessor blocked |
|
|
649
617
|
| No actionable issues | Report "No issues to resolve" |
|
|
650
|
-
| Incomplete review directory (no review-summary.md) | Skip — resolve only targets complete reviews |
|
|
651
618
|
| Latest review already resolved | Check bug-analysis fallback (Step 0c-5b); if also absent, skip worktree and suggest `/code-review` or `/bug-analysis` |
|
|
652
|
-
| Legacy flat layout (no subdirectories) | Read flat *.md files directly (backwards compatible) |
|
|
653
619
|
| `--review {timestamp}` in multi-worktree mode | Not supported — use `--path` + `--review` to target specific worktree + review |
|
|
654
|
-
| Worktree pre-flight fails | Report failure, continue with other worktrees |
|
|
655
|
-
| Empty FIX_NOW list | Skip Phases 3-4/6-8; still write full summary + run manage-debt if FIX_SEPARATE/TECH_DEBT exist |
|
|
656
|
-
| ESCALATED security issues | Surfaced in ## Escalations + display callout; never routed to manage-debt |
|
|
657
|
-
| DUPLICATE verdict without duplicate_of, or chained to another DUPLICATE | Treated as Triage failure — same retry-then-abort as a vanished id |
|
|
658
|
-
| DUPLICATE issues in THREAD_MAP | Map ext-{N} to primary's verdict/verification status for thread reply |
|
|
659
|
-
| Verification Gate FAILED after 2 attempts | Recorded as FAILED in ## Verification + blocking callout; CI gate skipped; proceed to Phase 9 (manage-debt) then Phase 10 (display) |
|
|
660
620
|
| gh/GitHub absent | manage-debt degrades (`TRACEABILITY: DEGRADED ({reason})`); Tracked stays `(pending — TRACEABILITY: DEGRADED ({reason}))` — recorded, not dropped |
|
|
661
621
|
| `EVIDENCE_POLICY` is `standard` | Phases 1b and 9b-step-1 are skipped; post-resolution-summary (Phase 9b step 2) still runs if a PR is known |
|
|
662
622
|
| `REQUIRE_NON_AUTHOR_APPROVAL` is `false` | Phase 9c is skipped and reported as SKIPPED |
|
|
663
|
-
| THREAD_MAP empty or DEGRADED | Phase 9b-1 skipped; resolution comment (Phase 9b-2) still posted if PR known |
|
|
664
|
-
| No PR exists for post-resolution-summary | Git agent returns TRACEABILITY: DEGRADED; resolution-summary.md already on disk — not a blocker |
|
|
665
623
|
| Public repo (`auto` mode) | Git agent probes visibility, posts counts-only STUB comment; full resolution report stays local |
|
|
666
624
|
| `reviewPublication: off` | Git agent skips posting the resolution comment (OFF) — except that, only when `EVIDENCE_POLICY` is `required`, Step 0d passes `stub` and a counts-only STUB comment posts |
|
|
667
625
|
| Fork PR this run cannot push to (no maintainer edits, no push access of its own) | validate-branch emits `TRACEABILITY: DEGRADED (cannot push to fork)` → `fork_no_push`: Phase 7 skips the push, Phase 8 is skipped, 9b-1 records FIXED threads as DEGRADED instead of citing unpushed commits; 9b-2 still posts the resolution comment; the head did not move, so 9b-0 and 9b-3 are skipped |
|
|
@@ -672,14 +630,8 @@ In multi-worktree mode, report results per worktree with aggregate summary.
|
|
|
672
630
|
|
|
673
631
|
1. **Orchestration only** - Command spawns agents, doesn't do git/resolve work itself
|
|
674
632
|
2. **No agent grades its own homework** - Triage agent validates, Code agents fix, Validate agent verifies
|
|
675
|
-
3. **
|
|
676
|
-
4. **
|
|
677
|
-
5. **Parallel execution** - Distinct-file Code agent batches run in parallel; same-file batches sequential
|
|
678
|
-
6. **Honest reporting** - Verification failure is recorded and displayed, never silenced
|
|
679
|
-
7. **Complete tracking** - Every issue gets exactly one verdict in the ledger
|
|
680
|
-
8. **Latest review by default** - Only process the most recent complete review
|
|
681
|
-
9. **Auto-discover worktrees** - One command handles all resolvable branches
|
|
682
|
-
10. **Traceability-aware** - Policy-gated ops (thread fetch/resolve, merge readiness) are skipped cleanly when the evidence policy does not ask for them; resolution comment (Phase 9b-2) is always-on; test-plan evidence is re-verified (≤1 Test agent) and refreshed only when this run moved the head (Steps 9b-0, 9b-3)
|
|
633
|
+
3. **Git agent for git work** - All git operations go through Git agent; the CI wait, the evidence refresh and the merge-readiness check are inline scripts (plumbing, no model work)
|
|
634
|
+
4. **Traceability-aware** - Policy-gated ops (thread fetch/resolve, merge readiness) are skipped cleanly when the evidence policy does not ask for them; resolution comment (Phase 9b-2) is always-on; test-plan evidence is re-verified (≤1 Test agent) and refreshed only when this run moved the head (Steps 9b-0, 9b-3)
|
|
683
635
|
|
|
684
636
|
## Output Artifact
|
|
685
637
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Self-review workflow -
|
|
2
|
+
description: Self-review workflow - Polish agent (code clarity) then Harden agent (9-pillar quality gate)
|
|
3
3
|
output-dir: dist/commands
|
|
4
4
|
---
|
|
5
5
|
@import { knowledge_load, knowledge_writeback } from "./_partials/_knowledge.mds"
|
|
@@ -7,7 +7,7 @@ output-dir: dist/commands
|
|
|
7
7
|
@import "./_partials/_settings.mds" as settings
|
|
8
8
|
# Self-Review Command
|
|
9
9
|
|
|
10
|
-
Run
|
|
10
|
+
Run Polish agent and Harden agent sequentially on changed files for post-implementation quality refinement.
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -30,18 +30,18 @@ Detect changed files and build context:
|
|
|
30
30
|
2. Else run `git diff --name-only HEAD` + `git diff --name-only --cached` to get staged + unstaged
|
|
31
31
|
3. If no changes found, report "No changes to review" and exit
|
|
32
32
|
4. Build TASK_DESCRIPTION from recent commit messages or branch name
|
|
33
|
-
5. Record `HEAD_BEFORE` (`git rev-parse HEAD`) now, before
|
|
33
|
+
5. Record `HEAD_BEFORE` (`git rev-parse HEAD`) now, before Polish runs — Phase 3 compares against it
|
|
34
34
|
|
|
35
35
|
{{settings.settings_resolve()}}
|
|
36
36
|
|
|
37
37
|
{{decisions_load()}}
|
|
38
38
|
<!-- learning:on -->
|
|
39
|
-
Pass `DECISIONS_CONTEXT` to
|
|
39
|
+
Pass `DECISIONS_CONTEXT` to Harden agent — the compact index lists active ADR/PF entries; Harden agent uses `devflow:apply-decisions` to Read full entry bodies on demand. Known pitfalls help identify reintroduced issues, prior decisions help validate architectural consistency. (Polish agent does not consume decisions — it operates at code-shape level and Harden agent runs after to catch any architectural drift.)
|
|
40
40
|
|
|
41
41
|
<!-- learning:end -->
|
|
42
42
|
{{knowledge_load()}}
|
|
43
43
|
|
|
44
|
-
Pass `FEATURE_KNOWLEDGE_RULES` to
|
|
44
|
+
Pass `FEATURE_KNOWLEDGE_RULES` to Harden agent.
|
|
45
45
|
|
|
46
46
|
<!-- learning:on -->
|
|
47
47
|
**Extract:** FILES_CHANGED (list), TASK_DESCRIPTION (string), DECISIONS_CONTEXT (string, optional), FEATURE_KNOWLEDGE (string, optional), FEATURE_KNOWLEDGE_RULES (string, optional), HEAD_BEFORE (40-hex SHA)
|
|
@@ -49,33 +49,33 @@ Pass `FEATURE_KNOWLEDGE_RULES` to Scrutinize agent.
|
|
|
49
49
|
**Extract:** FILES_CHANGED (list), TASK_DESCRIPTION (string), FEATURE_KNOWLEDGE (string, optional), FEATURE_KNOWLEDGE_RULES (string, optional), HEAD_BEFORE (40-hex SHA)
|
|
50
50
|
<!-- learning:end -->
|
|
51
51
|
|
|
52
|
-
### Phase 1:
|
|
52
|
+
### Phase 1: Polish agent (Code Refinement)
|
|
53
53
|
|
|
54
|
-
**Produces:**
|
|
54
|
+
**Produces:** POLISH_COMMITS
|
|
55
55
|
**Requires:** FILES_CHANGED, TASK_DESCRIPTION
|
|
56
56
|
|
|
57
|
-
Spawn
|
|
57
|
+
Spawn Polish agent to refine code for clarity and consistency:
|
|
58
58
|
|
|
59
|
-
Agent(subagent_type="
|
|
59
|
+
Agent(subagent_type="Polish", run_in_background=false):
|
|
60
60
|
"TASK_DESCRIPTION: {task_description}
|
|
61
61
|
FILES_CHANGED: {files_changed}
|
|
62
|
-
|
|
62
|
+
Polish and refine the code for clarity and consistency while preserving functionality.
|
|
63
63
|
Commit any improvements with a conventional-commit message."
|
|
64
64
|
|
|
65
|
-
**Wait for completion.**
|
|
65
|
+
**Wait for completion.** Polish agent commits changes directly.
|
|
66
66
|
|
|
67
|
-
### Phase 2:
|
|
67
|
+
### Phase 2: Harden agent (9-Pillar Quality Gate)
|
|
68
68
|
|
|
69
|
-
**Produces:**
|
|
69
|
+
**Produces:** HARDEN_STATUS
|
|
70
70
|
<!-- learning:on -->
|
|
71
71
|
**Requires:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT
|
|
72
72
|
<!-- learning:off -->
|
|
73
73
|
**Requires:** FILES_CHANGED, TASK_DESCRIPTION
|
|
74
74
|
<!-- learning:end -->
|
|
75
75
|
|
|
76
|
-
Spawn
|
|
76
|
+
Spawn Harden agent for quality evaluation and fixing:
|
|
77
77
|
|
|
78
|
-
Agent(subagent_type="
|
|
78
|
+
Agent(subagent_type="Harden", run_in_background=false):
|
|
79
79
|
"TASK_DESCRIPTION: {task_description}
|
|
80
80
|
FILES_CHANGED: {files_changed}
|
|
81
81
|
<!-- learning:on -->
|
|
@@ -93,11 +93,11 @@ Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE. Skip if (none)."
|
|
|
93
93
|
### Phase 3: Conditional Validation
|
|
94
94
|
|
|
95
95
|
**Produces:** VALIDATION_RESULT
|
|
96
|
-
**Requires:** HEAD_BEFORE,
|
|
96
|
+
**Requires:** HEAD_BEFORE, HARDEN_STATUS
|
|
97
97
|
|
|
98
98
|
If STATUS is BLOCKED, skip this phase: the report (Phase 4) names the blocker.
|
|
99
99
|
|
|
100
|
-
Run this phase only if HEAD moved — `git rev-parse HEAD` differs from `HEAD_BEFORE`, meaning
|
|
100
|
+
Run this phase only if HEAD moved — `git rev-parse HEAD` differs from `HEAD_BEFORE`, meaning Polish or Harden committed (Polish alone counts, whatever Harden's STATUS is). Otherwise skip it. Its scope is changed-only over what the two agents changed:
|
|
101
101
|
|
|
102
102
|
Agent(subagent_type="Validate", run_in_background=false):
|
|
103
103
|
"FILES_CHANGED: {output of `git diff --name-only HEAD_BEFORE..HEAD`}
|
|
@@ -109,7 +109,7 @@ Run build, typecheck, lint, test on modified files"
|
|
|
109
109
|
|
|
110
110
|
### Phase 4: Report
|
|
111
111
|
|
|
112
|
-
**Requires:**
|
|
112
|
+
**Requires:** HARDEN_STATUS, VALIDATION_RESULT
|
|
113
113
|
|
|
114
114
|
Display summary:
|
|
115
115
|
|
|
@@ -118,10 +118,10 @@ Display summary:
|
|
|
118
118
|
**Files Reviewed**: {n}
|
|
119
119
|
**Status**: {PASS|FIXED|BLOCKED}
|
|
120
120
|
|
|
121
|
-
###
|
|
121
|
+
### Polish agent
|
|
122
122
|
- {n} files refined for clarity
|
|
123
123
|
|
|
124
|
-
###
|
|
124
|
+
### Harden agent (9-Pillar Evaluation)
|
|
125
125
|
| Pillar | Status |
|
|
126
126
|
|--------|--------|
|
|
127
127
|
| Design | {status} |
|
|
@@ -154,14 +154,14 @@ Display summary:
|
|
|
154
154
|
│ └─ Record HEAD_BEFORE
|
|
155
155
|
<!-- learning:end -->
|
|
156
156
|
│
|
|
157
|
-
├─ Phase 1:
|
|
157
|
+
├─ Phase 1: Polish agent
|
|
158
158
|
│ └─ Code refinement (commits directly)
|
|
159
159
|
│
|
|
160
|
-
├─ Phase 2:
|
|
160
|
+
├─ Phase 2: Harden agent
|
|
161
161
|
│ └─ 9-pillar quality gate (may fix and commit)
|
|
162
162
|
│
|
|
163
163
|
├─ Phase 3: Validate agent (conditional)
|
|
164
|
-
│ └─ If HEAD moved since HEAD_BEFORE (
|
|
164
|
+
│ └─ If HEAD moved since HEAD_BEFORE (Polish or Harden committed), changed-only Validate over HEAD_BEFORE..HEAD
|
|
165
165
|
│
|
|
166
166
|
└─ Phase 4: Report
|
|
167
167
|
└─ Display summary with pillar status
|
|
@@ -171,15 +171,15 @@ Display summary:
|
|
|
171
171
|
| Case | Handling |
|
|
172
172
|
|------|----------|
|
|
173
173
|
| No changes | Report "No changes to review" and exit |
|
|
174
|
-
|
|
|
175
|
-
|
|
|
174
|
+
| Polish agent finds nothing | Normal, continue to Harden agent |
|
|
175
|
+
| Harden agent BLOCKED | Report blocking issue, halt workflow |
|
|
176
176
|
| Validation fails | Report failures, halt (don't create broken state) |
|
|
177
177
|
| Not in git repo | Report error, suggest running in git repo |
|
|
178
178
|
|
|
179
179
|
## Principles
|
|
180
180
|
|
|
181
181
|
1. **Orchestration only** - Command spawns agents, doesn't do the work
|
|
182
|
-
2. **Sequential execution** -
|
|
183
|
-
3. **Validation gate** - If
|
|
182
|
+
2. **Sequential execution** - Polish agent must complete before Harden agent
|
|
183
|
+
3. **Validation gate** - If Polish agent or Harden agent committed, the changes must pass validation
|
|
184
184
|
4. **Honest reporting** - Display actual agent outputs
|
|
185
185
|
5. **Fail fast** - Stop on BLOCKED or validation failure
|