mandrel 1.81.0 → 1.83.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 (121) hide show
  1. package/.agents/README.md +46 -5
  2. package/.agents/docs/SDLC.md +97 -82
  3. package/.agents/docs/agentrc-reference.json +10 -2
  4. package/.agents/docs/configuration.md +4 -1
  5. package/.agents/docs/execution-reference.md +52 -0
  6. package/.agents/docs/workflows.md +1 -1
  7. package/.agents/instructions.md +85 -45
  8. package/.agents/personas/architect.md +8 -5
  9. package/.agents/personas/engineer-mobile.md +3 -2
  10. package/.agents/personas/engineer-web.md +3 -2
  11. package/.agents/personas/engineer.md +6 -5
  12. package/.agents/personas/product.md +19 -13
  13. package/.agents/personas/project-manager.md +9 -8
  14. package/.agents/personas/qa-engineer.md +10 -6
  15. package/.agents/personas/refactorer.md +3 -2
  16. package/.agents/personas/technical-writer.md +2 -1
  17. package/.agents/personas/ux-designer.md +2 -2
  18. package/.agents/schemas/agentrc.schema.json +41 -3
  19. package/.agents/schemas/qa-ledger.schema.json +2 -2
  20. package/.agents/scripts/acceptance-spec-reconciler.js +143 -59
  21. package/.agents/scripts/epic-deliver-prepare.js +40 -31
  22. package/.agents/scripts/epic-plan-decompose.js +2 -5
  23. package/.agents/scripts/epic-plan-spec.js +16 -19
  24. package/.agents/scripts/hierarchy-gate.js +11 -11
  25. package/.agents/scripts/lib/ITicketingProvider.js +4 -3
  26. package/.agents/scripts/lib/bdd-runner-detect.js +1 -1
  27. package/.agents/scripts/lib/bdd-scenario-scanner.js +1 -1
  28. package/.agents/scripts/lib/cli-args.js +1 -5
  29. package/.agents/scripts/lib/codebase-snapshot.js +1 -1
  30. package/.agents/scripts/lib/config/explain.js +4 -1
  31. package/.agents/scripts/lib/config/temp-paths.js +1 -4
  32. package/.agents/scripts/lib/config-settings-schema.js +30 -1
  33. package/.agents/scripts/lib/epic-body-sections.js +310 -0
  34. package/.agents/scripts/lib/epic-plan-clarity.js +38 -1
  35. package/.agents/scripts/lib/epic-plan-ideation.js +15 -3
  36. package/.agents/scripts/lib/findings/promote-finding.js +3 -3
  37. package/.agents/scripts/lib/findings/severity.js +5 -6
  38. package/.agents/scripts/lib/label-constants.js +7 -17
  39. package/.agents/scripts/lib/label-taxonomy.js +4 -21
  40. package/.agents/scripts/lib/orchestration/check-baselines/phases/evaluate.js +65 -2
  41. package/.agents/scripts/lib/orchestration/context-hydration-engine.js +105 -9
  42. package/.agents/scripts/lib/orchestration/doc-reader.js +29 -0
  43. package/.agents/scripts/lib/orchestration/docs-digest.js +134 -0
  44. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/context.js +23 -22
  45. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/persist-helpers.js +7 -10
  46. package/.agents/scripts/lib/orchestration/epic-plan-decompose/phases/planning-artifacts.js +4 -38
  47. package/.agents/scripts/lib/orchestration/epic-plan-lease-guard.js +8 -9
  48. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/authoring-context.js +11 -5
  49. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/cli-args.js +26 -5
  50. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/plan-epic.js +102 -304
  51. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/prompts.js +32 -29
  52. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/run-spec-phase.js +19 -20
  53. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/spec-authoring-grounding.js +1 -1
  54. package/.agents/scripts/lib/orchestration/epic-plan-spec/phases/spec-freshness.js +6 -9
  55. package/.agents/scripts/lib/orchestration/epic-plan-state-store.js +3 -4
  56. package/.agents/scripts/lib/orchestration/epic-runner/phases/build-wave-dag.js +1 -1
  57. package/.agents/scripts/lib/orchestration/epic-runner/phases/snapshot.js +20 -27
  58. package/.agents/scripts/lib/orchestration/lifecycle/listeners/acceptance-reconciler.js +11 -5
  59. package/.agents/scripts/lib/orchestration/lifecycle/listeners/finalizer.js +22 -59
  60. package/.agents/scripts/lib/orchestration/lifecycle/listeners/index.js +1 -1
  61. package/.agents/scripts/lib/orchestration/planning-context-budget.js +1 -1
  62. package/.agents/scripts/lib/orchestration/preflight-cache.js +1 -1
  63. package/.agents/scripts/lib/orchestration/spec-freshness.js +3 -3
  64. package/.agents/scripts/lib/orchestration/spec-section-validator.js +1 -1
  65. package/.agents/scripts/lib/orchestration/story-close/baseline-attribution/phases/refresh-commit.js +15 -1
  66. package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +122 -1
  67. package/.agents/scripts/lib/orchestration/ticketing/bulk.js +5 -8
  68. package/.agents/scripts/lib/orchestration/ticketing/reads.js +2 -2
  69. package/.agents/scripts/lib/plan-phase-cleanup.js +1 -2
  70. package/.agents/scripts/lib/qa/console-allowlist.js +5 -4
  71. package/.agents/scripts/lib/qa/qa-context-hydrator.js +6 -85
  72. package/.agents/scripts/lib/qa/resolve-qa-contract.js +144 -8
  73. package/.agents/scripts/lib/templates/decomposer-prompts.js +14 -8
  74. package/.agents/scripts/lifecycle-emit.js +1 -1
  75. package/.agents/scripts/lint-label-vocabulary.js +2 -3
  76. package/.agents/scripts/providers/github/mappers.js +0 -3
  77. package/.agents/scripts/providers/github/tickets.js +7 -18
  78. package/.agents/scripts/single-story-init.js +0 -1
  79. package/.agents/scripts/story-init.js +1 -29
  80. package/.agents/skills/core/epic-plan-consolidate/SKILL.md +43 -22
  81. package/.agents/skills/core/epic-plan-consolidate/examples.md +51 -0
  82. package/.agents/skills/core/epic-plan-decompose-author/SKILL.md +27 -40
  83. package/.agents/skills/core/epic-plan-decompose-author/examples.md +47 -0
  84. package/.agents/skills/core/epic-plan-premortem/SKILL.md +15 -13
  85. package/.agents/skills/core/epic-plan-premortem/examples.md +53 -0
  86. package/.agents/skills/core/epic-plan-spec-author/SKILL.md +143 -151
  87. package/.agents/skills/core/epic-plan-spec-author/examples.md +91 -0
  88. package/.agents/skills/core/hydrate-context/SKILL.md +10 -5
  89. package/.agents/skills/core/knowledge-transfer/SKILL.md +3 -2
  90. package/.agents/skills/core/scope-triage/SKILL.md +2 -1
  91. package/.agents/skills/skills.index.json +8 -8
  92. package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +52 -38
  93. package/.agents/templates/epic-from-idea.md +4 -0
  94. package/.agents/workflows/audit-to-stories.md +2 -2
  95. package/.agents/workflows/helpers/code-review.md +11 -9
  96. package/.agents/workflows/helpers/deliver-epic-reference.md +514 -0
  97. package/.agents/workflows/helpers/deliver-epic.md +173 -490
  98. package/.agents/workflows/helpers/epic-audit.md +11 -8
  99. package/.agents/workflows/helpers/epic-deliver-story.md +45 -27
  100. package/.agents/workflows/helpers/epic-plan-decompose.md +17 -12
  101. package/.agents/workflows/helpers/epic-plan-spec.md +68 -68
  102. package/.agents/workflows/helpers/parallel-tooling.md +2 -1
  103. package/.agents/workflows/helpers/plan-epic-reference.md +136 -0
  104. package/.agents/workflows/helpers/plan-epic.md +141 -256
  105. package/.agents/workflows/helpers/plan-story.md +31 -61
  106. package/.agents/workflows/helpers/qa-run-scenario.md +194 -0
  107. package/.agents/workflows/helpers/scope-triage-gate.md +97 -0
  108. package/.agents/workflows/helpers/single-story-deliver-reference.md +423 -0
  109. package/.agents/workflows/helpers/single-story-deliver.md +129 -393
  110. package/.agents/workflows/helpers/worktree-lifecycle.md +1 -1
  111. package/.agents/workflows/plan.md +8 -8
  112. package/.agents/workflows/qa-assist.md +2 -1
  113. package/.agents/workflows/qa-explore.md +63 -32
  114. package/.agents/workflows/qa-run.md +293 -130
  115. package/docs/CHANGELOG.md +35 -0
  116. package/package.json +1 -1
  117. package/.agents/schemas/qa-finding.schema.json +0 -133
  118. package/.agents/scripts/lib/issue-link-parser.js +0 -74
  119. package/.agents/scripts/lib/orchestration/finalize/close-planning-tickets.js +0 -116
  120. package/.agents/scripts/lib/orchestration/planning-state-manager.js +0 -318
  121. package/.agents/scripts/lib/story-init/hierarchy-tracer.js +0 -57
