devflow-kit 3.1.0 → 3.3.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 (138) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +2 -2
  3. package/dist/cli/agents-view/render.js +69 -15
  4. package/dist/cli/agents-view/state.js +40 -14
  5. package/dist/cli/commands/agents.js +135 -45
  6. package/dist/cli/commands/init.js +128 -53
  7. package/dist/cli/commands/learning.js +61 -13
  8. package/dist/cli/commands/memory.js +35 -14
  9. package/dist/cli/commands/uninstall.js +163 -39
  10. package/dist/commands/code-review.md +1 -3
  11. package/dist/commands/debug.md +15 -12
  12. package/dist/commands/dynamic-build.md +172 -135
  13. package/dist/commands/dynamic-plan.md +9 -3
  14. package/dist/commands/explore.md +10 -4
  15. package/dist/commands/implement.md +149 -145
  16. package/dist/commands/plan.md +13 -9
  17. package/dist/commands/release.md +8 -2
  18. package/dist/commands/research.md +8 -2
  19. package/dist/commands/resolve.md +28 -19
  20. package/dist/commands/self-review.md +16 -13
  21. package/dist/core/agent-frontmatter.js +25 -0
  22. package/dist/core/agent-models.js +201 -36
  23. package/dist/core/agent-state.js +27 -5
  24. package/dist/core/assets.js +1 -1
  25. package/dist/core/feature-config.js +68 -10
  26. package/dist/core/flags.js +24 -0
  27. package/dist/core/learning-queue-cleanup.js +10 -11
  28. package/dist/core/learning-tuning-config.js +8 -0
  29. package/dist/core/linked-path.js +46 -0
  30. package/dist/core/plugins.js +16 -5
  31. package/dist/core/queue-drain.js +31 -0
  32. package/dist/hud/components/learning-counts.js +54 -8
  33. package/dist/skills/git/references/tracker/github/create-release.md +2 -2
  34. package/dist/skills/git/references/tracker/github/gather-release-evidence.md +1 -1
  35. package/dist/skills/git/references/tracker/jira/create-release.md +2 -2
  36. package/dist/skills/git/references/tracker/jira/gather-release-evidence.md +1 -1
  37. package/dist/skills/git/references/tracker/linear/create-release.md +2 -2
  38. package/dist/skills/git/references/tracker/linear/gather-release-evidence.md +1 -1
  39. package/dist/targets/claude-code/installer.js +36 -9
  40. package/dist/targets/claude-code/post-install.js +128 -38
  41. package/package.json +1 -1
  42. package/src/assets/agents/code.md +85 -35
  43. package/src/assets/agents/design.md +12 -0
  44. package/src/assets/agents/diagnose.md +18 -11
  45. package/src/assets/agents/evaluate.md +17 -24
  46. package/src/assets/agents/knowledge.md +7 -3
  47. package/src/assets/agents/learning.md +4 -6
  48. package/src/assets/agents/research.md +21 -0
  49. package/src/assets/agents/review.md +12 -0
  50. package/src/assets/agents/scrutinize.md +37 -9
  51. package/src/assets/agents/simplify.md +24 -0
  52. package/src/assets/agents/skim.md +6 -2
  53. package/src/assets/agents/synthesize.md +18 -0
  54. package/src/assets/agents/test.md +19 -11
  55. package/src/assets/agents/triage.md +8 -0
  56. package/src/assets/agents/validate.md +20 -11
  57. package/src/assets/commands/_partials/_engine.mds +36 -55
  58. package/src/assets/commands/_partials/_knowledge.mds +1 -3
  59. package/src/assets/commands/_partials/_plan_contract.mds +1 -1
  60. package/src/assets/commands/_partials/_tracker.mds +1 -1
  61. package/src/assets/commands/_partials/_wave.mds +8 -6
  62. package/src/assets/commands/code-review.mds +1 -3
  63. package/src/assets/commands/debug.mds +13 -8
  64. package/src/assets/commands/dynamic-build.mds +126 -72
  65. package/src/assets/commands/dynamic-plan.mds +7 -1
  66. package/src/assets/commands/explore.mds +9 -1
  67. package/src/assets/commands/implement.mds +147 -141
  68. package/src/assets/commands/plan.mds +12 -8
  69. package/src/assets/commands/release.md +8 -2
  70. package/src/assets/commands/research.mds +8 -2
  71. package/src/assets/commands/resolve.mds +27 -16
  72. package/src/assets/commands/self-review.mds +15 -10
  73. package/src/assets/mds/tracker/_common.mds +1 -1
  74. package/src/assets/mds/tracker/_github.mds +2 -2
  75. package/src/assets/mds/tracker/_jira.mds +2 -2
  76. package/src/assets/mds/tracker/_linear.mds +2 -2
  77. package/src/assets/scripts/ci-wait.cjs +636 -0
  78. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -3
  79. package/src/assets/scripts/hooks/background-memory-update +356 -17
  80. package/src/assets/scripts/hooks/capture-prompt +4 -3
  81. package/src/assets/scripts/hooks/capture-question +4 -3
  82. package/src/assets/scripts/hooks/capture-turn +4 -3
  83. package/src/assets/scripts/hooks/ensure-devflow-init +13 -1
  84. package/src/assets/scripts/hooks/ensure-root-gitignore +122 -10
  85. package/src/assets/scripts/hooks/git-marker +71 -0
  86. package/src/assets/scripts/hooks/json-helper.cjs +12 -145
  87. package/src/assets/scripts/hooks/json-parse +24 -129
  88. package/src/assets/scripts/hooks/lib/learning-store.cjs +169 -64
  89. package/src/assets/scripts/hooks/lib/render-decisions.cjs +1 -1
  90. package/src/assets/scripts/hooks/memory-worker +10 -0
  91. package/src/assets/scripts/hooks/pre-compact-memory +66 -14
  92. package/src/assets/scripts/hooks/preamble +9 -1
  93. package/src/assets/scripts/hooks/queue-append +53 -21
  94. package/src/assets/scripts/hooks/session-start-context +108 -29
  95. package/src/assets/scripts/hooks/session-start-memory +33 -11
  96. package/src/assets/scripts/release-trace.cjs +27 -10
  97. package/src/assets/skills/accessibility/SKILL.md +1 -1
  98. package/src/assets/skills/apply-decisions/SKILL.md +12 -82
  99. package/src/assets/skills/apply-feature-knowledge/SKILL.md +8 -42
  100. package/src/assets/skills/architecture/SKILL.md +1 -1
  101. package/src/assets/skills/boundary-validation/SKILL.md +1 -1
  102. package/src/assets/skills/complexity/SKILL.md +1 -1
  103. package/src/assets/skills/compliance/SKILL.md +1 -1
  104. package/src/assets/skills/consistency/SKILL.md +1 -1
  105. package/src/assets/skills/database/SKILL.md +1 -1
  106. package/src/assets/skills/dependencies/SKILL.md +1 -1
  107. package/src/assets/skills/dependency-research/SKILL.md +3 -6
  108. package/src/assets/skills/design-review/SKILL.md +1 -1
  109. package/src/assets/skills/docs-framework/SKILL.md +1 -1
  110. package/src/assets/skills/documentation/SKILL.md +1 -1
  111. package/src/assets/skills/gap-analysis/SKILL.md +1 -1
  112. package/src/assets/skills/git/SKILL.md +1 -1
  113. package/src/assets/skills/go/SKILL.md +1 -1
  114. package/src/assets/skills/java/SKILL.md +1 -1
  115. package/src/assets/skills/patterns/SKILL.md +1 -1
  116. package/src/assets/skills/performance/SKILL.md +1 -1
  117. package/src/assets/skills/python/SKILL.md +1 -1
  118. package/src/assets/skills/qa/SKILL.md +1 -3
  119. package/src/assets/skills/quality-gates/SKILL.md +9 -12
  120. package/src/assets/skills/quality-gates/references/report-template.md +20 -20
  121. package/src/assets/skills/react/SKILL.md +1 -1
  122. package/src/assets/skills/regression/SKILL.md +1 -1
  123. package/src/assets/skills/reliability/SKILL.md +1 -1
  124. package/src/assets/skills/research-codebase/SKILL.md +1 -1
  125. package/src/assets/skills/research-competitor/SKILL.md +1 -1
  126. package/src/assets/skills/research-external/SKILL.md +1 -1
  127. package/src/assets/skills/research-technology/SKILL.md +1 -1
  128. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  129. package/src/assets/skills/rust/SKILL.md +1 -1
  130. package/src/assets/skills/security/SKILL.md +1 -1
  131. package/src/assets/skills/software-design/SKILL.md +1 -1
  132. package/src/assets/skills/test-driven-development/SKILL.md +15 -33
  133. package/src/assets/skills/testing/SKILL.md +1 -1
  134. package/src/assets/skills/typescript/SKILL.md +1 -1
  135. package/src/assets/skills/ui-design/SKILL.md +1 -1
  136. package/src/assets/skills/worktree-support/SKILL.md +3 -55
  137. package/src/assets/skills/worktree-support/references/discovery.md +48 -0
  138. package/src/assets/skills/worktree-support/references/roots.md +2 -2
