mandrel 2.70.0 → 2.71.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 (64) hide show
  1. package/.agents/README.md +8 -9
  2. package/.agents/agents/acceptance-critic.md +1 -0
  3. package/.agents/agents/auditor.md +1 -0
  4. package/.agents/agents/plan-critic.md +1 -0
  5. package/.agents/agents/story-worker.md +63 -64
  6. package/.agents/docs/agentrc-reference.json +2 -1
  7. package/.agents/docs/configuration.md +7 -8
  8. package/.agents/rules/git-conventions-reference.md +2 -2
  9. package/.agents/schemas/agentrc.schema.json +19 -2
  10. package/.agents/scripts/acceptance-eval.js +194 -15
  11. package/.agents/scripts/deliver-run.js +92 -43
  12. package/.agents/scripts/lib/audit-suite/index.js +1 -1
  13. package/.agents/scripts/lib/audit-suite/story-checklist.js +65 -0
  14. package/.agents/scripts/lib/audit-to-stories/audit-label-taxonomy.js +2 -2
  15. package/.agents/scripts/lib/bootstrap/issue-forms-template.js +1 -1
  16. package/.agents/scripts/lib/cli-args.js +22 -0
  17. package/.agents/scripts/lib/close-validation/gates.js +17 -3
  18. package/.agents/scripts/lib/config/agent-models.js +117 -0
  19. package/.agents/scripts/lib/config-settings-schema-delivery.js +13 -1
  20. package/.agents/scripts/lib/config-settings-schema-quality.js +1 -1
  21. package/.agents/scripts/lib/generated/agentrc-validator.js +1 -1
  22. package/.agents/scripts/lib/git/sync-from-base.js +89 -17
  23. package/.agents/scripts/lib/label-taxonomy.js +13 -3
  24. package/.agents/scripts/lib/notifications/notifier.js +11 -15
  25. package/.agents/scripts/lib/observability/close-telemetry.js +19 -3
  26. package/.agents/scripts/lib/observability/source-classifier.js +1 -0
  27. package/.agents/scripts/lib/orchestration/code-review.js +2 -2
  28. package/.agents/scripts/lib/orchestration/file-assumptions.js +45 -11
  29. package/.agents/scripts/lib/orchestration/plan-context.js +17 -10
  30. package/.agents/scripts/lib/orchestration/plan-persist/changes-repair.js +130 -24
  31. package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +19 -16
  32. package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +1 -0
  33. package/.agents/scripts/lib/orchestration/plan-persist/summary.js +4 -3
  34. package/.agents/scripts/lib/orchestration/resolve-stories.js +10 -2
  35. package/.agents/scripts/lib/orchestration/review-providers/native.js +5 -165
  36. package/.agents/scripts/lib/orchestration/single-story-close/failed-terminal.js +14 -2
  37. package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +151 -56
  38. package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +4 -0
  39. package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +20 -4
  40. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +26 -17
  41. package/.agents/scripts/lib/orchestration/story-handoff.js +849 -0
  42. package/.agents/scripts/lib/orchestration/story-init-result.js +83 -0
  43. package/.agents/scripts/lib/orchestration/task-body-validator.js +35 -5
  44. package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +1 -1
  45. package/.agents/scripts/lib/orchestration/ticket-validator.js +20 -2
  46. package/.agents/scripts/lib/single-story/confirm-merge.js +44 -7
  47. package/.agents/scripts/lib/story-body/story-body.js +40 -5
  48. package/.agents/scripts/lib/templates/decomposer-prompts.js +33 -36
  49. package/.agents/scripts/single-story-close.js +8 -0
  50. package/.agents/scripts/single-story-init.js +17 -32
  51. package/.agents/scripts/story-handoff.js +112 -0
  52. package/.agents/scripts/sync-claude-agents.js +58 -27
  53. package/.agents/workflows/helpers/acceptance-self-eval.md +24 -18
  54. package/.agents/workflows/helpers/code-review.md +3 -3
  55. package/.agents/workflows/helpers/deliver-digest.md +79 -80
  56. package/.agents/workflows/helpers/deliver-light.md +9 -7
  57. package/.agents/workflows/helpers/deliver-reference.md +38 -22
  58. package/.agents/workflows/helpers/deliver-story-reference.md +11 -9
  59. package/.agents/workflows/helpers/deliver-story.md +30 -23
  60. package/.agents/workflows/helpers/plan-reference.md +24 -9
  61. package/docs/CHANGELOG.md +19 -0
  62. package/lib/cli/registry.js +7 -0
  63. package/package.json +4 -3
  64. package/.agents/scripts/lib/orchestration/review-providers/scoped-lint.js +0 -272
