mandrel 2.36.0 → 2.38.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 (225) hide show
  1. package/.agents/README.md +16 -16
  2. package/.agents/agents/plan-critic.md +1 -1
  3. package/.agents/docs/SDLC.md +40 -40
  4. package/.agents/docs/configuration.md +41 -16
  5. package/.agents/docs/execution-reference.md +3 -3
  6. package/.agents/docs/quality-gates.md +2 -2
  7. package/.agents/docs/workflows.md +6 -6
  8. package/.agents/instructions.md +5 -5
  9. package/.agents/rules/changelog-style.md +3 -3
  10. package/.agents/rules/ci-remediation.md +1 -1
  11. package/.agents/rules/git-conventions-reference.md +4 -4
  12. package/.agents/rules/testing-standards.md +56 -0
  13. package/.agents/schemas/agentrc.schema.json +9 -9
  14. package/.agents/schemas/story-deliver-terminal.schema.json +2 -2
  15. package/.agents/schemas/validation-evidence.schema.json +1 -1
  16. package/.agents/scripts/acceptance-eval.js +1 -1
  17. package/.agents/scripts/apply-quality-bootstrap.js +1 -1
  18. package/.agents/scripts/audit-to-stories.js +2 -2
  19. package/.agents/scripts/boot-sweep.js +7 -1
  20. package/.agents/scripts/check-context-budget.js +195 -103
  21. package/.agents/scripts/check-cyclomatic.js +112 -42
  22. package/.agents/scripts/check-doc-links.js +32 -4
  23. package/.agents/scripts/check-generated-validator.js +202 -0
  24. package/.agents/scripts/check-lifecycle-lint.js +2 -68
  25. package/.agents/scripts/check-schema-references.js +2 -28
  26. package/.agents/scripts/check-test-temp-hygiene.js +1 -1
  27. package/.agents/scripts/check-workflow-cli-lint.js +1 -1
  28. package/.agents/scripts/deliver-light.js +10 -10
  29. package/.agents/scripts/deliver-recover.js +1 -1
  30. package/.agents/scripts/drain-pending-cleanup.js +19 -2
  31. package/.agents/scripts/evidence-gate.js +1 -1
  32. package/.agents/scripts/generate-workflows-doc.js +1 -1
  33. package/.agents/scripts/lib/audit-suite/selector.js +1 -1
  34. package/.agents/scripts/lib/audit-to-stories/audit-label-taxonomy.js +1 -1
  35. package/.agents/scripts/lib/audit-to-stories/build-story-body.js +1 -1
  36. package/.agents/scripts/lib/audit-to-stories/seed-from-findings.js +5 -5
  37. package/.agents/scripts/lib/audit-to-stories/wire-dependencies.js +1 -1
  38. package/.agents/scripts/lib/baselines/components.js +32 -2
  39. package/.agents/scripts/lib/baselines/env-overrides.js +1 -1
  40. package/.agents/scripts/lib/bdd-runner-detect.js +1 -1
  41. package/.agents/scripts/lib/bdd-scenario-budget.js +1 -1
  42. package/.agents/scripts/lib/bdd-scenario-scanner.js +3 -3
  43. package/.agents/scripts/lib/bdd-step-index.js +1 -1
  44. package/.agents/scripts/lib/bootstrap/branch-protection.js +2 -2
  45. package/.agents/scripts/lib/bootstrap/commit-push.js +2 -2
  46. package/.agents/scripts/lib/bootstrap/install-ledger.js +1 -1
  47. package/.agents/scripts/lib/bootstrap/issue-forms-template.js +1 -1
  48. package/.agents/scripts/lib/bootstrap/prompt.js +1 -1
  49. package/.agents/scripts/lib/bootstrap/quality-bootstrap.js +2 -2
  50. package/.agents/scripts/lib/checks/core-bare-clean.js +1 -1
  51. package/.agents/scripts/lib/checks/loop-health.js +1 -1
  52. package/.agents/scripts/lib/checks/story-init-not-backgrounded.js +1 -1
  53. package/.agents/scripts/lib/cli-args.js +1 -3
  54. package/.agents/scripts/lib/close-validation/gates.js +1 -1
  55. package/.agents/scripts/lib/close-validation/process.js +1 -1
  56. package/.agents/scripts/lib/command-header.js +1 -1
  57. package/.agents/scripts/lib/config/delivery-routing.js +1 -1
  58. package/.agents/scripts/lib/config/explain.js +1 -1
  59. package/.agents/scripts/lib/config/runners.js +2 -2
  60. package/.agents/scripts/lib/config/runtime.js +1 -1
  61. package/.agents/scripts/lib/config/sync-agentrc.js +1 -1
  62. package/.agents/scripts/lib/config/temp-paths.js +2 -2
  63. package/.agents/scripts/lib/config-settings-schema-delivery.js +3 -3
  64. package/.agents/scripts/lib/config-settings-schema-quality.js +6 -6
  65. package/.agents/scripts/lib/config-settings-schema.js +49 -9
  66. package/.agents/scripts/lib/coverage-baseline.js +2 -2
  67. package/.agents/scripts/lib/cpu-pool.js +90 -10
  68. package/.agents/scripts/lib/crap-utils.js +6 -2
  69. package/.agents/scripts/lib/cyclomatic-ceiling.js +28 -6
  70. package/.agents/scripts/lib/cyclomatic-scope.js +144 -0
  71. package/.agents/scripts/lib/dependency-version.js +86 -0
  72. package/.agents/scripts/lib/duplicate-search.js +2 -2
  73. package/.agents/scripts/lib/errors/index.js +1 -1
  74. package/.agents/scripts/lib/feedback-loop/graduator-core.js +2 -2
  75. package/.agents/scripts/lib/feedback-loop/prior-feedback-fetcher.js +5 -5
  76. package/.agents/scripts/lib/feedback-loop/retro-proposals-graduator.js +2 -2
  77. package/.agents/scripts/lib/findings/classify-finding.js +1 -1
  78. package/.agents/scripts/lib/findings/promote-finding.js +12 -12
  79. package/.agents/scripts/lib/findings/route-finding.js +2 -2
  80. package/.agents/scripts/lib/generated/agentrc-validator.js +16 -0
  81. package/.agents/scripts/lib/git-branch-lifecycle.js +2 -2
  82. package/.agents/scripts/lib/install-cmd-parser.js +1 -1
  83. package/.agents/scripts/lib/knip-entry-sync.js +1 -57
  84. package/.agents/scripts/lib/label-constants.js +2 -2
  85. package/.agents/scripts/lib/label-taxonomy.js +1 -1
  86. package/.agents/scripts/lib/maintainability-utils.js +108 -10
  87. package/.agents/scripts/lib/observability/source-classifier.js +1 -0
  88. package/.agents/scripts/lib/onboard/init-tail.js +4 -4
  89. package/.agents/scripts/lib/onboard/scaffold-docs.js +2 -2
  90. package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +1 -1
  91. package/.agents/scripts/lib/orchestration/code-review.js +4 -4
  92. package/.agents/scripts/lib/orchestration/complexity-gate.js +5 -5
  93. package/.agents/scripts/lib/orchestration/deliver-recover.js +3 -3
  94. package/.agents/scripts/lib/orchestration/docs-digest.js +3 -3
  95. package/.agents/scripts/lib/orchestration/lease-guard-shared.js +2 -2
  96. package/.agents/scripts/lib/orchestration/light-backstop.js +1 -1
  97. package/.agents/scripts/lib/orchestration/light-escalation.js +6 -6
  98. package/.agents/scripts/lib/orchestration/light-suitability.js +19 -19
  99. package/.agents/scripts/lib/orchestration/plan-context.js +4 -4
  100. package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +2 -2
  101. package/.agents/scripts/lib/orchestration/plan-critics-evaluate.js +2 -2
  102. package/.agents/scripts/lib/orchestration/plan-metrics.js +1 -1
  103. package/.agents/scripts/lib/orchestration/plan-persist/persist-helpers.js +1 -1
  104. package/.agents/scripts/lib/orchestration/plan-persist/plan-context-source.js +3 -3
  105. package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +6 -6
  106. package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +86 -25
  107. package/.agents/scripts/lib/orchestration/plan-persist/summary.js +3 -3
  108. package/.agents/scripts/lib/orchestration/plan-persist/supersede-ops.js +6 -6
  109. package/.agents/scripts/lib/orchestration/planning/authoring-context.js +7 -7
  110. package/.agents/scripts/lib/orchestration/planning/decomposer-context.js +1 -1
  111. package/.agents/scripts/lib/orchestration/planning/memory-pool-advisory.js +3 -3
  112. package/.agents/scripts/lib/orchestration/pr-watch.js +1 -30
  113. package/.agents/scripts/lib/orchestration/reassert-status-column.js +2 -2
  114. package/.agents/scripts/lib/orchestration/remote-verifier.js +2 -2
  115. package/.agents/scripts/lib/orchestration/resolve-stories.js +4 -4
  116. package/.agents/scripts/lib/orchestration/review-providers/codex.js +3 -3
  117. package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +1 -1
  118. package/.agents/scripts/lib/orchestration/review-providers/native.js +9 -2
  119. package/.agents/scripts/lib/orchestration/review-providers/review-depth.js +2 -2
  120. package/.agents/scripts/lib/orchestration/review-providers/security-review.js +3 -3
  121. package/.agents/scripts/lib/orchestration/run-epilogue.js +2 -2
  122. package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +2 -2
  123. package/.agents/scripts/lib/orchestration/single-story-close/phases/conventional-subject.js +1 -1
  124. package/.agents/scripts/lib/orchestration/single-story-close/phases/normalize-pr-title.js +5 -1
  125. package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +52 -1
  126. package/.agents/scripts/lib/orchestration/single-story-close/phases/review-block.js +1 -1
  127. package/.agents/scripts/lib/orchestration/single-story-close/phases/wrong-tree-guard.js +3 -3
  128. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +2 -2
  129. package/.agents/scripts/lib/orchestration/single-story-lease-guard.js +1 -1
  130. package/.agents/scripts/lib/orchestration/story-close/format-autofix.js +2 -5
  131. package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +14 -12
  132. package/.agents/scripts/lib/orchestration/story-follow-ups.js +1 -1
  133. package/.agents/scripts/lib/orchestration/ticket-lease.js +34 -9
  134. package/.agents/scripts/lib/orchestration/ticket-validator.js +1 -1
  135. package/.agents/scripts/lib/orchestration/ticketing/reads.js +6 -4
  136. package/.agents/scripts/lib/plan-phase-cleanup.js +1 -1
  137. package/.agents/scripts/lib/preflight-runner.js +3 -3
  138. package/.agents/scripts/lib/qa/qa-session.js +1 -1
  139. package/.agents/scripts/lib/runtime-deps/manifest.js +1 -7
  140. package/.agents/scripts/lib/runtime-deps/scan-imports.js +3 -58
  141. package/.agents/scripts/lib/signals/schema.js +1 -1
  142. package/.agents/scripts/lib/single-story-sweep/sweep-lock.js +284 -25
  143. package/.agents/scripts/lib/skills/walk-skill-files.js +1 -1
  144. package/.agents/scripts/lib/source-text/strip-js-comments.js +115 -0
  145. package/.agents/scripts/lib/story-adjacency.js +2 -2
  146. package/.agents/scripts/lib/templates/decomposer-prompts.js +1 -1
  147. package/.agents/scripts/lib/test-isolate/runner.js +3 -3
  148. package/.agents/scripts/lib/test-runner-contract.js +14 -6
  149. package/.agents/scripts/lib/test-tiers.js +135 -18
  150. package/.agents/scripts/lib/ticket-body-sections.js +1 -1
  151. package/.agents/scripts/lib/transpile.js +16 -3
  152. package/.agents/scripts/lib/util/concurrent-map.js +1 -1
  153. package/.agents/scripts/lib/util/parse-id-list.js +1 -1
  154. package/.agents/scripts/lib/wave-runner/live-probe.js +4 -4
  155. package/.agents/scripts/lib/wave-runner/ready-set.js +1 -1
  156. package/.agents/scripts/lib/workflow-closure.js +1 -1
  157. package/.agents/scripts/lib/worktree/lifecycle/pending-cleanup.js +170 -32
  158. package/.agents/scripts/lib/worktree/node-modules-strategy.js +2 -5
  159. package/.agents/scripts/lint-issue-body.js +3 -3
  160. package/.agents/scripts/plan-context.js +4 -4
  161. package/.agents/scripts/plan-critics.js +2 -2
  162. package/.agents/scripts/plan-persist.js +2 -2
  163. package/.agents/scripts/plan-run-epilogue.js +2 -2
  164. package/.agents/scripts/pr-watch-with-update.js +305 -137
  165. package/.agents/scripts/providers/github/board-add.js +1 -1
  166. package/.agents/scripts/providers/github/errors.js +1 -1
  167. package/.agents/scripts/providers/github/tickets.js +114 -21
  168. package/.agents/scripts/quality-preview.js +162 -70
  169. package/.agents/scripts/resolve-stories.js +3 -3
  170. package/.agents/scripts/resync-status-column.js +1 -1
  171. package/.agents/scripts/run-lint.js +1 -1
  172. package/.agents/scripts/run-test-profile.js +8 -5
  173. package/.agents/scripts/run-tests.js +79 -14
  174. package/.agents/scripts/single-story-close.js +2 -4
  175. package/.agents/scripts/single-story-init.js +10 -6
  176. package/.agents/scripts/stories-wave-tick.js +8 -8
  177. package/.agents/skills/core/idea-refinement/SKILL.md +5 -5
  178. package/.agents/skills/core/scope-triage/SKILL.md +3 -3
  179. package/.agents/skills/skills.index.json +1 -1
  180. package/.agents/skills/stack/qa/qa-harness/SKILL.md +1 -1
  181. package/.agents/workflows/audit-data-model.md +1 -1
  182. package/.agents/workflows/audit-documentation.md +2 -2
  183. package/.agents/workflows/audit-to-stories.md +11 -11
  184. package/.agents/workflows/git-deliver.md +4 -4
  185. package/.agents/workflows/helpers/_merge-conflict-template.md +1 -1
  186. package/.agents/workflows/helpers/audit-lens-core.md +1 -1
  187. package/.agents/workflows/helpers/code-review.md +4 -4
  188. package/.agents/workflows/helpers/deliver-light.md +26 -26
  189. package/.agents/workflows/helpers/deliver-reference.md +15 -7
  190. package/.agents/workflows/helpers/deliver-story-reference.md +9 -4
  191. package/.agents/workflows/helpers/deliver-story.md +6 -7
  192. package/.agents/workflows/helpers/diagnose.md +2 -2
  193. package/.agents/workflows/helpers/parallel-tooling.md +1 -1
  194. package/.agents/workflows/helpers/plan-reference.md +9 -9
  195. package/.agents/workflows/helpers/qa-core.md +8 -8
  196. package/.agents/workflows/helpers/worktree-lifecycle.md +6 -6
  197. package/.agents/workflows/{deliver.md → mandrel-deliver.md} +15 -19
  198. package/.agents/workflows/{plan.md → mandrel-plan.md} +9 -9
  199. package/.agents/workflows/memory-consolidate.md +4 -4
  200. package/.agents/workflows/prototype.md +3 -3
  201. package/.agents/workflows/qa-assist.md +12 -12
  202. package/.agents/workflows/qa-explore.md +6 -6
  203. package/.agents/workflows/qa-run.md +1 -1
  204. package/README.md +7 -7
  205. package/docs/CHANGELOG.md +43 -0
  206. package/lib/cli/doctor.js +1 -1
  207. package/lib/cli/init.js +1 -1
  208. package/lib/cli/migrate.js +100 -94
  209. package/lib/migrations/helpers/retire-agentrc-key.js +200 -0
  210. package/lib/migrations/index.js +32 -33
  211. package/lib/migrations/steps/2.1.0-retire-mi-drop-knobs.js +21 -80
  212. package/lib/migrations/steps/2.1.0-retire-verify-concurrency-cap.js +15 -87
  213. package/lib/migrations/steps/2.11.0-retire-max-seed-words.js +13 -71
  214. package/lib/migrations/steps/2.2.0-retire-epic-ac-tags.js +1 -1
  215. package/lib/migrations/steps/2.20.0-retire-codebase-snapshot.js +13 -101
  216. package/lib/migrations/steps/2.32.0-retire-lint-baseline-command.js +13 -100
  217. package/package.json +7 -3
  218. package/.agents/scripts/lib/audit-suite/frontmatter-lint.js +0 -32
  219. package/.agents/scripts/lib/baselines/maintainability-baseline-save.js +0 -37
  220. package/.agents/scripts/lib/cli/parse-numeric.js +0 -60
  221. package/.agents/scripts/lib/close-validation/telemetry.js +0 -79
  222. package/.agents/scripts/lib/orchestration/label-transitions.js +0 -44
  223. package/.agents/scripts/lib/orchestration/parked-follow-ons.js +0 -147
  224. package/.agents/scripts/lib/orchestration/phase-runner.js +0 -88
  225. package/.agents/scripts/lib/orchestration/recut.js +0 -56
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * A **thin entry point, not a second delivery engine.** It runs the
7
7
  * suitability gate, authors a minimal receipt `type::story`, and then hands off