@@ -353,7 +353,7 @@ Human reviewers should **keep using the main checkout** — not a worktree:
353
353
  the main checkout, not in any per-story worktree.
354
354
  - Opening a worktree in an IDE can mislead: the working directory looks like the
355
355
  main repo but carries a different HEAD. The main checkout is the canonical
356
- place to read PRDs, Tech Specs, and run the `helpers/code-review.md`
356
+ place to read Epic planning bodies and run the `helpers/code-review.md`
357
357
  procedure.
358
358
  - `git worktree list --porcelain` on the main checkout enumerates any still
359
359
  in-flight story worktrees if you need to inspect one — prefer read-only
@@ -2,8 +2,8 @@
2
2
  description:
3
3
  Unified planning entry point. Routes a seed idea (via scope triage) or an
4
4
  existing Epic ID to the right planning path — the full Epic pipeline
5
- (PRD, Tech Spec, Acceptance Spec, decomposition) or the standalone-Story
6
- authoring path — and absorbs every planning flag.
5
+ (sectioned Epic body: Tech Spec + Acceptance Table, then decomposition)
6
+ or the standalone-Story authoring path — and absorbs every planning flag.
7
7
  ---
8
8
 
9
9
  # /plan [Epic ID] | --idea "<seed>" | --from-notes <path>
