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.
Files changed (107) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +4 -4
  3. package/dist/agents/{diagnose.md → debug.md} +4 -4
  4. package/dist/agents/{code-fix.md → fix.md} +2 -2
  5. package/dist/agents/{scrutinize.md → harden.md} +6 -6
  6. package/dist/agents/{code-edit.md → refactor.md} +3 -3
  7. package/dist/cli/agents-view/render.js +1 -1
  8. package/dist/cli/commands/init.js +3 -3
  9. package/dist/cli/commands/learning.js +12 -12
  10. package/dist/cli/commands/legacy-hooks.js +1 -1
  11. package/dist/cli/commands/uninstall.js +111 -5
  12. package/dist/commands/bug-analysis.md +19 -15
  13. package/dist/commands/code-review.md +13 -22
  14. package/dist/commands/debug.md +15 -15
  15. package/dist/commands/dynamic-build.md +51 -55
  16. package/dist/commands/dynamic-plan.md +11 -9
  17. package/dist/commands/dynamic-profile.md +7 -5
  18. package/dist/commands/dynamic-tickets.md +11 -9
  19. package/dist/commands/explore.md +13 -13
  20. package/dist/commands/implement.md +58 -127
  21. package/dist/commands/plan.md +19 -41
  22. package/dist/commands/release.md +9 -5
  23. package/dist/commands/research.md +12 -8
  24. package/dist/commands/resolve.md +42 -86
  25. package/dist/commands/self-review.md +42 -42
  26. package/dist/core/agent-models.js +47 -11
  27. package/dist/core/{learning-tuning-config.js → curate-tuning-config.js} +14 -14
  28. package/dist/core/learning-queue-cleanup.js +1 -1
  29. package/dist/core/migrations.js +63 -44
  30. package/dist/core/plugins.js +14 -12
  31. package/dist/core/project-paths.js +3 -3
  32. package/dist/hud/codex-usage.js +247 -0
  33. package/dist/hud/components/codex-quota.js +37 -0
  34. package/dist/hud/components/usage-quota.js +1 -1
  35. package/dist/hud/config.js +1 -0
  36. package/dist/hud/index.js +16 -3
  37. package/dist/hud/render.js +3 -1
  38. package/dist/learning-off/agents/{diagnose.md → debug.md} +4 -4
  39. package/dist/learning-off/agents/{code-fix.md → fix.md} +2 -2
  40. package/dist/learning-off/agents/{scrutinize.md → harden.md} +6 -6
  41. package/dist/learning-off/agents/{code-edit.md → refactor.md} +3 -3
  42. package/dist/learning-off/commands/bug-analysis.md +9 -9
  43. package/dist/learning-off/commands/code-review.md +2 -15
  44. package/dist/learning-off/commands/debug.md +4 -8
  45. package/dist/learning-off/commands/dynamic-build.md +45 -51
  46. package/dist/learning-off/commands/dynamic-plan.md +5 -5
  47. package/dist/learning-off/commands/dynamic-profile.md +1 -1
  48. package/dist/learning-off/commands/dynamic-tickets.md +5 -5
  49. package/dist/learning-off/commands/explore.md +2 -6
  50. package/dist/learning-off/commands/implement.md +46 -119
  51. package/dist/learning-off/commands/plan.md +8 -33
  52. package/dist/learning-off/commands/release.md +4 -2
  53. package/dist/learning-off/commands/research.md +2 -2
  54. package/dist/learning-off/commands/resolve.md +31 -79
  55. package/dist/learning-off/commands/self-review.md +30 -34
  56. package/dist/skills/git/references/pr/check-merge-readiness.md +2 -0
  57. package/dist/skills/git/references/pr/update-pr-evidence.md +4 -6
  58. package/dist/targets/claude-code/installer.js +117 -84
  59. package/dist/targets/claude-code/tracker-servers.js +1 -1
  60. package/package.json +1 -1
  61. package/src/assets/agents/_partials/_code.mds +2 -2
  62. package/src/assets/agents/code.mds +2 -2
  63. package/src/assets/agents/{learning.md → curate.md} +4 -4
  64. package/src/assets/agents/{diagnose.mds → debug.mds} +4 -4
  65. package/src/assets/agents/evaluate.md +4 -4
  66. package/src/assets/agents/{code-fix.mds → fix.mds} +5 -5
  67. package/src/assets/agents/{scrutinize.mds → harden.mds} +6 -6
  68. package/src/assets/agents/{simplify.md → polish.md} +4 -4
  69. package/src/assets/agents/{code-edit.mds → refactor.mds} +6 -6
  70. package/src/assets/agents/test.md +2 -2
  71. package/src/assets/commands/_partials/_compliance.mds +1 -1
  72. package/src/assets/commands/_partials/_decisions.mds +26 -6
  73. package/src/assets/commands/_partials/_engine.mds +15 -15
  74. package/src/assets/commands/_partials/_evidence_policy.mds +0 -17
  75. package/src/assets/commands/_partials/_knowledge.mds +14 -9
  76. package/src/assets/commands/_partials/_preamble.mds +4 -2
  77. package/src/assets/commands/_partials/_roster.mds +4 -4
  78. package/src/assets/commands/bug-analysis.mds +7 -7
  79. package/src/assets/commands/code-review.mds +1 -14
  80. package/src/assets/commands/debug.mds +2 -2
  81. package/src/assets/commands/dynamic-build.mds +26 -32
  82. package/src/assets/commands/implement.mds +45 -102
  83. package/src/assets/commands/plan.mds +7 -37
  84. package/src/assets/commands/release.mds +5 -1
  85. package/src/assets/commands/resolve.mds +28 -76
  86. package/src/assets/commands/self-review.mds +27 -27
  87. package/src/assets/mds/git/_pr.mds +6 -6
  88. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
  89. package/src/assets/scripts/hooks/capture-prompt +1 -1
  90. package/src/assets/scripts/hooks/capture-question +1 -1
  91. package/src/assets/scripts/hooks/capture-turn +1 -1
  92. package/src/assets/scripts/hooks/json-helper.cjs +2 -2
  93. package/src/assets/scripts/hooks/lib/learning-store.cjs +1 -1
  94. package/src/assets/scripts/hooks/lib/project-paths.cjs +4 -4
  95. package/src/assets/scripts/hooks/preamble +1 -1
  96. package/src/assets/scripts/hooks/session-start-context +58 -45
  97. package/src/assets/scripts/verify-evidence.cjs +726 -9
  98. package/src/assets/skills/agent-references/SKILL.md +9 -5
  99. package/src/assets/skills/agent-references/references/commands/implement-evidence-asks.md +35 -0
  100. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +15 -0
  101. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +1 -1
  102. package/src/assets/skills/apply-decisions/SKILL.md +6 -4
  103. package/src/assets/skills/docs-framework/SKILL.md +3 -3
  104. package/src/assets/skills/qa/SKILL.md +1 -1
  105. package/src/assets/skills/quality-gates/SKILL.md +7 -7
  106. package/src/assets/skills/quality-gates/references/report-template.md +7 -7
  107. /package/src/assets/skills/agent-references/references/{learning → curate}/maintain.md +0 -0