@@ -30,7 +30,7 @@ Process issues from code review reports: triage every issue through the blast-ra
30
30
 
31
31
  1. **Discover resolvable worktrees** using the `devflow:worktree-support` skill discovery algorithm:
32
32
  - Run `git worktree list --porcelain` → parse, filter (skip protected/detached/mid-rebase), dedup by branch, sort by recent commit
33
- - See the `devflow:worktree-support` skill for the full 7-step algorithm and canonical protected branch list
33
+ - Invoke the `devflow:worktree-support` skill, then Read its `references/discovery.md` from the skill's base directory for the full 7-step algorithm; the canonical protected branch list stays in the skill
34
34
  - Additional filter: must have unresolved reviews (latest review directory has no `resolution-summary.md`)
35
35
  2. **If `--path` flag provided:** use only that worktree, skip discovery
36
36
  **`--path` validation**: Before proceeding, verify the path exists as a directory and appears in `git worktree list` output. If not: report error and stop.
@@ -216,8 +216,8 @@ For each batch, spawn Code agent with `OPERATION: issue-fix` and `PUSH: false`:
216
216
 
217
217
  ```
218
218
  Agent(subagent_type="Code"):
219
- "TASK_ID: resolve-{batch-id}
220
- OPERATION: issue-fix
219
+ "OPERATION: issue-fix
220
+ TASK_ID: resolve-{batch-id}
221
221
  ISSUES: {fix_now_issues_in_batch}
222
222
  SCOPE: {risk_tier_per_issue}
223
223
  PUSH: false
@@ -262,7 +262,8 @@ Agent(subagent_type="Simplify", run_in_background=false):
262
262
  "TASK_DESCRIPTION: Issue resolution fixes
263
263
  WORKTREE_PATH: {worktree_path} (omit if cwd)
264
264
  FILES_CHANGED: {list of files modified by Code agents}
265
- Simplify and refine the fixes for clarity and consistency"
265
+ Simplify and refine the fixes for clarity and consistency
266
+ Commit any improvements with a conventional-commit message."
266
267
  ```