package/.agents/README.md CHANGED
@@ -510,14 +510,13 @@ ticketing provider is GitHub, resolved by `provider-factory.js` from the
510
510
  `orchestration.provider` config key. CLI scripts receive provider
511
511
  instances from the SDK surface rather than importing provider
512
512
  implementations directly. Execution is Claude-Code-in-session — there is
513
- no separate adapter abstraction; `manifest-builder.js` synthesizes the
514
- dispatch record inline and the dispatch manifest (md + structured
515
- comment) is the cross-runtime contract.
516
-
517
- The SDK barrel is `scripts/lib/orchestration/index.js`; its exports are
518
- the source of truth for the public in-process surface. Key families
519
- include dispatch (`dispatch-engine.js`, `manifest-builder.js`), context
520
- hydration, planning state, label transitions, Story-close internals,
513
+ no separate adapter abstraction; a Story's GitHub labels and structured
514
+ comments are the cross-runtime contract.
515
+
516
+ There is no SDK barrel: callers import each module directly, with
517
+ `scripts/lib/orchestration/ticketing.js` as the authoritative ticketing SDK.
518
+ Key families include Story resolution and delivery (`single-story-init.js`
519
+ / `single-story-close.js` internals), planning state, label transitions,
521
520
  retro proposals, and structured error capture.
522
521
 
523
522
  ### GitHub authentication
@@ -615,7 +614,7 @@ and per-kind CLI deletion are tracked in **Epic #1943**.
615
614
 
616
615
  `schemas/` contains JSON Schema draft 2020-12 contracts consumed by the
617
616
  orchestration layer. Each schema describes one structured artefact:
618
- configuration, runtime reports, dispatch manifests, or persisted state.
617
+ configuration, runtime reports, or persisted state.
619
618
  Where a runtime AJV schema also exists, the JSON file is a mirror kept
620
619
  in sync by a drift test.
621
620
 
@@ -8,6 +8,7 @@ description: >-
8
8
  helpers/deliver-story Step 1a under ceremonyProfile strict, the one profile
9
9
  whose verdict owner is a fresh critic.
10
10
  effort: medium
11
+ model: inherit
11
12
  ---
12
13
 
13
14
  <!--
@@ -8,6 +8,7 @@ description: >-
8
8
  only the lens's own dimensions. Dispatched as subagent_type: auditor by every
9
9
  audit-<lens> workflow's first-class execution path.
10
10
  effort: medium
11
+ model: sonnet
11
12
  ---
12
13
 
13
14
  <!--
@@ -8,6 +8,7 @@ description: >-
8
8
  transcript. Dispatched on an operator-requested plan-critics.js verdict
9
9
  when delivery.routing.roleScopedAgents is enabled (the default).
10
10
  effort: medium
11
+ model: inherit
11
12
  ---
12
13
 
13
14
  <!--
@@ -5,6 +5,7 @@ description: >-
5
5
  system prompt (no entry-doc / instructions.md closure). Carries the
6
6
  load-bearing delivery MUSTs standalone. Dispatched by helpers/deliver-story
7
7
  when delivery.routing.roleScopedAgents is enabled (the default).
8
+ model: inherit
8
9
  ---
9
10
 
10
11
  <!--
@@ -47,10 +48,11 @@ the step-by-step. This shared core binds every role:
47
48
 
48
49
  You are a **Story delivery worker**: you take one Story from init through
49
50
  implementation to a **pushed branch**, then return. You do **not** close it —
50
- your caller owns the close-and-land tail. Follow the `helpers/deliver-story`
51
- prose your caller hands you; this delta states the MUSTs. Treat a
52
- blocking tool-permission prompt as a harness condition — flip to
53
- `agent::blocked` rather than waiting on an approval that cannot come.
51
+ your caller owns the close-and-land tail. This file carries every worker
52
+ MUST; your mandatory reads are it, the dispatch prompt, the Story body and
53
+ the checklist it names. Treat a blocking tool-permission prompt as a harness
54
+ condition — flip to `agent::blocked` rather than wait on an approval that
55
+ cannot come.
54
56
 