@@ -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 Code-fix spawns, on a line of its own.
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 (Simplify, Verification Gate, CI gate, Tech Debt) trigger context compaction.
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: Simplify
285
+ ### Phase 6: Polish
286
286
 
287
- **Produces:** SIMPLIFICATION_RESULT
287
+ **Produces:** POLISH_RESULT
288
288
  **Requires:** CODE_AGENT_RESULTS
289
289
 
290
- If any fixes were made, spawn Simplify agent to refine the changed code:
290
+ If any fixes were made, spawn Polish agent to refine the changed code:
291
291
 
292
292
  ```
293
- Agent(subagent_type="Simplify", run_in_background=false):
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
- Simplify and refine the fixes for clarity and consistency
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 Code-fix agent with fix context:
323
+ - Spawn Fix agent with fix context:
324
324
  ```
325
- Agent(subagent_type="Code-fix"):
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 Code-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):
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="Code-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 Code-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.
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="Code-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 Code-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.
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})`. Spawn Git agent:
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
- Agent(subagent_type="Git"):
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
- Omit the `EVIDENCE_FILE` line when Step 9b-0 appended no claim. `REVIEW_PUBLICATION` 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 `EVIDENCE` line and its `**Body**:` / `**Comment**:` line, or its `TRACEABILITY: DEGRADED ({reason})` line, as `EVIDENCE_REFRESH`. It never blocks.
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
- Spawn Git agent:
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
- Agent(subagent_type="Git"):
522
- "OPERATION: check-merge-readiness
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 Git agent returns `TRACEABILITY: DEGRADED`: warn, proceed to Phase 10.
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 6: Simplify [Simplify agent]
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: Git agent (update-pr-evidence) — only when the head moved
602
+ │ └─ Step 9b-3: verify-evidence.cjs publish (inline, no Git spawn) — only when the head moved
635
603
  │
636
- ├─ Phase 9c: Git agent (check-merge-readiness) — non-author approval required, report-only
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. **Global triage first** - Single Triage agent sees all issues for cross-issue consistency; no issue may vanish
676
- 4. **Git agent for git work** - All git operations go through Git agent
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 - Simplify agent (code clarity) then Scrutinize agent (9-pillar quality gate)
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 Simplify agent and Scrutinize agent sequentially on changed files for post-implementation quality refinement.
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 Simplify runs — Phase 3 compares against it
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 Scrutinize agent — the compact index lists active ADR/PF entries; Scrutinize agent uses `devflow:apply-decisions` to Read full entry bodies on demand. Known pitfalls help identify reintroduced issues, prior decisions help validate architectural consistency. (Simplify agent does not consume decisions — it operates at code-shape level and Scrutinize agent runs after to catch any architectural drift.)
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 Scrutinize agent.
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: Simplify agent (Code Refinement)
52
+ ### Phase 1: Polish agent (Code Refinement)
53
53
 
54
- **Produces:** SIMPLIFY_COMMITS
54
+ **Produces:** POLISH_COMMITS
55
55
  **Requires:** FILES_CHANGED, TASK_DESCRIPTION
56
56
 
57
- Spawn Simplify agent to refine code for clarity and consistency:
57
+ Spawn Polish agent to refine code for clarity and consistency:
58
58
 
59
- Agent(subagent_type="Simplify", run_in_background=false):
59
+ Agent(subagent_type="Polish", run_in_background=false):
60
60
  "TASK_DESCRIPTION: {task_description}
61
61
  FILES_CHANGED: {files_changed}
62
- Simplify and refine the code for clarity and consistency while preserving functionality.
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.** Simplify agent commits changes directly.
65
+ **Wait for completion.** Polish agent commits changes directly.
66
66
 
67
- ### Phase 2: Scrutinize agent (9-Pillar Quality Gate)
67
+ ### Phase 2: Harden agent (9-Pillar Quality Gate)
68
68
 
69
- **Produces:** SCRUTINIZE_STATUS
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 Scrutinize agent for quality evaluation and fixing:
76
+ Spawn Harden agent for quality evaluation and fixing:
77
77
 
78
- Agent(subagent_type="Scrutinize", run_in_background=false):
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, SCRUTINIZE_STATUS
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 Simplify or Scrutinize committed (Simplify alone counts, whatever Scrutinize's STATUS is). Otherwise skip it. Its scope is changed-only over what the two agents changed:
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:** SCRUTINIZE_STATUS, VALIDATION_RESULT
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
- ### Simplify agent
121
+ ### Polish agent
122
122
  - {n} files refined for clarity
123
123
 
124
- ### Scrutinize agent (9-Pillar Evaluation)
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: Simplify agent
157
+ ├─ Phase 1: Polish agent
158
158
  │ └─ Code refinement (commits directly)
159
159
  │
160
- ├─ Phase 2: Scrutinize agent
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 (Simplify or Scrutinize committed), changed-only Validate over HEAD_BEFORE..HEAD
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
- | Simplify agent finds nothing | Normal, continue to Scrutinize agent |
175
- | Scrutinize agent BLOCKED | Report blocking issue, halt workflow |
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** - Simplify agent must complete before Scrutinize agent
183
- 3. **Validation gate** - If Simplify agent or Scrutinize agent committed, the changes must pass validation
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
@@ -260,6 +260,8 @@ Load for `check-merge-readiness` under every tracker provider.
260
260
 
261
261
  ### Process
262
262
 
263
+ Run the script from `WORKTREE_PATH` (else cwd) and print its stdout, nothing else: `node "$HOME/.devflow/scripts/verify-evidence.cjs" readiness --pr {PR_NUMBER}; echo "exit=$?"`, adding `--require-non-author-approval {REQUIRE_NON_AUTHOR_APPROVAL}` only when that is `true` or `false`, with the Bash `timeout` at 180000. On exit 0 or 2 its stdout is the `## Merge Readiness` block (exit 2: `DEGRADED`, closed by a `TRACEABILITY: DEGRADED ({reason})` line); any other exit, or empty stdout, is `TRACEABILITY: DEGRADED (readiness unavailable)`. The script makes the reads and applies the ladder below, so the steps are its specification: run none of them yourself.
264
+
263
265
  1. Fetch unresolved review threads via GraphQL: `reviewThreads(first: 100) { nodes { isResolved } totalCount }`. Count unresolved from nodes (`isResolved == false`). If `totalCount > 100`, report the unresolved count as approximate: prefix with `>` and note `(count approximate — PR has more than 100 threads)`.