267
268
 
268
269
  ### Phase 7: Verification Gate
@@ -275,7 +276,7 @@ If no fixes were made (CODE_AGENT_RESULTS contains 0 commits) → set VERIFICATI
275
276
  Otherwise, spawn Validate agent:
276
277
 
277
278
  ```
278
- Agent(subagent_type="Validate", model="haiku"):
279
+ Agent(subagent_type="Validate"):
279
280
  "FILES_CHANGED: {list of files from Code agent output}
280
281
  VALIDATION_SCOPE: full
281
282
  Run build, typecheck, lint, test. Report pass/fail with failure details."
@@ -290,8 +291,8 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
290
291
  - Spawn Code agent with fix context:
291
292
  ```
292
293
  Agent(subagent_type="Code"):
293
- "TASK_ID: resolve-{batch-id}-valfix-{count}
294
- OPERATION: validation-fix
294
+ "OPERATION: validation-fix
295
+ TASK_ID: resolve-{batch-id}-valfix-{count}
295
296
  VALIDATION_FAILURES: {parsed failures from Validate agent}
296
297
  SCOPE: Fix only the listed failures, no other changes
297
298
  PUSH: false
@@ -329,14 +330,24 @@ If `fork_no_push` is set → skip: "Cannot push to fork — skipping CI validati
329
330
 
