mandrel 1.94.0 → 2.1.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 (560) hide show
  1. package/.agents/README.md +116 -99
  2. package/.agents/agents/acceptance-critic.md +9 -7
  3. package/.agents/agents/story-worker.md +45 -51
  4. package/.agents/audit-checklists/performance.md +1 -1
  5. package/.agents/docs/SDLC.md +498 -1287
  6. package/.agents/docs/agentrc-reference.json +185 -80
  7. package/.agents/docs/configuration.md +132 -190
  8. package/.agents/docs/execution-reference.md +51 -25
  9. package/.agents/docs/quality-gates.md +25 -33
  10. package/.agents/docs/workflows.md +8 -8
  11. package/.agents/instructions.md +113 -139
  12. package/.agents/rules/ci-remediation.md +11 -15
  13. package/.agents/rules/git-conventions-reference.md +48 -58
  14. package/.agents/rules/git-conventions.md +16 -22
  15. package/.agents/schemas/acceptance-eval-verdict.schema.json +1 -1
  16. package/.agents/schemas/agentrc.schema.json +83 -254
  17. package/.agents/schemas/audit-rules.json +59 -1
  18. package/.agents/schemas/audit-rules.schema.json +33 -1
  19. package/.agents/schemas/lifecycle/README.md +1 -2
  20. package/.agents/schemas/lifecycle/ledger-record.schema.json +1 -1
  21. package/.agents/schemas/lifecycle/merge.flip-failed.schema.json +33 -0
  22. package/.agents/schemas/lifecycle/merge.unlanded.schema.json +1 -0
  23. package/.agents/schemas/lifecycle/retro.end.schema.json +1 -1
  24. package/.agents/schemas/lifecycle/story.merged.schema.json +1 -1
  25. package/.agents/schemas/signal-event.schema.json +3 -3
  26. package/.agents/schemas/story-deliver-terminal.schema.json +152 -0
  27. package/.agents/schemas/validation-evidence.schema.json +1 -1
  28. package/.agents/scripts/acceptance-eval.js +22 -66
  29. package/.agents/scripts/agents-bootstrap-github.js +1 -1
  30. package/.agents/scripts/audit-to-stories.js +7 -7
  31. package/.agents/scripts/boot-sweep.js +1 -1
  32. package/.agents/scripts/bootstrap.js +3 -3
  33. package/.agents/scripts/check-dead-exports.js +43 -104
  34. package/.agents/scripts/check-doc-links.js +2 -2
  35. package/.agents/scripts/check-lifecycle-lint.js +7 -10
  36. package/.agents/scripts/check-workflow-cli-lint.js +91 -0
  37. package/.agents/scripts/cleanup-repo-test-temp.js +6 -1
  38. package/.agents/scripts/deliver-recover.js +122 -0
  39. package/.agents/scripts/drain-pending-cleanup.js +1 -1
  40. package/.agents/scripts/evidence-gate.js +20 -50
  41. package/.agents/scripts/generate-skills-index.js +17 -1
  42. package/.agents/scripts/generate-workflows-doc.js +4 -4
  43. package/.agents/scripts/lib/ITicketingProvider.js +1 -19
  44. package/.agents/scripts/lib/Logger.js +6 -10
  45. package/.agents/scripts/lib/audit-suite/runner.js +2 -2
  46. package/.agents/scripts/lib/audit-suite/selector.js +328 -28
  47. package/.agents/scripts/lib/audit-to-stories/{seed-epic-from-findings.js → seed-from-findings.js} +9 -9
  48. package/.agents/scripts/lib/baselines/kernel.js +206 -18
  49. package/.agents/scripts/lib/baselines/kinds/maintainability.js +0 -15
  50. package/.agents/scripts/lib/baselines/reader.js +1 -6
  51. package/.agents/scripts/lib/bdd-runner-detect.js +5 -9
  52. package/.agents/scripts/lib/bootstrap/ci-workflow-template.js +28 -33
  53. package/.agents/scripts/lib/bootstrap/issue-forms-template.js +32 -33
  54. package/.agents/scripts/lib/bootstrap/manifest.js +8 -11
  55. package/.agents/scripts/lib/bootstrap/project-bootstrap.js +30 -53
  56. package/.agents/scripts/lib/bootstrap/quality-bootstrap.js +0 -2
  57. package/.agents/scripts/lib/checks/core-bare-clean.js +6 -3
  58. package/.agents/scripts/lib/checks/index.js +3 -2
  59. package/.agents/scripts/lib/checks/loop-health.js +12 -11
  60. package/.agents/scripts/lib/checks/state.js +17 -248
  61. package/.agents/scripts/lib/checks/story-init-not-backgrounded.js +26 -24
  62. package/.agents/scripts/lib/checks/subagent-agent-tool-required.js +3 -4
  63. package/.agents/scripts/lib/checks/worktree-bootstrap-env.js +2 -2
  64. package/.agents/scripts/lib/checks/worktree-residue-biome.js +3 -3
  65. package/.agents/scripts/lib/cli/standard-args.js +13 -22
  66. package/.agents/scripts/lib/cli-args.js +39 -9
  67. package/.agents/scripts/lib/close-validation/gates.js +15 -15
  68. package/.agents/scripts/lib/close-validation/projections/inputs.js +7 -7
  69. package/.agents/scripts/lib/close-validation/projections/maintainability.js +12 -12
  70. package/.agents/scripts/lib/close-validation/runner.js +13 -21
  71. package/.agents/scripts/lib/close-validation/telemetry.js +17 -8
  72. package/.agents/scripts/lib/config/ci.js +6 -31
  73. package/.agents/scripts/lib/config/delivery-routing.js +52 -35
  74. package/.agents/scripts/lib/config/explain.js +61 -48
  75. package/.agents/scripts/lib/config/github.js +7 -5
  76. package/.agents/scripts/lib/config/limits.js +29 -80
  77. package/.agents/scripts/lib/config/paths.js +0 -2
  78. package/.agents/scripts/lib/config/quality.js +12 -15
  79. package/.agents/scripts/lib/config/runners.js +20 -66
  80. package/.agents/scripts/lib/config/temp-paths.js +30 -63
  81. package/.agents/scripts/lib/config/worktree-isolation.js +0 -5
  82. package/.agents/scripts/lib/config-resolver.js +2 -7
  83. package/.agents/scripts/lib/config-settings-schema-delivery.js +55 -161
  84. package/.agents/scripts/lib/config-settings-schema-quality.js +17 -16
  85. package/.agents/scripts/lib/config-settings-schema.js +100 -60
  86. package/.agents/scripts/lib/dead-exports-knip.js +105 -0
  87. package/.agents/scripts/lib/dead-exports-mode.js +51 -0
  88. package/.agents/scripts/lib/dependency-parser.js +3 -2
  89. package/.agents/scripts/lib/doc-tiers.js +2 -2
  90. package/.agents/scripts/lib/duplicate-search.js +242 -41
  91. package/.agents/scripts/lib/feedback-loop/retro-proposals-graduator.js +1 -1
  92. package/.agents/scripts/lib/findings/promote-finding.js +23 -14
  93. package/.agents/scripts/lib/format-generated-json.js +97 -0
  94. package/.agents/scripts/lib/framework-version.js +19 -190
  95. package/.agents/scripts/lib/gh-exec.js +8 -0
  96. package/.agents/scripts/lib/git-branch-cleanup.js +1 -10
  97. package/.agents/scripts/lib/git-branch-lifecycle.js +17 -180
  98. package/.agents/scripts/lib/git-utils.js +32 -20
  99. package/.agents/scripts/lib/github/framework-repo.js +6 -0
  100. package/.agents/scripts/lib/json-utils.js +1 -2
  101. package/.agents/scripts/lib/label-constants.js +10 -38
  102. package/.agents/scripts/lib/label-taxonomy.js +10 -55
  103. package/.agents/scripts/lib/observability/active-story-env.js +44 -165
  104. package/.agents/scripts/lib/observability/runtime-friction.js +243 -0
  105. package/.agents/scripts/lib/observability/signal-validator.js +4 -4
  106. package/.agents/scripts/lib/observability/signals-writer.js +6 -82
  107. package/.agents/scripts/lib/observability/source-classifier.js +5 -5
  108. package/.agents/scripts/lib/observability/tool-trace-hook.js +2 -12
  109. package/.agents/scripts/lib/onboard/init-tail.js +1 -3
  110. package/.agents/scripts/lib/orchestration/acceptance-clusters.js +1 -1
  111. package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +2 -2
  112. package/.agents/scripts/lib/orchestration/ceremony-routing.js +105 -44
  113. package/.agents/scripts/lib/orchestration/code-review.js +78 -436
  114. package/.agents/scripts/lib/orchestration/column-sync.js +1 -1
  115. package/.agents/scripts/lib/orchestration/consolidation-precondition.js +4 -4
  116. package/.agents/scripts/lib/orchestration/context-envelope.js +2 -5
  117. package/.agents/scripts/lib/orchestration/deliver-recover.js +328 -0
  118. package/.agents/scripts/lib/orchestration/detectors-phase.js +12 -6
  119. package/.agents/scripts/lib/orchestration/docs-digest.js +8 -8
  120. package/.agents/scripts/lib/orchestration/file-assumptions.js +7 -13
  121. package/.agents/scripts/lib/orchestration/git-cleanup/phases/cli.js +1 -1
  122. package/.agents/scripts/lib/orchestration/git-cleanup/phases/fast-forward.js +34 -0
  123. package/.agents/scripts/lib/orchestration/lease-guard-shared.js +3 -2
  124. package/.agents/scripts/lib/orchestration/lifecycle/emit-ledger-event.js +142 -0
  125. package/.agents/scripts/lib/orchestration/lifecycle/emit-loop-tick.js +17 -19
  126. package/.agents/scripts/lib/orchestration/lifecycle/emit-merge-flip-failed.js +86 -0
  127. package/.agents/scripts/lib/orchestration/lifecycle/emit-merge-unlanded.js +37 -103
  128. package/.agents/scripts/lib/orchestration/lifecycle/ledger-writer.js +6 -3
  129. package/.agents/scripts/lib/orchestration/lifecycle/listeners/README.md +21 -43
  130. package/.agents/scripts/lib/orchestration/lifecycle/listeners/watcher.js +50 -85
  131. package/.agents/scripts/lib/orchestration/lifecycle/trace-logger.js +3 -14
  132. package/.agents/scripts/lib/orchestration/lint-baseline-service.js +4 -4
  133. package/.agents/scripts/lib/orchestration/merge-block-class.js +77 -21
  134. package/.agents/scripts/lib/orchestration/merge-poll.js +104 -0
  135. package/.agents/scripts/lib/orchestration/phase-runner.js +3 -2
  136. package/.agents/scripts/lib/orchestration/plan-context.js +354 -282
  137. package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +11 -22
  138. package/.agents/scripts/lib/orchestration/plan-critics-evaluate.js +4 -8
  139. package/.agents/scripts/lib/orchestration/plan-metrics.js +38 -6
  140. package/.agents/scripts/lib/orchestration/plan-navigation.js +92 -0
  141. package/.agents/scripts/lib/orchestration/plan-persist/fan-out-gate.js +71 -0
  142. package/.agents/scripts/lib/orchestration/plan-persist/persist-helpers.js +245 -0
  143. package/.agents/scripts/lib/orchestration/plan-persist/plan-context-source.js +116 -0
  144. package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +432 -858
  145. package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +778 -0
  146. package/.agents/scripts/lib/orchestration/plan-persist/summary.js +47 -115
  147. package/.agents/scripts/lib/orchestration/plan-persist/supersede-ops.js +509 -0
  148. package/.agents/scripts/lib/orchestration/plan-reachability.js +9 -14
  149. package/.agents/scripts/lib/orchestration/plan-runner/worktree-sweep.js +1 -1
  150. package/.agents/scripts/lib/orchestration/{epic-plan-spec/phases → planning}/authoring-context.js +52 -51
  151. package/.agents/scripts/lib/orchestration/planning/decomposer-context.js +27 -0
  152. package/.agents/scripts/lib/orchestration/{epic-plan-spec/phases → planning}/spec-authoring-grounding.js +1 -1
  153. package/.agents/scripts/lib/orchestration/pr-base-guard.js +18 -28
  154. package/.agents/scripts/lib/orchestration/remote-verifier.js +1 -1
  155. package/.agents/scripts/lib/orchestration/resolve-stories.js +344 -0
  156. package/.agents/scripts/lib/orchestration/resolves-token.js +1 -1
  157. package/.agents/scripts/lib/orchestration/retro-proposals.js +140 -79
  158. package/.agents/scripts/lib/orchestration/review-depth.js +126 -47
  159. package/.agents/scripts/lib/orchestration/review-providers/codex.js +2 -2
  160. package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +3 -13
  161. package/.agents/scripts/lib/orchestration/review-providers/native.js +1 -154
  162. package/.agents/scripts/lib/orchestration/review-providers/review-depth.js +3 -2
  163. package/.agents/scripts/lib/orchestration/review-providers/review-provider-factory.js +21 -56
  164. package/.agents/scripts/lib/orchestration/review-providers/security-review.js +1 -1
  165. package/.agents/scripts/lib/orchestration/review-providers/types.js +5 -4
  166. package/.agents/scripts/lib/orchestration/review-providers/ultrareview.js +1 -1
  167. package/.agents/scripts/lib/orchestration/run-epilogue.js +784 -0
  168. package/.agents/scripts/lib/orchestration/single-story-close/phases/auto-merge.js +25 -1
  169. package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +11 -9
  170. package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +4 -4
  171. package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +86 -41
  172. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +608 -152
  173. package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +77 -32
  174. package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +305 -0
  175. package/.agents/scripts/lib/orchestration/single-story-close/phases/pull-request.js +1 -1
  176. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-block.js +44 -0
  177. package/.agents/scripts/lib/orchestration/single-story-close/phases/worktree-reap.js +37 -4
  178. package/.agents/scripts/lib/orchestration/single-story-close/phases/wrong-tree-guard.js +2 -2
  179. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +275 -46
  180. package/.agents/scripts/lib/orchestration/single-story-lease-guard.js +1 -1
  181. package/.agents/scripts/lib/orchestration/spec-freshness.js +14 -205
  182. package/.agents/scripts/lib/orchestration/spec-section-validator.js +4 -5
  183. package/.agents/scripts/lib/orchestration/spec-spill.js +60 -0
  184. package/.agents/scripts/lib/orchestration/split-policy-validator.js +188 -0
  185. package/.agents/scripts/lib/orchestration/story-close/emit-blocked.js +49 -0
  186. package/.agents/scripts/lib/orchestration/story-close/format-autofix.js +10 -10
  187. package/.agents/scripts/lib/orchestration/story-close/phases/code-review.js +28 -42
  188. package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +360 -0
  189. package/.agents/scripts/lib/orchestration/story-follow-ups.js +298 -0
  190. package/.agents/scripts/lib/orchestration/story-init-remote.js +51 -0
  191. package/.agents/scripts/lib/orchestration/story-plan-state.js +33 -0
  192. package/.agents/scripts/lib/orchestration/structured-comment-parser.js +1 -1
  193. package/.agents/scripts/lib/orchestration/task-body-validator.js +60 -25
  194. package/.agents/scripts/lib/orchestration/ticket-lease.js +27 -74
  195. package/.agents/scripts/lib/orchestration/ticket-validator-conflicts.js +130 -75
  196. package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +192 -377
  197. package/.agents/scripts/lib/orchestration/ticket-validator.js +123 -25
  198. package/.agents/scripts/lib/orchestration/ticketing/bulk.js +14 -72
  199. package/.agents/scripts/lib/orchestration/ticketing/reads.js +45 -55
  200. package/.agents/scripts/lib/orchestration/ticketing/transition.js +66 -6
  201. package/.agents/scripts/lib/orchestration/ticketing.js +0 -1
  202. package/.agents/scripts/lib/plan-phase-cleanup.js +12 -14
  203. package/.agents/scripts/lib/planning-corpus.js +12 -281
  204. package/.agents/scripts/lib/preflight-runner.js +4 -4
  205. package/.agents/scripts/lib/qa/coverage-verdict.js +5 -5
  206. package/.agents/scripts/lib/qa/qa-context-hydrator.js +5 -5
  207. package/.agents/scripts/lib/signals/index.js +4 -17
  208. package/.agents/scripts/lib/signals/read.js +35 -35
  209. package/.agents/scripts/lib/signals/schema.js +8 -11
  210. package/.agents/scripts/lib/signals/span-tree.js +7 -7
  211. package/.agents/scripts/lib/signals/write.js +0 -1
  212. package/.agents/scripts/lib/single-story/story-merged-notify.js +13 -2
  213. package/.agents/scripts/lib/single-story-sweep/protection-ctx.js +1 -1
  214. package/.agents/scripts/lib/skills/parse-skill.js +16 -3
  215. package/.agents/scripts/lib/story-adjacency.js +17 -19
  216. package/.agents/scripts/lib/story-body/story-body.js +130 -75
  217. package/.agents/scripts/lib/story-plan.js +2 -4
  218. package/.agents/scripts/lib/templates/decomposer-prompts.js +51 -46
  219. package/.agents/scripts/lib/templates/spec-author-prompts.js +47 -45
  220. package/.agents/scripts/lib/test-env.js +14 -1
  221. package/.agents/scripts/lib/test-tiers.js +0 -3
  222. package/.agents/scripts/lib/{epic-body-sections.js → ticket-body-sections.js} +25 -39
  223. package/.agents/scripts/lib/validation-evidence.js +32 -60
  224. package/.agents/scripts/lib/wave-runner/ready-set.js +38 -12
  225. package/.agents/scripts/lib/workspace-provisioner.js +1 -1
  226. package/.agents/scripts/lib/worktree/lifecycle/pending-cleanup.js +1 -1
  227. package/.agents/scripts/lib/worktree/lifecycle/reap.js +72 -25
  228. package/.agents/scripts/lib/worktree/lifecycle-manager.js +1 -2
  229. package/.agents/scripts/lint-issue-body.js +71 -40
  230. package/.agents/scripts/mandrel-update-preflight.js +1 -1
  231. package/.agents/scripts/notify.js +4 -3
  232. package/.agents/scripts/plan-context.js +102 -80
  233. package/.agents/scripts/plan-persist.js +230 -279
  234. package/.agents/scripts/plan-run-epilogue.js +142 -0
  235. package/.agents/scripts/post-structured-comment.js +0 -38
  236. package/.agents/scripts/pr-watch-with-update.js +43 -22
  237. package/.agents/scripts/providers/github/compose.js +0 -1
  238. package/.agents/scripts/providers/github/errors.js +0 -19
  239. package/.agents/scripts/providers/github/issues.js +13 -39
  240. package/.agents/scripts/providers/github/mappers.js +5 -12
  241. package/.agents/scripts/providers/github/sub-issues.js +0 -47
  242. package/.agents/scripts/providers/github/tickets.js +33 -156
  243. package/.agents/scripts/providers/github.js +17 -6
  244. package/.agents/scripts/resolve-stories.js +236 -0
  245. package/.agents/scripts/run-coverage.js +4 -1
  246. package/.agents/scripts/run-lint.js +2 -2
  247. package/.agents/scripts/run-verify.js +31 -2
  248. package/.agents/scripts/signals-view.js +25 -21
  249. package/.agents/scripts/single-story-close.js +178 -26
  250. package/.agents/scripts/single-story-confirm-merge.js +313 -24
  251. package/.agents/scripts/single-story-init.js +35 -30
  252. package/.agents/scripts/stories-wave-tick.js +85 -10
  253. package/.agents/scripts/story-plan.js +28 -49
  254. package/.agents/scripts/update-ticket-state.js +14 -65
  255. package/.agents/skills/core/code-review-and-quality/SKILL.md +28 -450
  256. package/.agents/skills/core/code-review-and-quality/reference.md +458 -0
  257. package/.agents/skills/core/debugging-and-error-recovery/SKILL.md +22 -315
  258. package/.agents/skills/core/debugging-and-error-recovery/reference.md +323 -0
  259. package/.agents/skills/core/diagnose-friction/SKILL.md +14 -18
  260. package/.agents/skills/core/documentation-and-adrs/SKILL.md +25 -397
  261. package/.agents/skills/core/documentation-and-adrs/reference.md +403 -0
  262. package/.agents/skills/core/gates-and-baselines/SKILL.md +12 -12
  263. package/.agents/skills/core/idea-refinement/SKILL.md +9 -9
  264. package/.agents/skills/core/scope-triage/SKILL.md +31 -172
  265. package/.agents/skills/core/security-and-hardening/SKILL.md +22 -367
  266. package/.agents/skills/core/security-and-hardening/reference.md +375 -0
  267. package/.agents/skills/skills.index.json +3 -53
  268. package/.agents/skills/stack/qa/playwright-bdd/SKILL.md +2 -4
  269. package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +1 -1
  270. package/.agents/skills/stack/qa/qa-harness/SKILL.md +1 -3
  271. package/.agents/starter-agentrc.json +0 -5
  272. package/.agents/templates/agent-protocol.md +9 -10
  273. package/.agents/workflows/audit-architecture.md +6 -7
  274. package/.agents/workflows/audit-clean-code.md +7 -7
  275. package/.agents/workflows/audit-dependencies.md +3 -3
  276. package/.agents/workflows/audit-devops.md +3 -3
  277. package/.agents/workflows/audit-documentation.md +9 -10
  278. package/.agents/workflows/audit-lighthouse.md +11 -3
  279. package/.agents/workflows/audit-navigability.md +13 -2
  280. package/.agents/workflows/audit-performance.md +5 -6
  281. package/.agents/workflows/audit-privacy.md +3 -3
  282. package/.agents/workflows/audit-quality.md +11 -12
  283. package/.agents/workflows/audit-security.md +4 -5
  284. package/.agents/workflows/audit-seo.md +13 -3
  285. package/.agents/workflows/audit-sre.md +3 -3
  286. package/.agents/workflows/audit-to-stories.md +20 -20
  287. package/.agents/workflows/audit-ux-ui.md +10 -3
  288. package/.agents/workflows/deliver.md +177 -176
  289. package/.agents/workflows/git-cleanup.md +5 -6
  290. package/.agents/workflows/git-deliver.md +1 -1
  291. package/.agents/workflows/helpers/_merge-conflict-template.md +1 -1
  292. package/.agents/workflows/helpers/acceptance-self-eval.md +35 -40
  293. package/.agents/workflows/helpers/code-quality-guardrails.md +7 -7
  294. package/.agents/workflows/helpers/code-review.md +75 -196
  295. package/.agents/workflows/helpers/{single-story-deliver-reference.md → deliver-story-reference.md} +83 -44
  296. package/.agents/workflows/helpers/deliver-story.md +606 -0
  297. package/.agents/workflows/helpers/diagnose.md +10 -10
  298. package/.agents/workflows/helpers/parallel-tooling.md +3 -3
  299. package/.agents/workflows/helpers/signals.md +16 -16
  300. package/.agents/workflows/helpers/worktree-lifecycle.md +66 -86
  301. package/.agents/workflows/mandrel-update.md +2 -1
  302. package/.agents/workflows/plan.md +277 -145
  303. package/.agents/workflows/qa-assist.md +27 -33
  304. package/.agents/workflows/qa-explore.md +29 -38
  305. package/.agents/workflows/qa-run.md +2 -6
  306. package/README.md +9 -8
  307. package/bin/mandrel.js +12 -1
  308. package/docs/CHANGELOG.md +70 -0
  309. package/lib/cli/registry.js +262 -19
  310. package/lib/cli/sync-agents.js +157 -0
  311. package/lib/cli/sync-commands.js +115 -6
  312. package/lib/cli/sync.js +168 -6
  313. package/lib/cli/update.js +105 -8
  314. package/lib/cli/version-helpers.js +131 -0
  315. package/lib/migrations/README.md +7 -5
  316. package/lib/migrations/index.js +12 -8
  317. package/lib/migrations/steps/2.1.0-retire-mi-drop-knobs.js +100 -0
  318. package/lib/migrations/steps/2.1.0-retire-verify-concurrency-cap.js +101 -0
  319. package/package.json +2 -2
  320. package/.agents/agents/retro.md +0 -42
  321. package/.agents/personas/architect.md +0 -113
  322. package/.agents/personas/devops-engineer.md +0 -38
  323. package/.agents/personas/engineer.md +0 -33
  324. package/.agents/personas/project-manager.md +0 -114
  325. package/.agents/personas/qa-engineer.md +0 -95
  326. package/.agents/personas/security-engineer.md +0 -111
  327. package/.agents/personas/technical-writer.md +0 -101
  328. package/.agents/schemas/dispatch-manifest.json +0 -232
  329. package/.agents/schemas/epic-perf-report.schema.json +0 -89
  330. package/.agents/schemas/epic-spec.schema.json +0 -153
  331. package/.agents/schemas/lifecycle/acceptance.reconcile.failed.schema.json +0 -13
  332. package/.agents/schemas/lifecycle/acceptance.reconcile.ok.schema.json +0 -13
  333. package/.agents/schemas/lifecycle/acceptance.reconcile.skipped.schema.json +0 -13
  334. package/.agents/schemas/lifecycle/acceptance.reconcile.start.schema.json +0 -12
  335. package/.agents/schemas/lifecycle/acceptance.reconcile.waived.schema.json +0 -13
  336. package/.agents/schemas/lifecycle/epic.automerge.end.schema.json +0 -15
  337. package/.agents/schemas/lifecycle/epic.automerge.start.schema.json +0 -13
  338. package/.agents/schemas/lifecycle/epic.blocked.schema.json +0 -13
  339. package/.agents/schemas/lifecycle/epic.cleanup.end.schema.json +0 -12
  340. package/.agents/schemas/lifecycle/epic.cleanup.start.schema.json +0 -12
  341. package/.agents/schemas/lifecycle/epic.close.end.schema.json +0 -12
  342. package/.agents/schemas/lifecycle/epic.complete.schema.json +0 -13
  343. package/.agents/schemas/lifecycle/epic.finalize.end.schema.json +0 -13
  344. package/.agents/schemas/lifecycle/epic.finalize.start.schema.json +0 -12
  345. package/.agents/schemas/lifecycle/epic.merge.armed.schema.json +0 -13
  346. package/.agents/schemas/lifecycle/epic.merge.blocked.schema.json +0 -14
  347. package/.agents/schemas/lifecycle/epic.merge.confirmed.schema.json +0 -17
  348. package/.agents/schemas/lifecycle/epic.merge.ready.schema.json +0 -15
  349. package/.agents/schemas/lifecycle/epic.plan.end.schema.json +0 -18
  350. package/.agents/schemas/lifecycle/epic.plan.start.schema.json +0 -12
  351. package/.agents/schemas/lifecycle/epic.snapshot.end.schema.json +0 -16
  352. package/.agents/schemas/lifecycle/epic.snapshot.start.schema.json +0 -12
  353. package/.agents/schemas/lifecycle/epic.watch.end.schema.json +0 -29
  354. package/.agents/schemas/lifecycle/epic.watch.start.schema.json +0 -16
  355. package/.agents/schemas/lifecycle/slice.end.schema.json +0 -21
  356. package/.agents/schemas/lifecycle/slice.heartbeat.schema.json +0 -20
  357. package/.agents/schemas/lifecycle/slice.start.schema.json +0 -17
  358. package/.agents/schemas/lifecycle/story.heartbeat.schema.json +0 -20
  359. package/.agents/schemas/risk-verdict.schema.json +0 -66
  360. package/.agents/schemas/story-perf-summary.schema.json +0 -73
  361. package/.agents/scripts/acceptance-spec-reconciler.js +0 -642
  362. package/.agents/scripts/analyze-execution.js +0 -444
  363. package/.agents/scripts/bookkeeping-reconcile.js +0 -117
  364. package/.agents/scripts/check-prepush-recovery.js +0 -90
  365. package/.agents/scripts/dispatcher.js +0 -295
  366. package/.agents/scripts/epic-audit-prepare.js +0 -497
  367. package/.agents/scripts/epic-audit-recheck.js +0 -274
  368. package/.agents/scripts/epic-deliver-note-intervention.js +0 -192
  369. package/.agents/scripts/epic-deliver-preflight.js +0 -462
  370. package/.agents/scripts/epic-deliver-prepare.js +0 -852
  371. package/.agents/scripts/epic-execute-record-wave.js +0 -449
  372. package/.agents/scripts/epic-plan-clarity.js +0 -211
  373. package/.agents/scripts/epic-plan-healthcheck.js +0 -581
  374. package/.agents/scripts/epic-reconcile.js +0 -625
  375. package/.agents/scripts/lib/baseline-snapshot.js +0 -979
  376. package/.agents/scripts/lib/checks/epic-merge-lock-stale.js +0 -54
  377. package/.agents/scripts/lib/checks/stale-origin-epic.js +0 -49
  378. package/.agents/scripts/lib/config/lifecycle.js +0 -40
  379. package/.agents/scripts/lib/config/preflight.js +0 -58
  380. package/.agents/scripts/lib/config/retro.js +0 -77
  381. package/.agents/scripts/lib/epic-merge-lock.js +0 -322
  382. package/.agents/scripts/lib/epic-plan-clarity.js +0 -181
  383. package/.agents/scripts/lib/epic-plan-ideation.js +0 -261
  384. package/.agents/scripts/lib/git-merge-orchestrator.js +0 -261
  385. package/.agents/scripts/lib/observability/baseline-refresh-rate.js +0 -221
  386. package/.agents/scripts/lib/observability/hook-heartbeat.js +0 -219
  387. package/.agents/scripts/lib/observability/perf-aggregator.js +0 -813
  388. package/.agents/scripts/lib/observability/perf-report-readers.js +0 -328
  389. package/.agents/scripts/lib/observability/perf-report-render.js +0 -182
  390. package/.agents/scripts/lib/orchestration/bookkeeping-outbox.js +0 -270
  391. package/.agents/scripts/lib/orchestration/context-hydration-engine.js +0 -539
  392. package/.agents/scripts/lib/orchestration/deliver-route.js +0 -173
  393. package/.agents/scripts/lib/orchestration/dispatch-engine.js +0 -134
  394. package/.agents/scripts/lib/orchestration/dispatch-pipeline.js +0 -183
  395. package/.agents/scripts/lib/orchestration/epic-cleanup.js +0 -801
  396. package/.agents/scripts/lib/orchestration/epic-deliver-lease-guard.js +0 -310
  397. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/context.js +0 -163
  398. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/creation.js +0 -140
  399. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/dag.js +0 -64
  400. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/diagnostics.js +0 -72
  401. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist-helpers.js +0 -156
  402. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist.js +0 -345
  403. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/planning-artifacts.js +0 -41
  404. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/reconcile-spawn.js +0 -86
  405. package/.agents/scripts/lib/orchestration/epic-plan-lease-guard.js +0 -391
  406. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/drain.js +0 -94
  407. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/plan-epic.js +0 -236
  408. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/risk-verdict.js +0 -105
  409. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/run-spec-phase.js +0 -307
  410. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/spec-freshness.js +0 -117
  411. package/.agents/scripts/lib/orchestration/epic-plan-state-store.js +0 -117
  412. package/.agents/scripts/lib/orchestration/epic-run-state-store.js +0 -621
  413. package/.agents/scripts/lib/orchestration/epic-runner/concurrency-gate.js +0 -186
  414. package/.agents/scripts/lib/orchestration/epic-runner/deliver-phases.js +0 -50
  415. package/.agents/scripts/lib/orchestration/epic-runner/phases/build-wave-dag.js +0 -129
  416. package/.agents/scripts/lib/orchestration/epic-runner/phases/snapshot.js +0 -103
  417. package/.agents/scripts/lib/orchestration/epic-runner/progress-reporter/composition.js +0 -267
  418. package/.agents/scripts/lib/orchestration/epic-runner/progress-reporter/signals.js +0 -210
  419. package/.agents/scripts/lib/orchestration/epic-runner/progress-reporter/transport.js +0 -238
  420. package/.agents/scripts/lib/orchestration/epic-runner/progress-signals/_bullet-format.js +0 -32
  421. package/.agents/scripts/lib/orchestration/epic-runner/progress-signals/component-drift.js +0 -203
  422. package/.agents/scripts/lib/orchestration/epic-runner/progress-signals/crap-drift.js +0 -227
  423. package/.agents/scripts/lib/orchestration/epic-runner/progress-signals/maintainability-drift.js +0 -117
  424. package/.agents/scripts/lib/orchestration/epic-runner/progress-signals/stalled-worktree.js +0 -37
  425. package/.agents/scripts/lib/orchestration/epic-runner/story-launcher.js +0 -127
  426. package/.agents/scripts/lib/orchestration/epic-runner/story-run-progress-writer.js +0 -400
  427. package/.agents/scripts/lib/orchestration/epic-runner/sub-agent-return.js +0 -276
  428. package/.agents/scripts/lib/orchestration/epic-runner/wave-scheduler.js +0 -66
  429. package/.agents/scripts/lib/orchestration/epic-spec-reconciler-apply.js +0 -789
  430. package/.agents/scripts/lib/orchestration/epic-spec-reconciler-diff.js +0 -676
  431. package/.agents/scripts/lib/orchestration/epic-spec-reconciler-discriminator.js +0 -389
  432. package/.agents/scripts/lib/orchestration/epic-spec-reconciler-format.js +0 -230
  433. package/.agents/scripts/lib/orchestration/epic-spec-reconciler-ops.js +0 -361
  434. package/.agents/scripts/lib/orchestration/error-journal.js +0 -139
  435. package/.agents/scripts/lib/orchestration/finalize/open-or-locate-pr.js +0 -306
  436. package/.agents/scripts/lib/orchestration/finalize/post-handoff-comment.js +0 -489
  437. package/.agents/scripts/lib/orchestration/finalize/sanitize-skip-ci.js +0 -88
  438. package/.agents/scripts/lib/orchestration/lifecycle/emit-slice-lifecycle.js +0 -270
  439. package/.agents/scripts/lib/orchestration/lifecycle/emit-story-dispatch-end.js +0 -147
  440. package/.agents/scripts/lib/orchestration/lifecycle/emit-story-heartbeat.js +0 -155
  441. package/.agents/scripts/lib/orchestration/lifecycle/ledger-diff.js +0 -140
  442. package/.agents/scripts/lib/orchestration/lifecycle/listeners/acceptance-reconciler.js +0 -465
  443. package/.agents/scripts/lib/orchestration/lifecycle/listeners/automerge-armer.js +0 -501
  444. package/.agents/scripts/lib/orchestration/lifecycle/listeners/automerge-predicate.js +0 -984
  445. package/.agents/scripts/lib/orchestration/lifecycle/listeners/branch-cleaner.js +0 -264
  446. package/.agents/scripts/lib/orchestration/lifecycle/listeners/checkpoint-pointer-writer.js +0 -284
  447. package/.agents/scripts/lib/orchestration/lifecycle/listeners/cleaner.js +0 -355
  448. package/.agents/scripts/lib/orchestration/lifecycle/listeners/finalizer.js +0 -673
  449. package/.agents/scripts/lib/orchestration/lifecycle/listeners/index.js +0 -378
  450. package/.agents/scripts/lib/orchestration/lifecycle/listeners/intervention-recorder.js +0 -140
  451. package/.agents/scripts/lib/orchestration/lifecycle/listeners/label-transitioner.js +0 -144
  452. package/.agents/scripts/lib/orchestration/lifecycle/listeners/merge-watcher.js +0 -665
  453. package/.agents/scripts/lib/orchestration/lifecycle/listeners/notify-dispatcher.js +0 -174
  454. package/.agents/scripts/lib/orchestration/manifest-builder.js +0 -222
  455. package/.agents/scripts/lib/orchestration/plan-persist/amend.js +0 -359
  456. package/.agents/scripts/lib/orchestration/plan-persist/delivery-mode.js +0 -127
  457. package/.agents/scripts/lib/orchestration/plan-review-routing.js +0 -63
  458. package/.agents/scripts/lib/orchestration/planning-context-budget.js +0 -213
  459. package/.agents/scripts/lib/orchestration/planning-risk.js +0 -194
  460. package/.agents/scripts/lib/orchestration/post-merge/phases/branch-cleanup.js +0 -56
  461. package/.agents/scripts/lib/orchestration/post-merge/phases/dashboard-refresh.js +0 -33
  462. package/.agents/scripts/lib/orchestration/post-merge/phases/notification.js +0 -78
  463. package/.agents/scripts/lib/orchestration/post-merge/phases/temp-cleanup.js +0 -68
  464. package/.agents/scripts/lib/orchestration/post-merge/phases/ticket-closure.js +0 -118
  465. package/.agents/scripts/lib/orchestration/post-merge/phases/worktree-reap.js +0 -396
  466. package/.agents/scripts/lib/orchestration/post-merge-pipeline.js +0 -205
  467. package/.agents/scripts/lib/orchestration/preflight-cache.js +0 -187
  468. package/.agents/scripts/lib/orchestration/recurring-failure-detector.js +0 -152
  469. package/.agents/scripts/lib/orchestration/retro/phases/checks.js +0 -94
  470. package/.agents/scripts/lib/orchestration/retro/phases/compose-body.js +0 -571
  471. package/.agents/scripts/lib/orchestration/retro/phases/gather-signals.js +0 -450
  472. package/.agents/scripts/lib/orchestration/retro/phases/post-and-mirror.js +0 -191
  473. package/.agents/scripts/lib/orchestration/retro-heuristics.js +0 -57
  474. package/.agents/scripts/lib/orchestration/retro-perf-heuristics.js +0 -275
  475. package/.agents/scripts/lib/orchestration/retro-runner.js +0 -197
  476. package/.agents/scripts/lib/orchestration/spec-renderer.js +0 -447
  477. package/.agents/scripts/lib/orchestration/story-close/auto-refresh-runner.js +0 -747
  478. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution/phases/gate-failure.js +0 -211
  479. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution/phases/pre-merge-attribution.js +0 -158
  480. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution/phases/refresh-commit.js +0 -446
  481. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution/phases/regression-projection.js +0 -297
  482. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution/phases/scope-discovery.js +0 -48
  483. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution-wiring.js +0 -67
  484. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution.js +0 -161
  485. package/.agents/scripts/lib/orchestration/story-close/baseline-friction-body.js +0 -117
  486. package/.agents/scripts/lib/orchestration/story-close/cd-out-guard.js +0 -86
  487. package/.agents/scripts/lib/orchestration/story-close/cleanup-reconciler.js +0 -147
  488. package/.agents/scripts/lib/orchestration/story-close/close-inputs.js +0 -142
  489. package/.agents/scripts/lib/orchestration/story-close/comment-bodies.js +0 -62
  490. package/.agents/scripts/lib/orchestration/story-close/merge-runner.js +0 -658
  491. package/.agents/scripts/lib/orchestration/story-close/merge-subject.js +0 -198
  492. package/.agents/scripts/lib/orchestration/story-close/phases/branch-restore.js +0 -105
  493. package/.agents/scripts/lib/orchestration/story-close/phases/close.js +0 -222
  494. package/.agents/scripts/lib/orchestration/story-close/phases/gates.js +0 -292
  495. package/.agents/scripts/lib/orchestration/story-close/phases/locked-pipeline.js +0 -270
  496. package/.agents/scripts/lib/orchestration/story-close/phases/preflight.js +0 -110
  497. package/.agents/scripts/lib/orchestration/story-close/phases/refresh.js +0 -86
  498. package/.agents/scripts/lib/orchestration/story-close/phases/timeout-blocked-emitter.js +0 -112
  499. package/.agents/scripts/lib/orchestration/story-close/phases/timeout-blocked.js +0 -157
  500. package/.agents/scripts/lib/orchestration/story-close/post-merge-close.js +0 -421
  501. package/.agents/scripts/lib/orchestration/story-close/pre-merge-validation.js +0 -302
  502. package/.agents/scripts/lib/orchestration/story-close/shared-checkout-guard.js +0 -163
  503. package/.agents/scripts/lib/orchestration/story-close-recovery.js +0 -690
  504. package/.agents/scripts/lib/orchestration/wave-marker.js +0 -28
  505. package/.agents/scripts/lib/orchestration/wave-record-io.js +0 -218
  506. package/.agents/scripts/lib/orchestration/wave-record-notifications.js +0 -145
  507. package/.agents/scripts/lib/orchestration/wave-record-projection.js +0 -212
  508. package/.agents/scripts/lib/presentation/dispatch-manifest-render.js +0 -111
  509. package/.agents/scripts/lib/presentation/manifest-builder.js +0 -239
  510. package/.agents/scripts/lib/presentation/manifest-formatter.js +0 -242
  511. package/.agents/scripts/lib/presentation/manifest-helpers.js +0 -213
  512. package/.agents/scripts/lib/presentation/manifest-persistence.js +0 -261
  513. package/.agents/scripts/lib/presentation/manifest-procedures.js +0 -55
  514. package/.agents/scripts/lib/presentation/manifest-render-waves.js +0 -306
  515. package/.agents/scripts/lib/presentation/manifest-renderer.js +0 -188
  516. package/.agents/scripts/lib/presentation/manifest-story-views.js +0 -110
  517. package/.agents/scripts/lib/push-epic-retry.js +0 -209
  518. package/.agents/scripts/lib/spec/index.js +0 -36
  519. package/.agents/scripts/lib/spec/loader.js +0 -425
  520. package/.agents/scripts/lib/spec/state.js +0 -208
  521. package/.agents/scripts/lib/story-init/blocker-validator.js +0 -68
  522. package/.agents/scripts/lib/story-init/branch-initializer.js +0 -408
  523. package/.agents/scripts/lib/story-init/context-resolver.js +0 -92
  524. package/.agents/scripts/lib/story-init/donor-precheck.js +0 -207
  525. package/.agents/scripts/lib/story-init/state-transitioner.js +0 -80
  526. package/.agents/scripts/lib/story-init/task-graph-builder.js +0 -124
  527. package/.agents/scripts/lib/story-init/transition-summary.js +0 -34
  528. package/.agents/scripts/lib/test-reserved-epic-temp-ids.js +0 -35
  529. package/.agents/scripts/lib/wave-runner/tick.js +0 -754
  530. package/.agents/scripts/lib/wave-runner/wave-runner-error.js +0 -20
  531. package/.agents/scripts/lifecycle-emit-story-dispatch.js +0 -194
  532. package/.agents/scripts/lifecycle-emit.js +0 -510
  533. package/.agents/scripts/retro-run.js +0 -218
  534. package/.agents/scripts/slice-phase.js +0 -361
  535. package/.agents/scripts/standalone-feedback-rollup.js +0 -188
  536. package/.agents/scripts/story-close.js +0 -294
  537. package/.agents/scripts/story-init.js +0 -599
  538. package/.agents/scripts/story-phase.js +0 -369
  539. package/.agents/scripts/wave-tick.js +0 -464
  540. package/.agents/skills/core/analyze-execution/SKILL.md +0 -98
  541. package/.agents/skills/core/epic-plan-consolidate/SKILL.md +0 -172
  542. package/.agents/skills/core/epic-plan-consolidate/examples.md +0 -51
  543. package/.agents/skills/core/epic-plan-decompose-author/SKILL.md +0 -441
  544. package/.agents/skills/core/epic-plan-decompose-author/examples.md +0 -47
  545. package/.agents/skills/core/epic-plan-premortem/SKILL.md +0 -146
  546. package/.agents/skills/core/epic-plan-premortem/examples.md +0 -53
  547. package/.agents/skills/core/epic-plan-spec-author/SKILL.md +0 -383
  548. package/.agents/skills/core/epic-plan-spec-author/examples.md +0 -91
  549. package/.agents/workflows/helpers/deliver-epic-reference.md +0 -547
  550. package/.agents/workflows/helpers/deliver-epic-single.md +0 -331
  551. package/.agents/workflows/helpers/deliver-epic.md +0 -998
  552. package/.agents/workflows/helpers/deliver-stories.md +0 -450
  553. package/.agents/workflows/helpers/epic-audit.md +0 -189
  554. package/.agents/workflows/helpers/epic-deliver-story.md +0 -436
  555. package/.agents/workflows/helpers/epic-testing.md +0 -125
  556. package/.agents/workflows/helpers/plan-epic-reference.md +0 -160
  557. package/.agents/workflows/helpers/plan-epic.md +0 -353
  558. package/.agents/workflows/helpers/plan-story.md +0 -251
  559. package/.agents/workflows/helpers/scope-triage-gate.md +0 -108
  560. package/.agents/workflows/helpers/single-story-deliver.md +0 -557