264
266
  2. Fetch PR review decision: `gh pr view {PR_NUMBER} --json reviewDecision --jq '.reviewDecision'`
265
267
  - Values: `APPROVED`, `CHANGES_REQUESTED`, `REVIEW_REQUIRED`, or null
@@ -289,16 +291,14 @@ Never take action on the PR — report READY or NOT_READY, always with the speci
289
291
 
290
292
  Load for `update-pr-evidence` under every tracker provider.
291
293
 
292
- **PR mechanics held here:** the evidence script run, the compare-and-swap body edit and the append-only evidence comment. The script owns every marker, grammar and state rule; nothing here restates one.
294
+ **PR mechanics held here:** the one script run. `verify-evidence.cjs publish` owns every step, marker, grammar and state rule, and scrubs (D11) each body before it posts one; nothing here restates any of them.
293
295
 
294
296
  ### Process
295
297
 
296
- Run steps 1–4 as ONE Bash invocation from `WORKTREE_PATH` (else cwd) — the trap removes `$S` and the temp files when it exits — with `V="$HOME/.devflow/scripts"`.
298
+ 1. From `WORKTREE_PATH` (else cwd), run `node "$HOME/.devflow/scripts/verify-evidence.cjs" publish --pr {PR_NUMBER}; echo "exit=$?"`, adding `--publication {REVIEW_PUBLICATION}` only when that is `auto`, `full`, `off` or `stub`, and `--evidence "{EVIDENCE_FILE}"` when given — only a value matching `^[A-Za-z0-9._/-]{1,255}$` reaches the shell; any other is a failed run. Set the Bash `timeout` to 180000.
299
+ 2. Print the script's stdout and nothing else. On exit 0 it is the `## PR Evidence` block: the heading, the line `EVIDENCE pr:<n> head:<sha> total:<n> VERIFIED-CI:<n> ATTESTED-LOCAL:<n> UNVERIFIED:<n> STALE:<n> FAILED:<n> INDETERMINATE:<n> stale:<ids|none> exceptions:<kinds|none> approval:<yes|no|unchecked> key:<hex> posted:<yes|no|n/a> body:<same|changed>`, and the `**Body**:` / `**Comment**:` line, then one `TRACEABILITY: DEGRADED ({reason})` line for each part that degraded, such as `DEGRADED (concurrent edit)` (the body edit then reads `SKIPPED`), `DEGRADED (body read-back mismatch)` or `DEGRADED (redaction unavailable)`: a body the script cannot scrub is never posted. On exit 2 it is `TRACEABILITY: DEGRADED (evidence unavailable)`. Any other exit, or empty stdout, is a failed run: emit that same line.
297
300
 