330
331
  Otherwise, for each worktree with fixes:
331
332
 
332
- <!-- PATTERN: ci-status-gate — shared polling/classification/budget logic; context-specific preamble lives outside this block -->
333
- 1. Spawn `Agent(subagent_type="Git")` with `OPERATION: check-ci-status` and `WORKTREE_PATH`.
333
+ `PR_NUMBER` is the worktree's `pr_number` from Phase 0; when it is absent, skip: "No PR/CI configured, skipping CI validation."
334
+
335
+ **Push first, outside the gate block.** The gate waits on the pushed head, so push once more with the gate's own command — never forced, and no retry:
336
+
337
+ ```bash
338
+ git -C {worktree} push; echo "exit=$?"
339
+ ```
340
+
341
+ Phase 7 has pushed already, so this is a no-op unless the head moved since. `exit=0` continues to the gate. Any other result records `TRACEABILITY: DEGRADED (ci push failed)`, reports "CI status unknown — verify manually before merging" and skips the wait for this worktree. Pass `WORKTREE_PATH: {worktree_path}` on the fix spawn below.
342
+
343
+ <!-- PATTERN: ci-status-gate -->
344
+ 1. Wait: run `cd {worktree} && HEAD_SHA=$(git rev-parse HEAD) && node "$HOME/.devflow/scripts/ci-wait.cjs" --pr {PR_NUMBER} --head "$HEAD_SHA"` through the Bash tool with `timeout: 600000`. Each run is one wait of at most 570 seconds and prints one line, `CI <STATUS> pr=… head=… failing=… pending=… waited=…` (INDETERMINATE adds `reason=…`). A missing or unparseable line, a status outside the six below, or a non-zero exit is INDETERMINATE.
334
345
  2. **If PASSING** → proceed to next phase.
335
346
  3. **If NO_PR or NO_CI** → skip: "No PR/CI configured, skipping CI validation." Proceed to next phase.
336
- 4. **If PENDING** → poll every 60 seconds (global budget, see step 7). Re-spawn Git agent each poll. If PASSING → proceed. If still PENDING after budget exhausted → report "CI still running — verify manually before merging" and proceed.
337
- 5. **If INDETERMINATE** → poll as PENDING within the same budget. If still INDETERMINATE after budget exhausted → report "CI status unknown — verify manually before merging" and proceed.
338
- 6. **If FAILING** → report failing checks. Spawn `Agent(subagent_type="Code")` with `COMPLIANCE_FRAMEWORKS` to fix CI failures based on check names and failure context. After fix, push and re-check. Max 2 fix attempts. If still failing → report failures and proceed.
339
- 7. **Total budget**: max 10 polls and max 2 fix attempts across all check/fix cycles combined. If the budget is exhausted, report current status and proceed.
347
+ 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.
348
+ 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.
349
+ 6. **If FAILING** and fewer than 2 fixes have run → report the failing checks from the line. Spawn `Agent(subagent_type="Code")` whose prompt opens with `OPERATION: ci-fix`, with `COMPLIANCE_FRAMEWORKS`, `CI_FAILURES` and `PUSH: false`; `CI_FAILURES` holds the failing-check names from the line and nothing else, because the Code agent fetches the full names and reads the logs itself and this command reads none. After a fix, push with the command above and, if a wait remains, wait again (step 1); a failed push records `TRACEABILITY: DEGRADED (ci push failed)`, reports "CI status unknown — verify manually before merging" and stops waiting. After the second fix still FAILING → report the failing checks and proceed.
350
+ 7. **Budget**: at most 3 waits and 2 fixes in all, per worktree. When one is spent, report the current status and proceed.
340
351
  <!-- /PATTERN: ci-status-gate -->