package/.agents/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Mandrel Framework
2
2
 
3
3
  An opinionated workflow framework for AI coding assistants built on
4
- Epic-centric GitHub orchestration. Planning, execution, and state all live natively in GitHub Issues, Labels, and Projects V2.
4
+ Story-centric GitHub orchestration. Planning, execution, and state all live natively in GitHub Issues, Labels, and Projects V2.
5
5
 
6
6
  This is the consumer README inside the distributed `.agents/` bundle. It explains what each part of the bundle is for and captures the cross-directory authoring conventions. The process narrative for
7
7
  `/plan` and `/deliver` stays in [`docs/SDLC.md`](docs/SDLC.md).
8
8
 
9
9
  The framework payload (`.agents/`) is consumed by host repos. It ships inside the [`mandrel`](https://www.npmjs.com/package/mandrel)
10
- npm package and is materialized into a consumer's `./.agents/` directory by `mandrel sync`. It carries a system prompt, a baseline rule pack, a two-tier skill library, a slash-command workflow set, and the orchestration engine that runs Epic → Story plans on GitHub.
10
+ npm package and is materialized into a consumer's `./.agents/` directory by `mandrel sync`. It carries a system prompt, a baseline rule pack, a two-tier skill library, a slash-command workflow set, and the orchestration engine that runs Story-centric plans on GitHub (`/plan` → Stories, `/deliver` → `story-*` → `main`).
11
11
 
12
12
  The framework version is the version of the installed [`mandrel`](https://www.npmjs.com/package/mandrel) npm package — run `npm ls mandrel` (or read `package.json`), not a
13
13
  count here.
@@ -96,17 +96,17 @@ The bootstrap pipeline, in order:
96
96
  3. **Project-side mutations.** Seeds `.agentrc.json` from
97
97
  [`starter-agentrc.json`](starter-agentrc.json), merges the framework's
98
98
  runtime dependencies into `package.json`, runs the install, wires the
99
- command-sync hook (the UserPromptSubmit hook that regenerates the flat
100
- `.claude/commands/` tree so every `/<command>` loads), wires the system
101
- prompt (see below), gitignores derived artefacts, and runs the
102
- quality-gates installer.
99
+ system prompt (see below), gitignores derived artefacts, and runs the
100
+ quality-gates installer. The flat `.claude/commands/` tree is generated
101
+ at install time (via `prepare`) and on every `mandrel sync`/`update`
102
+ see [`mandrel sync-commands`](#mandrel-sync-commands) below.
103
103
  4. **GitHub-side mutations.** Creates the label taxonomy, branch protection,
104
104
  and merge-method settings. Skipped with `--skip-github`. Two additional
105
105
  mutations are **opt-in** (prompted y/N, defaulting No, or passed as flags):
106
106
  - `--with-project-board` — provision the Projects V2 Status field and
107
107
  custom fields on an existing board.
108
- - `--with-issue-forms` — generate `.github/ISSUE_TEMPLATE/story.yml` and
109
- `epic.yml` from the ticket-body schema.
108
+ - `--with-issue-forms` — generate `.github/ISSUE_TEMPLATE/story.yml`
109
+ from the ticket-body schema.
110
110
 
111
111
  The bootstrap is idempotent — safe to re-run; an already-configured
112
112
  clone produces zero file mutations.
@@ -154,6 +154,7 @@ Run `mandrel --help` for a subcommand list. Each subcommand supports
154
154
  | `init` | Install + configure mandrel in the current project (cold-start). | `--assume-yes`, `--skip-github`, `--dry-run` |
155
155
  | `sync` | Re-materialize `.agents/` from the installed package payload. | `--dry-run` |
156
156
  | `sync-commands` | Regenerate `.claude/commands/` from `.agents/workflows/`. | — |
157
+ | `sync-agents` | Regenerate `.claude/agents/` from `.agents/agents/`. | — |
157
158
  | `doctor` | Run readiness checks and print per-check remedies. | — |
158
159
  | `update` | Upgrade mandrel to the newest published version. | `--dry-run`, `--install-cmd` |
159
160
  | `migrate` | Apply version-keyed migrations for a version range. | `--from`, `--to`, `--dry-run` |
@@ -175,13 +176,27 @@ mandrel explain --json # same report as JSON
175
176
  ### `mandrel sync-commands`
176
177
 
177
178
  Regenerates the flat `.claude/commands/` projection from `.agents/workflows/`.
178
- The bootstrap wires a `UserPromptSubmit` hook that runs this automatically on
179
- every Claude Code prompt submission, so manual runs are rarely needed.
179
+ Runs automatically at install time (via the `prepare` script) and as part of
180
+ `mandrel sync` / `mandrel update`; doctor's `commands-in-sync` check flags a
181
+ hand-edited or stale tree. Refuses to project when the materialized `.agents/`
182
+ tree doesn't match the running CLI's own version — run `mandrel sync` first.
180
183
 
181
184
  ```bash
182
185
  mandrel sync-commands # rebuild .claude/commands/
183
186
  ```
184
187
 
188
+ ### `mandrel sync-agents`
189
+
190
+ Regenerates the flat `.claude/agents/` projection from `.agents/agents/` —
191
+ the role-scoped boot contexts (`story-worker`, `acceptance-critic`) that
192
+ `delivery.routing.roleScopedAgents` (default `true`) dispatches spawns
193
+ against. Same delegation shape, wiring, and version-match refusal as
194
+ `sync-commands` above.
195
+
196
+ ```bash
197
+ mandrel sync-agents # rebuild .claude/agents/
198
+ ```
199
+
185
200
  ### `mandrel uninstall`
186
201
 
187
202
  Reverses a recorded install using the install ledger
@@ -226,8 +241,6 @@ read-when-relevant pattern skills use).
226
241
  **Always-load (the recommended core):**
227
242
 
228
243
  - [`instructions.md`](instructions.md) — the core agent protocol.
229
- - [`personas/engineer.md`](personas/engineer.md) — the default persona (swap in
230
- another persona when the task calls for it).
231
244
  - [`rules/security-baseline.md`](rules/security-baseline.md) — inviolable
232
245
  security MUSTs, relevant to every change.
233
246
  - [`rules/git-conventions.md`](rules/git-conventions.md) — every commit,
@@ -249,6 +262,13 @@ read-when-relevant pattern skills use).
249
262
  [`rules/test-seams.md`](rules/test-seams.md)) — when the task is in that