8
- * to the SAME engine scripts `/deliver` uses:
8
+ * to the SAME engine scripts `/mandrel-deliver` uses:
9
9
  *
10
10
  * suitability gate → inline receipt Story → single-story-init.js
11
11
  * → (agent implements + self-evals) → diff backstop
@@ -38,9 +38,9 @@
38
38
  * envelope with status `escalated` and **ends the session**. Before that it was
39
39
  * an ordinary gate envelope plus exit 2 — a warning a caller could walk past,
40
40
  * and one mandrel-bench 2.13.0 light-arm run did exactly that: it read the
41
- * escalation, invoked `/plan` in the same session, and delivered. In-session
41
+ * escalation, invoked `/mandrel-plan` in the same session, and delivered. In-session
42
42
  * planning under-decomposed (ONE Story against the scenario's 3-5 contract,
43
- * where a fresh `/plan` session on the identical seed authored four), so
43
+ * where a fresh `/mandrel-plan` session on the identical seed authored four), so
44
44
  * escalation silently produced the outcome the guard exists to prevent.
45
45
  * {@link module:lib/orchestration/story-deliver-terminal.buildEscalationTerminal}
46
46
  * carries the guarantees the schema then enforces.
@@ -88,7 +88,7 @@ Usage:
88
88
  deliver-light.js --backstop --story <id>