341
352
 
342
353
  ### Phase 9: Manage Debt (Sequential)
@@ -369,7 +380,7 @@ After manage-debt completes:
369
380
 
370
381
  **Step 9b-0: Re-verify stale test-plan items**
371
382
 
372
- Run this step only when this run's Phase 7 push succeeded — the one way /resolve moves the PR head — and a PR is known; otherwise skip it and Step 9b-3, and record `STALE_REVERIFICATION` as `SKIPPED (head unchanged)`. Detection needs no Git agent: from the worktree root, run the evidence script, which re-derives every test-plan state at the new head and writes the stale TP lines whose text the PR's trusted evidence record vouches for:
383
+ Run this step only when a push of this run succeeded — Phase 7's, or the push of Phase 8's gate — and a PR is known; otherwise skip it and Step 9b-3, and record `STALE_REVERIFICATION` as `SKIPPED (head unchanged)`. Detection needs no Git agent: from the worktree root, run the evidence script, which re-derives every test-plan state at the new head and writes the stale TP lines whose text the PR's trusted evidence record vouches for:
373
384
 
374
385
  ```bash
375
386
  cd {worktree} && node "$HOME/.devflow/scripts/verify-evidence.cjs" verify --pr {pr_number} --stale-out "{TARGET_DIR_REL}/stale-plan.md"; echo "exit=$?"
@@ -521,7 +532,7 @@ Final gate: {PASS | FAILED after N attempts}
521
532
  - Resolution comment: {POSTED | POSTED+TRUNCATED | SKIPPED (already posted) | SKIPPED (publication off) | SKIPPED (no PR) | DEGRADED (reason)}
522
533
  - Publication: {FULL (private repo) | FULL (config override) | STUB (public repository) | OFF (publication disabled by config) | STUB (visibility undeterminable) | STUB (evidence policy)}
523
534
  - Thread replies: {COMPLETE | PARTIAL | TRUNCATED | SKIPPED (reason) | DEGRADED (reason)}
524
- - Push: {pushed | skipped (no fixes) | skipped (cannot push to fork)}
535
+ - Push: {pushed (Phase 7, a CI-fix push, or both) | skipped (no fixes) | skipped (cannot push to fork) | DEGRADED (ci push failed)}
525
536
  - Test-plan re-verification: {Test plan: n stale, m re-verified | SKIPPED (head unchanged) | DEGRADED (reason)}
526
537
  - Test-plan evidence: {the EVIDENCE line's VERIFIED-CI + ATTESTED-LOCAL / total, then the Body / Comment line | SKIPPED (reason) | DEGRADED (reason)}
527
538
 
@@ -569,7 +580,7 @@ In multi-worktree mode, report results per worktree with aggregate summary.
569
580
  ├─ Phase 7: Verification Gate [Validate agent, haiku] + push + Code agent validation-fix loop ≤2
570
581
  │
571
582
  ├─ Phase 8: CI Status Gate (conditional — skipped if no fixes or verification FAILED)
572
- │ └─ Git agent (check-ci-status) → poll/fix loop
583
+ │ └─ push, then ci-wait.cjs (inline, one wait ≤ 570 s) → Code agent on FAILING (3 waits + 2 fixes per worktree)
573
584
  │
574
585
  ├─ Phase 9: Git agent (manage-debt) — FIX_SEPARATE + TECH_DEBT → backfill Tracked={ISSUE_REF} (or TRACEABILITY: DEGRADED on failure)
575
586
  │ SEQUENTIAL across worktrees
@@ -17,7 +17,7 @@ Run Simplify agent and Scrutinize agent sequentially on changed files for post-i
17
17
 
18
18
  ### Phase 0: Context Gathering
19
19
 
20
- **Produces:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE
20
+ **Produces:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT, FEATURE_KNOWLEDGE, HEAD_BEFORE
21
21
 
22
22
  Detect changed files and build context:
23
23
 
@@ -25,6 +25,7 @@ Detect changed files and build context:
25
25
  2. Else run `git diff --name-only HEAD` + `git diff --name-only --cached` to get staged + unstaged
26
26
  3. If no changes found, report "No changes to review" and exit
27
27
  4. Build TASK_DESCRIPTION from recent commit messages or branch name
28
+ 5. Record `HEAD_BEFORE` (`git rev-parse HEAD`) now, before Simplify runs — Phase 3 compares against it
28
29
  {{decisions_load()}}
29
30
 
30
31
  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.)
@@ -33,7 +34,7 @@ Pass `DECISIONS_CONTEXT` to Scrutinize agent — the compact index lists active
33
34
 
34
35
  Pass `FEATURE_KNOWLEDGE` to Scrutinize agent.
35
36
 
36
- **Extract:** FILES_CHANGED (list), TASK_DESCRIPTION (string), DECISIONS_CONTEXT (string, optional), FEATURE_KNOWLEDGE (string, optional)
37
+ **Extract:** FILES_CHANGED (list), TASK_DESCRIPTION (string), DECISIONS_CONTEXT (string, optional), FEATURE_KNOWLEDGE (string, optional), HEAD_BEFORE (40-hex SHA)
37
38
 
38
39
  ### Phase 1: Simplify agent (Code Refinement)
39
40
 
@@ -45,13 +46,14 @@ Spawn Simplify agent to refine code for clarity and consistency:
45
46
  Agent(subagent_type="Simplify", run_in_background=false):
46
47
  "TASK_DESCRIPTION: {task_description}
47
48
  FILES_CHANGED: {files_changed}
48
- Simplify and refine the code for clarity and consistency while preserving functionality."
49
+ Simplify and refine the code for clarity and consistency while preserving functionality.
50
+ Commit any improvements with a conventional-commit message."
49
51
 
50
52
  **Wait for completion.** Simplify agent commits changes directly.
51
53
 
52
54
  ### Phase 2: Scrutinize agent (9-Pillar Quality Gate)
53
55
 
54
- **Produces:** SCRUTINIZE_STATUS, SCRUTINIZE_CHANGES
56
+ **Produces:** SCRUTINIZE_STATUS
55
57
  **Requires:** FILES_CHANGED, TASK_DESCRIPTION, DECISIONS_CONTEXT
56
58
 
57
59
  Spawn Scrutinize agent for quality evaluation and fixing:
@@ -65,17 +67,19 @@ Evaluate against 9-pillar framework. Fix P0/P1 issues. Return structured report.
65
67
  Follow devflow:apply-decisions to scan DECISIONS_CONTEXT and Read full ADR/PF bodies on demand. Skip if (none).
66
68
  Follow devflow:apply-feature-knowledge for FEATURE_KNOWLEDGE. Skip if (none)."
67
69
 
68
- **Wait for completion.** Extract: STATUS (PASS|FIXED|BLOCKED), changes_made (bool)
70
+ **Wait for completion.** Extract: STATUS (PASS|FIXED|BLOCKED) from the `### Status` line
69
71
 