55
57
  ## Worktree discipline (MUST)
56
58
 
@@ -58,9 +60,9 @@ blocking tool-permission prompt as a harness condition — flip to
58
60
  `node .agents/scripts/single-story-init.js --story <storyId>` from the
59
61
  **main checkout**, synchronously at max Bash timeout — the install
60
62
  can take minutes; never background it.
61
- 2. Capture `workCwd` and `dependenciesInstalled` from the envelope.
62
- Anchor every path at the absolute `workCwd` and work only there; never
63
- move the main checkout HEAD.
63
+ 2. Capture `workCwd` and `checklistPath` from the envelope. Anchor every
64
+ path at the absolute `workCwd` and work only there; never move the main
65
+ checkout HEAD. Read the checklist (when non-null) before writing.
64
66
 
65
67
  ## Verify branch before every commit (MUST)
66
68
 
@@ -71,59 +73,60 @@ work to `main` or outside the worktree/branch. Re-run
71
73
 
72
74
  ## Commit discipline
73
75
 
74
- Author Conventional Commit subjects on `story-<storyId>` per
75
- [`git-conventions.md`](../rules/git-conventions.md): imperative mood,
76
- ≤100 chars, `(refs #<storyId>)`. Never bypass the `commit-msg` hook
77
- (`--no-verify` / `--no-gpg-sign`); if one fails, fix the cause and add a
78
- follow-up commit, never amend.
76
+ Conventional Commit subjects on `story-<storyId>` per
77
+ [`git-conventions.md`](../rules/git-conventions.md): imperative, ≤100
78
+ chars, `(refs #<storyId>)`. Never bypass a hook (`--no-verify` /
79
+ `--no-gpg-sign`); if one fails, fix the cause in a follow-up commit, never
80
+ amend. Docs are digest-first: read the digest your caller passes and pull
81
+ files on demand; a null digest path means no docs mandate.
82
+
83
+ ## Acceptance self-eval (MUST)
84
+
85
+ Once the implementation is committed, run
86
+ `node <main-repo>/.agents/scripts/acceptance-eval.js --story <storyId> --init --cwd <workCwd>`.
87
+ It writes the verdict skeleton — one empty record per `acceptance[]` item —
88
+ and prints its path, the derived change set `files` and the `verdictOwner`.
89
+ Under the default profile the owner is **you**: fill every record, scoring
90
+ that `files` set — never one you re-derive — with `verify[]` output as
91
+ evidence, and score it in one call (`--verdict <path>`). Under `strict` the
92
+ owner is a fresh critic
93
+ ([`acceptance-self-eval.md`](../workflows/helpers/acceptance-self-eval.md));
94
+ hand it that same `files` list. **proceed** → the handoff; **redraft** → fix,
95
+ commit, re-init, re-score; **block** → the blocked path. Never hand off an
96
+ unscored branch.
97
+
98
+ ## Close gates — one credited run, via `story-handoff.js`
79
99
 
80
- ## Docs context — digest first
100
+ `single-story-close.js` runs the canonical close-validation chain
101
+ (**typecheck, lint, test, format, maintainability, coverage, crap**) and is
102
+ the authoritative gate — do not pre-run it. Your whole tail is one command:
81
103
 
82
- Do **not** re-read every file in `project.docsContextFiles`. Read the
83
- digest your caller passes, then pull files on demand at the lines it
84
- names. A null digest path means no docs mandate.
104
+ `node <main-repo>/.agents/scripts/story-handoff.js --story <storyId> --cwd <workCwd>`
85
105
 
86
- ## Close gates — one credited run
106
+ It runs the blocking preflight, the base merge, the one credited run, the
107
+ `--seat-missing` seat, the push with its remote-ref check, and the held
108
+ review, then prints one envelope (what each step runs:
109
+ [`deliver-digest.md`](../workflows/helpers/deliver-digest.md) § 5).
110
+ `ready` → return. `fix-required` (exit 2) → fix the cause it names, commit,
111
+ re-run it; the same cause surviving the same fix twice is your blocked path.
112
+ `blocked` (exit 1) → it already flipped `agent::blocked`; exit non-zero.
87
113
 
