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
@@ -60,7 +60,7 @@ import { upsertStructuredComment } from '../orchestration/ticketing.js';
60
60
  * finalize indefinitely; the walk now caps every spawn at this bound unless
61
61
  * a caller overrides it.
62
62
  */
63
- export const DEFAULT_RUN_CHILD_TIMEOUT_MS = 30000;
63
+ const DEFAULT_RUN_CHILD_TIMEOUT_MS = 30000;
64
64
 
65
65
  /**
66
66
  * Default per-run filing cap. `graduate()` files at most this many follow-up
@@ -72,7 +72,7 @@ export const DEFAULT_MAX_FILINGS_PER_RUN = 20;
72
72
  * Structured-comment type used to durably persist cross-repo-deferred
73
73
  * findings on the Epic. Registered in `STRUCTURED_COMMENT_TYPES`.
74
74
  */
75
- export const CROSS_REPO_DEFERRED_COMMENT_TYPE = 'cross-repo-deferred';
75
+ const CROSS_REPO_DEFERRED_COMMENT_TYPE = 'cross-repo-deferred';
76
76
 
77
77
  /**
78
78
  * Explicit, greppable opt-back-in to live issue filing from a context the
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * prior-feedback-fetcher.js — gh-CLI-backed fetcher for open meta feedback
3
- * issues that feed the `/plan` Phase 0 planner context.
3
+ * issues that feed the `/mandrel-plan` Phase 0 planner context.
4
4
  *
5
5
  * Story #2554 / Epic #2547. Tech Spec #2550 specifies that the fetcher MUST
6
6
  * return open issues carrying the `meta::framework-gap` and
@@ -17,8 +17,8 @@
17
17
  * `recurringDefectClasses[]` array derived from the `friction::<class>`
18
18
  * labels the retro routed-proposals composer stamps onto the meta issues it
19
19
  * proposes. That closes the retro→planner loop: a recurring defect class
20
- * caught by review/deliver is filed as a `meta::*` + `friction::<class>`
21
- * issue, and the next `/plan` Phase 0 surfaces the class (with a recurrence
20
+ * caught by review/mandrel-deliver is filed as a `meta::*` + `friction::<class>`
21
+ * issue, and the next `/mandrel-plan` Phase 0 surfaces the class (with a recurrence
22
22
  * count across the open feedback issues) to the decompose-author guidance so
23
23
  * the planning floor ratchets up. The derivation is no-op-safe: issues with
24
24
  * no `friction::*` label contribute nothing and the array is empty.
@@ -52,7 +52,7 @@ const FRICTION_LABEL_PREFIX = 'friction::';
52
52
  * @param {Array<{ number: number, labels?: string[] }>} issues
53
53
  * @returns {Array<{ class: string, count: number, issues: number[] }>}
54
54
  */