70
72
  ### Phase 3: Conditional Validation
71
73
 
72
74
  **Produces:** VALIDATION_RESULT
73
- **Requires:** SCRUTINIZE_CHANGES
75
+ **Requires:** HEAD_BEFORE, SCRUTINIZE_STATUS
74
76
 
75
- If Scrutinize agent made changes (STATUS == FIXED):
77
+ If STATUS is BLOCKED, skip this phase: the report (Phase 4) names the blocker.
78
+
79
+ 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:
76
80
 
77
81
  Agent(subagent_type="Validate", run_in_background=false):
78
- "FILES_CHANGED: {scrutinize_modified_files}
82
+ "FILES_CHANGED: {output of `git diff --name-only HEAD_BEFORE..HEAD`}
79
83
  VALIDATION_SCOPE: changed-only
80
84
  Run build, typecheck, lint, test on modified files"
81
85
 
@@ -122,6 +126,7 @@ Display summary:
122
126
  │
123
127
  ├─ Phase 0: Context gathering
124
128
  │ ├─ Git diff for changed files
129
+ │ ├─ Record HEAD_BEFORE
125
130
  │ └─ Read index.md → DECISIONS_CONTEXT
126
131
  │
127
132
  ├─ Phase 1: Simplify agent
@@ -131,7 +136,7 @@ Display summary:
131
136
  │ └─ 9-pillar quality gate (may fix and commit)