89
89
 
90
90
  The thin /deliver-light entry point: suitability gate → inline receipt Story →
91
- the same single-story-init.js / single-story-close.js engine /deliver uses.
91
+ the same single-story-init.js / single-story-close.js engine /mandrel-deliver uses.
92
92
 
93
93
  The gate judges EFFORT and RISK, not artifact counts: N instances of one
94
94
  mechanical edit is one kind at N sites. It rejects only clearly-epic work; the
@@ -102,9 +102,9 @@ Gate options:
102
102
  --kinds <csv> Distinct KINDS of change (default: one per assumption, so
103
103
  N same-shaped edits count once).
104
104
  --magnitude <m> Coarse effort bucket: trivial | moderate | substantial
105
- (default moderate; substantial routes to /plan).
105
+ (default moderate; substantial routes to /mandrel-plan).
106
106
  --uncertainty <u> determined (the request fixes the shape) | needs-design
107
- (default determined; needs-design routes to /plan).
107
+ (default determined; needs-design routes to /mandrel-plan).
108
108
  --route <r> Ledgered model verdict route: lite | full.
109
109
  --reason <text> Recorded reason for a lite verdict (required for lite).
110
110
  --amends <#id> Mark this as an amendment of an existing issue.
@@ -125,7 +125,7 @@ Backstop options:
125
125
  change's IMPLEMENTATION half by magnitude (changed lines +
