mandrel 1.91.0 → 1.93.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.
- package/.agents/README.md +5 -5
- package/.agents/docs/SDLC.md +75 -107
- package/.agents/docs/configuration.md +1 -1
- package/.agents/docs/quality-gates.md +8 -7
- package/.agents/docs/workflows.md +4 -10
- package/.agents/instructions.md +2 -2
- package/.agents/schemas/agentrc.schema.json +1 -1
- package/.agents/schemas/lifecycle/README.md +2 -1
- package/.agents/schemas/lifecycle/ledger-record.schema.json +1 -1
- package/.agents/schemas/risk-verdict.schema.json +14 -1
- package/.agents/scripts/README.md +0 -46
- package/.agents/scripts/analyze-execution.js +76 -1
- package/.agents/scripts/check-doc-links.js +3 -0
- package/.agents/scripts/check-workflow-cli-lint.js +208 -0
- package/.agents/scripts/epic-audit-recheck.js +1 -1
- package/.agents/scripts/epic-plan-clarity.js +16 -6
- package/.agents/scripts/epic-plan-decompose.js +37 -59
- package/.agents/scripts/epic-plan-healthcheck.js +39 -6
- package/.agents/scripts/epic-plan-spec.js +41 -168
- package/.agents/scripts/epic-reconcile.js +7 -1
- package/.agents/scripts/lib/Logger.js +4 -4
- package/.agents/scripts/lib/audit-suite/index.js +4 -5
- package/.agents/scripts/lib/audit-suite/runner.js +6 -4
- package/.agents/scripts/lib/audit-suite/selector.js +2 -3
- package/.agents/scripts/lib/bdd-runner-detect.js +1 -1
- package/.agents/scripts/lib/command-header.js +20 -0
- package/.agents/scripts/lib/config/github.js +1 -3
- package/.agents/scripts/lib/config-settings-schema.js +4 -3
- package/.agents/scripts/lib/degraded-mode.js +1 -1
- package/.agents/scripts/lib/label-constants.js +18 -3
- package/.agents/scripts/lib/label-taxonomy.js +14 -3
- package/.agents/scripts/lib/mutation/baseline-snapshot.js +7 -6
- package/.agents/scripts/lib/orchestration/consolidation-precondition.js +18 -8
- package/.agents/scripts/lib/orchestration/context-hydration-engine.js +3 -4
- package/.agents/scripts/lib/orchestration/docs-digest.js +2 -2
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist-helpers.js +4 -0
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist.js +22 -12
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/authoring-context.js +6 -1
- package/.agents/scripts/lib/orchestration/epic-spec-reconciler-diff.js +18 -2
- package/.agents/scripts/lib/orchestration/file-assumptions.js +68 -7
- package/.agents/scripts/{lifecycle-diff.js → lib/orchestration/lifecycle/ledger-diff.js} +10 -76
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/acceptance-reconciler.js +1 -1
- package/.agents/scripts/lib/orchestration/plan-context.js +696 -0
- package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +177 -0
- package/.agents/scripts/lib/orchestration/plan-critics-evaluate.js +99 -0
- package/.agents/scripts/lib/orchestration/plan-metrics.js +445 -0
- package/.agents/scripts/lib/orchestration/plan-persist/amend.js +359 -0
- package/.agents/scripts/lib/orchestration/plan-persist/delivery-mode.js +127 -0
- package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +1015 -0
- package/.agents/scripts/lib/orchestration/plan-persist/summary.js +206 -0
- package/.agents/scripts/lib/orchestration/plan-reachability.js +160 -0
- package/.agents/scripts/lib/orchestration/plan-runner/worktree-sweep.js +3 -3
- package/.agents/scripts/lib/orchestration/planning-risk.js +1 -1
- package/.agents/scripts/lib/orchestration/spec-freshness.js +1 -1
- package/.agents/scripts/lib/orchestration/ticket-validator.js +18 -1
- package/.agents/scripts/lib/orchestration/ticketing/bulk.js +1 -1
- package/.agents/scripts/lib/orchestration/ticketing/reads.js +11 -2
- package/.agents/scripts/lib/plan-phase-cleanup.js +16 -0
- package/.agents/scripts/lib/presentation/manifest-persistence.js +2 -3
- package/.agents/scripts/lib/templates/spec-author-prompts.js +74 -0
- package/.agents/scripts/plan-context.js +204 -0
- package/.agents/scripts/plan-critics.js +199 -0
- package/.agents/scripts/plan-persist.js +383 -0
- package/.agents/scripts/pr-watch-with-update.js +8 -7
- package/.agents/scripts/run-lint.js +10 -11
- package/.agents/scripts/story-plan.js +19 -7
- package/.agents/scripts/sync-claude-commands.js +10 -5
- package/.agents/skills/core/knowledge-transfer/SKILL.md +11 -7
- package/.agents/workflows/audit-documentation.md +5 -7
- package/.agents/workflows/audit-lighthouse.md +1 -0
- package/.agents/workflows/audit-security.md +1 -0
- package/.agents/workflows/audit-to-stories.md +16 -5
- package/.agents/workflows/git-deliver.md +76 -243
- package/.agents/workflows/helpers/_merge-conflict-template.md +1 -1
- package/.agents/workflows/helpers/code-review.md +7 -6
- package/.agents/workflows/helpers/deliver-epic.md +5 -4
- package/.agents/workflows/helpers/plan-epic-reference.md +120 -96
- package/.agents/workflows/helpers/plan-epic.md +307 -994
- package/.agents/workflows/helpers/plan-story.md +14 -14
- package/.agents/workflows/helpers/scope-triage-gate.md +15 -4
- package/.agents/workflows/helpers/single-story-deliver.md +5 -4
- package/.agents/workflows/helpers/worktree-lifecycle.md +9 -7
- package/.agents/workflows/mandrel-update.md +144 -466
- package/.agents/workflows/plan.md +87 -145
- package/docs/CHANGELOG.md +20 -0
- package/lib/cli/registry.js +21 -3
- package/package.json +1 -1
- package/.agents/schemas/loop-unit.schema.json +0 -70
- package/.agents/scripts/assert-branch.js +0 -81
- package/.agents/scripts/check-loop-units.js +0 -204
- package/.agents/scripts/detect-merges.js +0 -111
- package/.agents/scripts/git-pr-quality-gate.js +0 -205
- package/.agents/scripts/git-rebase-and-resolve.js +0 -234
- package/.agents/scripts/hierarchy-gate.js +0 -192
- package/.agents/scripts/hydrate-context.js +0 -179
- package/.agents/scripts/lib/loop-units/validate-loop-unit.js +0 -197
- package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/cli.js +0 -167
- package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/cli-args.js +0 -69
- package/.agents/scripts/lib/orchestration/plan-runner/plan-router.js +0 -86
- package/.agents/scripts/loc-delta.js +0 -205
- package/.agents/scripts/render-manifest.js +0 -143
- package/.agents/scripts/run-audit-suite.js +0 -97
- package/.agents/scripts/select-audits.js +0 -155
- package/.agents/scripts/update-mutation-baseline.js +0 -189
- package/.agents/workflows/explain.md +0 -118
- package/.agents/workflows/git-merge-pr.md +0 -377
- package/.agents/workflows/helpers/epic-plan-decompose.md +0 -22
- package/.agents/workflows/helpers/epic-plan-spec.md +0 -22
- package/.agents/workflows/loops/README.md +0 -65
- package/.agents/workflows/loops/fix-failing-tests.md +0 -74
- package/.agents/workflows/loops/nightly-audit.md +0 -81
- package/.agents/workflows/loops/watch-ci.md +0 -68
|
@@ -41,9 +41,9 @@ If a Story-under-Epic needs replanning, use `/plan <epicId> --force`. If you
|
|
|
41
41
|
have a refactor, framework-maintenance idea, or any standalone unit of
|
|
42
42
|
work, use this workflow.
|
|
43
43
|
|
|
44
|
-
**Inbound from `/plan` scope triage.**
|
|
45
|
-
[`core/scope-triage`](../../skills/core/scope-triage/SKILL.md) rubric over
|
|
46
|
-
sharpened one-pager. On a `story` / `borderline` verdict the operator may route
|
|
44
|
+
**Inbound from `/plan` scope triage.** The Epic path's interrogate step runs
|
|
45
|
+
the [`core/scope-triage`](../../skills/core/scope-triage/SKILL.md) rubric over
|
|
46
|
+
the sharpened one-pager. On a `story` / `borderline` verdict the operator may route
|
|
47
47
|
the work here via `/plan --from-notes <path>`. That invocation is a
|
|
48
48
|
**scope-triage handoff** — the triage decision is already made, so `/plan`
|
|
49
49
|
MUST NOT re-triage it (the no-re-triage rule in the skill); it proceeds straight
|
|
@@ -116,7 +116,7 @@ when there is nothing to surface.
|
|
|
116
116
|
(or empty). Pass `--refine` / `--no-refine` to override. When the
|
|
117
117
|
envelope advises refinement, activate the
|
|
118
118
|
[`core/idea-refinement`](../../skills/core/idea-refinement/SKILL.md) skill
|
|
119
|
-
before drafting the body — same skill
|
|
119
|
+
before drafting the body — same skill the Epic path's interrogate step drives.
|
|
120
120
|
|
|
121
121
|
## Phase 2 — Host LLM Authors a Draft Body
|
|
122
122
|
|
|
@@ -155,11 +155,11 @@ Check `corpusContext` before authoring the `## Context` section:
|
|
|
155
155
|
|
|
156
156
|
Write the draft to `temp/single-story-draft.md`.
|
|
157
157
|
|
|
158
|
-
### Scope-triage escalation gate (symmetric counterpart to
|
|
158
|
+
### Scope-triage escalation gate (symmetric counterpart to the Epic path's ideation triage)
|
|
159
159
|
|
|
160
160
|
This gate runs the shared scope-triage gate over the **drafted Story body** to
|
|
161
161
|
catch an Epic-sized scope before it is persisted as a standalone Story — the
|
|
162
|
-
outbound mirror of
|
|
162
|
+
outbound mirror of the Epic path's inbound downgrade gate. The gate
|
|
163
163
|
mechanics (verdict meanings, the three-way operator choice, the `--yes`
|
|
164
164
|
resolution, and the no-re-triage rule) live in the single-homed fragment
|
|
165
165
|
[`scope-triage-gate.md`](scope-triage-gate.md); read it and follow it. This
|
|
@@ -172,13 +172,13 @@ phase supplies only its path-specific firing conditions:
|
|
|
172
172
|
`refine` heuristic in `story-plan.js` is unchanged — it is a deterministic
|
|
173
173
|
seed-length proxy, not a scope-size judgment.)
|
|
174
174
|
- **When it is skipped**: entirely, when `/plan` was entered via a scope-triage
|
|
175
|
-
handoff — from
|
|
176
|
-
|
|
175
|
+
handoff — from the Epic path's ideation triage (the inbound route above) or
|
|
176
|
+
its existing-Epic story-sized conversion path (the no-re-triage rule in the
|
|
177
177
|
fragment).
|
|
178
178
|
- **Recommended branch on an `epic` verdict**: escalate to `/plan --idea` —
|
|
179
179
|
persist the notes/draft to a notes file and hand off to `/plan --idea` (or
|
|
180
180
|
`--from-notes <path>`), identifying the invocation as a scope-triage handoff
|
|
181
|
-
so `/plan` skips its own
|
|
181
|
+
so `/plan` skips its own ideation triage gate, then **abandon the draft and exit
|
|
182
182
|
`/plan`** (no standalone Story is created). The alternative branches are
|
|
183
183
|
**persist as a standalone Story anyway** (proceed to Phase 3 with the draft
|
|
184
184
|
unchanged) and **abort**.
|
|
@@ -186,8 +186,8 @@ phase supplies only its path-specific firing conditions:
|
|
|
186
186
|
### HITL — operator confirms the draft (verdict folded in)
|
|
187
187
|
|
|
188
188
|
Display the draft to the operator and **STOP**. Do not call the persist phase
|
|
189
|
-
until the operator explicitly confirms the draft. This mirrors the
|
|
190
|
-
|
|
189
|
+
until the operator explicitly confirms the draft. This mirrors the Epic
|
|
190
|
+
path's gate #1 at the exit of its interrogate step. This is the
|
|
191
191
|
story-path face of `/plan`'s **gate #1** (the ideation one-pager /
|
|
192
192
|
scope-triage confirm). The scope-triage verdict folds into this same stop, per
|
|
193
193
|
the branch bindings above; on a **`story` verdict (or gate skipped via
|
|
@@ -229,8 +229,8 @@ exact `gh issue create` shape that would run.
|
|
|
229
229
|
## Constraints
|
|
230
230
|
|
|
231
231
|
- **No `Epic: #N` references.** This is the standalone contract; persist
|
|
232
|
-
fails fast if one is present. To attach a Story to an Epic,
|
|
233
|
-
`/plan
|
|
232
|
+
fails fast if one is present. To attach a Story to an Epic, plan it
|
|
233
|
+
through the Epic path (`/plan <epicId>`) instead.
|
|
234
234
|
- **No external LLM APIs.** Mirrors the v5.6 contract: the host LLM does
|
|
235
235
|
the authoring; the Node wrapper does the I/O.
|
|
236
236
|
- **Idempotent.** Re-running `--emit-context` is safe. Re-running
|
|
@@ -245,7 +245,7 @@ exact `gh issue create` shape that would run.
|
|
|
245
245
|
|
|
246
246
|
- [`/single-story-deliver`](single-story-deliver.md) — the consumer
|
|
247
247
|
workflow that picks the Story up after this one creates it.
|
|
248
|
-
- [`/plan`](plan-epic.md) — the Epic-tier equivalent.
|
|
248
|
+
- [`/plan`](plan-epic.md) — the Epic-tier equivalent. Its ideation entry
|
|
249
249
|
inspired the seed-capture + envelope-emit pattern used here.
|
|
250
250
|
- [`core/idea-refinement`](../../skills/core/idea-refinement/SKILL.md) —
|
|
251
251
|
optional pre-authoring skill activated when the seed is short.
|
|
@@ -11,7 +11,8 @@ caller: plan-epic.md, plan-story.md
|
|
|
11
11
|
|
|
12
12
|
> **Not a slash command.** This file lives in `helpers/` and is a
|
|
13
13
|
> path-included fragment (not projected into the plugin command tree). It is
|
|
14
|
-
> referenced by [`plan-epic.md`](plan-epic.md) (
|
|
14
|
+
> referenced by [`plan-epic.md`](plan-epic.md) (its interrogate step — the
|
|
15
|
+
> ideation triage and the existing-Epic story-sized advisory) and
|
|
15
16
|
> [`plan-story.md`](plan-story.md) (Phase 2), which supply only their
|
|
16
17
|
> path-specific firing conditions and defer the gate mechanics here.
|
|
17
18
|
|
|
@@ -44,7 +45,7 @@ The rubric emits exactly one verdict:
|
|
|
44
45
|
presented so the operator makes the call.
|
|
45
46
|
|
|
46
47
|
The verdict is **advisory**. Being wrong in the `epic` direction is cheap
|
|
47
|
-
(
|
|
48
|
+
(the consolidation critic and the sizing validator catch an over-planned Story
|
|
48
49
|
later), so the gate never costs the operator a stop on an `epic` verdict; the
|
|
49
50
|
gate exists to avoid the ceremony tax of pushing a story-sized scope through
|
|
50
51
|
the full Epic pipeline.
|
|
@@ -86,11 +87,21 @@ meanings; it only forces the Recommended resolution where the gate would
|
|
|
86
87
|
otherwise STOP. See
|
|
87
88
|
[`plan.md` § Headless / non-interactive mode](../plan.md#headless--non-interactive-mode---yes).
|
|
88
89
|
|
|
90
|
+
**Headless seed entry — the verdict is already in the envelope (#4496).**
|
|
91
|
+
On the `--idea` `--yes` path the rubric is applied **CLI-side** by
|
|
92
|
+
`plan-context.js --seed` and shipped as the envelope's `scopeTriage` field
|
|
93
|
+
(`{ verdict, reasons, advisory: true, appliedBy: "cli" }`), anchored to the
|
|
94
|
+
same sizing SSOT this skill anchors to. Do **not** Read the
|
|
95
|
+
`core/scope-triage` skill headless — use the envelope verdict and resolve it
|
|
96
|
+
per this section. The attended paths keep the skill-based judgment
|
|
97
|
+
unchanged.
|
|
98
|
+
|
|
89
99
|
## No-re-triage rule
|
|
90
100
|
|
|
91
101
|
A **scope-triage handoff** is a triage decision *already made*. When `/plan` is
|
|
92
|
-
entered via a handoff (from the
|
|
93
|
-
|
|
102
|
+
entered via a handoff (from the Epic path's ideation triage, its
|
|
103
|
+
existing-Epic story-sized conversion, or the standalone-Story Phase 2
|
|
104
|
+
escalation), the
|
|
94
105
|
receiving path **MUST NOT** re-run this gate. Re-triaging a settled call would
|
|
95
106
|
re-litigate it and risk a ping-pong between the two `/plan` paths. Each
|
|
96
107
|
referencing path states its own skip-on-handoff condition and defers the
|
|
@@ -351,13 +351,14 @@ When the watch exits, branch on the exit code:
|
|
|
351
351
|
commit on `story-<storyId>`, then re-watch. Auto-merge stays enabled
|
|
352
352
|
across retries; no need to re-arm it. The Story stays at
|
|
353
353
|
`agent::closing` throughout, so a failed/abandoned PR never strands a
|
|
354
|
-
CLOSED issue. If the same failure class recurs, hand convergence off to
|
|
355
|
-
|
|
354
|
+
CLOSED issue. If the same failure class recurs, hand convergence off to a
|
|
355
|
+
self-paced host loop (`/loop`) that re-runs the failing check and applies
|
|
356
|
+
the smallest fix until it exits green.
|
|
356
357
|
- **Exit 2 (still-running — slow CI, not red)** — the poll cap fired with
|
|
357
358
|
checks still pending and the watcher exhausted its resume budget with
|
|
358
359
|
nothing red. This is **never** a failure. Hand the wait off to the
|
|
359
|
-
host's interval loop rather than ending your turn:
|
|
360
|
-
|
|
360
|
+
host's interval loop rather than ending your turn: `/loop 5m` polling
|
|
361
|
+
`gh pr checks` until the checks settle.
|
|
361
362
|
|
|
362
363
|
> **Triage authority.** How to classify and remediate a red (or repeatedly
|
|
363
364
|
> slow) check — the root-cause-only decision tree for infra/transient and
|
|
@@ -102,7 +102,7 @@ or stale locks.
|
|
|
102
102
|
|
|
103
103
|
`.worktrees/.pending-cleanup.json` accumulates entries when
|
|
104
104
|
`story-close.js` cannot remove a worktree on Windows because of an
|
|
105
|
-
EBUSY-class lock. Plan boot ([`drainPendingCleanupAtBoot`](../../scripts/epic-plan-spec.js) → [`worktree-sweep.js`](../../scripts/lib/orchestration/plan-runner/worktree-sweep.js))
|
|
105
|
+
EBUSY-class lock. Plan boot ([`drainPendingCleanupAtBoot`](../../scripts/lib/orchestration/epic-plan-spec/phases/drain.js), run by `plan-persist.js` → [`worktree-sweep.js`](../../scripts/lib/orchestration/plan-runner/worktree-sweep.js))
|
|
106
106
|
retries the entries — but if the holder
|
|
107
107
|
is a long-lived user-mode process (a stranded test runner, a lingering
|
|
108
108
|
biome/tsc, a node REPL), the lock never clears and the entry pins.
|
|
@@ -127,7 +127,7 @@ PowerShell `Get-CimInstance Win32_Process`, terminating them with
|
|
|
127
127
|
| Trigger | Caller |
|
|
128
128
|
| ---------------- | ---------------------------------------------------------------------------- |
|
|
129
129
|
| `/deliver` | [`Cleaner` lifecycle listener](../../scripts/lib/orchestration/lifecycle/listeners/cleaner.js) at the close-tail cleanup phase (before `wm.gc()`) |
|
|
130
|
-
| `/plan` | [`drainPendingCleanupAtBoot`](../../scripts/epic-plan-spec.js) → [`worktree-sweep.js`](../../scripts/lib/orchestration/plan-runner/worktree-sweep.js) |
|
|
130
|
+
| `/plan` | [`drainPendingCleanupAtBoot`](../../scripts/lib/orchestration/epic-plan-spec/phases/drain.js) (run by `plan-persist.js`) → [`worktree-sweep.js`](../../scripts/lib/orchestration/plan-runner/worktree-sweep.js) |
|
|
131
131
|
| Story merge close | [`story-close.js`](../../scripts/story-close.js) (`drainPendingCleanupAfterClose`) |
|
|
132
132
|
|
|
133
133
|
All automatic paths call `forceDrainPendingCleanup()` (or are folded into
|
|
@@ -242,7 +242,8 @@ Symlink strategy:
|
|
|
242
242
|
content-addressable store at `~/.local/share/pnpm/store` (or the platform
|
|
243
243
|
equivalent) — reused packages are hard-linked into the worktree instead of
|
|
244
244
|
re-downloaded and re-extracted. First-run on a cold store is no faster than
|
|
245
|
-
`per-worktree`, and `epic-plan-healthcheck.js
|
|
245
|
+
`per-worktree`, and the plan healthcheck (`epic-plan-healthcheck.js
|
|
246
|
+
--prime-install`, an opt-in manual run) primes the store in the
|
|
246
247
|
main checkout to avoid paying that cost in parallel story windows.
|
|
247
248
|
|
|
248
249
|
## Windows notes
|
|
@@ -334,8 +335,9 @@ Set `delivery.worktreeIsolation.enabled: false` (or omit the block) to
|
|
|
334
335
|
restore v5.5.1 single-tree behavior:
|
|
335
336
|
|
|
336
337
|
- No `git worktree add` / `remove` calls.
|
|
337
|
-
- `
|
|
338
|
-
place as the primary
|
|
338
|
+
- The native `git branch --show-current` pre-commit check and
|
|
339
|
+
`computeStoryWaves` focus-area serialization remain in place as the primary
|
|
340
|
+
race guards.
|
|
339
341
|
- All existing v5.5.1 tests pass in this mode.
|
|
340
342
|
|
|
341
343
|
Pick single-tree mode when:
|
|
@@ -370,8 +372,8 @@ Human reviewers should **keep using the main checkout** — not a worktree:
|
|
|
370
372
|
- **Always** use the main checkout for code review — not a per-story worktree.
|
|
371
373
|
- **Always** respect `delivery.worktreeIsolation.enabled: false` as a
|
|
372
374
|
first-class fallback mode, not a degraded one. v5.5.1 single-tree guards
|
|
373
|
-
(`
|
|
374
|
-
that mode.
|
|
375
|
+
(the `git branch --show-current` pre-commit check, focus-area serialization)
|
|
376
|
+
remain the primary defense in that mode.
|
|
375
377
|
|
|
376
378
|
## Operator escape hatches
|
|
377
379
|
|