88
- `single-story-close.js` runs the canonical close-validation chain
89
- (**typecheck, lint, test, format, maintainability, coverage, crap**) and is
90
- the authoritative gate — do not pre-run it. Two exceptions, both run in
91
- `<workCwd>` exactly as
92
- [`deliver-digest.md`](../workflows/helpers/deliver-digest.md) § 5 states them:
93
- the **blocking** lint + quality-preview preflight, then the one credited run
94
- (the coverage capture or the test depositor, as § 5 picks), once after the
95
- self-eval loop's last fix commit, then the `--seat-missing` baseline seat
96
- before push. That section is their only home, so read the invocations there
97
- rather than from a copy here.
98
-
99
- If the run outruns the host's sync Bash ceiling, dispatch it in the
114
+ If it outruns the host's sync Bash ceiling, dispatch it in the
100
115
  **background**: its completion re-invokes you. Never spawn a task to poll or
101
116
  `sleep`-loop against it; a waiter with a wrong condition outlives the agent.
102
- An exit code is never evidence a gate did work — its **output** is. Redraft
103
- rounds run the scoped projects for the roots you changed plus `verify[]`, not
104
- the whole suite, and never stamp coverage / CRAP fresh any other way.
117
+ An exit code is never evidence a gate did work — its **output** is: read the
118
+ envelope's per-step outcomes and credit. Redraft rounds run the scoped
119
+ projects for the roots you changed plus `verify[]`, not the whole suite, and
120
+ never stamp coverage / CRAP fresh any other way.
105
121
 
106
122
  Gate output that lies (mandrel's own repo): `docs/contributing/known-tooling-behavior.md`.
107
123
  Waiter traps: [`parallel-tooling.md`](../workflows/helpers/parallel-tooling.md) Rule 2.
108
124
 
109
- ## Acceptance self-eval before close (MUST)
110
-
111
- **Before** flipping to `closing`, run the bounded self-eval loop
112
- ([`acceptance-self-eval.md`](../workflows/helpers/acceptance-self-eval.md)).
113
- Derive the change set and the verdict owner with
114
- `node <main-repo>/.agents/scripts/ceremony-derive.js --story <storyId> --cwd <workCwd>`.
115
- Under the default profile the owner is **you**: author **one** verdict file
116
- covering every `acceptance[]` item, scoring the derived `files` set — never
117
- one you re-derive — with `verify[]` output as evidence, and score it in one
118
- gate call. Under `strict` the owner is a fresh critic; hand it that same
119
- `files` list. **proceed** → flip to `closing`, run the suite, push, hand off;
120
- **redraft** → fix the criteria, commit, re-eval; **block** → take the
121
- blocked path below. Never hand off an unscored branch.
122
-
123
125
  ## Lifecycle: progress & blocked (MUST)
124
126
 
125
- - **Progress.** One terse line per phase transition (e.g.
126
- `Story #<id>: implementing → closing`).
127
+ - **Progress.** One terse line per phase (e.g.
128
+ `Story #<id>: implementing → pushed`), not a label: the Story stays
129
+ `agent::executing` until close opens the PR.
127
130
  - **Blocked.** When you cannot proceed, transition the Story to
128
131
  `agent::blocked`, post a `friction` comment naming the decision needed
129
132
  (or the unmet criteria and their evidence), and **exit non-zero**.
@@ -132,25 +135,21 @@ blocked path below. Never hand off an unscored branch.
132
135
 
133
136
  ## Land or block — the only sanctioned landing (MUST)
134
137
 
135
- The init envelope carries `remoteVerified` + `remoteProbe`. When
136
- `remoteVerified` is `false`, flip to `agent::blocked` quoting
137
- `remoteProbe.detail` and stop. A PR opened by `single-story-close.js` is
138
- the only sanctioned landing.
138
+ `remoteVerified: false` in the init envelope → flip to `agent::blocked`
139
+ quoting `remoteProbe.detail` and stop. A PR opened by
140
+ `single-story-close.js` is the only sanctioned landing.
139
141
 
140
142
  ## Your turn ends at a pushed branch (MUST)
141
143
 
142
- You do **not** run close. Push `story-<storyId>` to `origin` — confirming
143
- the remote ref moved — then return: a turn that ends unpushed reads as
144
- unfinished work. The orchestrator runs
145
- `single-story-close.js` in its own session, serialized against your
146
- siblings. Do not open the PR, flip `agent::done`, or spawn a child to
147
- close for you. If the push fails, take the blocked path above. After
148
- the push, compute the held review and fix a CRITICAL before returning
149
- ([`deliver-reference.md`](../workflows/helpers/deliver-reference.md) § Held review).
144
+ You do **not** run close. `story-handoff.js` is how you push `story-<storyId>`
145
+ to `origin` and confirm the remote ref equals HEAD; then return. The
146
+ orchestrator runs `single-story-close.js` in its own session, serialized
147
+ against your siblings. Do not open the PR, flip `agent::done`, or spawn a
148
+ child to close for you.
150
149
 
151
150
  ## Return contract — the hand-off report
152
151
 
153
- A short, literal hand-off your caller can act on: Story id, `workCwd`,
154
- branch, pushed head SHA, self-eval verdict, `verify[]` evidence, review
155
- tally. Say the branch is pushed and unclosed. Never hand-compose a
156
- terminal envelope — inventing one makes an unlanded Story look landed.
152
+ Return the `ready` envelope `story-handoff.js` printed, plus the self-eval
153
+ verdict and `verify[]` evidence: Story id, `workCwd`, branch, pushed head
154
+ SHA, review tally. Say the branch is pushed and unclosed. Never hand-compose
155
+ a terminal envelope — inventing one makes an unlanded Story look landed.
@@ -251,7 +251,8 @@
251
251
  "routing": {
252
252
  "roleScopedAgents": true,
253
253
  "ceremonyProfile": "standard",
254
- "closeAndLand": true
254
+ "closeAndLand": true,
255
+ "agentModels": {}
255
256
  }
256
257
  },