@@ -14,8 +14,8 @@ Router. `/plan` owns argument parsing and path selection only — all phase
14
14
  content lives in the two path helpers:
15
15
 
16
16
  - [`helpers/plan-epic.md`](helpers/plan-epic.md) — the full Epic planning
17
- pipeline (PRD, Tech Spec, Acceptance Spec, work breakdown, healthcheck,
18
- handoff).
17
+ pipeline (Tech Spec + Acceptance Table folded into the Epic body, work
18
+ breakdown, healthcheck, handoff).
19
19
  - [`helpers/plan-story.md`](helpers/plan-story.md) — the standalone-Story
20
20
  authoring path (context envelope → host-LLM draft → HITL → issue create).
21
21
 
@@ -93,10 +93,10 @@ without waiting for operator input:
93
93
  forces a review (`planningRisk.requiresReview === true`, or the operator
94
94
  also passed `--force-review`),
95
95
  [`helpers/plan-epic.md`](helpers/plan-epic.md) Phase 7 STOPs for operator
96
- approval of the PRD / Tech Spec / Acceptance Spec before decomposition.
97
- Under `--yes` this review auto-proceeds straight to Phase 8 — the three
98
- context tickets stay **open** through delivery exactly as on the low-risk
99
- auto-proceed path.
96
+ approval of the updated Epic body (its Tech Spec sections and
97
+ `## Acceptance Table`) before decomposition.
98
+ Under `--yes` this review auto-proceeds straight to Phase 8 exactly as
99
+ on the low-risk auto-proceed path.
100
100
 
101
101
  **Composition.** `--yes` is orthogonal to the other planning flags and
102
102
  composes cleanly:
@@ -226,7 +226,8 @@ every decision to the shared core helpers; never re-derive them in prose.
226
226
 
227
227
  3. **Hydrate the QA context** to locate code precisely, via
228
228
  [`qa-context-hydrator.js`](../scripts/lib/qa/qa-context-hydrator.js) — it
229
- resolves the Epic/Feature context tickets, the feature-file set, the surface
229
+ resolves the Epic (whose body carries the planning sections), the
230
+ feature-file set, the surface
230
231
  map, and recent git log:
