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
@@ -1,9 +1,10 @@
1
1
  ---
2
2
  name: hydrate-context
3
3
  description: >-
4
- Hydrate a Task or Story ticket into a structured ContextEnvelope (or the
5
- legacy `{ prompt }` stdout wrapper). Reads the ticket body, parses
6
- Feature / Epic hierarchy, fetches the Tech Spec + PRD, and assembles
4
+ Hydrate a Story ticket into a structured ContextEnvelope (or the
5
+ legacy `{ prompt }` stdout wrapper). Reads the ticket body, resolves the
6
+ parent Epic, embeds the sectioned Epic body (acceptance-table section
7
+ stripped), and assembles
7
8
  named sections with provenance and section-aware elision. Successor to
8
9
  the retired mandrel MCP `context.hydrate` tool.
9
10
  allowed_tools:
@@ -26,8 +27,12 @@ allowed_tools:
26
27
  ## Role
27
28
 
28
29
  Context aggregator. Resolves a ticket's hierarchy (Story → Epic)
29
- and stitches the linked planning artifacts into a
30
- single prompt the executor consumes.
30
+ and stitches the Epic body — the single planning document, carrying the
31
+ folded Tech Spec sections — plus the Story body into a
32
+ single prompt the executor consumes. The Epic body is embedded with its
33
+ `## Acceptance Table` managed section stripped (close-time reconciliation
34
+ detail the executor does not need); there is no separate Tech Spec fetch
35
+ (Story #4324).
31
36
 
32
37
  ## When to use
33
38
 
@@ -69,8 +69,9 @@ differs (a plan vs. a diff); the *method* is identical.
69
69
 
70
70
  Before starting, identify the comprehension subject and gather it:
71
71
 
72
- - **A plan** — the Epic body, the linked PRD / Tech Spec context tickets, the
73
- decomposition (Features/Stories with inline `acceptance[]` / `verify[]`),
72
+ - **A plan** — the Epic body (whose managed sections carry the folded Tech
73
+ Spec and Acceptance Table), the
74
+ decomposition (Stories with inline `acceptance[]` / `verify[]`),
74
75
  and the dispatch/wave roadmap.
75
76
  - **A change** — a PR, a branch, or a working-tree diff. Read the diff, the
76
77
  PR/issue description, and the surrounding code the change touches.
@@ -32,7 +32,8 @@ description:
32
32
  wrong in the `epic` direction is cheap — the Phase 8.3 consolidation pass and
33
33
  the sizing validator catch an over-planned Story later. Being wrong in the
34
34
  `story` direction is expensive — a story-sized scope pushed through the full
35
- Epic ceremony pays a PRD + Tech Spec + Acceptance Spec + Story backlog +
35
+ Epic ceremony pays a sectioned-Epic-body (Tech Spec + Acceptance Table) +
36
+ Story backlog +
36
37
  `epic/<id>` integration-branch tax for a degenerate one-Story output.
37
38
  - Keep the rubric prose **artifact-agnostic**. The thing under judgment may be a
38
39
  sharpened one-pager, an existing Epic body, or a draft Story — the rubric
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-06-16T16:35:27.286Z",
2
+ "generatedAt": "2026-07-04T23:12:38.376Z",
3
3
  "generator": "generate-skills-index.js@1",
4
4
  "skills": [
5
5
  {
@@ -127,7 +127,7 @@
127
127
  "tier": "core",
128
128
  "category": "core",
129
129
  "path": ".agents/skills/core/epic-plan-consolidate/SKILL.md",
130
- "description": "Run a holistic, pre-persist consolidation pass over the draft Story ticket array an Epic's decompose phase produced. Use during Phase 8 of `/plan`, after `epic-plan-decompose-author` writes `temp/epic-<Epic_ID>/tickets.json` and before `epic-plan-decompose.js` validates and persists it. Reconciles the draft against the Tech Spec \"Delivery Slicing\" target via scope-preserving operations only.",
130
+ "description": "Run a holistic, pre-persist consolidation pass over the draft Story ticket array an Epic's decompose phase produced. Use during Phase 8 of `/plan`, after `epic-plan-decompose-author` writes `temp/epic-<Epic_ID>/tickets.json` and before `epic-plan-decompose.js` validates and persists it. Reconciles the draft against the Tech Spec \"Delivery Slicing\" ceiling via scope-preserving operations only.",
131
131
  "policyCapsuleBullets": 9,
132
132
  "allowedTools": ["Read", "Write", "Bash"],
133
133
  "vendor": null
@@ -147,7 +147,7 @@
147
147
  "tier": "core",
148
148
  "category": "core",
149
149
  "path": ".agents/skills/core/epic-plan-premortem/SKILL.md",
150
- "description": "Run a fresh-context, code-reading pre-mortem critic over the draft Story ticket array an Epic's decompose phase produced. Use during Phase 8 of `/plan`, after `epic-plan-decompose-author` / `epic-plan-consolidate` write `temp/epic-<Epic_ID>/tickets.json` and before `epic-plan-decompose.js` validates and persists it. Reads the PRD / Tech Spec AND the actual cited code surfaces, then emits predicted-rework findings before any GitHub write.",
150
+ "description": "Run a fresh-context, code-reading pre-mortem critic over the draft Story ticket array an Epic's decompose phase produced. Use during Phase 8 of `/plan`, after `epic-plan-decompose-author` / `epic-plan-consolidate` write `temp/epic-<Epic_ID>/tickets.json` and before `epic-plan-decompose.js` validates and persists it. Reads the sectioned Epic body AND the cited code surfaces, then emits predicted-rework findings before any GitHub write.",
151
151
  "policyCapsuleBullets": 7,
152
152
  "allowedTools": ["Read", "Write", "Bash", "Grep"],
153
153
  "vendor": null
@@ -157,8 +157,8 @@
157
157
  "tier": "core",
158
158
  "category": "core",
159
159
  "path": ".agents/skills/core/epic-plan-spec-author/SKILL.md",
160
- "description": "Author the PRD, Tech Spec, Acceptance Spec markdown, and risk-verdict JSON for an Epic from the planner authoring context emitted by `epic-plan-spec.js --emit-context`. Use during Phase 7 of `/plan` when the host LLM needs to write the four artifacts before `epic-plan-spec.js` persists them.",
161
- "policyCapsuleBullets": 12,
160
+ "description": "Author the Tech Spec, Acceptance Table markdown, and risk-verdict JSON for an Epic from the planner authoring context emitted by `epic-plan-spec.js --emit-context`. Use during Phase 7 of `/plan` when the host LLM needs to write the three artifacts before `epic-plan-spec.js` folds them into the Epic body's managed sections.",
161
+ "policyCapsuleBullets": 13,
162
162
  "allowedTools": ["Read", "Write", "Bash"],
163
163
  "vendor": null
164
164
  },
@@ -187,7 +187,7 @@
187
187
  "tier": "core",
188
188
  "category": "core",
189
189
  "path": ".agents/skills/core/hydrate-context/SKILL.md",
190
- "description": "Hydrate a Task or Story ticket into a structured ContextEnvelope (or the legacy `{ prompt }` stdout wrapper). Reads the ticket body, parses Feature / Epic hierarchy, fetches the Tech Spec + PRD, and assembles named sections with provenance and section-aware elision. Successor to the retired mandrel MCP `context.hydrate` tool.",
190
+ "description": "Hydrate a Story ticket into a structured ContextEnvelope (or the legacy `{ prompt }` stdout wrapper). Reads the ticket body, resolves the parent Epic, embeds the sectioned Epic body (acceptance-table section stripped), and assembles named sections with provenance and section-aware elision. Successor to the retired mandrel MCP `context.hydrate` tool.",
191
191
  "policyCapsuleBullets": 7,
192
192
  "allowedTools": ["Read", "Bash"],
193
193
  "vendor": null
@@ -567,8 +567,8 @@
567
567
  "tier": "stack",
568
568
  "category": "qa",
569
569
  "path": ".agents/skills/stack/qa/qa-explore-driving/SKILL.md",
570
- "description": "Conventions for agent-driven exploratory QA driving — how the agent itself drives a surface during `/qa-explore` (agent-led), as opposed to the human-led `/qa-assist`. Use when the agent explores a running app via the browser MCP (navigation-first, the default) or walks a static surface (the documented interim until consumer persona-seeding lands), under a strictly read-only capture invariant. The exploration procedure lives in `.agents/workflows/qa-explore.md`; this skill is the driving-conventions reference it leans on.",
571
- "policyCapsuleBullets": 8,
570
+ "description": "Conventions for agent-driven exploratory QA driving — how the agent itself drives a surface during `/qa-explore` (agent-led), as opposed to the human-led `/qa-assist`. Use when the agent explores a running app via the browser MCP (navigation-first, the default) — including authenticated deployed surfaces reached through the resolved environment's sign-in seam — or walks a static surface (the documented interim where no seam resolves), under a strictly read-only capture invariant. The exploration procedure lives in `.agents/workflows/qa-explore.md`; this skill is the driving-conventions reference it leans on.",
571
+ "policyCapsuleBullets": 9,
572
572
  "allowedTools": null,
573
573
  "vendor": null
574
574
  },
@@ -4,9 +4,10 @@ description:
4
4
  Conventions for agent-driven exploratory QA driving — how the agent itself
5
5
  drives a surface during `/qa-explore` (agent-led), as opposed to the
6
6
  human-led `/qa-assist`. Use when the agent explores a running app via the
7
- browser MCP (navigation-first, the default) or walks a static surface (the
8
- documented interim until consumer persona-seeding lands), under a strictly
9
- read-only capture invariant. The exploration procedure lives in
7
+ browser MCP (navigation-first, the default) including authenticated
8
+ deployed surfaces reached through the resolved environment's sign-in seam —
9
+ or walks a static surface (the documented interim where no seam resolves),
10
+ under a strictly read-only capture invariant. The exploration procedure lives in
10
11
  `.agents/workflows/qa-explore.md`; this skill is the driving-conventions
11
12
  reference it leans on.
12
13
  ---
@@ -16,9 +17,10 @@ description:
16
17
  ## Policy Capsule
17
18
 
18
19
  - Drive the running app **by default** through the browser MCP, navigation-first: start at a root and reach each surface only via UI affordances — never URL-jump to a deep link.
19
- - Treat **static driving** (reading source, routes, and rendered markup without a live runtime) as the **documented interim** method, chosen at Plan time when a live runtime is not reachable — never the silent fallback.
20
+ - Resolve the target **environment** at Plan time (via `resolveQaEnvironment`) and record its name in the ledger; each environment keys its own `baseUrl`, `signInSeam`, and `allowWrites`.
21
+ - Treat **static driving** (reading source, routes, and rendered markup without a live runtime) as the **documented interim** method, chosen at Plan time **only where no seam resolves** for the target environment — never the silent fallback.
20
22
  - Hold the **read-only capture invariant** absolutely: the agent makes no source edits and no product mutations while driving; the only write is appending to the `temp/qa/<sessionId>` ledger.
21
- - Authenticated driving depends on **consumer persona-seeding infrastructure that this Epic does not deliver**; without it, drive only the unauthenticated surface or fall back to static, and record the gap never enter real credentials or fabricate a session.
23
+ - Authenticated driving follows the resolved environment's **`signInSeam`**: sign in through a dev `url` seam (persona name substituted into the template) or a `skill` seam (a stored `credentialRef` read by the named sign-in skill), with **mandatory redaction** of all captured evidence. Never type real credentials inline or fabricate a session; where an environment resolves no seam, drive the unauthenticated surface or fall back to static and record the gap.
22
24
  - Pick the driving method explicitly in the Plan phase (drive vs. static) and record it in the ledger; do not switch methods mid-surface without a new Plan note.
23
25
  - Every phase transition and every GitHub write is HITL-gated; the agent drives and captures, but never files or promotes findings autonomously.
24
26
  - Broken navigation, a missing affordance, or a guard redirect loop is a **finding**, not a workaround — record it and move on; do not route around it with a direct URL.
@@ -65,15 +67,14 @@ state rather than an artifact of a deep link.
65
67
 
66
68
  ## 2. Static Driving — the Documented Interim
67
69
 
68
- Static driving is the **explicitly documented interim** method for when a live
69
- runtime is not reachable most commonly because authenticated driving needs
70
- consumer persona-seeding infrastructure that does not yet exist (§ 4). It walks
71
- the surface from source, route definitions, and rendered markup rather than a
72
- running browser.
70
+ Static driving is the **explicitly documented interim** method for when **no
71
+ seam resolves** for the target environment the resolved environment carries
72
+ no `signInSeam` the agent can drive through (§ 4). It walks the surface from
73
+ source, route definitions, and rendered markup rather than a running browser.
73
74
 
74
75
  - **Choose it at Plan time, never silently.** Static is a deliberate Plan-phase
75
- decision recorded in the ledger ("method: static, reason: no reachable
76
- authenticated runtime"), not an unannounced fallback the agent slips into
76
+ decision recorded in the ledger ("environment: preview, method: static,
77
+ reason: no seam resolves"), not an unannounced fallback the agent slips into
77
78
  when the browser MCP hiccups.
78
79
  - **It is interim, not equivalent.** Static driving cannot exercise real
79
80
  authorization, routing guards, or runtime console/network signal. Treat its
@@ -81,10 +82,10 @@ running browser.
81
82
  same coverage a driven pass would.
82
83
  - **Same read-only invariant.** Static driving reads source and routes; it makes
83
84
  no edits. The read-only capture invariant (§ 3) applies identically.
84
- - **Promote to driving when the runtime lands.** Static is the bridge until the
85
- consumer's persona-seeding infrastructure (§ 4) makes authenticated driving
86
- possible. When that lands, re-run the surface driven; do not leave a surface
87
- permanently static when it could be driven.
85
+ - **Promote to driving when a seam lands.** Static is the bridge until the
86
+ target environment resolves a `signInSeam` (§ 4) that makes driven
87
+ authenticated exploration possible. When that lands, re-run the surface
88
+ driven; do not leave a surface permanently static when it could be driven.
88
89
 
89
90
  ## 3. The Read-Only Capture Invariant
90
91
 
@@ -109,29 +110,42 @@ and the Epic's security considerations — it is not a soft preference.
109
110
  (ticket creation, promotion) happen only behind an operator confirmation gate.
110
111
  The agent never files or promotes findings autonomously.
111
112
 
112
- ## 4. Authenticated Driving Depends on Consumer Infra (Not Delivered Here)
113
-
114
- Driving an **authenticated** surface requires signing in as a seeded persona.
115
- That seeding provisioning a test persona with the right org, role, and data
116
- so the agent can reach a logged-in surface navigation-first — is **consumer
117
- persona-seeding infrastructure that this Epic does not deliver**. It is an
118
- explicit non-goal of the `/qa-explore` rebuild.
119
-
120
- - **Unauthenticated surface only, by default.** Without persona-seeding infra in
121
- the consumer project, drive only the surface reachable without sign-in, or
122
- fall back to static driving (§ 2) for the authenticated surface. Record the
123
- gap in the ledger so the partial coverage is visible.
124
- - **Never enter real credentials.** The agent MUST NOT type real usernames,
125
- passwords, or tokens to reach an authenticated surface, and MUST NOT fabricate
126
- or forge a session. This is a hard security boundary, not a convenience to
113
+ ## 4. Authenticated Driving Follows the Per-Environment Seam
114
+
115
+ Driving an **authenticated** surface requires signing in. The resolved target
116
+ environment (via `resolveQaEnvironment`, § Policy Capsule) carries the
117
+ `signInSeam` the agent drives through the same discriminated-union shape
118
+ `qa-harness` resolves via its contract. When a seam resolves, authenticated
119
+ deployed surfaces are **driven**, not statically deferred.
120
+
121
+ - **Drive the authenticated surface through the seam.** When the target
122
+ environment carries a `signInSeam`, sign in via that seam and then reach the
123
+ authenticated surface navigation-first including authenticated **deployed**
124
+ hosts. The two seam kinds:
125
+ - **`kind: 'url'` (dev impersonation).** Substitute the persona **name** into
126
+ the seam's URL template and navigate there. The persona name is the sole
127
+ input; no per-persona auth material is read.
128
+ - **`kind: 'skill'` (procedural / credential).** Invoke the named consumer
129
+ sign-in skill, which reads a per-persona **`credentialRef`** — an indirect
130
+ handle to a stored credential, never an inline secret. Read the skill's
131
+ `SKILL.md` and follow it.
132
+ - **Never enter real credentials inline.** The agent MUST NOT type real
133
+ usernames, passwords, or tokens to reach an authenticated surface, and MUST
134
+ NOT fabricate or forge a session. Sign-in flows only through the seam, which
135
+ consumes a persona name or a `credentialRef` indirection — never a
136
+ hand-typed secret. This is a hard security boundary, not a convenience to
127
137
  work around.
128
- - **The dependency is the consumer's to satisfy.** When a consumer wants driven
129
- authenticated exploration, the consumer supplies a dev sign-in seam and seeded
130
- personas (the same shape `qa-harness` resolves via its contract). Until then,
131
- authenticated coverage is static or deferred say which in the ledger.
132
- - **Surface the gap, don't paper over it.** A surface that could not be driven
133
- because authenticated seeding is absent is itself a coverage signal worth
134
- recording, not a silent skip.
138
+ - **Redaction is mandatory.** Every captured evidence string console,
139
+ network, headers — passes through the shared redaction path 3) before it
140
+ reaches disk or GitHub; bearer tokens, session cookies, `Authorization`
141
+ headers, and PII are masked. Authenticated driving raises the stakes on
142
+ redaction, it does not relax it.
143
+ - **Static only where no seam resolves.** When the target environment resolves
144
+ **no** `signInSeam`, drive only the unauthenticated surface or fall back to
145
+ static driving (§ 2), and record the gap in the ledger so the partial
146
+ coverage is visible. A surface that could not be driven because the
147
+ environment carries no seam is itself a coverage signal worth recording, not
148
+ a silent skip.
135
149
 
136
150
  ## 5. Cross-References
137
151
 
@@ -16,6 +16,10 @@
16
16
 
17
17
  {{scope}}
18
18
 
19
+ ## User Stories
20
+
21
+ {{userStories}}
22
+
19
23
  ## Acceptance Criteria
20
24
 
21
25
  {{acceptanceCriteria}}
@@ -118,8 +118,8 @@ Ask:
118
118
  > How would you like these `<M>` Stories created?
119
119
  >
120
120
  > - **Single Epic via `/plan`** **[Recommended]** — opens one Epic,
121
- > then chains into `/plan --idea` so the standard PRD / Tech Spec
122
- > / WBS authoring handles decomposition. Grouped Stories become the
121
+ > then chains into `/plan --idea` so the standard spec-and-WBS
122
+ > authoring handles decomposition. Grouped Stories become the
123
123
  > seed for Phase 7 decomposition.
124
124
  > - **Individual standalone Stories** — opens one GitHub Issue per
125
125
  > group directly, no Epic wrapper.
@@ -79,13 +79,15 @@ review yourself, honor the `depth` semantics above directly.
79
79
 
80
80
  1. Resolve `[TICKET_ID]` from `ticketId` (Story or Epic depending on `scope`).
81
81
  2. Resolve `[BASE_REF]` from `baseRef` and `[HEAD_REF]` from `headRef`.
82
- 3. Fetch the `[TICKET_ID]` ticket and identify linked context tickets:
82
+ 3. Fetch the `[TICKET_ID]` ticket and resolve the planning context:
83
83
  - **Story scope** — read the parent Epic from the Story body, then load
84
- the Epic's `context::prd` (PRD) and `context::tech-spec` (Tech Spec).
85
- - **Epic scope** — load the Epic's `context::prd` (PRD) and
86
- `context::tech-spec` (Tech Spec) directly from the Epic body.
87
- 4. Read both the PRD and Tech Spec fully to understand the intended scope,
88
- architectural decisions, and acceptance criteria.
84
+ the Epic body (including its `## User Stories` section and its folded
85
+ Tech Spec sections).
86
+ - **Epic scope** read the Epic body directly; its managed sections
87
+ carry the Tech Spec.
88
+ 4. Read the Epic body fully (including its Tech Spec sections) to
89
+ understand the intended
90
+ scope, architectural decisions, and acceptance criteria.
89
91
 
90
92
  ## Step 1 — Automated Audit (Pre-Review)
91
93
 
@@ -120,7 +122,7 @@ before finalizing findings.
120
122
 
121
123
  ### Pillar 1: Spec Adherence
122
124
 
123
- Does the implementation match the PRD requirements and Tech Spec architecture?
125
+ Does the implementation match the Epic's requirements and Tech Spec architecture?
124
126
 
125
127
  - Compare each completed Story/Task against its stated acceptance criteria.
126
128
  - Flag any undocumented deviations, missing features, or scope creep.
@@ -251,7 +253,7 @@ anything not fixed in-place.
251
253
  structured comment for the operator to triage in Step 5.
252
254
  2. **Leave the finding on the structured comment for Step 5.** Required
253
255
  when the finding falls into any of the following classes:
254
- - `spec-deviation` — the change diverges from the PRD/Tech Spec.
256
+ - `spec-deviation` — the change diverges from the Epic/Tech Spec.
255
257
  - `secrets` — credentials, tokens, or PII surfaced in the diff.
256
258
  - `test-deletion` — coverage was removed without an explicit
257
259
  decision in the spec.
@@ -359,7 +361,7 @@ to the next phase of the parent workflow.
359
361
  the scope is set by the caller, and reviewing against the wrong base
360
362
  produces either a hollow review (too small a diff) or noise (too large a
361
363
  diff that includes unrelated history).
362
- - **Always** read the PRD and Tech Spec before reviewing code. Findings without
364
+ - **Always** read the Epic body and Tech Spec before reviewing code. Findings without
363
365
  spec context are noise.
364
366
  - **Never** implement fixes unless the operator explicitly requests it. The
365
367
  default mode is read-only audit.