132
137
  │
133
138
  ├─ Phase 3: Validate agent (conditional)
134
- │ └─ If Scrutinize agent made changes, verify tests pass
139
+ │ └─ If HEAD moved since HEAD_BEFORE (Simplify or Scrutinize committed), changed-only Validate over HEAD_BEFORE..HEAD
135
140
  │
136
141
  └─ Phase 4: Report
137
142
  └─ Display summary with pillar status
@@ -150,6 +155,6 @@ Display summary:
150
155
 
151
156
  1. **Orchestration only** - Command spawns agents, doesn't do the work
152
157
  2. **Sequential execution** - Simplify agent must complete before Scrutinize agent
153
- 3. **Validation gate** - If Scrutinize agent changes code, must pass validation
158
+ 3. **Validation gate** - If Simplify agent or Scrutinize agent committed, the changes must pass validation
154
159
  4. **Honest reporting** - Display actual agent outputs
155
160
  5. **Fail fast** - Stop on BLOCKED or validation failure
@@ -125,7 +125,7 @@ extract the segment {{match_phrase}} and verify it with the *fetch by key* capab
125
125
  @end
126
126
 
127
127
  @define closing_keyword_rule():
128
- 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?|refs):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
128
+ 3a. **Closing-keyword rule.** A candidate follows, on the same line, a whitespace token matching `^\(?(close[sd]?|fix(e[sd])?|resolve[sd]?):?$` (case-insensitive). Take the next token, plus each further token while the previous one ends in `,`. Split each on `,`, strip one leading `(` and every trailing character in `[.,;:)\]!?]`, drop empties, then apply step 5's anchored gate unchanged. Read each message as `git log --format=%B` lines.
129
129
  @end
130
130
 
131
131
  @define handoff_values(id_form, link_form):
@@ -226,13 +226,13 @@ This issue reached the size limit.
226
226
 
227
227
  Load when the resolved tracker provider is `github` and the operation is `create-release`.
228
228
 
229
- **Mechanics held here:** the closed-issues step only. Tag creation, release creation and notes composition stay with the operation.
229
+ **Mechanics held here:** the shipped-issues step only. Tag creation, release creation and notes composition stay with the operation.
230
230
 
231
231
  ### Process
232
232
 
233
233
  Inside step 5 (compose release notes):
234
234
 