298
- 1. **Verify.** Set `S=`, arm the D11 trap with `[ -n "$S" ] && { rm -- "$S/base" "$S/base.sha256"; rmdir -- "$S"; } 2>/dev/null` added before its `exit`, then the four `mktemp`s and `S="$(mktemp -d)"`. Run `node "$V/verify-evidence.cjs" verify --pr {PR_NUMBER} --state "$S" --block-out "$DEVFLOW_NOTES_RAW" --comment-out "$DEVFLOW_BODY_RAW"`, adding `--publication {REVIEW_PUBLICATION}` only when that is `auto`, `full`, `off` or `stub`, and `--evidence "{EVIDENCE_FILE}"` when given — only a value matching `^[A-Za-z0-9._/-]{1,255}$` reaches the shell; any other is a failed run. Continue only on exit 0 with stdout exactly one line, `EVIDENCE pr:<n> head:<sha> total:<n> VERIFIED-CI:<n> ATTESTED-LOCAL:<n> UNVERIFIED:<n> STALE:<n> FAILED:<n> INDETERMINATE:<n> stale:<ids|none> exceptions:<kinds|none> approval:<yes|no|unchecked> key:<hex> posted:<yes|no|n/a> body:<same|changed>`; otherwise emit `TRACEABILITY: DEGRADED (evidence unavailable)` and stop. The script makes this op's one `gh pr view` read and prints nothing it read from the PR; never read the PR another way.
299
- 2. **Body**, only on `body:changed` (else `UNCHANGED`): `node "$V/redact-secrets.cjs" "$DEVFLOW_NOTES_RAW" "$DEVFLOW_NOTES" && node "$V/verify-evidence.cjs" splice --pr {PR_NUMBER} --state "$S" --block "$DEVFLOW_NOTES" --out "$DEVFLOW_BODY" && gh pr edit {PR_NUMBER} --body-file "$DEVFLOW_BODY"`. Only the composed block is scrubbed (D11); every byte outside its markers is the PR's own and stays identical. `splice` re-reads the body: unchanged since step 1 → it writes; changed → it splices once onto the fresh body and re-reads; changed again → `SPLICE conflict`: `SKIPPED` and `TRACEABILITY: DEGRADED (concurrent edit)`. Any other non-zero → `DEGRADED ({reason})`, naming a printed `SPLICE` token. No edit either way; go to step 4.
300
- 3. **Read back** after an edit: `node "$V/verify-evidence.cjs" readback --pr {PR_NUMBER} --expect "$DEVFLOW_BODY"`; anything but `READBACK ok` → `TRACEABILITY: DEGRADED (body read-back mismatch)`, else `EDITED`. GitHub has no conditional body edit: a human edit landing between the last re-read and `gh pr edit` is overwritten (it stays in the PR's edit history), and the read-back proves only that these bytes landed.
301
- 4. **Comment.** `posted:yes` → `SKIPPED`; `posted:n/a` → `OFF`. Otherwise apply the Comment-sink scrub (D11): `node "$V/redact-secrets.cjs" "$DEVFLOW_BODY_RAW" "$DEVFLOW_BODY" && gh pr comment {PR_NUMBER} --body-file "$DEVFLOW_BODY"` → `POSTED`. Never edit or delete an evidence comment. On 5xx retry once; still 5xx → `DEGRADED ({reason})`.
301
+ Run nothing else: the script makes the one PR read, the compare-and-swap body edit, its read-back and the append-only comment itself, and posts nothing it could not scrub.
302
302
  @end
303
303
 
304
304
  <!-- op: validate-branch -->
@@ -5,16 +5,17 @@ Never do work-product mainline: no file edits, no builds, no multi-file reads, n
5
5
 
6
6
  Routing (Agent tool) — pick the roster agent that fits the work:
7
7
  - Search and listing: Explore. Codebase orientation: Skim.
8
- - Execution against a spec: Code (write code to a plan; open the prompt with `OPERATION: <mode>` — `issue-fix` for pre-classified review issues, else `implement`), Code-edit (mechanical changes: renames, moves, boilerplate; `OPERATION: edit`), Validate (build, typecheck, lint, test), Git (git/GitHub operations).
8
+ - Execution against a spec: Code (write code to a plan; open the prompt with `OPERATION: <mode>` — `issue-fix` for pre-classified review issues, else `implement`), Refactor (a given mechanical change: "rename X to Y everywhere", moves, boilerplate; `OPERATION: edit`), Polish (judgment pass for clarity that keeps behaviour: "make this code cleaner"), Validate (build, typecheck, lint, test), Git (git/GitHub).
9
+ - Bug fix: Code (`OPERATION: implement`; `issue-fix` only for Triage-classified review issues). Fix: gate failures only (`validation-fix`, `alignment-fix`, `qa-fix`, `ci-fix`).
9
10
  - Analysis, design, research: Design, Research, Review, Triage (validate review issues against blast-radius matrix).
10
- - Real-scale work that matches a workflow: invoke the full skill instead — devflow:implement, devflow:plan, devflow:research, devflow:explore, devflow:debug, devflow:code-review, devflow:resolve.
11
+ - Real-scale work matching a workflow: invoke the full skill instead — devflow:implement, devflow:plan, devflow:research, devflow:explore, devflow:debug (all debug work, never the Debug agent), devflow:code-review, devflow:resolve.
11
12
  - Anything else: the closest roster agent, never general-purpose.
12
13
 
13
14
  Stays mainline (judgment work): conversation, decisions, routing, synthesizing agent reports, answers already in loaded context, one targeted Read to scope a delegation.
14
15
 
15
16
  Operating rules:
16
17
  - Decompose mainline. Subagents cannot spawn subagents — you own task breakdown, then delegate leaf tasks.
17
- - Subagents see none of this conversation. Make every delegation self-contained: goal, constraints, relevant session decisions and facts, exact paths. A deliverable that draws on the conversation (issue, PR, report) needs the substance in the prompt — not a pointer to it.
18
+ - Subagents see none of this conversation. Make every delegation self-contained: goal, constraints, relevant session decisions and facts, exact paths. A deliverable that draws on the conversation (issue, PR, report) needs its substance in the prompt, not a pointer.
18
19
  - Report cap: ask every direct delegation for a final report of at most about 1,500 tokens — findings, paths and verdicts, not file dumps.
19
20
  - Parallelize independent delegations in one message. Git operations stay sequential.
20
21
  - Feature knowledge (direct delegations only — workflow skills handle their own): before delegating non-trivial code work, match the task area against .devflow/features/index.md and pass each matching KB's one to three most relevant `## Rules` bullets (verbatim, IDs included; a KB without Rules: Anti-Patterns or Gotchas entries, cited by section), its path and its `##` heading index as FEATURE_KNOWLEDGE; after delegated changes to a covered area, spawn Knowledge to refresh that KB.
@@ -43,7 +43,7 @@ df_resolve_roots "$CWD" 2>/dev/null || true
43
43
  PROJECT_ROOT="${DF_ROOT:-$CWD}"
44
44
  # The learning queue is the repository's, not the checkout's: in a linked worktree
45
45
  # it is the main worktree's queue (D-LEDGER-MAIN-WORKTREE, resolve-project-root),
46
- # the one the Learning agent drains into the shared ledger. Memory stays per checkout.
46
+ # the one the Curate agent drains into the shared ledger. Memory stays per checkout.
47
47
  LEDGER_ROOT="${DF_LEDGER_ROOT:-$PROJECT_ROOT}"
48
48
 
49
49
  # The machine-wide manifest (the memory/learning switches, D-FEATURES-NARROW-ONLY
@@ -62,7 +62,7 @@ df_resolve_roots "$CWD" 2>/dev/null || true
62
62
  PROJECT_ROOT="${DF_ROOT:-$CWD}"
63
63
  # The learning queue is the repository's, not the checkout's: in a linked worktree
64
64
  # it is the main worktree's queue (D-LEDGER-MAIN-WORKTREE, resolve-project-root),
65
- # the one the Learning agent drains into the shared ledger. Memory stays per checkout.
65
+ # the one the Curate agent drains into the shared ledger. Memory stays per checkout.
66
66
  LEDGER_ROOT="${DF_LEDGER_ROOT:-$PROJECT_ROOT}"
67
67
 
68
68
  # The machine-wide manifest (the memory/learning switches, D-FEATURES-NARROW-ONLY
@@ -47,7 +47,7 @@ df_resolve_roots "$CWD" 2>/dev/null || true
47
47
  PROJECT_ROOT="${DF_ROOT:-$CWD}"
48
48
  # The learning queue is the repository's, not the checkout's: in a linked worktree
49
49
  # it is the main worktree's queue (D-LEDGER-MAIN-WORKTREE, resolve-project-root),
50
- # the one the Learning agent drains into the shared ledger. Memory stays per checkout.
50
+ # the one the Curate agent drains into the shared ledger. Memory stays per checkout.
51
51
  LEDGER_ROOT="${DF_LEDGER_ROOT:-$PROJECT_ROOT}"
52
52
 
53
53
  # The machine-wide manifest (the memory/learning switches, D-FEATURES-NARROW-ONLY
@@ -2,9 +2,9 @@
2
2
 
3
3
  // src/assets/scripts/hooks/json-helper.cjs
4
4
  // Provides jq-equivalent operations for hooks when jq is not installed, and the
5
- // learning ops the Learning agent runs from the project root.
5
+ // learning ops the Curate agent runs from the project root.
6
6
  // SECURITY: This is a local CLI helper invoked only by shell hooks and the
7
- // Learning agent with controlled arguments. No operation takes a file path: a
7
+ // Curate agent with controlled arguments. No operation takes a file path: a
8
8
  // file's content arrives on stdin (json-parse redirects it), and the learning ops
9
9
  // build every path from the current directory.
10
10
  // Usage: node json-helper.cjs <operation> [args...]
@@ -1516,7 +1516,7 @@ function moveQueueToClaim(queuePath, claimPath) {
1516
1516
  }
1517
1517
 
1518
1518
  /**
1519
- * Claim the learning queue for one Learning run.
1519
+ * Claim the learning queue for one Curate run.
1520
1520
  *
1521
1521
  * D-OWNED-CLAIM: the learning queue is claimed and released only through the
1522
1522
  * claim-queue and release-claim ops, under the learning lock. A claim moves the
@@ -57,7 +57,7 @@ function getLearningPendingTurnsPath(projectRoot) {
57
57
  return path.join(projectRoot, '.devflow', 'learning', '.pending-turns.jsonl');
58
58
  }
59
59
 
60
- /** .devflow/learning/.pending-turns.processing — the claimed batch a Learning run holds while it processes it */
60
+ /** .devflow/learning/.pending-turns.processing — the claimed batch a Curate run holds while it processes it */
61
61
  function getLearningPendingTurnsProcessingPath(projectRoot) {
62
62
  return path.join(projectRoot, '.devflow', 'learning', '.pending-turns.processing');
63
63
  }
@@ -81,8 +81,8 @@ function getPitfallsFilePath(projectRoot) {
81
81
  return path.join(projectRoot, '.devflow', 'learning', 'pitfalls.md');
82
82
  }
83
83
 
84
- /** .devflow/learning/learning.json — project-level learning agent tuning config */
85
- function getLearningTuningConfigPath(projectRoot) {
84
+ /** .devflow/learning/learning.json — project-level curate agent tuning config */
85
+ function getCurateTuningConfigPath(projectRoot) {
86
86
  return path.join(projectRoot, '.devflow', 'learning', 'learning.json');
87
87
  }
88
88
 
@@ -179,7 +179,7 @@ module.exports = {
179
179
  // Learning content files
180
180
  getDecisionsFilePath,
181
181
  getPitfallsFilePath,
182
- getLearningTuningConfigPath,
182
+ getCurateTuningConfigPath,
183
183
  getDecisionsLedgerPath,
184
184
  getDecisionsLogPath,
185
185
  getDecisionsArchivePath,
@@ -75,7 +75,7 @@ elif [[ "$HEAD" == "/"* ]]; then
75
75
  dbg "EXIT: slash command — no reminder"
76
76
  else
77
77
  dbg "ORCHESTRATOR_REMINDER injected"
78
- json_prompt_output "Orchestrator reminder: coordinate, don't produce — delegate edits, builds, multi-file reads, and debug loops to the fitting roster agent (Agent tool) or the matching devflow workflow skill.
78
+ json_prompt_output "Orchestrator reminder: coordinate, don't produce — delegate edits, builds and multi-file reads to the fitting roster agent (Agent tool) or the matching devflow workflow skill. Send debug work to the devflow:debug skill, never to the Debug agent.
79
79
  Keep only judgment work mainline: conversation, decisions, routing, synthesis of agent reports."
80
80
  fi
81
81