250
263
  domain.
251
264
  - Every `SKILL.md` under [`skills/`](skills/) — when the task hits its trigger.
265
+ A `SKILL.md` is itself split the same way: it leads with its **Policy
266
+ Capsule** (the contract, and the whole cost of activating the skill) plus
267
+ pointers into an on-demand `reference.md` sibling carrying the long-form
268
+ material. Activating a skill costs the capsule, not the essay — open a
269
+ `reference.md` section only when the task engages it. Routing does not
270
+ depend on the long-form being inline: skill descriptions live in the
271
+ generated [`skills/skills.index.json`](skills/skills.index.json).
252
272
  - [`docs/execution-reference.md`](docs/execution-reference.md) — log-level and
253
273
  token-budget reference detail lifted out of `instructions.md`.
254
274
 
@@ -282,13 +302,12 @@ For non-interactive (CI) installs, pass `--owner`, `--repo`, and
282
302
  `--assume-yes`; pass `--skip-github` to defer the remote half.
283
303
 
284
304
  After bootstrap, every Mandrel command is generated into a flat
285
- `.claude/commands/` tree by `npm run sync:commands` (the UserPromptSubmit hook
286
- keeps it current) and loads as a bare `/<command>` slash command — e.g.
287
- `/plan`, `/plan`, `/deliver`, `/audit-security`. The
288
- commands load in every Claude Code environment. The [SDLC guide](docs/SDLC.md) walks
289
- an end-to-end Epic; standalone Stories pair
290
- [`/plan`](workflows/helpers/plan-story.md) (ideadrafted Story
291
- Issue) with [`/deliver`](workflows/helpers/deliver-stories.md) (Story Issue → merged
305
+ `.claude/commands/` tree by `npm run sync:commands` (kept current at install
306
+ time and on every `mandrel sync`/`update`) and loads as a bare `/<command>`
307
+ slash command — e.g. `/plan`, `/deliver`, `/audit-security`. The commands load
308
+ in every Claude Code environment. The [SDLC guide](docs/SDLC.md) walks end-to-end planning and
309
+ delivery; Stories pair [`/plan`](workflows/plan.md) (idea → drafted Story Issue)
310
+ with [`/deliver`](workflows/deliver.md) (Story Issue merged
292
311
  PR).
293
312
 
294
313
  ---
@@ -331,9 +350,18 @@ in `runtime-deps.json`.
331
350
 
332
351
  ## Ticket Hierarchy
333
352
 
334
- Mandrel uses a **2-tier hierarchy** (Epic → Story) with inline `acceptance[]` / `verify[]` on story bodies.
353
+ Orchestration and planning are **Story-only** (`type::story`): `/plan`
354
+ persists Stories with inline `acceptance[]` / `verify[]` and a folded
355
+ `## Spec`; `/deliver` runs `helpers/deliver-story` on
356
+ `story-<id>` → PR → `main`. There is no `type::epic` / `type::task`
357
+ label and no Epic issue form — an Epic is at most an optional untyped
358
+ human umbrella issue outside orchestration. There is no Epic wave /
359
+ `epic/<id>` integration branch. Tickets that still carry an `Epic: #N`
360
+ footer are refused by `/deliver` and must be closed or re-planned as
361
+ v2 Stories.
335
362
 
336
- See [`docs/SDLC.md` § Ticket hierarchy](docs/SDLC.md) for the diagram and execution-model implications.
363
+ See [`docs/SDLC.md`](docs/SDLC.md) and [`instructions.md` § 5.D](instructions.md)
364
+ for the execution-model contract.
337
365
 
338
366
  ---
339
367
 
@@ -345,7 +373,7 @@ See [`docs/SDLC.md` § Ticket hierarchy](docs/SDLC.md) for the diagram and execu
345
373
  | [`docs/SDLC.md`](docs/SDLC.md) | Operator process for `/plan` and `/deliver`. |
346
374
  | [`starter-agentrc.json`](starter-agentrc.json) | Bootstrap delta-seed copied to the consumer repo root as `.agentrc.json`. |
347
375
  | [`agentrc-reference.json`](docs/agentrc-reference.json) | Exhaustive editor reference enumerating every schema key with its framework default. |
348
- | [`personas/`](personas/) | Role-specific behavior packs selected by task persona or explicit user instruction. |
376
+ | [`agents/`](agents/) | Optional role-scoped spawn boot contexts (`delivery.routing.roleScopedAgents`). |
349
377
  | [`rules/`](rules/) | Domain-agnostic coding, security, testing, shell, git, and workflow rules. |
350
378
  | [`skills/core/`](skills/core/) | Universal process skills such as debugging, TDD, security, documentation, and code review. |
351
379
  | [`skills/stack/`](skills/stack/) | Stack-specific guardrails for frameworks, services, and testing tools. |
@@ -369,7 +397,7 @@ See [`docs/SDLC.md` § Ticket hierarchy](docs/SDLC.md) for the diagram and execu
369
397
  | Quality-gate runbooks (CRAP, MI, lint, friction) plus the baseline envelope, component model, and writer/reader contract | [`.agents/docs/quality-gates.md`](docs/quality-gates.md) |
370
398
  | Slash-command workflow definitions | [`workflows/`](workflows/) |
371
399
  | Render the signals span-tree (debug helper) | [`workflows/helpers/signals.md`](workflows/helpers/signals.md) |
372
- | Persona behavior packs | [`personas/`](personas/) |
400
+ | Role-scoped spawn boot contexts | [`agents/`](agents/) |
373
401
  | Domain-agnostic baseline rules | [`rules/`](rules/) |
374
402
  | Skill library (core process + stack guardrails) | [`skills/core/`](skills/core/) · [`skills/stack/`](skills/stack/) |
375
403
  | Decision rule: should this be a Skill or a Script? | [§ When to use a Skill vs a Script](#when-to-use-a-skill-vs-a-script) |
@@ -402,9 +430,9 @@ rule:
402
430
  > GitHub I/O, label transitions, JSON validators, NDJSON readers,
403
431
  > diff-vs-baseline gates, template renderers.
404
432
  >
405
- > **Prompt + judgment → make it a Skill.** Examples: composing a Tech
406
- > Spec from an Epic body, classifying friction signals from a failed shell
407
- > command, decomposing a Tech Spec into a ticket hierarchy.
433
+ > **Prompt + judgment → make it a Skill.** Examples: composing a Story's
434
+ > `## Spec` from planning context, classifying friction signals from a
435
+ > failed shell command, decomposing a Spec into Stories.
408
436
 
409
437
  The rule is two-sided on purpose. "Has an LLM step adjacent" is *not*
410
438
  the signal — many deterministic scripts emit a JSON envelope that a host
@@ -418,17 +446,18 @@ The collapsed plan pipeline (`plan-context.js` → author → `plan-persist.js`,
418
446
  Epic #4474) is a **split**: the deterministic halves stay as scripts, the
419
447
  judgment middle moves to a Skill.
420
448
 
421
- - **`--emit-context`** (script half) — fetches the Epic body (which
422
- carries the folded Tech Spec sections), scrapes project docs, emits a
423
- JSON envelope. Parseable in, parseable out. Stays a script.
449
+ - **`--emit-context`** (script half) — fetches the seed/source tickets
450
+ and scrapes project docs, emits a JSON envelope. Parseable in,
451
+ parseable out. Stays a script.
424
452
  - **Authoring middle** (Skill half) — given the envelope, author the
425
- ticket hierarchy JSON. Pure prompt + judgment. Migrates to a Skill
453
+ Story JSON. Pure prompt + judgment. Migrates to a Skill
426
454
  under `.agents/skills/core/` so it ships with declarative
427
455
  `allowed_tools` and a smoke test rather than bespoke prompt-template
428
456
  plumbing inside a Node module.
429
457
  - **Persist half** (script half) — given the author-provided tickets
430
- JSON, validate against the schema, create GitHub issues, flip the Epic
431
- label. Deterministic GitHub I/O + schema validation. Stays a script.
458
+ JSON, validate against the schema, create the `type::story` issue(s)
459
+ and label them `agent::ready`. Deterministic GitHub I/O + schema
460
+ validation. Stays a script.
432
461
 
433
462
  The split codifies the "host LLM authors directly" pattern explicitly:
434
463
  the prompt+judgment step gets a `description`, an
@@ -518,8 +547,8 @@ comment) is the cross-runtime contract.
518
547
  The SDK barrel is `scripts/lib/orchestration/index.js`; its exports are
519
548
  the source of truth for the public in-process surface. Key families
520
549
  include dispatch (`dispatch-engine.js`, `manifest-builder.js`), context
521
- hydration, planning state, label transitions, Epic runner phases,
522
- Story-close internals, retro heuristics, and structured error capture.
550
+ hydration, planning state, label transitions, Story-close internals,
551
+ retro proposals, and structured error capture.
523
552
 
524
553
  ### GitHub authentication
525
554
 
@@ -543,7 +572,7 @@ sessions, `gh auth login` is sufficient.
543
572
  ## Self-Healing Checks
544
573
 
545
574
  `scripts/lib/checks/` is the discovery-based registry of named checks
546
- consumed by preflight guards (`/deliver`, `/story-close`, `npm test`),
575
+ consumed by preflight guards (`/deliver`, `single-story-close`, `npm test`),
547
576
  the `diagnose.js` ad-hoc viewer, and the retro surface. Use one check per
548
577
  file. The runner (`index.js`) loads checks at process start and filters by
549
578
  scope at each call site.
@@ -552,9 +581,9 @@ Each check module default-exports an object with this shape:
552
581
 
553
582
  ```js
554
583
  export default {
555
- id: 'stale-origin-epic',
584
+ id: 'stale-origin-main',
556
585
  severity: 'blocker', // 'blocker' | 'warning' | 'info'
557
- scope: ['epic-deliver', 'story-close', 'retro'],
586
+ scope: ['deliver', 'single-story-close', 'retro'],
558
587
  autoCorrect: 'refuse-and-print', // 'auto' | 'refuse-and-print'
559
588
  detect(state) {
560
589
  return null;
@@ -572,7 +601,7 @@ environment inside the check. A finding includes `id`, `severity`,
572
601
  `autoCorrectable`.
573
602
 
574
603
  `autoCorrect: 'auto'` means the fix is local, bounded, and reversible.
575
- Auto-fixes must not push to remotes, commit to `epic/*` or `main`, amend
604
+ Auto-fixes must not push to remotes, commit to `main`, amend
576
605
  history, recursively delete outside `.worktrees/<id>/`, write GitHub
577
606
  state, or read secret values. Anything requiring those operations must be
578
607
  `refuse-and-print` with a human-run `fixCommand`.
@@ -636,21 +665,19 @@ follow-up **Epic #1943**.
636
665
 
637
666
  `schemas/` contains JSON Schema draft 2020-12 contracts consumed by the
638
667
  orchestration layer. Each schema describes one structured artefact:
639
- configuration, structural Epic specs, runtime reports, dispatch
640
- manifests, or persisted state. Where a runtime AJV schema also exists,
641
- the JSON file is a mirror kept in sync by a drift test.
668
+ configuration, runtime reports, dispatch manifests, or persisted state.
669
+ Where a runtime AJV schema also exists, the JSON file is a mirror kept
670
+ in sync by a drift test.
642
671
 
643
672
  Important schema groups:
644
673
 
645
- - Structural specs: `epic-spec.schema.json` for the declarative
646
- `epic.yaml` plus reconciler flow.
647
674
  - Configuration: `agentrc.schema.json`, mirrored from the runtime config
648
675
  schemas.
676
+ - Story / signal contracts: `signal-event.schema.json`, acceptance-eval
677
+ verdicts, and related runtime envelopes.
649
678
  - Runtime reports: audit results, CRAP and maintainability reports,
650
679
  performance summaries, friction and signal events, and validation
651
680
  evidence.
652
- - Dispatch: `dispatch-manifest.json`, the per-Epic dispatch manifest
653
- schema written by `dispatcher.js`.
654
681
 
655
682
  Schema conventions:
656
683
 
@@ -666,18 +693,13 @@ Schema conventions:
666
693
 
667
694
  ## Code review providers (pluggable chain)
668
695
 
669
- `runCodeReview()` (invoked at the end of `helpers/epic-deliver-story`,
670
- `helpers/single-story-deliver`, and `/deliver`'s `delivery.code-review`
671
- state) loads its review backend through a pluggable registry. Two configuration shapes are supported:
672
-
673
- - **Legacy single provider** — `delivery.codeReview.provider: "native"`
674
- (default), `"codex"`, or `"security-review"`. Returns one adapter; one
675
- set of findings; one structured comment.
676
- - **Provider chain** (Story #2871) — `delivery.codeReview.providers: []`
677
- iterates a declared list of entries, merges every inline adapter's
678
- `Finding[]` in declaration order, and appends a non-blocking
679
- "Manual Review Suggestions" section for any manual-prompt entries
680
- that contributed text. When both fields are set, `providers` wins.
696
+ `runCodeReview()` (invoked from `helpers/deliver-story` and `/deliver`'s
697
+ risk-routed ceremony) loads its review backend through a pluggable registry.
698
+ Configure a provider chain via `delivery.codeReview.providers` an array
699
+ of entries iterated in declaration order. Inline adapters merge their
700
+ `Finding[]`; manual-prompt entries append a non-blocking
701
+ "Manual Review Suggestions" section. When `providers` is unset or empty,
702
+ the factory defaults to `[{ name: "native" }]`.
681
703
 
682
704
  ```json
683
705
  {
@@ -685,10 +707,10 @@ state) loads its review backend through a pluggable registry. Two configuration
685
707
  "codeReview": {
686
708
  "providers": [
687
709
  { "name": "native" },
688
- { "name": "security-review", "scopes": ["epic"], "optional": true },
710
+ { "name": "security-review", "scopes": ["story"], "optional": true },
689
711
  {
690
712
  "name": "ultrareview",
691
- "scopes": ["epic"],
713
+ "scopes": ["story"],
692
714
  "manualPrompt": true,
693
715
  "when": { "label": "risk::high" }
694
716
  }
@@ -733,9 +755,9 @@ chain, `security-review`, and `ultrareview` were added in Story #2871.
733
755
 
734
756
  ## Feedback loop — verification-results auto-graduation
735
757
 
736
- When the Epic finalize listener runs, non-blocking findings (severity
737
- `high`, `medium`, or `suggestion`) that survived merge are auto-graduated
738
- into follow-up issues in a SINGLE pass over the unified
758
+ When a Story (or plan-run) finalize path runs, non-blocking findings
759
+ (severity `high`, `medium`, or `suggestion`) that survived merge are
760
+ auto-graduated into follow-up issues in a SINGLE pass over the unified
739
761
  `verification-results` structured comment (Story #4411 folded the former
740
762
  `code-review` and `audit-results` comments into one), routed by source
741
763
  classification into the framework repo or the consumer repo. The toggle
@@ -759,7 +781,7 @@ stabilization window), set the toggle to `false` in your root
759
781
  ```
760
782
 
761
783
  When disabled, the listener short-circuits and leaves the
762
- `verification-results` comment on the Epic ticket untouched. Re-enabling
784
+ `verification-results` comment on the Story ticket untouched. Re-enabling
763
785
  the toggle is safe: the graduator embeds a content-derived idempotency
764
786
  marker in each filed issue body, so re-runs skip findings that already
765
787
  have an issue.
@@ -776,15 +798,16 @@ each with different cost/portability trade-offs:
776
798
 
777
799
  | Strategy | When to use | Cold-start cost | Notes |
778
800
  | -------------- | ---------------------------------------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------- |
779
- | `per-worktree` | Default-safeno host setup, no symlink semantics to worry about. | Full `npm ci` per Story. | Slowest. Each worktree gets an independent `node_modules`. |
801
+ | `clone` | **Shipped default on darwin/linux** copy-on-write clone of donor `node_modules`. | Near-zero on APFS/reflink FS. | Falls back to `per-worktree` on unsupported filesystems or cross-volume clones. |
802
+ | `per-worktree` | Default on Windows; also the safe fallback everywhere. | Full `npm ci` per Story. | Each worktree gets an independent `node_modules`. |
780
803
  | `symlink` | npm/yarn repos that want the fast path. **Opt-in.** | Near-zero. | Junctions a single donor `node_modules` into each worktree. Refuses on Windows unless explicitly opted in. |
781
- | `pnpm-store` | pnpm repos. **Shipped consumer default in `agentrc-reference.json`.** | Fast (store-backed). | Runs `pnpm install --frozen-lockfile` against the shared content-addressable store. |
804
+ | `pnpm-store` | pnpm repos. **Opt-in.** | Fast (store-backed). | Runs `pnpm install --frozen-lockfile` against the shared content-addressable store. |
782
805
 
783
806
  The **shipped consumer default in
784
- [`.agents/docs/agentrc-reference.json`](./docs/agentrc-reference.json) remains
785
- `pnpm-store`**. Repos that do not use pnpm should opt in to `symlink`
786
- explicitly in their root `.agentrc.json`; this repo dogfoods that
787
- configuration.
807
+ [`.agents/docs/agentrc-reference.json`](./docs/agentrc-reference.json) is
808
+ `clone`** (Windows resolves to `per-worktree` via the platform-aware
809
+ accessor). Repos that use pnpm or want symlink semantics should set
810
+ `nodeModulesStrategy` explicitly in their root `.agentrc.json`.
788
811
 
789
812
  ### Symlink opt-in (npm / yarn)
790
813
 
@@ -809,13 +832,13 @@ To opt in, set three fields on `delivery.worktreeIsolation` in your root
809
832
  - **`primeFromPath`** — relative path (from the repo root) to the donor
810
833
  worktree whose `node_modules/` is reused. `"."` means the root
811
834
  checkout, which must already have `node_modules/` populated before a
812
- Story initializes. `story-init.js` enforces this with a pre-check.
835
+ Story initializes. `single-story-init.js` enforces this with a pre-check.
813
836
  - **`allowSymlinkOnWindows`** — required on Windows. The strategy uses
814
837
  junctions (no admin rights needed) on Windows when this is `true`; it
815
838
  refuses with an explanatory error otherwise, because symlink semantics
816
839
  vary by Windows version.
817
840
 
818
- Once these are set, `story-init.js` skips `npm ci` in the worktree and
841
+ Once these are set, `single-story-init.js` skips `npm ci` in the worktree and
819
842
  junctions/symlinks `node_modules` from the donor — typical cold-start
820
843
  falls from minutes to under a second.
821
844
 
@@ -823,13 +846,12 @@ falls from minutes to under a second.
823
846
 
824
847
  ## Multi-developer coordination
825
848
 
826
- Two operators can drive the same repository at once — one running
827
- `/deliver <id>`, another running `/single-story-deliver <id>`, or two
828
- operators on the same Epic from separate clones. The framework keeps those
849
+ Two operators can drive the same repository at once — for example, two
850
+ `/deliver <storyId>` runs from separate clones. The framework keeps those
829
851
  runs from clobbering one another with **two distinct coordination layers**.
830
852
  They solve different problems and must not be confused:
831
853
 
832
- - **Filesystem locks** (`epic-merge-lock`, `sweep-lock`) serialise work
854
+ - **Filesystem locks** (`sweep-lock`) serialise work
833
855
  **within a single machine/clone**. They are keyed on local process PIDs
834
856
  and live under `.git/` (or a local lockfile path), so they do **not**
835
857
  coordinate across clones. See
@@ -845,8 +867,16 @@ The lease primitive lives in
845
867
  [`scripts/lib/orchestration/ticket-lease.js`](scripts/lib/orchestration/ticket-lease.js).
846
868
  Rather than inventing a new state column, the lease rides the ticket's
847
869
  existing **assignees** field: the single assignee *is* the lease owner.
848
- Liveness is decided by the owner's most-recent `story.heartbeat` timestamp
849
- compared against a configurable TTL (`delivery.lease.ttlMs`).
870
+ Liveness is decided by the owner's last-heartbeat timestamp compared against
871
+ a configurable TTL (`delivery.lease.ttlMs`).
872
+
873
+ > **In practice the lease always fails closed.** There is no live heartbeat
874
+ > source — the `story.heartbeat` emitter was structurally inert and has been
875
+ > deleted (A22) — so every guard anchors the owner's heartbeat to *now*,
876
+ > making **any** foreign claim read as live. The **stale-claim reclaim** row
877
+ > below is therefore unreachable in normal operation: a stranded claim is
878
+ > cleared with `--steal`, never by TTL expiry. The TTL and the reclaim branch
879
+ > remain as a seam for a caller that supplies its own `heartbeatAt`.
850
880
 
851
881
  The model has five behaviours, all expressed through `acquireLease` /
852
882
  `releaseLease`:
@@ -856,7 +886,7 @@ The model has five behaviours, all expressed through `acquireLease` /
856
886
  | **Acquire by self-assign** | The ticket is unassigned. | The operator is written to `assignees`; the run proceeds (`reason: 'unclaimed'`). |
857
887
  | **Re-affirm a self-held claim** | The operator already holds the lease. | No write; the run proceeds (`reason: 'already-held'`). |
858
888
  | **Refuse-if-foreign** | A *different* operator holds the lease and their heartbeat is within the TTL (the claim is **live**). | The acquire **fails closed** — the run refuses to start and names the current owner so you know who to coordinate with (`reason: 'held'`). |
859
- | **Stale-claim reclaim** | A foreign claim exists but its heartbeat is older than the TTL (or the owner never heartbeated). | The lease is automatically reassigned to the operator (`reason: 'reclaimed'`). An abandoned claim never wedges the ticket. |
889
+ | **Stale-claim reclaim** *(unreachable — see above)* | A foreign claim exists but the caller supplied a `heartbeatAt` older than the TTL. | The lease is reassigned to the operator (`reason: 'reclaimed'`). No shipped caller supplies one, so this never fires today. |
860
890
  | **`--steal` override** | A foreign claim is *live* and the operator passes `--steal`. | The live claim is forcibly transferred (`reason: 'stolen'`). This is the **only** way past a live foreign claim. |
861
891
 
862
892
  On a clean completion the holder **releases** the lease (clears the
@@ -866,28 +896,15 @@ yanks the claim back from whoever legitimately took over.
866
896
 
867
897
  **Where it's wired:**
868
898
 
869
- - **`/deliver`** acquires the lease on the **Epic** ticket during its
870
- prepare phase, before any mutating git work
871
- ([`epic-deliver-lease-guard.js`](scripts/lib/orchestration/epic-deliver-lease-guard.js)).
872
- A live foreign claim refuses the run; pass `--steal` to override and
873
- `--as <handle>` to claim under a specific identity. The operator is
874
- resolved from `--as`, then `github.operatorHandle`, then
875
- `git config user.email`; when none resolve, the lease step is skipped
876
- (the checkout-safety guard still runs).
877
- - **`/single-story-deliver`** acquires the lease on the **Story** ticket at
878
- init and releases it at close
899
+ - **`/deliver`** runs each Story through `helpers/deliver-story`, which
900
+ acquires the lease on the **Story** ticket at init and releases it at close
879
901
  ([`single-story-lease-guard.js`](scripts/lib/orchestration/single-story-lease-guard.js)).
880
- The standalone path requires `github.operatorHandle` to be set — without
881
- an operator identity the lease has no owner to record.
882
- - **`/plan`** acquires the lease on the **Epic** ticket before Phase 7
883
- (spec) and releases it after Phase 8 (decompose)
884
- ([`epic-plan-lease-guard.js`](scripts/lib/orchestration/epic-plan-lease-guard.js)).
885
- Because planning emits no `story.heartbeat` (heartbeats are a
886
- delivery-time signal), the plan path has no live-heartbeat source and so
887
- **fails closed**: any foreign assignee is treated as a live claim and
888
- refuses the run unless `--steal` transfers it. Unassigned or self-held
889
- Epics proceed. When `github.operatorHandle` is unset the lease cannot be
890
- keyed and the preflight degrades to a no-op.
902
+ A live foreign claim refuses the run; pass `--steal` to override. The Story
903
+ path requires `github.operatorHandle` to be set without an operator identity
904
+ the lease has no owner to record.
905
+ - **`/plan`** does not take a planning lease on an Epic ticket. Planning is a
906
+ short authoring ceremony over Stories; concurrent `/plan` runs coordinate
907
+ via ordinary GitHub issue creation, not an Epic lease guard.
891
908
 
892
909
  ---
893
910
 
@@ -4,8 +4,9 @@ description: >-
4
4
  Role-scoped boot context for a maker-blind acceptance critic. Booted on its
5
5
  own system prompt (no CLAUDE.md / instructions.md closure). Scores a delivered
6
6
  diff against the Story's acceptance-criteria cluster and emits the verdict
7
- schema — without seeing the maker's self-assessment. INERT under M7-A no
8
- workflow references this agent type yet (that is M7-B).
7
+ schema — without seeing the maker's self-assessment. Live under M7-B
8
+ helpers/deliver-story Step 1a dispatches subagent_type: acceptance-critic
9
+ on the default risk-routed path.
9
10
  ---
10
11
 
11
12
  # acceptance-critic — maker-blind acceptance evaluation
@@ -34,8 +35,11 @@ file they authored. You grade the **work product**, not the homework the maker
34
35
  turned in about it. Your only trusted inputs are:
35
36
 
36
37
  - the working **diff** (`git diff origin/<baseBranch>...HEAD`),
37
- - the Story's inline `acceptance[]` and `verify[]` arrays (from the
38
- `story-init` structured comment: `context.acceptance` / `context.verify`),
38
+ - the Story's inline `acceptance[]` and `verify[]` arrays, read from the
39
+ **Story body itself** (`gh issue view <storyId> --json body`) — its `##
40
+ Acceptance` / `## Verify` sections are the SSOT. The `story-init` structured
41
+ comment does not carry them: it reports init state (`workCwd`,
42
+ `dependenciesInstalled`, `remoteVerified`, …) and nothing else.
39
43
  - the **actual output** of the `verify[]` commands you run yourself.
40
44
 
41
45
  Treat the implementation reasoning as untrusted. Score each criterion afresh
@@ -66,12 +70,10 @@ For each acceptance item in your cluster:
66
70
  a passing run records an evidence entry in the keyspace close consults:
67
71
 
68
72
  ```bash
69
- # Epic-attached Story:
70
73
  node <main-repo>/.agents/scripts/evidence-gate.js \
71
- --epic-id <epicId> --scope-id <storyId> --gate lint \
74
+ --standalone --scope-id <storyId> --gate lint \
72
75
  --worktree <worktree> -- npm run lint
73
76
 
74
- # Standalone Story (no parent Epic): use --standalone, omit --epic-id.
75
77
  node <main-repo>/.agents/scripts/evidence-gate.js \
76
78
  --standalone --scope-id <storyId> --gate typecheck \
77
79
  --worktree <worktree> -- <resolved typecheck command>