231
232
 
232
233
  ```js
@@ -59,13 +59,17 @@ skill. It is the conventions reference this procedure depends on for the
59
59
  browser MCP, starting at a root and reaching each surface only via UI
60
60
  affordances — never URL-jump to a deep link. Browser instrumentation lives in
61
61
  [`core/browser-testing-with-devtools`](../skills/core/browser-testing-with-devtools/SKILL.md).
62
- - **Static driving (the documented interim).** When a live runtime is not
63
- reachable, walk the surface from source, route definitions, and rendered
64
- markup — chosen explicitly at Plan time, never as a silent fallback.
65
- - **Authenticated driving depends on consumer persona-seeding infrastructure
66
- this framework does not deliver.** Without it, drive only the unauthenticated
67
- surface or fall back to static, never enter real credentials, and record the
68
- gap.
62
+ - **Static driving (the documented interim).** When **no seam resolves** for the
63
+ target environment, walk the surface from source, route definitions, and
64
+ rendered markup — chosen explicitly at Plan time, never as a silent fallback.
65
+ - **Authenticated driving follows the per-environment seam.** When the resolved
66
+ target environment carries a `signInSeam` a dev `url` seam or a `skill` seam
67
+ with `credentialRef`-indirected sign-in drive the authenticated surface via
68
+ that seam, including authenticated deployed hosts. Real credentials are never
69
+ typed inline: the seam consumes a persona **name** (`url`) or a stored
70
+ `credentialRef` (`skill`), and every evidence string passes through mandatory
71
+ redaction. Static is the interim **only** where the target environment
72
+ resolves no seam.
69
73
  - **Broken navigation is a finding, not a workaround.** A missing affordance, a
70
74
  nav 404, or a guard redirect loop is recorded and you move on — you do not
71
75
  route around it with a direct URL.
@@ -160,31 +164,54 @@ before touching the surface.
160
164
  1. Re-read the `qa-engineer` persona and the
161
165
  [`stack/qa/qa-explore-driving`](../skills/stack/qa/qa-explore-driving/SKILL.md)
162
166
  skill, and resolve the `qa` contract and session (above).
163
- 2. **Choose the driving method explicitly** for the named `surface`:
164
- - **Drive (default):** the live runtime is reachable, so the agent will
165
- drive it through the browser MCP, navigation-first (start at a root, reach
166
- the surface via UI affordances, never URL-jump).
167
- - **Static (documented interim):** the live runtime is *not* reachable —
168
- most commonly because authenticated driving needs consumer persona-seeding
169
- infrastructure that does not exist — so the agent will walk the surface
170
- from source, routes, and rendered markup. This is a deliberate Plan-time
171
- decision with a recorded reason, never a silent fallback when the browser
172
- MCP hiccups.
173
-
174
- Record the chosen method and reason on the ledger (e.g.
175
- `method: static, reason: no reachable authenticated runtime`).
176
- 3. Draft an **exploration plan** for the named `surface`:
167
+ 2. **Resolve the target environment** via
168
+ [`resolveQaEnvironment`](../scripts/lib/qa/resolve-qa-contract.js). The
169
+ contract's `environments` map keys each deployment target (`local`, a
170
+ staging host, an authenticated deployed host) to its `baseUrl`, `signInSeam`,
171
+ and resolved `allowWrites`:
172
+
173
+ ```js
174
+ import { resolveQaEnvironment } from '../scripts/lib/qa/resolve-qa-contract.js';
175
+ // `target` is an environment name or a raw URL; omit for the default.
176
+ const environment = resolveQaEnvironment(contract, target);
177
+ // → { name, baseUrl, signInSeam, allowWrites }
178
+ ```
179
+
180
+ When the operator's `surface` does not pin an unambiguous target and the
181
+ contract declares more than one environment, **prompt** the operator to name
182
+ the environment (or accept the `defaultEnvironment`) — never silently pick
183
+ one. The resolver throws loudly (naming the known environments) on an unknown
184
+ name or an unmatched URL; surface that verbatim and stop. Record the resolved
185
+ **environment name** on the ledger alongside the driving method.
186
+ 3. **Choose the driving method explicitly** for the named `surface` on the
187
+ resolved environment:
188
+ - **Drive (default):** a seam resolves for the target environment, so the
189
+ agent will drive it through the browser MCP, navigation-first (start at a
190
+ root, reach the surface via UI affordances, never URL-jump). Drive is
191
+ available for **any** environment whose `signInSeam` resolves — including
192
+ authenticated deployed hosts reached via a `skill` seam.
193
+ - **Static (documented interim):** **no seam resolves** for the target
194
+ environment, so the agent will walk the surface from source, routes, and
195
+ rendered markup. This is a deliberate Plan-time decision with a recorded
196
+ reason, never a silent fallback when the browser MCP hiccups.
197
+
198
+ Record the resolved environment name, the chosen method, and the reason on
199
+ the ledger (e.g.
200
+ `environment: staging, method: drive, seam: skill` or
201
+ `environment: preview, method: static, reason: no seam resolves`).
202
+ 4. Draft an **exploration plan** for the named `surface`:
203
+ - the resolved target environment (name + `baseUrl`),
177
204
  - the sub-surfaces / flows / states the agent intends to drive,
178
205
  - the classes of signal it is hunting (product bug, environment-setup,
179
206
  tooling-dx, test-gap, enhancement — the
180
207
  [ledger `class` enum](../schemas/qa-ledger.schema.json)),
181
208
  - the chosen driving method and its rationale,
182
209
  - any rolling backlog (`untriaged`) carried forward from a resumed session.
183
- 4. Present the plan, the chosen driving method, and the resolved `ledgerPath`
184
- (under `temp/qa/`) to the operator.
185
- 5. **Gate:** ask the operator to confirm the plan and the driving method (or
186
- amend the surface/scope/method). Do **not** proceed to Capture until they
187
- confirm.
210
+ 5. Present the plan, the resolved target environment, the chosen driving
211
+ method, and the resolved `ledgerPath` (under `temp/qa/`) to the operator.
212
+ 6. **Gate:** ask the operator to confirm the plan, the target environment, and
213
+ the driving method (or amend the surface/scope/environment/method). Do
214
+ **not** proceed to Capture until they confirm.
188
215
 
189
216
  ---
190
217
 
@@ -212,10 +239,12 @@ observations. **This phase is strictly read-only.**
212
239
  MCP — start at a root, click the affordances a real user would, and observe
213
240
  the rendered state, console, and network signal. Never URL-jump to establish
214
241
  a starting state; a broken affordance, nav 404, or guard redirect loop is
215
- itself a **finding**, not a workaround. Never enter real credentials to reach
216
- an authenticated surface and never fabricate a session drive only the
217
- unauthenticated surface (or capture the authenticated surface statically) and
218
- record the persona-seeding gap.
242
+ itself a **finding**, not a workaround. To reach an authenticated surface,
243
+ sign in through the resolved environment's `signInSeam`a dev `url` seam
244
+ (substitute the persona name into the template) or a `skill` seam (invoke the
245
+ named sign-in skill, which reads a stored `credentialRef`). Never type real
246
+ credentials inline and never fabricate a session; the seam is the only path
247
+ to a logged-in surface, and all captured evidence is redacted (§ 1 below).
219
248
  - **Static (documented interim):** walk the surface from source, route
220
249
  definitions, and rendered markup. Treat its coverage as partial and say so in
221
250
  the ledger — a static pass does not close the same coverage a driven pass
@@ -368,8 +397,10 @@ deferred rolling backlog that a resumed session will pick up.
368
397
  [`stack/qa/qa-explore-driving`](../skills/stack/qa/qa-explore-driving/SKILL.md).
369
398
  - **Capture is read-only.** The only Capture write is appending ledger lines
370
399
  under `temp/qa/`. No source edits, no ticket mutations, no product writes,
371
- no destructive form submissions. Never enter real credentials or fabricate a
372
- session; record the persona-seeding gap instead.
400
+ no destructive form submissions. Never type real credentials inline or
401
+ fabricate a session; reach an authenticated surface only through the resolved
402
+ environment's `signInSeam`, and where no seam resolves, record the gap and
403
+ fall back to static.
373
404
  - **Broken navigation is a finding, not a workaround.** Never URL-jump around a
374
405
  missing affordance, a nav 404, or a guard redirect loop — record it and move
375
406
  on.