55
- export function extractRecurringDefectClasses(issues) {
55
+ function extractRecurringDefectClasses(issues) {
56
56
  if (!Array.isArray(issues)) return [];
57
57
  /** @type {Map<string, Set<number>>} */
58
58
  const byClass = new Map();
@@ -297,7 +297,7 @@ export async function fetchPriorFeedback({
297
297
 
298
298
  // Story #4135 (Epic #4131, F11) — close the retro→planner loop: derive the
299
299
  // recurring defect classes from the `friction::<class>` labels carried by
300
- // the deduped feedback issues, so the next /plan Phase 0 surfaces them to
300
+ // the deduped feedback issues, so the next /mandrel-plan Phase 0 surfaces them to
301
301
  // the decompose-author guidance. No-op-safe when no issue carries a
302
302
  // `friction::*` label (empty array, no behavioural change).
303
303
  envelope.recurringDefectClasses = extractRecurringDefectClasses([
@@ -6,7 +6,7 @@
6
6
  * (`retro-proposals.js`) already split the Epic's source-tagged friction
7
7
  * into `framework` / `consumer` actionable items, each carrying a
8
8
  * pre-drafted `gh issue create` command stanza. Historically an operator
9
- * had to copy-paste those stanzas by hand, so `/plan` Phase 0's
9
+ * had to copy-paste those stanzas by hand, so `/mandrel-plan` Phase 0's
10
10
  * `recurringDefectClasses` stayed empty unless someone remembered to run
11
11
  * the commands. This module files them mechanically instead — the retro
12
12
  * body then lists the real filed issue numbers rather than paste-ready
@@ -387,7 +387,7 @@ export function enrichRoutedProposalsWithFilings(routedProposals, filed) {
387
387
  * @param {string|null|undefined} slug
388
388
  * @returns {{ owner: string, repo: string } | null}
389
389
  */
390
- export function parseRepoSlug(slug) {
390
+ function parseRepoSlug(slug) {
391
391
  if (typeof slug !== 'string') return null;
392
392
  const parts = slug.split('/');
393
393
  if (parts.length !== 2) return null;
@@ -51,7 +51,7 @@ export const FINDING_CLASSES = Object.freeze([
51
51
  /**
52
52
  * Class → label-set routing table. Each class maps to exactly one label set.
53
53
  * `tooling-dx` is the framework-gap path: it carries `meta::framework-gap` so
54
- * the `/plan` Phase 0 feedback fetcher surfaces it to the planner.
54
+ * the `/mandrel-plan` Phase 0 feedback fetcher surfaces it to the planner.
55
55
  */
56
56
  const CLASS_TO_LABELS = Object.freeze({
57
57
  'product-bug': [FOCUS_LABELS.PRODUCT],
@@ -5,8 +5,8 @@
5
5
  * tail of the exploratory-QA Triage path: once an operator has dispositioned a
6
6
  * session's ledger items (see `.agents/schemas/qa-ledger.schema.json` and
7
7
  * `lib/qa/qa-session.js`), the still-untriaged backlog is clustered and each
8
- * cluster is promoted to a follow-up ticket — a single Story (via `/plan`)
9
- * for a tight, one-deliverable cluster, or a multi-Story plan-seed (via `/plan --seed`) for
8
+ * cluster is promoted to a follow-up ticket — a single Story (via `/mandrel-plan`)
9
+ * for a tight, one-deliverable cluster, or a multi-Story plan-seed (via `/mandrel-plan --seed`) for
10
10
  * a broad cluster that spans multiple coverage surfaces. Each contributing
11
11
  * ledger item then has the resulting `routedTo` issue link written back onto it
12
12
  * so a resume run sees the item as filed rather than re-promoting it.
@@ -23,7 +23,7 @@
23
23
  * Pure orchestration: **no network I/O lives here.** Every GitHub side-effect
24
24
  * (issue search, ticket creation) flows through INJECTED PORTS so the unit test
25
25
  * runs with no network. Production wires the ports to the GitHub provider /
26
- * `/plan` / `/plan` surfaces; tests pass in-memory stubs.
26
+ * `/mandrel-plan` / `/mandrel-plan` surfaces; tests pass in-memory stubs.
27
27
  */
28
28
 
29
29
  import { fingerprintFinding, routeFinding } from './route-finding.js';
@@ -35,8 +35,8 @@ const TRIAGED_DISPOSITIONS = Object.freeze(['file', 'defer', 'dismiss']);
35
35
  /**
36
36
  * The two promotion targets a cluster routes to.
37
37
  *
38
- * `PLAN_SEED` promotes a broad cluster by seeding a multi-Story `/plan`
39
- * run (`/plan --seed`). Its persisted wire token is the legacy string
38
+ * `PLAN_SEED` promotes a broad cluster by seeding a multi-Story `/mandrel-plan`
39
+ * run (`/mandrel-plan --seed`). Its persisted wire token is the legacy string
40
40
  * `'epic'`: archived qa-ledger records (and the distributed
41
41
  * `qa-ledger.schema.json` `routedTo.kind` enum) still carry `'epic'`, so
42
42
  * the value is kept read-compatible while the write-side constant name is
@@ -49,8 +49,8 @@ export const PROMOTION_TARGETS = Object.freeze({
49
49
 
50
50
  /**
51
51
  * A cluster of more than this many distinct coverage surfaces is broad enough
52
- * to warrant a plan-seed (`/plan --seed`) rather than a single Story
53
- * (`/plan`). One or two surfaces is a tight, single-deliverable cluster.
52
+ * to warrant a plan-seed (`/mandrel-plan --seed`) rather than a single Story
53
+ * (`/mandrel-plan`). One or two surfaces is a tight, single-deliverable cluster.
54
54
  */
55
55
  const EPIC_COVERAGE_THRESHOLD = 2;
56
56
 
@@ -168,8 +168,8 @@ export function clusterLedgerItems(items) {
168
168
  /**
169
169
  * Decide a cluster's promotion target. A cluster that spans more than
170
170
  * {@link EPIC_COVERAGE_THRESHOLD} distinct coverage surfaces is broad enough to
171
- * warrant a plan-seed (`/plan --seed`); otherwise it is a single-deliverable
172
- * Story (`/plan`).
171
+ * warrant a plan-seed (`/mandrel-plan --seed`); otherwise it is a single-deliverable
172
+ * Story (`/mandrel-plan`).
173
173
  *
174
174
  * @param {{ coverages: string[] }} cluster
175
175
  * @returns {'story'|'epic'}
@@ -242,7 +242,7 @@ function routedToLink(issue, kind) {
242
242
  * shared `routeFinding` against existing Issues (via the injected search
243
243
  * port). This dedups against work already filed.
244
244
  * 2. On a `new` decision, open the follow-up ticket through the injected
245
- * `createStory` (`/plan`) or `createPlanSeed` (`/plan --seed`) port,
245
+ * `createStory` (`/mandrel-plan`) or `createPlanSeed` (`/mandrel-plan --seed`) port,
246
246
  * chosen by {@link targetForCluster}. On any other decision, link back to
247
247
  * the matched Issue rather than creating a duplicate.
248
248
  * 3. Stamp the resolved `routedTo` link onto every contributing ledger item
@@ -259,9 +259,9 @@ function routedToLink(issue, kind) {
259
259
  * @param {(finding: object) => Promise<Array<{ number: number, state: string, title?: string, body?: string }>>} [ports.searchCandidates]
260
260
  * Optional semantic candidate search, forwarded to `routeFinding`.
261
261
  * @param {(cluster: object) => Promise<{ number: number, url?: string }>} ports.createStory
262
- * Opens a single Story (`/plan`) for a tight cluster.
262
+ * Opens a single Story (`/mandrel-plan`) for a tight cluster.
263
263
  * @param {(cluster: object) => Promise<{ number: number, url?: string }>} ports.createPlanSeed
264
- * Opens a plan-seed (`/plan --seed`) run for a broad cluster.
264
+ * Opens a plan-seed (`/mandrel-plan --seed`) run for a broad cluster.
265
265
  * @returns {Promise<{
266
266
  * promotions: Array<{
267
267
  * clusterKey: string,
@@ -249,9 +249,9 @@ function parseAllFooterValues(text, pattern, isValid) {
249
249
  * Carry audit dedup provenance from a source document into a target body
250
250
  * (Story #4877).
251
251
  *
252
- * The audit sweep's Single-plan path emits a `/plan` seed whose MVP Scope
252
+ * The audit sweep's Single-plan path emits a `/mandrel-plan` seed whose MVP Scope
253
253
  * bullets already carry the `audit-fingerprints` / `audit-semantic-keys`
254
- * footers (Story #4626). Nothing then copied them into the Story `/plan`
254
+ * footers (Story #4626). Nothing then copied them into the Story `/mandrel-plan`
255
255
  * actually persisted, so the recommended path filed Stories that the next
256
256
  * sweep could not recognise and re-filed as new. It was left to the authoring
257
257
  * agent to notice HTML comments in a one-pager and hand-carry them — a