126
126
  file sprawl); test/doc/baseline companions are exempt from
127
127
  the counts but still matched for sensitive paths. A block
128
- emits a nextCommand recycling the receipt through /plan.
128
+ emits a nextCommand recycling the receipt through /mandrel-plan.
129
129
  --story <id> Story issue number whose story-<id> branch to diff.
130
130
 
131
131
  --pretty Pretty-print the JSON envelope.
@@ -280,7 +280,7 @@ export async function createLightReceipt({
280
280
  }
281
281
 
282
282
  /**
283
- * The engine hand-off — the SAME scripts `/deliver` uses. Named here as
283
+ * The engine hand-off — the SAME scripts `/mandrel-deliver` uses. Named here as
284
284
  * commands, never reimplemented: this is the whole of deliver-light's
285
285
  * relationship to worktree/branch/lease/PR/merge mechanics.
286
286
  *
@@ -397,7 +397,7 @@ export async function runGateMode(values, deps = {}) {
397
397
  if (values.yes === true && hasOperatorOverride(values)) {
398
398
  process.stderr.write(HELP);
399
399
  throw new Error(
400
- '[deliver-light] --operator-proceed-light is attended-only and cannot be combined with --yes: an unattended run has no operator whose answer this is, and over-scope must fail closed to /plan',
400
+ '[deliver-light] --operator-proceed-light is attended-only and cannot be combined with --yes: an unattended run has no operator whose answer this is, and over-scope must fail closed to /mandrel-plan',
401
401
  );
402
402
  }
403
403
 
@@ -423,7 +423,7 @@ export async function runGateMode(values, deps = {}) {
423
423
  });
424
424
  emitTerminalFn(envelope);
425
425
  Logger.warn(
426
- `[deliver-light] ESCALATED to /plan — this session ENDS here; run ${envelope.nextCommand} in a FRESH session: ${gate.outcome.reasons.join('; ')}`,
426
+ `[deliver-light] ESCALATED to /mandrel-plan — this session ENDS here; run ${envelope.nextCommand} in a FRESH session: ${gate.outcome.reasons.join('; ')}`,
427
427
  );
428
428
  return exitCodeForTerminal(envelope);
429
429
  }
@@ -12,7 +12,7 @@
12
12
  * is the thing they cannot act on.
13
13
  *
14
14
  * The strand this exists for above all others is the **merged-but-label-stale**
15
- * Story: a `/deliver` re-run refuses it outright, because
15
+ * Story: a `/mandrel-deliver` re-run refuses it outright, because
16
16
  * `single-story-init.js` hard-errors on an already-closed Story. Before this
17
17
  * surface, that Story had no automated way back.
18
18
  *
@@ -8,7 +8,7 @@
8
8
  * any still-stuck entries by enumerating the processes holding handles
9
9
  * inside the worktree path and terminating them.
10
10
  *
11
- * Invoked by `/deliver` and `/plan`
11
+ * Invoked by `/mandrel-deliver` and `/mandrel-plan`
12
12
  * (via `drainPendingCleanupAtBoot` → `worktree-sweep.js`), and
13
13
  * `story-close` so the pending-cleanup ledger drains automatically
14
14
  * across the sprint lifecycle. Operators can also run it standalone:
@@ -39,6 +39,18 @@ const progress = Logger.createProgress('drain-pending-cleanup', {
39
39
  stderr: false,
40
40
  });
41
41
 
42
+ /**
43
+ * The escalation posture, as a real boolean. `allowNegative` resolves
44
+ * `--no-escalate` to boolean `false`, but under `strict: false` the other
45
+ * documented spelling `--escalate=false` arrives as the *string* `'false'`,
46
+ * which is truthy while `forceDrainPendingCleanup` gates on `!escalate`.
47
+ * Both must reach the engine as a boolean or the flag is advertised and inert.
48
+ *
49
+ * @param {boolean|string|undefined} value
50
+ * @returns {boolean}
51
+ */
52
+ const escalateFrom = (value) => value !== false && value !== 'false';
53
+
42
54
  /**
43
55
  * The drain core, extracted from the CLI shell so the whole decision table —
44
56
  * empty manifest, dry-run report, drain + escalate reporting — is reachable
@@ -83,6 +95,11 @@ export async function runDrainPendingCleanup(
83
95
  'worktree-root': { type: 'string' },
84
96
  },
85
97
  strict: false,
98
+ // `node:util.parseArgs` honours a `--no-<flag>` spelling ONLY when this is
99
+ // set. Without it `--no-escalate` landed in `values['no-escalate']` and
100
+ // left `values.escalate` at its `true` default, so the documented passive
101
+ // drain performed the forced removal it promises to suppress.
102
+ allowNegative: true,
86
103
  });
87
104
 
88
105
  const config = resolveConfigImpl();
@@ -126,7 +143,7 @@ export async function runDrainPendingCleanup(
126
143
  repoRoot: projectRoot,
127
144
  worktreeRoot,
128
145
  git: gitImpl,
129
- escalate: values.escalate,
146
+ escalate: escalateFrom(values.escalate),
130
147
  logger: {
131
148
  info: (m) => progressImpl('DRAIN', m),
132
149
  warn: (m) => progressImpl('DRAIN', `⚠️ ${m}`),
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * evidence-gate.js — evidence-aware wrapper around a single shell gate.
5
5
  *
6
- * Tech Spec #819 §"Evidence record (Story 7)" — `/deliver` Phase 3
6
+ * Tech Spec #819 §"Evidence record (Story 7)" — `/mandrel-deliver` Phase 3
7
7
  * (close-validation) runs `npm run lint` and `npm test` against the Epic
8
8
  * branch before opening the PR.
9
9
  * If the same gate has already passed against the current `git rev-parse
@@ -93,7 +93,7 @@ export function renderWorkflowsDoc(catalog, loopCatalog = []) {
93
93
  'Every command file lives at `.agents/workflows/<name>.md` and is projected',
94
94
  'into a flat `.claude/commands/` tree by `npm run sync:commands` (kept',
95
95
  'current at install time and on every `mandrel sync`/`update`) so it shows',
96
- 'up as a bare `/<name>` slash command (e.g. `/deliver`). The projection',
96
+ 'up as a bare `/<name>` slash command (e.g. `/mandrel-deliver`). The projection',
97
97
  'writes only `.claude/commands/<name>.md` — there is no plugin manifest and no',
98
98
  'marketplace listing. The commands load in every Claude Code environment.',
99
99
  '',
@@ -701,7 +701,7 @@ export function changeSetLacksSiblingTest(changedFiles) {
701
701
  * callers MUST pass the requested Epic's own branch ref (e.g.
702
702
  * `refs/heads/epic/<id>`) so the change set is pinned to that Epic's branch
703
703
  * rather than whatever HEAD the shared checkout happens to sit on. Under two
704
- * concurrent `/deliver` runs sharing one checkout, diffing against
704
+ * concurrent `/mandrel-deliver` runs sharing one checkout, diffing against
705
705
  * `HEAD` silently resolves the *other* Epic's change set (Story #3362). When
706
706
  * `headRef` cannot be resolved in the repo, the selector returns a
707
707
  * `degraded: true` envelope (or hard-fails in gate-mode) instead of diffing
@@ -140,7 +140,7 @@ const AUDIT_STORY_AXIS_LABELS = Object.freeze([
140
140
  name: AGENT_LABELS.READY,
141
141
  color: hex(LABEL_COLORS.AGENT),
142
142
  description:
143
- 'Parking state — frozen dispatch manifest exists; awaiting local /deliver',
143
+ 'Parking state — frozen dispatch manifest exists; awaiting local /mandrel-deliver',
144
144
  },
145
145
  {
146
146
  name: RISK_LABELS.HIGH,
@@ -292,7 +292,7 @@ export function buildStoryBody({ group, edges = [], issueByGroupKey = null }) {
292
292
  };
293
293
 
294
294
  // The `---` / `blocked by #N` footer is the canonical serializer's own, so
295
- // the body round-trips through `parse()` and `/deliver`'s resolver reads the
295
+ // the body round-trips through `parse()` and `/mandrel-deliver`'s resolver reads the
296
296
  // ordering from the same place it reads every other Story's.
297
297
  const canonicalSections = serialize(storyBody, {
298
298
  includeFooter: storyBody.depends_on.length > 0,
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * lib/audit-to-stories/seed-from-findings.js
3
3
  *
4
- * Build the `/plan --seed`-shaped one-pager markdown that the audit-to-
5
- * stories Single-plan grouping path emits for `/plan` to consume.
4
+ * Build the `/mandrel-plan --seed`-shaped one-pager markdown that the audit-to-
5
+ * stories Single-plan grouping path emits for `/mandrel-plan` to consume.
6
6
  *
7
7
  * The seed renders the canonical one-pager sections so the authoring
8
8
  * pass can sharpen it without having to invent context:
@@ -10,7 +10,7 @@
10
10
  * - Recommended Direction (rollup of recommendations by dimension)
11
11
  * - Key Assumptions (carries the source-report links forward)
12
12
  * - MVP Scope (the proposed Stories, one bullet per group)
13
- * - Key Files (explicit file paths so `/plan` authoring has concrete
13
+ * - Key Files (explicit file paths so `/mandrel-plan` authoring has concrete
14
14
  * anchors)
15
15
  * - Not Doing (out-of-scope items by convention)
16
16
  *
@@ -97,8 +97,8 @@ function formatMVPScope(groups) {
97
97
  const dims = g.dimensions.join(' / ');
98
98
  const file = g.files[0] ? ` (\`${g.files[0]}\`)` : '';
99
99
  // Carry each group's fingerprint (and location-based semantic-key)
100
- // footer into the seed so a Story authored from it via `/plan` inherits
101
- // the dedup identity — without this the recommended `/plan --seed-file`
100
+ // footer into the seed so a Story authored from it via `/mandrel-plan` inherits
101
+ // the dedup identity — without this the recommended `/mandrel-plan --seed-file`
102
102
  // path is invisible to the next sweep's dedup (Story #4626). The footers
103
103
  // are HTML comments, so they never render in the visible one-pager but
104
104
  // stay machine-readable for the dedup probe.
@@ -17,7 +17,7 @@
17
17
  * edges**. Both halves are written:
18
18
  *
19
19
  * 1. The **body footer** (`---` / `blocked by #N`) — canonical, parsed by
20
- * `/deliver`'s resolver, and the fallback when the dependencies API is
20
+ * `/mandrel-deliver`'s resolver, and the fallback when the dependencies API is
21
21
  * unavailable.
22
22
  * 2. The **native `blocked_by` relation** — visible in the GitHub UI,
23
23
  * readable without parsing markdown, and settable by an operator later.
@@ -19,11 +19,41 @@
19
19
  // the literal `*` are treated as the whole-repo rollup and always match
20
20
  // every row regardless of declared globs.
21
21
 
22
- import { minimatch } from 'minimatch';
22
+ import { Minimatch } from 'minimatch';
23
23
 
24
24
  /** The default components map, used when a gate omits `components`. */
25
25
  const DEFAULT_COMPONENTS = Object.freeze({ '*': Object.freeze(['**']) });
26
26
 
27
+ /**
28
+ * Compiled-matcher cache for `groupRows`, keyed on the glob string.
29
+ *
30
+ * `groupRows` is called once per gate over the whole baseline row set — tens
31
+ * of thousands of rows for `crap.json` — and the functional `minimatch()` it
32
+ * used re-parsed each component glob for every single row. The component
33
+ * globs come from config, so the distinct set is small and immutable; caching
34
+ * the compiled matcher turns an O(rows × globs) parse into an O(globs) one
35
+ * (Story #5109). Matching semantics are unchanged: same patterns, same
36
+ * `{ dot: true }`.
37
+ *
38
+ * @type {Map<string, import('minimatch').Minimatch>}
39
+ */
40
+ const GLOB_MATCHER_CACHE = new Map();
41
+
42
+ /**
43
+ * Compile (once) the `Minimatch` for one glob.
44
+ *
45
+ * @param {string} glob
46
+ * @returns {import('minimatch').Minimatch}
47
+ */
48
+ function matcherFor(glob) {
49
+ let matcher = GLOB_MATCHER_CACHE.get(glob);
50
+ if (!matcher) {
51
+ matcher = new Minimatch(glob, { dot: true });
52
+ GLOB_MATCHER_CACHE.set(glob, matcher);
53
+ }
54
+ return matcher;
55
+ }
56
+
27
57
  /**
28
58
  * Resolve the components map for a single gate config.
29
59
  *
@@ -112,7 +142,7 @@ export function groupRows(rows, components, keyField = 'path') {
112
142
  const list = Array.isArray(globs) ? globs : [];
113
143
  for (const glob of list) {
114
144
  if (typeof glob !== 'string' || glob.length === 0) continue;
115
- if (minimatch(normalized, glob, { dot: true })) {
145
+ if (matcherFor(glob).match(normalized)) {
116
146
  buckets[name].push(row);
117
147
  break;
118
148
  }
@@ -16,7 +16,7 @@ import { Logger } from '../Logger.js';
16
16
  // rounding) routinely drifts +/- 0.05 to 0.3 on otherwise-unchanged files —
17
17
  // well below the threshold of "actually less maintainable." A 0.5 floor
18
18
  // stops the pre-push hook from auto-ratcheting the baseline on noise.
19
- export const MI_DEFAULT_TOLERANCE = 0.5;
19
+ const MI_DEFAULT_TOLERANCE = 0.5;
20
20
 
21
21
  /**
22
22
  * Pure helper: resolve the effective CRAP config by layering env-var
@@ -13,7 +13,7 @@
13
13
  * The verification is **static**: we inspect `package.json` for a known BDD
14
14
  * runner dependency, and consult a small lookup table of which runners
15
15
  * support which pending/skip tag. We do not boot the runner. This keeps
16
- * `/plan` Phase 7 hermetic and offline.
16
+ * `/mandrel-plan` Phase 7 hermetic and offline.
17
17
  *
18
18
  * **Workspace awareness (Story #2956).** In a pnpm / npm / yarn monorepo the
19
19
  * BDD runner is rarely a root devDependency — it lives in the workspace
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * bdd-scenario-budget.js — envelope byte budget for the `bddScenarios`
3
- * `/plan` context-envelope field (Story #4977).
3
+ * `/mandrel-plan` context-envelope field (Story #4977).
4
4
  *
5
5
  * `bdd-scenario-scanner.js`'s `scanBddScenarios` stays a faithful, uncapped
6
6
  * index of the project's `.feature` corpus — that scan is also used
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bdd-scenario-scanner.js — Gherkin scenario index for /plan Phase 7.
2
+ * bdd-scenario-scanner.js — Gherkin scenario index for /mandrel-plan Phase 7.
3
3
  *
4
4
  * Story #2637 (sibling to #2636's file-assumption gate; the #2634 and #2635
5
5
  * planner-grounding siblings were retired in Story #4811). The Acceptance
@@ -8,7 +8,7 @@
8
8
  * alone — it never inspects the consumer project's existing `.feature`
9
9
  * files. Planned ACs frequently duplicate scenarios that already exist or
10
10
  * re-specify behaviour the codebase already proves; the duplication is
11
- * only discovered (at best) during `/deliver` or (at worst) after
11
+ * only discovered (at best) during `/mandrel-deliver` or (at worst) after
12
12
  * a redundant PR ships.
13
13
  *
14
14
  * `scanBddScenarios` walks every configured feature root, parses each
@@ -21,7 +21,7 @@
21
21
  * have a matching scenario.
22
22
  *
23
23
  * Determinism is load-bearing: the matcher is keyword-based, not
24
- * embedding-based, so re-running `/plan` against the same
24
+ * embedding-based, so re-running `/mandrel-plan` against the same
25
25
  * acceptance spec produces the same disposition annotations.
26
26
  */
27
27
 
@@ -9,7 +9,7 @@
9
9
  * 1. **Discovery** — which files under a scope's `stepRoots` hold step
10
10
  * definitions, and which `.feature` files sit under its `featureRoots`.
11
11
  * Feature discovery is delegated to `listFeatureFiles` in
12
- * `bdd-scenario-scanner.js` rather than copied: /plan's scenario index and
12
+ * `bdd-scenario-scanner.js` rather than copied: /mandrel-plan's scenario index and
13
13
  * this gate must agree on what counts as a feature file, and two walkers
14
14
  * would eventually disagree.
15
15
  * 2. **Matching** — turn each definition's Cucumber expression or regular
@@ -7,7 +7,7 @@
7
7
  * - `enforce_admins: true` — admins do not bypass the prGate suite.
8
8
  * - `required_pull_request_reviews.required_approving_review_count: 0` —
9
9
  * CI is the gate; the operator monitors and iterates the open PR
10
- * to green via `/deliver`'s Phase 7 watch loop.
10
+ * to green via `/mandrel-deliver`'s Phase 7 watch loop.
11
11
  *
12
12
  * Behaviour rules
13
13
  * ---------------
@@ -43,7 +43,7 @@ const TARGET_APPROVAL_COUNT = 0;
43
43
  * return value is a structured diff suitable for `hitlConfirm` so the
44
44
  * operator sees exactly what would flip.
45
45
  */
46
- export function diffProtection(current, targetContexts) {
46
+ function diffProtection(current, targetContexts) {
47
47
  if (!current) return null; // create-from-scratch path; no diff needed.
48
48
 
49
49
  const diff = {};
@@ -112,8 +112,8 @@ export function buildManualInstructions({ stagePaths, baseBranch }) {
112
112
  ` git push -u origin ${baseBranch}`,
113
113
  '',
114
114
  'Story delivery runs in git worktrees that check out tracked files only,',
115
- 'so the .agents/ wiring MUST be committed before any /deliver or',
116
- '/deliver run — otherwise the worktree has no scripts and breaks.',
115
+ 'so the .agents/ wiring MUST be committed before any /mandrel-deliver or',
116
+ '/mandrel-deliver run — otherwise the worktree has no scripts and breaks.',
117
117
  ].join('\n');
118
118
  }
119
119
 
@@ -80,7 +80,7 @@ const TARGET_TO_PHASE = Object.freeze({
80
80
  * @param {Record<string, { action?: string }>} [report]
81
81
  * @returns {string|undefined}
82
82
  */
83
- export function resolveExecutedAction(entry, report) {
83
+ function resolveExecutedAction(entry, report) {
84
84
  if (!report) return undefined;
85
85
  const phaseName = TARGET_TO_PHASE[entry.target];
86
86
  if (!phaseName) return undefined;
@@ -325,7 +325,7 @@ function renderConformanceWorkflow() {
325
325
  # Generated by agents-bootstrap-github. Runs the canonical story-body parser
326
326
  # against human-opened type::story issues and comments when the
327
327
  # body does not round-trip, instead of letting the supported human entry
328
- # points (e.g. /plan from an existing Epic ID) fail silently later. The lint
328
+ # points (e.g. /mandrel-plan from an existing Epic ID) fail silently later. The lint
329
329
  # informs; it never fails the issue. Re-run /agents-bootstrap-github to refresh.
330
330
  name: Issue Body Conformance
331
331
 
@@ -28,7 +28,7 @@ import readline from 'node:readline/promises';
28
28
  * Flags the bootstrap CLI accepts. Keep this list in sync with the
29
29
  * `--help` text in bootstrap.js.
30
30
  */
31
- export const KNOWN_FLAGS = Object.freeze({
31
+ const KNOWN_FLAGS = Object.freeze({
32
32
  string: [
33
33
  'owner',
34
34
  'repo',
@@ -41,7 +41,7 @@ import { deepEqual } from '../json-utils.js';
41
41
  * the hook-installer can detect a verbatim framework hook (overwrite-safe)
42
42
  * vs a custom hook (preserve and warn).
43
43
  */
44
- export const FRAMEWORK_PRE_COMMIT = `node scripts/check-version-sync.js
44
+ const FRAMEWORK_PRE_COMMIT = `node scripts/check-version-sync.js
45
45
  npx lint-staged
46
46
  # Story #1395 / Epic #1386: catch MI/CRAP drift at git-commit time so the
47
47
  # agent refactors before the diff is closed. quality:preview wraps both gates
@@ -78,7 +78,7 @@ export const PRE_COMMIT_MARKER =
78
78
  * when the keys are absent. Mirrors `.agents/docs/agentrc-reference.json` — keep in
79
79
  * sync when those numbers move.
80
80
  */
81
- export const QUALITY_CONFIG_DEFAULTS = Object.freeze({
81
+ const QUALITY_CONFIG_DEFAULTS = Object.freeze({
82
82
  codingGuardrails: Object.freeze({
83
83
  cyclomaticFlag: 8,
84
84
  cyclomaticMustFix: 12,
@@ -26,7 +26,7 @@ export default {
26
26
  severity: 'blocker',
27
27
  // 'npm-test' keeps the test-wrapper preflight's refusal claim true: a
28
28
  // poisoned shared config is caught before a suite (or N concurrent
29
- // /deliver workers) inherits it, not only at close/retro time (#4580).
29
+ // /mandrel-deliver workers) inherits it, not only at close/retro time (#4580).
30
30
  scope: ['story-close', 'retro', 'npm-test'],
31
31
  autoCorrect: 'refuse-and-print',
32
32
  detect(state) {
@@ -42,7 +42,7 @@ import { validateSignal } from '../observability/signal-validator.js';
42
42
  * a health probe, not an exhaustive audit — the most recent window is a
43
43
  * representative sample that keeps the read bounded on long streams.
44
44
  */
45
- export const MAX_SAMPLE_LINES = 200;
45
+ const MAX_SAMPLE_LINES = 200;
46
46
 
47
47
  /**
48
48
  * Locate the most-recently-touched `run-<id>` temp tree under
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * Scope: 'story-close', 'retro'. The check runs at every
13
13
  * preflight surface that has the opportunity to invoke Story init —
14
- * primarily `/deliver`'s init step — and surfaces as a retro audit
14
+ * primarily `/mandrel-deliver`'s init step — and surfaces as a retro audit
15
15
  * signal if the failure mode resurfaces during a sprint.
16
16
  *
17
17
  * The check is `refuse-and-print`. Auto-rewriting an orchestration call
@@ -210,7 +210,6 @@ export function parseSprintArgs(
210
210
  'recut-of': { type: 'string' },
211
211
  resume: { type: 'boolean', default: false },
212
212
  restart: { type: 'boolean', default: false },
213
- 'no-evidence': { type: 'boolean', default: false },
214
213
  },
215
214
  allowPositionals: true,
216
215
  strict: false,
@@ -254,13 +253,12 @@ export function parseSprintArgs(
254
253
  process.env.AGENT_WORKTREE_ROOT ||
255
254
  null,
256
255
  recutOf: parseTicketId(values['recut-of']),
257
- // Story #4253: pre-resolved Epic linkage threaded by the /deliver
256
+ // Story #4253: pre-resolved Epic linkage threaded by the /mandrel-deliver
258
257
  // fan-out so `single-story-init.js` can skip redundant Epic lookups when
259
258
  // the parent already threaded Epic context (pre-v2; field retained for
260
259
  // CLI compatibility).
261
260
  resume: values.resume ?? false,
262
261
  restart: values.restart ?? false,
263
- noEvidence: values['no-evidence'] ?? false,
264
262
  };
265
263
 
266
264
  parsed.ticketId =
@@ -392,7 +392,7 @@ export const DEFAULT_GATES = buildDefaultGates();
392
392
  * state, no overlapping ports/sockets). Safe to run concurrently — see
393
393
  * `runCloseValidation` for the Promise.all + AbortController plumbing.
394
394
  */
395
- export const INDEPENDENT_GATE_NAMES = new Set(['lint', 'format', 'typecheck']);
395
+ const INDEPENDENT_GATE_NAMES = new Set(['lint', 'format', 'typecheck']);
396
396
 
397
397
  /**
398
398
  * Partition a gate list into the parallel-safe set and the order-sensitive
@@ -113,7 +113,7 @@ const MARKER_PROBE_TAIL_LINES = 32;
113
113
  * @param {string} output - Combined stdout/stderr captured from the gate child.
114
114
  * @returns {boolean}
115
115
  */
116
- export function isBiomeNoFilesProcessed(output) {
116
+ function isBiomeNoFilesProcessed(output) {
117
117
  return (
118
118
  typeof output === 'string' && output.includes(BIOME_NO_FILES_PROCESSED)
119
119
  );
@@ -36,7 +36,7 @@ export function applyHeader(content, header) {
36
36
  * True when a workflow opts out of slash-command projection via a
37
37
  * `command: false` key in its YAML frontmatter (#4482). Used for dual-use
38
38
  * lens files (e.g. `audit-security.md`) that stay in
39
- * the payload as `/deliver` audit-suite prompts but must NOT surface as
39
+ * the payload as `/mandrel-deliver` audit-suite prompts but must NOT surface as
40
40
  * standalone slash commands because the host ships a native equivalent.
41
41
  *
42
42
  * Both `sync-claude-commands.js` (projection + orphan-reap) and the
@@ -36,7 +36,7 @@ export const DELIVERY_ROUTING_DEFAULTS = Object.freeze({
36
36
  /** @type {'minimal'|'standard'|'strict'} */
37
37
  ceremonyProfile: 'standard',
38
38
  /**
39
- * When true (default), attended `/deliver` lands through merge in one
39
+ * When true (default), attended `/mandrel-deliver` lands through merge in one
40
40
  * close (`--wait-merge` semantics) instead of stopping at `agent::closing`.
41
41
  * Operators opt out per-run with `--no-wait-merge`.
42
42
  */
@@ -266,7 +266,7 @@ const PREFIX_MEANINGS = Object.freeze([
266
266
  const BLOCK_MEANINGS = Object.freeze({
267
267
  project: 'Project identity, paths, and command configuration.',
268
268
  github: 'GitHub provider identity and merge/notification policy.',
269
- planning: 'Inputs and guardrails for /plan.',
269
+ planning: 'Inputs and guardrails for /mandrel-plan.',
270
270
  delivery: 'Execution, isolation, quality, and CI settings for delivery.',
271
271
  qa: 'Agent-driven QA harness contract.',
272
272
  });
@@ -23,7 +23,7 @@ export const DEFAULT_DECOMPOSER = Object.freeze({
23
23
  * the GitHub API with concurrent label writes, while still allowing a
24
24
  * small ready-set fan-out. Operators who want strictly sequential delivery
25
25
  * should set `delivery.deliverRunner.concurrencyCap: 1`. Raising the cap
26
- * reduces wall-clock time where dependencies allow. See `deliver.md` and
26
+ * reduces wall-clock time where dependencies allow. See `mandrel-deliver.md` and
27
27
  * `agentrc-reference.json` `delivery.deliverRunner.concurrencyCap`.
28
28
  *
29
29
  * Story #4545 removed the sibling `verifyConcurrencyCap`: the
@@ -46,7 +46,7 @@ const DEFAULT_DELIVER_RUNNER = Object.freeze({
46
46
  });
47
47
 
48
48
  /**
49
- * Default auto-fix loop ceilings for /deliver code-review. Operators
49
+ * Default auto-fix loop ceilings for /mandrel-deliver code-review. Operators
50
50
  * override via `delivery.codeReview.*` in `.agentrc.json` (Story #2611,
51
51
  * Epic #2586; `autoFixSeverity` default `'medium'` per Story #4399).
52
52
  */
@@ -77,7 +77,7 @@ export function resolveWorkingPath({
77
77
 
78
78
  /**
79
79
  * One-shot environment-aware runtime resolution. Returns the trio of runtime
80
- * signals consumed across `/deliver`: whether worktree isolation is on
80
+ * signals consumed across `/mandrel-deliver`: whether worktree isolation is on
81
81
  * for this process, the session id for claim labels, and whether we're in a
82
82
  * Claude Code web session. Each signal also records its **source** so the
83
83
  * `story-init` startup log can name why the value is what it is.
@@ -173,7 +173,7 @@ export function collectRedundantAdvisories(
173
173
  * @param {string} dottedPath
174
174
  * @returns {boolean}
175
175
  */
176
- export function isLeafSchemaRemovable(rootSchema, dottedPath) {
176
+ function isLeafSchemaRemovable(rootSchema, dottedPath) {
177
177
  if (!rootSchema || typeof rootSchema !== 'object') return true;
178
178
  const parts = dottedPath.split('.');
179
179
  let cursor = rootSchema;
@@ -41,7 +41,7 @@
41
41
  * parent of `git rev-parse --git-common-dir`) rather than `process.cwd()`.
42
42
  * Without this, a story child that `cd`s into `.worktrees/story-<id>/` before
43
43
  * emitting a lifecycle record would append it to
44
- * `<worktree>/temp/run-N/lifecycle.ndjson`, while the `/deliver` host
44
+ * `<worktree>/temp/run-N/lifecycle.ndjson`, while the `/mandrel-deliver` host
45
45
  * (running from the main checkout) reads the main-checkout copy — so the
46
46
  * host never sees the child's records (the audit-#3513 bug class; its
47
47
  * original `story.heartbeat` instance is gone with that emitter, but the
@@ -372,7 +372,7 @@ function storyTerminalEnvelopeName(sid) {
372
372
  * `close-gates-<sid>.log`, and `deliver-recover.js` reads the pair together to
373
373
  * tell a finished close from a live one. Sharing `orchestrationLogDir` also
374
374
  * means it inherits main-checkout anchoring for free — the close runs inside
375
- * `.worktrees/story-<sid>/` while the `/deliver` host reads from the main
375
+ * `.worktrees/story-<sid>/` while the `/mandrel-deliver` host reads from the main
376
376
  * checkout, and an un-anchored path would put the envelope somewhere the
377
377
  * router never looks.
378
378
  *
@@ -66,13 +66,13 @@ const DOCS_FRESHNESS_SCHEMA = {
66
66
  */
67
67
  const DELIVER_RUNNER_SCHEMA = {
68
68
  type: 'object',
69
- description: 'Bounded-concurrency knob for the /deliver fan-out.',
69
+ description: 'Bounded-concurrency knob for the /mandrel-deliver fan-out.',
70
70
  properties: {
71
71
  concurrencyCap: {
72
72
  type: 'integer',
73
73
  minimum: 1,
74
74
  description:
75
- 'Maximum ready Stories dispatched by /deliver at once. Default 3. Moderate by design — keeps host-quota consumption predictable while allowing a small ready-set fan-out. Set 1 for strictly sequential delivery; raise further on hosts with adequate parallel-agent quota. See deliver.md for the sequencing model and throughput tradeoff.',
75
+ 'Maximum ready Stories dispatched by /mandrel-deliver at once. Default 3. Moderate by design — keeps host-quota consumption predictable while allowing a small ready-set fan-out. Set 1 for strictly sequential delivery; raise further on hosts with adequate parallel-agent quota. See deliver.md for the sequencing model and throughput tradeoff.',
76
76
  // getRunners() resolves this from its own DEFAULT_DELIVER_RUNNER
77
77
  // constant, not from this annotation; the parity suite asserts the two
78
78
  // agree.
@@ -637,7 +637,7 @@ const TEMP_RETENTION_SCHEMA = {
637
637
  export const DELIVERY_SCHEMA = {
638
638
  type: 'object',
639
639
  description:
640
- 'Everything `/deliver` and `single-story-close` consume: execution timeouts, worktree isolation, runner concurrency, docs freshness, signals, quality gates, merge/CI watch, review ceremony, and the feedback loop.',
640
+ 'Everything `/mandrel-deliver` and `single-story-close` consume: execution timeouts, worktree isolation, runner concurrency, docs freshness, signals, quality gates, merge/CI watch, review ceremony, and the feedback loop.',
641
641
  properties: {
642
642
  execution: EXECUTION_SCHEMA,
643
643
  docsFreshness: DOCS_FRESHNESS_SCHEMA,