235
- - If `SHIPPED_ISSUES` provided: append a `## Closed Issues` section with issue references — **first ≤50 issues** (the same bound `backlink-shipped-issues` applies); if truncated, add a final `…and {n} more issues` line (D4 degrade if enrichment fails)
235
+ - If `SHIPPED_ISSUES` provided: append a `## Shipped Issues` section with issue references — **first ≤50 issues** (the same bound `backlink-shipped-issues` applies); if truncated, add a final `…and {n} more issues` line (D4 degrade if enrichment fails)
236
236
  @end
237
237
 
238
238
  @define gather_release_evidence():
@@ -180,13 +180,13 @@ Over `{{comment_cap()}}` characters the rolling item is closed and a successor i
180
180
 
181
181
  Load when the resolved tracker provider is `jira` and the operation is `create-release`.
182
182
 
183
- **Mechanics held here:** the closed-issues step only. Tag creation, release creation and notes composition stay with the operation and are unchanged — they are release-host mechanics, not tracker mechanics.
183
+ **Mechanics held here:** the shipped-issues step only. Tag creation, release creation and notes composition stay with the operation and are unchanged — they are release-host mechanics, not tracker mechanics.
184
184
 
185
185
  ### Process
186
186
 
187
187
  Inside step 5 (compose release notes):
188
188
 
189
- - If `SHIPPED_ISSUES` is provided: append a `## Closed Issues` section rendering each entry through `## Reference Rendering` — **first ≤50 issues** (the same bound `backlink-shipped-issues` applies); if truncated, add a final `…and {n} more issues` line (D4 degrade if enrichment fails).
189
+ - If `SHIPPED_ISSUES` is provided: append a `## Shipped Issues` section rendering each entry through `## Reference Rendering` — **first ≤50 issues** (the same bound `backlink-shipped-issues` applies); if truncated, add a final `…and {n} more issues` line (D4 degrade if enrichment fails).
190
190
  - {{common.ref_preflight_list("jira", "`^[A-Z][A-Z0-9_]{1,9}-[1-9][0-9]{0,8}$`", "", "", " and the section is omitted rather than rendered empty.")}}
191
191
  - `## Reference Rendering` absent, or its token discarded by the gate below ⇒ render the key itself on its own line, and record the discard under `### Substitutions`.
192
192
 
@@ -218,13 +218,13 @@ Over `{{comment_cap()}}` characters the rolling item is closed and a successor i
218
218
 
219
219
  Load when the resolved tracker provider is `linear` and the operation is `create-release`.
220
220
 
221
- **Mechanics held here:** the closed-issues step only. Tag creation, release creation and notes composition stay with the operation and are unchanged — they are release-host mechanics, not tracker mechanics.
221
+ **Mechanics held here:** the shipped-issues step only. Tag creation, release creation and notes composition stay with the operation and are unchanged — they are release-host mechanics, not tracker mechanics.
222
222
 
223
223
  ### Process
224
224
 
225
225
  Inside step 5 (compose release notes):
226
226
 
227
- - If `SHIPPED_ISSUES` is provided: append a `## Closed Issues` section rendering each entry through `## Reference Rendering` — **first ≤50 issues** (the same bound `backlink-shipped-issues` applies); if truncated, add a final `…and {n} more issues` line (D4 degrade if enrichment fails).
227
+ - If `SHIPPED_ISSUES` is provided: append a `## Shipped Issues` section rendering each entry through `## Reference Rendering` — **first ≤50 issues** (the same bound `backlink-shipped-issues` applies); if truncated, add a final `…and {n} more issues` line (D4 degrade if enrichment fails).
228
228
  - {{common.ref_preflight_list("linear", "**either** anchored form — the team-key form `^[A-Z][A-Z0-9]{0,9}-[1-9][0-9]{0,8}$` or the internal-id form `^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$`", "**ASCII-upper-normalise every entry first.** ", ", never joined into one alternation", " and the section is omitted rather than rendered empty.")}}
229
229
  - `## Reference Rendering` absent, or its token discarded by the gate below ⇒ render the reference itself on its own line, and record the discard under `### Substitutions`.
230
230