257
258
  "qa": {
@@ -237,7 +237,7 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
237
237
  | `mergeWatch.maxWaitSeconds` | No | `integer` | — | Per-invocation merge-wait bound (seconds). Default 300 (5 minutes) — chosen to fit inside a single host tool invocation (~10 min ceiling) alongside the close gates that precede the wait. Expiry yields `pending` (exit 3), never a block. Headless callers with no host ceiling raise this to land in one block. |
238
238
  | `mergeWatch.maxBudgetSeconds` | No | `integer` | `3600` | Cumulative wall-clock budget (seconds) across merge-wait resumes, anchored at the PR's createdAt. Default 3600 (60 minutes). Exhausting this classifies the block and transitions the Story to agent::blocked. |
239
239
  | `codeReview` | No | `object` | — | Review-provider chain and on-branch remediation threshold for the /mandrel-deliver code-review ceremony. |
240
- | `codeReview.providers[]` | No | `array<object>` | `[{"name":"native"},{"name":"code-review","scopes":["story"],"optional":true}]` | Review-provider chain (Story #2871). When unset or empty, falls back to this default: `native` (scoped lint + MI) then an optional story-scoped `code-review` — a low-effort `claude --print` bug review whose every finding is critical and halts close before auto-merge; hosts without the `claude` CLI skip it. `security-review` and `ultrareview` are opt-in. The orchestrator iterates inline entries in declaration order and merges their Finding[] before posting one structured comment; manual-prompt entries (e.g. ultrareview) contribute a trailing 'Manual review suggestions' section. Selecting an adapter whose probe fails hard-fails at factory construction unless declared `optional: true` in the chain. Each item has: name, scopes, optional, manualPrompt, when. |
240
+ | `codeReview.providers[]` | No | `array<object>` | `[{"name":"native"},{"name":"code-review","scopes":["story"],"optional":true}]` | Review-provider chain (Story #2871). When unset or empty, falls back to this default: `native` (maintainability scoring of the changed files) then an optional story-scoped `code-review` — a low-effort `claude --print` bug review whose every finding is critical and halts close before auto-merge; hosts without the `claude` CLI skip it. `security-review` and `ultrareview` are opt-in. The orchestrator iterates inline entries in declaration order and merges their Finding[] before posting one structured comment; manual-prompt entries (e.g. ultrareview) contribute a trailing 'Manual review suggestions' section. Selecting an adapter whose probe fails hard-fails at factory construction unless declared `optional: true` in the chain. Each item has: name, scopes, optional, manualPrompt, when. |
241
241
  | `codeReview.autoFixSeverity` | No | `"high"` \| `"medium"` | `"medium"` | Severity threshold for on-branch remediation in /mandrel-deliver Phase 5 (code-review). `medium` (default) routes 🔴/🟠/🟡 findings into the host-LLM focused-fix routing (Mediums batched per lens: one commit per lens, a single validation + rescan at the end) while 🟢 suggestions still graduate to follow-up issues; `high` reproduces the pre-4399 Critical/High-only routing. Hard cutover — no back-compat flag. |
242
242
  | `refactorStage` | No | `object` | — | Opt-in, config-gated post-green refactor checkpoint wired into story-deliver (Story #3430, Epic #3418). Strictly additive and default-OFF: when disabled, story-deliver behaves exactly as before. Advisory only — never changes existing close-validation gate semantics. |
243
243
  | `refactorStage.enabled` | No | `boolean` | `false` | When true, story-deliver runs an advisory post-green refactor stage (core/code-review-and-quality skill, Post-Green Refactor Pass) after the suite is green. Default false — when unset the stage is skipped and close-validation gate semantics are unchanged. |
@@ -246,7 +246,7 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
246
246
  | `feedbackLoop` | No | `object` | — | Opt-in toggle for the close-time retro auto-file graduator. Auto-filing defaults to OFF (Story #5341). |
247
247
  | `feedbackLoop.retroProposals` | No | `boolean` | `false` | When true, the retro auto-files its actionable routed proposals as meta::<framework-gap\|consumer-improvement> + friction::<category> issues via the graduator pre-parsed-findings seam, and the rendered retro sections list the filed issue numbers instead of paste-ready gh command stanzas. Defaults to false (Story #5341), which renders the command stanzas instead. |
248
248
  | `ci` | No | `object` | — | CI-aware delivery namespace (Story #4356, Epic #4355): the merge posture and the advisory-check policy. |
249
- | `ci.autoMerge` | No | `"trust-ci"` \| `"strict"` | `"trust-ci"` | Story #4356 (Epic #4355). Merge posture. 'trust-ci' (default) merges once required checks pass; 'strict' additionally requires a clean review gate. |
249
+ | `ci.autoMerge` | No | `"trust-ci"` \| `"strict"` | `"trust-ci"` | Story #4356 (Epic #4355). Merge posture. 'trust-ci' (default) merges once required checks pass; 'strict' skips arming auto-merge, so the operator owns the merge; it adds no review gate. |
250
250
  | `ci.blockOnAdvisoryFailure` | No | `boolean` | `true` | Story #5096. When true (default), delivery refuses to arm — and disarms — GitHub native auto-merge while a non-required (advisory) check is genuinely red on the PR head and GitHub reports the PR mergeable anyway (mergeStateStatus=UNSTABLE). `--auto` waits on REQUIRED contexts only, so without this a red advisory quality gate merges unattended. Set false to restore the pre-#5096 behaviour verbatim. |
251
251
  | `ci.advisoryAllowlist` | No | `array<string>` | `[]` | Story #5096. Check-run names exempt from blockOnAdvisoryFailure — a red run whose name matches exactly never blocks arming. Matching is exact; an unnamed run can never match and always blocks. |
252
252
  | `ci.rerunAdvisory` | No | `integer` | `0` | Story #5266. How many times close may re-run a failed advisory workflow run before blocking on it, per close invocation. Default 0: close spends no CI minutes and issues no GitHub mutation on an advisory red unless asked. At n > 0 the failed run(s) are re-run within that allowance and the merge wait re-polls inside its existing budget, landing or blocking on the re-run verdict. Overridden per invocation by --rerun-advisory <n>. |
@@ -254,6 +254,7 @@ Everything `/mandrel-deliver` and `single-story-close` consume: worktree isolati
254
254
  | `routing.roleScopedAgents` | No | `boolean` | `true` | Epic #4478 (M7-B). Kill-switch for the role-scoped boot contexts. When true (default), a converted delivery spawn (`story-worker`, `acceptance-critic`) boots on its own `.claude/agents/<role>.md` system prompt instead of re-paying the full entry-doc (AGENTS.md or CLAUDE.md) @-import closure. When false, every converted spawn falls back to `subagent_type: general-purpose` — the instant, code-rollback-free per-consumer revert, and the universal escape for hosts that ignore `.claude/agents/`. The fallback is the full-closure agent that ran before M7-B, so flipping it off never drops a gate. |
255
255
  | `routing.ceremonyProfile` | No | `"minimal"` \| `"standard"` \| `"strict"` | `"standard"` | Acceptance-ceremony depth — who authors the Story acceptance verdict. minimal and standard (default) = the inline self-eval, whatever the diff touches; strict = a fresh-context maker-blind critic. Review depth is a separate decision and still derives `deep` for any sensitive path (review-depth.js). |
256
256
  | `routing.closeAndLand` | No | `boolean` | `true` | When true (default), single-story-close lands through merge in one close. Opt out per-run with --no-wait-merge. |
257
+ | `routing.agentModels` | No | `object<map>` | `{}` | Per-role model override for the role-scoped agents, keyed by role name (`story-worker`, `acceptance-critic`, `plan-critic`, `auditor`; any other key is a validation error). A value is a Claude Code agent model: an alias (`sonnet`, `opus`, `haiku`), a full model id, or `inherit` (the operator's session model). It replaces the role file's `model:` frontmatter default when `sync-claude-agents` projects `.claude/agents/<role>.md`. Defaults: story-worker, acceptance-critic and plan-critic `inherit` (a checker runs at least as strong as the maker); auditor `sonnet` (a read-heavy lens sweep). Nothing here selects or changes the operator's session model, and a one-Story run stays inline in that session. A multi-Story close records the dispatched story-worker's resolved model as `telemetry.workerModel` beside `workerTokens` (null for an inline close), so opting workers down, e.g. `{ "story-worker": "sonnet" }`, is decided from measured outcomes. |
257
258
 
258
259
  ### `qa` (optional)
259
260
 
@@ -320,11 +321,9 @@ names or defaults.
320
321
 
321
322
  ### `planning`
322
323
 
323
- Defaults are **advisory, not Story-width ceilings**. Session-mass ceilings live
324
- as absolute authored-token constants on `DEFAULT_MODEL_CAPACITY` in
325
- `ticket-validator-sizing.js` (soft 30k / hard 75k); there is no `maxTokenBudget`
326
- envelope, and cohesion / split policy / conflict advisories are the primary
327
- sizing signal.
324
+ Defaults are **advisory, not Story-width ceilings**. There is no token
325
+ ceiling and no `maxTokenBudget` envelope: sizing is cohesion-only, with split
326
+ policy and conflict advisories as its signals.
328
327
 
329
328
  There is no snapshot knob to tune: Story #4811 retired the structural-snapshot
330
329
  block outright. Spec authoring is grounded by the author's own targeted repo
@@ -626,7 +625,7 @@ Claude Code web environment-variables UI for web sessions.
626
625
  | Variable | Required? | Purpose |
627
626
  | -------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
628
627
  | `GITHUB_TOKEN` | Yes\* | GitHub API auth for all ticketing operations. `GH_TOKEN` is accepted as a synonym. `gh auth token` is a fallback for local sessions. |
629
- | `NOTIFICATION_WEBHOOK_URL` | No | POST target for in-band Notifier events (Make.com / Slack / Discord). Unset disables the webhook channel; `log` and `epic-comment` channels still fire. |
628
+ | `NOTIFICATION_WEBHOOK_URL` | No | POST target for in-band Notifier events (Make.com / Slack / Discord). Unset disables the webhook channel; the GitHub comment channel still fires. |
630
629
  | `WEBHOOK_SECRET` | No | Shared secret used to sign outbound webhook payloads as `X-Signature-256: sha256=<hmac>`. Unset ships unsigned payloads. |
631
630
  | `MANDREL_ALLOW_TEST_WEBHOOKS` | No | Set to `1` to keep `NOTIFICATION_WEBHOOK_URL` live inside `npm test` / `npm run test:profile`. Default behaviour scrubs the env var from the test child so no URL resolves and the webhook never fires (see below). |
632
631
  | `MANDREL_POOL_CONCURRENCY` | No | Upper bound on the width of every `runOnPool` worker pool in the process (the MI and CRAP scan pools). Precedence is: a caller's explicit `concurrency` → this variable → a clamp of 4 under `node:test` → `os.availableParallelism()`. Set it on a constrained or shared runner where one pool per core oversubscribes the host; a non-numeric value is ignored rather than collapsing the pool. |
@@ -129,8 +129,8 @@ pushing `story-<id>` and opening a PR. Two guards remain, and they cover
129
129
  different hazards:
130
130
 
131
131
  - **Per-Story lease** (`lib/orchestration/single-story-lease-guard.js`). The
132
- standalone path has no Epic-scoped dispatch manifest to serialize two
133
- operators driving the **same** Story, so `single-story-init.js` takes an
132
+ standalone path has nothing else to serialize two operators driving the
133
+ **same** Story, so `single-story-init.js` takes an
134
134
  exclusive, time-bounded lease on the Story ticket (assignee-as-lease) and
135
135
  clears it at close. It **fails closed** on a foreign assignee — there is no
136
136
  heartbeat ledger to judge staleness from — so a foreign holder always blocks
@@ -1282,7 +1282,7 @@
1282
1282
  },
1283
1283
  "additionalProperties": false
1284
1284
  },
1285
- "description": "Review-provider chain (Story #2871). When unset or empty, falls back to this default: `native` (scoped lint + MI) then an optional story-scoped `code-review` — a low-effort `claude --print` bug review whose every finding is critical and halts close before auto-merge; hosts without the `claude` CLI skip it. `security-review` and `ultrareview` are opt-in. The orchestrator iterates inline entries in declaration order and merges their Finding[] before posting one structured comment; manual-prompt entries (e.g. ultrareview) contribute a trailing 'Manual review suggestions' section. Selecting an adapter whose probe fails hard-fails at factory construction unless declared `optional: true` in the chain.",
1285
+ "description": "Review-provider chain (Story #2871). When unset or empty, falls back to this default: `native` (maintainability scoring of the changed files) then an optional story-scoped `code-review` — a low-effort `claude --print` bug review whose every finding is critical and halts close before auto-merge; hosts without the `claude` CLI skip it. `security-review` and `ultrareview` are opt-in. The orchestrator iterates inline entries in declaration order and merges their Finding[] before posting one structured comment; manual-prompt entries (e.g. ultrareview) contribute a trailing 'Manual review suggestions' section. Selecting an adapter whose probe fails hard-fails at factory construction unless declared `optional: true` in the chain.",
1286
1286
  "default": [
1287
1287
  {
1288
1288
  "name": "native"
@@ -1347,7 +1347,7 @@
1347
1347
  "autoMerge": {
1348
1348
  "type": "string",
1349
1349
  "enum": ["trust-ci", "strict"],
1350
- "description": "Story #4356 (Epic #4355). Merge posture. 'trust-ci' (default) merges once required checks pass; 'strict' additionally requires a clean review gate.",
1350
+ "description": "Story #4356 (Epic #4355). Merge posture. 'trust-ci' (default) merges once required checks pass; 'strict' skips arming auto-merge, so the operator owns the merge; it adds no review gate.",
1351
1351
  "default": "trust-ci"
1352
1352
  },
1353
1353
  "blockOnAdvisoryFailure": {
@@ -1391,6 +1391,23 @@
1391
1391
  "type": "boolean",
1392
1392
  "description": "When true (default), single-story-close lands through merge in one close. Opt out per-run with --no-wait-merge.",
1393
1393
  "default": true
1394
+ },
1395
+ "agentModels": {
1396
+ "type": "object",
1397
+ "description": "Per-role model override for the role-scoped agents, keyed by role name (`story-worker`, `acceptance-critic`, `plan-critic`, `auditor`; any other key is a validation error). A value is a Claude Code agent model: an alias (`sonnet`, `opus`, `haiku`), a full model id, or `inherit` (the operator's session model). It replaces the role file's `model:` frontmatter default when `sync-claude-agents` projects `.claude/agents/<role>.md`. Defaults: story-worker, acceptance-critic and plan-critic `inherit` (a checker runs at least as strong as the maker); auditor `sonnet` (a read-heavy lens sweep). Nothing here selects or changes the operator's session model, and a one-Story run stays inline in that session. A multi-Story close records the dispatched story-worker's resolved model as `telemetry.workerModel` beside `workerTokens` (null for an inline close), so opting workers down, e.g. `{ \"story-worker\": \"sonnet\" }`, is decided from measured outcomes.",
1398
+ "propertyNames": {
1399
+ "enum": [
1400
+ "story-worker",
1401
+ "acceptance-critic",
1402
+ "plan-critic",
1403
+ "auditor"
1404
+ ]
1405
+ },
1406
+ "additionalProperties": {
1407
+ "type": "string",
1408
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
1409
+ },
1410
+ "default": {}
1394
1411
  }
1395
1412
  },
1396
1413
  "additionalProperties": false