@pareto4/pp-core 1.18.0 → 1.20.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 (194) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/agents/pp-code-fixer.md +9 -5
  3. package/agents/pp-code-reviewer.md +1 -0
  4. package/agents/pp-codebase-mapper.md +3 -0
  5. package/agents/pp-debugger.md +3 -2
  6. package/agents/pp-executor.md +16 -7
  7. package/agents/pp-integration-checker.md +1 -0
  8. package/agents/pp-phase-researcher.md +13 -1
  9. package/agents/pp-plan-checker.md +3 -0
  10. package/agents/pp-planner.md +20 -1
  11. package/agents/pp-research-synthesizer.md +1 -1
  12. package/agents/pp-ui-auditor.md +1 -0
  13. package/agents/pp-ui-researcher.md +3 -1
  14. package/agents/pp-vault-reviewer.md +2 -0
  15. package/agents/pp-verifier.md +22 -10
  16. package/commands/pp-add-tests.md +1 -1
  17. package/commands/pp-debug.md +1 -0
  18. package/commands/pp-discovery.md +3 -2
  19. package/commands/pp-init.md +4 -3
  20. package/commands/pp-quick.md +3 -0
  21. package/commands/pp-review-backlog.md +2 -1
  22. package/gemini-extension.json +1 -1
  23. package/package.json +6 -3
  24. package/pareto-skills/_shared/pp-claude-md-protocol.md +1 -1
  25. package/pareto-skills/pp-project-setup/SKILL.md +18 -343
  26. package/pp-core/bin/lib/capability-registry.cjs +3 -3
  27. package/pp-core/bin/lib/check-command-router.cjs +60 -20
  28. package/pp-core/bin/lib/commands.cjs +79 -4
  29. package/pp-core/bin/lib/compose-bindings.cjs +97 -14
  30. package/pp-core/bin/lib/discovery-access.cjs +276 -0
  31. package/pp-core/bin/lib/discovery-charter.cjs +664 -0
  32. package/pp-core/bin/lib/discovery-deviations.cjs +264 -0
  33. package/pp-core/bin/lib/discovery-entities.cjs +323 -0
  34. package/pp-core/bin/lib/discovery-for-phase.cjs +628 -0
  35. package/pp-core/bin/lib/discovery-integrations.cjs +286 -0
  36. package/pp-core/bin/lib/discovery-migration.cjs +246 -0
  37. package/pp-core/bin/lib/discovery-phases.cjs +233 -0
  38. package/pp-core/bin/lib/discovery-processes.cjs +355 -0
  39. package/pp-core/bin/lib/discovery-research-track.cjs +5 -4
  40. package/pp-core/bin/lib/discovery-rollup.cjs +12 -8
  41. package/pp-core/bin/lib/discovery-rules.cjs +216 -0
  42. package/pp-core/bin/lib/discovery-screens.cjs +21 -3
  43. package/pp-core/bin/lib/discovery-session-check.cjs +264 -0
  44. package/pp-core/bin/lib/discovery-stories.cjs +273 -0
  45. package/pp-core/bin/lib/discovery-sweep.cjs +13 -4
  46. package/pp-core/bin/lib/discovery-table.cjs +55 -0
  47. package/pp-core/bin/lib/discovery-vault-check.cjs +37 -3
  48. package/pp-core/bin/lib/init-contract.cjs +48 -7
  49. package/pp-core/bin/lib/io.cjs +22 -0
  50. package/pp-core/bin/lib/vault-coordinates.cjs +1 -1
  51. package/pp-core/bin/lib/vault-index.cjs +18 -5
  52. package/pp-core/bin/lib/vault-standards-review.cjs +50 -2
  53. package/pp-core/bin/lib/vault-update.cjs +4 -0
  54. package/pp-core/bin/lib/vault.cjs +2 -2
  55. package/pp-core/bin/pp-tools.cjs +153 -5
  56. package/pp-core/org-profile.json +1 -1
  57. package/pp-core/references/autonomous-best-effort.md +3 -2
  58. package/pp-core/references/autonomous-lifecycle.md +1 -0
  59. package/pp-core/references/autonomous-smart-discuss.md +5 -1
  60. package/pp-core/references/discovery-access.md +112 -0
  61. package/pp-core/references/discovery-build-consumption.md +256 -0
  62. package/pp-core/references/discovery-charter.md +127 -0
  63. package/pp-core/references/discovery-data-model.md +145 -0
  64. package/pp-core/references/discovery-id-conventions.md +77 -8
  65. package/pp-core/references/discovery-integrations.md +151 -0
  66. package/pp-core/references/discovery-processes.md +190 -0
  67. package/pp-core/references/discovery-rebaseline.md +2 -2
  68. package/pp-core/references/discovery-research-track.md +5 -6
  69. package/pp-core/references/discovery-session-output.md +70 -0
  70. package/pp-core/references/discovery-standards.md +107 -0
  71. package/pp-core/references/discovery-traceability.md +2 -2
  72. package/pp-core/references/execute-mvp-tdd.md +3 -3
  73. package/pp-core/references/git-integration.md +57 -33
  74. package/pp-core/references/git-planning-commit.md +31 -9
  75. package/pp-core/references/phase-argument-parsing.md +1 -0
  76. package/pp-core/references/planner-discovery-extract.md +35 -0
  77. package/pp-core/references/planner-gap-closure.md +1 -0
  78. package/pp-core/references/planner-revision.md +3 -1
  79. package/pp-core/references/planner-tdd.md +4 -4
  80. package/pp-core/references/planning-config.md +3 -3
  81. package/pp-core/references/shell-portability.md +28 -0
  82. package/pp-core/references/tdd.md +20 -16
  83. package/pp-core/references/verifier-discovery-conformance.md +36 -0
  84. package/pp-core/references/worktree-path-safety.md +1 -0
  85. package/pp-core/templates/milestone.md +5 -5
  86. package/pp-core/templates/project-charter.md +161 -100
  87. package/pp-core/templates/project.md +3 -3
  88. package/pp-core/templates/requirements.md +18 -0
  89. package/pp-core/templates/verification-report.md +16 -0
  90. package/pp-core/workflows/add-backlog.md +1 -1
  91. package/pp-core/workflows/add-tests.md +5 -2
  92. package/pp-core/workflows/add-todo.md +3 -1
  93. package/pp-core/workflows/ai-integration-phase.md +2 -1
  94. package/pp-core/workflows/audit-fix.md +4 -3
  95. package/pp-core/workflows/audit-milestone.md +1 -0
  96. package/pp-core/workflows/autonomous.md +6 -0
  97. package/pp-core/workflows/check-todos.md +2 -1
  98. package/pp-core/workflows/cleanup.md +3 -1
  99. package/pp-core/workflows/code-review-fix.md +12 -5
  100. package/pp-core/workflows/code-review.md +15 -1
  101. package/pp-core/workflows/complete-milestone.md +13 -3
  102. package/pp-core/workflows/debug.md +2 -0
  103. package/pp-core/workflows/diagnose-issues.md +1 -1
  104. package/pp-core/workflows/discovery-sprint/charter.md +114 -0
  105. package/pp-core/workflows/discovery-sprint/prefill.md +1 -1
  106. package/pp-core/workflows/discovery-sprint/prototype.md +4 -4
  107. package/pp-core/workflows/discovery-sprint/session-13-gates.md +11 -1
  108. package/pp-core/workflows/discovery-sprint/sessions/01-kick-off.md +54 -7
  109. package/pp-core/workflows/discovery-sprint/sessions/02-as-is.md +31 -7
  110. package/pp-core/workflows/discovery-sprint/sessions/03-to-be.md +64 -37
  111. package/pp-core/workflows/discovery-sprint/sessions/04-ux-design.md +12 -3
  112. package/pp-core/workflows/discovery-sprint/sessions/05-architecture.md +45 -22
  113. package/pp-core/workflows/discovery-sprint/sessions/06-security.md +30 -15
  114. package/pp-core/workflows/discovery-sprint/sessions/07-identity.md +43 -25
  115. package/pp-core/workflows/discovery-sprint/sessions/08-integration.md +63 -24
  116. package/pp-core/workflows/discovery-sprint/sessions/09-qa.md +28 -13
  117. package/pp-core/workflows/discovery-sprint/sessions/10-infrastructure.md +35 -16
  118. package/pp-core/workflows/discovery-sprint/sessions/11-roadmap.md +32 -8
  119. package/pp-core/workflows/discovery-sprint/sessions/12-delivery-model.md +21 -18
  120. package/pp-core/workflows/discovery-sprint/sessions/13-wrap-up.md +29 -12
  121. package/pp-core/workflows/discovery-sprint/vault-context.md +14 -3
  122. package/pp-core/workflows/discovery-sprint.md +23 -23
  123. package/pp-core/workflows/discovery-to-build/steps/architecture-deliverables.md +81 -29
  124. package/pp-core/workflows/discovery-to-build/steps/{screen-inventory-gate.md → handoff-gates.md} +111 -3
  125. package/pp-core/workflows/discovery-to-build/templates/discovery-references.md +12 -9
  126. package/pp-core/workflows/discovery-to-build/templates/pp-handoff.md +27 -26
  127. package/pp-core/workflows/discovery-to-build.md +70 -34
  128. package/pp-core/workflows/discuss-phase/discovery.md +83 -0
  129. package/pp-core/workflows/discuss-phase/templates/context.md +4 -0
  130. package/pp-core/workflows/discuss-phase-assumptions.md +5 -3
  131. package/pp-core/workflows/discuss-phase.md +18 -10
  132. package/pp-core/workflows/docs-update.md +1 -0
  133. package/pp-core/workflows/eval-review.md +2 -1
  134. package/pp-core/workflows/execute-phase/steps/check-query-gate.md +7 -6
  135. package/pp-core/workflows/execute-phase/steps/cross-ai-delegation.md +1 -0
  136. package/pp-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +1 -0
  137. package/pp-core/workflows/execute-phase/steps/vault-fetch.md +12 -0
  138. package/pp-core/workflows/execute-phase.md +19 -7
  139. package/pp-core/workflows/execute-plan.md +18 -7
  140. package/pp-core/workflows/explore.md +1 -1
  141. package/pp-core/workflows/forensics.md +4 -2
  142. package/pp-core/workflows/health.md +1 -0
  143. package/pp-core/workflows/import.md +2 -1
  144. package/pp-core/workflows/ingest-docs.md +1 -0
  145. package/pp-core/workflows/init/steps/client-context-capture.md +1 -0
  146. package/pp-core/workflows/init/steps/github-provisioning.md +145 -0
  147. package/pp-core/workflows/init/steps/gitlab-provisioning.md +18 -4
  148. package/pp-core/workflows/init/steps/reachability-outcome.md +3 -1
  149. package/pp-core/workflows/init.md +56 -66
  150. package/pp-core/workflows/map-codebase.md +5 -1
  151. package/pp-core/workflows/milestone-summary.md +2 -1
  152. package/pp-core/workflows/mvp-phase.md +1 -0
  153. package/pp-core/workflows/new-milestone.md +9 -5
  154. package/pp-core/workflows/new-project.md +12 -11
  155. package/pp-core/workflows/new-workspace.md +1 -0
  156. package/pp-core/workflows/next.md +2 -1
  157. package/pp-core/workflows/pause-work.md +6 -4
  158. package/pp-core/workflows/plan-milestone-gaps.md +3 -1
  159. package/pp-core/workflows/plan-phase/steps/chunked-planning.md +1 -1
  160. package/pp-core/workflows/plan-phase/steps/discovery-extract.md +41 -0
  161. package/pp-core/workflows/plan-phase.md +36 -16
  162. package/pp-core/workflows/plan-review-convergence.md +2 -0
  163. package/pp-core/workflows/plant-seed.md +4 -2
  164. package/pp-core/workflows/pr-branch.md +2 -0
  165. package/pp-core/workflows/progress.md +5 -0
  166. package/pp-core/workflows/quick.md +11 -4
  167. package/pp-core/workflows/reapply-patches.md +3 -0
  168. package/pp-core/workflows/remove-phase.md +1 -1
  169. package/pp-core/workflows/resume-project.md +3 -0
  170. package/pp-core/workflows/review.md +7 -1
  171. package/pp-core/workflows/secure-phase.md +2 -1
  172. package/pp-core/workflows/session-report.md +1 -0
  173. package/pp-core/workflows/ship.md +8 -1
  174. package/pp-core/workflows/sketch-wrap-up.md +1 -1
  175. package/pp-core/workflows/sketch.md +3 -2
  176. package/pp-core/workflows/spec-phase.md +2 -1
  177. package/pp-core/workflows/spike-wrap-up.md +1 -1
  178. package/pp-core/workflows/spike.md +4 -3
  179. package/pp-core/workflows/sync-skills.md +5 -2
  180. package/pp-core/workflows/thread.md +3 -2
  181. package/pp-core/workflows/transition.md +6 -0
  182. package/pp-core/workflows/ui-phase.md +3 -1
  183. package/pp-core/workflows/ui-review.md +2 -1
  184. package/pp-core/workflows/ultraplan-phase.md +1 -0
  185. package/pp-core/workflows/undo.md +14 -10
  186. package/pp-core/workflows/update.md +5 -0
  187. package/pp-core/workflows/validate-phase.md +6 -3
  188. package/pp-core/workflows/vault-review.md +7 -1
  189. package/pp-core/workflows/vault-write-back.md +5 -0
  190. package/pp-core/workflows/verify-phase.md +5 -0
  191. package/pp-core/workflows/verify-work.md +8 -1
  192. package/scripts/prompt-injection-scan.sh +1 -1
  193. package/scripts/sync-runtime-launcher.cjs +115 -5
  194. package/pp-core/workflows/discovery-sprint/templates/context-template.md +0 -266
@@ -5,38 +5,40 @@
5
5
 
6
6
  ### Session 10: Infrastructure & Deployment Readiness
7
7
 
8
- **Goal:** Define the cloud or hosting strategy, plan the deployment approach, establish monitoring and alerting, determine backup and disaster recovery procedures, and assess go-live readiness criteria.
8
+ **Goal:** Confirm the hosting, deployment, monitoring and recovery approach against the client's platform standards, record the deviations, and assess go-live readiness criteria.
9
+
10
+ **Standards first.** Where a document this session's `## Vault Context` record names already fixes the hosting platform, the pipeline, infrastructure as code, naming, monitoring, backup or recovery, do not ask the open question: present the vault's answer — "the vault fixes X `[vault: <path>]` — does this product deviate, and why?" — and record the standard in the **Standards Applied** row for that area. A deviation is one `DEV-<nn>` row of `.planning/discovery/_deviations.md` (template and grammar: `${PP_TOOLS%/bin/pp-tools.cjs}/references/discovery-standards.md`; create the file on first need) plus a Key Decisions row `D-10-<n>`, both cited in the Standards Applied row; never recommend an alternative the standards rule out. An area no standard covers reads `not in vault` and keeps its question open. With no vault bound, every question below stays open-ended.
9
11
 
10
12
  **What We Cover:**
11
13
 
12
14
  1. **Cloud / hosting strategy**
13
- *Why it matters: hosting choice constrains every deployment, monitoring, and DR decision below. Skip when: the platform standard (GCP/pareto-platform-gcp) applies with no client override.*
14
- - What cloud provider will be used (GCP / `pareto-platform-gcp` is the Pareto platform standard; or AWS, Azure, on-premises, hybrid)?
15
+ *Why it matters: hosting choice constrains every deployment, monitoring, and DR decision below. Skip when: Session 1 recorded a mandated platform and the client has no override.*
16
+ - What cloud provider will be used? Start from the platform Session 1 recorded; when it is open, choose between cloud providers, on-premises and hybrid.
15
17
  - What is the account and subscription structure?
16
18
  - What regions and availability zones are required?
17
19
  - Are there data sovereignty or residency requirements that constrain hosting?
18
20
  - What is the cost model and budget for infrastructure? [needs-business-input]
19
21
 
20
22
  2. **Deployment strategy**
21
- *Why it matters: deployment model determines rollback risk and go-live readiness criteria (Session 13). Skip when: the platform CI/CD pipeline already fixes this by default.*
22
- - What deployment model will be used (blue-green, canary, rolling, immutable)?
23
- - How will the CI/CD pipeline be structured?
24
- - What tools will be used for CI/CD (GitLab CI is the Pareto platform pipeline; or GitHub Actions, Azure DevOps, Jenkins)?
25
- - How will infrastructure be managed (IaC with Terraform, Pulumi, CloudFormation)?
26
- - What is the approach to containerization (GKE or Cloud Run via pareto-platform-gcp; Docker/Kubernetes on-prem; or other cloud options)?
23
+ *Why it matters: deployment model determines rollback risk and go-live readiness criteria (Session 13). Skip when: the mandated platform's CI/CD pipeline already fixes this by default.*
24
+ - Deployment model: the vault's release rules fix stages and gates when bound — does this product deviate? Otherwise: blue-green, canary, rolling, immutable?
25
+ - Pipeline structure and tool: the vault's pipeline standard fixes them when bound — does this product deviate? Otherwise: GitHub Actions, GitLab CI, Azure DevOps, Jenkins? Take the platform's pipeline when Session 1 recorded one.
26
+ - Infrastructure as code: the vault's IaC standard fixes it when bound — does this product deviate? Otherwise: Terraform, Pulumi, CloudFormation?
27
+ - Resource naming: the vault's naming convention fixes it when bound — record the standard; a name outside it is a deviation.
28
+ - What is the approach to containerization (the platform's managed container or Kubernetes service, Kubernetes on-premises, or none)? The vault's container rules apply when bound.
27
29
 
28
30
  3. **Monitoring, logging, and alerting**
29
- *Why it matters: alerting design determines who gets paged and how incidents are caught pre-go-live. Skip when: a platform-standard observability stack already covers requirements.*
30
- - What monitoring platform will be used (Google Cloud Monitoring / Cloud Logging via pareto-platform-gcp; or Datadog, New Relic, CloudWatch)?
31
+ *Why it matters: alerting design determines who gets paged and how incidents are caught pre-go-live. Skip when: the mandated platform's observability stack already covers requirements.*
32
+ - Monitoring platform: the vault's default stack fixes observability when bound — does this product deviate? Otherwise: the platform's native monitoring and logging, or Datadog, New Relic, Grafana?
31
33
  - What metrics will be tracked (latency, error rate, throughput, saturation)?
32
34
  - What is the alerting strategy (thresholds, escalation chains, on-call rotation)?
33
35
  - How will application logs be aggregated and queried?
34
36
 
35
37
  4. **Backup and disaster recovery**
36
38
  *Why it matters: DR strategy directly answers Session 6's RTO/RPO targets with a concrete implementation. Skip when: non-critical internal tool with no formal DR requirement.*
37
- - What is the backup strategy (frequency, retention, storage location)?
39
+ - Backup strategy: the vault's governance and compliance rules fix frequency, retention and location when bound — does this product deviate? Otherwise: which?
38
40
  - How will backups be tested and validated?
39
- - What is the DR strategy (active-passive, active-active, pilot light)?
41
+ - DR strategy: the vault fixes the tier per criticality when bound — does this product deviate? Otherwise: active-passive, active-active, pilot light?
40
42
  - How often will DR drills be conducted?
41
43
 
42
44
  5. **Go-live readiness criteria**
@@ -48,7 +50,22 @@
48
50
 
49
51
  **Notes Template:**
50
52
 
51
- > **Platform standard (D-08):** The Pareto deployment platform is GCP / `pareto-platform-gcp` with GitLab CI as the CI/CD pipeline and Google Cloud Monitoring / Cloud Logging for observability. Fill the tables below against this baseline unless the client has an overriding constraint.
53
+ > **Platform:** fill the tables below against the platform Session 1 recorded (its `D-01-<n>` platform decision, citing the vault's platform standard when there is one): its cloud provider, CI/CD pipeline and observability stack. A choice that departs from it is a Key Decisions row `D-10-<n>`. When Session 1 recorded the platform as open, the choices are made here.
54
+
55
+ **Standards Applied**
56
+
57
+ | Area | Standard | Deviation | Decision |
58
+ |------|----------|-----------|----------|
59
+ | Hosting platform and landing zone | | | |
60
+ | Environments and promotion | | | |
61
+ | CI/CD pipeline | | | |
62
+ | Infrastructure as code | | | |
63
+ | Resource naming | | | |
64
+ | Monitoring and alerting | | | |
65
+ | Backup and disaster recovery | | | |
66
+ | Sizing and cost | | | |
67
+
68
+ **Standard** is the governing document's `[vault: <rel path>]` citation, or `not in vault`. **Deviation** is `none` or the `DEV-<nn>` of the `_deviations.md` row. **Decision** is `—` or the `D-10-<n>` that records the deviation or the decision taken for an uncovered area (`references/discovery-standards.md`).
52
69
 
53
70
  **Infrastructure Architecture**
54
71
 
@@ -62,6 +79,8 @@
62
79
 
63
80
  **Deployment Pipeline Design**
64
81
 
82
+ > **Environments:** the deploy stages name the environments Session 9's Test Environment Plan recorded — the bound vault's names when one is bound (its naming standard, cited `[vault: <path>]`), one `Deploy to <env>` row per environment in promotion order. The preset rows stand only when no vault is bound.
83
+
65
84
  | Stage | Trigger | Actions | Quality Gate | Environment | Duration |
66
85
  |-------|---------|---------|-------------|-------------|----------|
67
86
  | Build | | | | | |
@@ -103,12 +122,12 @@
103
122
 
104
123
  **Key Decisions**
105
124
 
106
- | # | Decision | Rationale | Owner | Date |
125
+ | ID | Decision | Rationale | Owner | Date |
107
126
  |---|----------|-----------|-------|------|
108
127
  | | | | | |
109
128
 
110
129
  **Action Items**
111
130
 
112
- | # | Action | Owner | Due Date | Status |
131
+ | ID | Action | Owner | Due Date | Status |
113
132
  |---|--------|-------|----------|--------|
114
133
  | | | | | |
@@ -14,7 +14,7 @@
14
14
  - What are the major phases of the project (Discovery, Build, UAT, Go-Live, Hypercare)?
15
15
  - What is the overall timeline from build start to production go-live?
16
16
  - Are there hard deadlines driven by business events, regulatory dates, or contracts? [needs-business-input]
17
- - What is the sprint cadence (1-week, 2-week, 3-week)?
17
+ - What is the iteration model: calendar sprints (1, 2 or 3 weeks), or one iteration = one pp-core phase (discuss, plan, execute, verify), sized by scope rather than by the calendar? Record the choice as `D-11-<n>`; Session 12's cadence follows it.
18
18
 
19
19
  2. **MVP scope confirmation**
20
20
  *Why it matters: re-validates Session 3's MVP boundary before locking the build order below. Skip when: no time has passed since Session 3 and nothing has changed.*
@@ -24,11 +24,12 @@
24
24
  - What is the minimum viable product that demonstrates value to end-users?
25
25
 
26
26
  3. **Build order and dependencies**
27
- *Why it matters: this ordering becomes the literal sprint-by-sprint plan the delivery team executes. Skip when: only a single EPIC exists with no sequencing decision to make.*
27
+ *Why it matters: this ordering becomes the literal iteration-by-iteration plan the delivery team executes. Skip when: only a single EPIC exists with no sequencing decision to make.*
28
28
  - In what order should EPICs be built?
29
29
  - What are the technical dependencies between EPICs?
30
30
  - Are there infrastructure or integration prerequisites that must be ready first?
31
31
  - What is the critical path?
32
+ - Which requirement IDs does each phase realise, and what must be observably true when it is done? The answers are the **Phase Plan** (`.planning/discovery/_phases.md`, Closing Step) — the literal source of ROADMAP.md; every MVP requirement belongs to exactly one phase.
32
33
 
33
34
  4. **Milestones and release plan**
34
35
  *Why it matters: milestone criteria are what stakeholder demos and Session 13's transition plan are scheduled against. Skip when: a single go-live milestone applies with no phased rollout.*
@@ -38,6 +39,7 @@
38
39
 
39
40
  5. **Risk register and mitigation**
40
41
  *Why it matters: risks captured here are what Session 13's go/no-go recommendation weighs most heavily. Skip when: never — always capture at least the top known risks.*
42
+ - Which risks from Session 1's **Constraints and Risks Register** are still open? They keep their `R-` IDs here.
41
43
  - What are the top project risks (technical, resourcing, scope, external)?
42
44
  - What is the likelihood and impact of each risk?
43
45
  - What mitigation strategies will be applied?
@@ -50,7 +52,7 @@
50
52
  | Phase | Start Date | End Date | Duration | Key Activities | Dependencies |
51
53
  |-------|-----------|----------|----------|---------------|--------------|
52
54
  | Discovery | | | | | |
53
- | Sprint 0 / Setup | | | | | |
55
+ | Setup (Sprint 0 or first phase) | | | | | |
54
56
  | Build -- MVP | | | | | |
55
57
  | UAT | | | | | |
56
58
  | Go-Live | | | | | |
@@ -58,10 +60,16 @@
58
60
 
59
61
  **EPIC Build Order**
60
62
 
61
- | Order | EPIC ID | EPIC Name | Sprint(s) | Dependencies | Critical Path? | Notes |
62
- |-------|---------|-----------|-----------|--------------|---------------|-------|
63
+ | Order | EPIC ID | EPIC Name | Iteration(s) | Dependencies | Critical Path? | Notes |
64
+ |-------|---------|-----------|--------------|--------------|---------------|-------|
63
65
  | 1 | | | | | | |
64
66
 
67
+ **Iteration(s)** names sprints (`S1–S2`) or pp-core phases (`Phase 3`), following the iteration model chosen in topic 1.
68
+
69
+ **Phase Plan** (populated via the Closing Step)
70
+
71
+ One row per pp-core phase in `.planning/discovery/_phases.md` § Phases — `Phase | Goal | EPICs | Requirement IDs | Success criteria | Depends on`. Record here only what the table cannot hold (why a requirement moved phase, what was debated).
72
+
65
73
  **Milestone Plan**
66
74
 
67
75
  | Milestone | Target Date | Included EPICs / Features | Entry Criteria | Exit Criteria | Stakeholder Demo? |
@@ -74,17 +82,33 @@
74
82
  **Risk Register**
75
83
 
76
84
  | ID | Risk Description | Category | Likelihood (H/M/L) | Impact (H/M/L) | Risk Score | Mitigation | Owner | Status |
77
- |----|-----------------|----------|--------------------|-----------------|-----------|-----------:|-------|--------|
85
+ |----|-----------------|----------|--------------------|-----------------|-----------|------------|-------|--------|
78
86
  | R-01 | | | | | | | | |
79
87
 
80
88
  **Key Decisions**
81
89
 
82
- | # | Decision | Rationale | Owner | Date |
90
+ | ID | Decision | Rationale | Owner | Date |
83
91
  |---|----------|-----------|-------|------|
84
92
  | | | | | |
85
93
 
86
94
  **Action Items**
87
95
 
88
- | # | Action | Owner | Due Date | Status |
96
+ | ID | Action | Owner | Due Date | Status |
89
97
  |---|--------|-------|----------|--------|
90
98
  | | | | | |
99
+
100
+ ---
101
+
102
+ ## Session 11: Phase Plan
103
+
104
+ **Closing Step — Phase Plan.** Run it after Step 7 and before Step 8, every time Session 11 completes, including a redo. The EPIC Build Order says in what order; the Phase Plan says what each phase delivers, by requirement ID, so `/pp-discovery-to-build` copies it into ROADMAP.md verbatim and every build phase can read its discovery rows (`references/discovery-build-consumption.md`).
105
+
106
+ 1. Create `.planning/discovery/_phases.md` from the bootstrap template in `${PP_TOOLS%/bin/pp-tools.cjs}/references/discovery-build-consumption.md` § `_phases.md` when it does not exist.
107
+ 2. Write one row per pp-core phase, in build order, following the iteration model from topic 1 (one iteration = one phase when that was chosen; otherwise one phase per EPIC Build Order row, several sprints to a phase being fine). pp-core phases count from 1: a "Phase 0", "Sprint 0" or "Setup" row of this session becomes Phase 1 and every later row shifts by one — record the mapping (`Session 11 phase 0 → pp-core Phase 1`) under **Phase Plan** in the Notes Template so the two numberings never meet unexplained:
108
+ - **Goal** — one sentence, the phase's deliverable;
109
+ - **EPICs** — the `E-nn` rows the phase realises, or `—`;
110
+ - **Requirement IDs** — every `_requirements.md` ID the phase realises: each EPIC's requirements from Session 3, the `N-`/`T-` rows that belong with them; an `MVP` requirement goes in exactly one phase, a `Later` one in none unless the plan reaches it, a `Dropped` one never. A requirement the build order splits across phases ("basic list" now, "filters" later) belongs to the phase where its acceptance criteria are fully met — the earlier phase names the partial work in its Goal, not in this column. A cross-cutting process or validation requirement that every phase exercises belongs to the phase that establishes it. A setup or infrastructure phase that realises no requirement writes `—`;
111
+ - **Success criteria** — two to five observable statements separated by ` · `, written from the user's seat ("A clerk closes a task and it leaves the list");
112
+ - **Depends on** — the earlier phase numbers whose output this phase needs, or `—`.
113
+ 3. Run `pp_run query discovery.phases-check` — exit 0, or fix the rows it names: `mvp_requirement_unplanned` is an MVP requirement no phase owns, `requirement_in_multiple_phases` a requirement two phases both claim.
114
+ 4. Smoke the join: `pp_run query discovery.for-phase 1 --markdown` renders the rows Phase 1 will read. An empty section is a fact to settle now (no step cites those IDs, no screen covers them), not a rendering fault.
@@ -5,34 +5,34 @@
5
5
 
6
6
  ### Session 12: Team & Delivery Model Definition
7
7
 
8
- **Goal:** Define the team structure and roles, establish governance and decision-making processes, agree on agile ceremonies, and plan the support model for post-go-live.
8
+ **Goal:** Define the team structure and roles, establish governance and decision-making processes, agree on the working rhythm, and plan the support model for post-go-live. The model fits the team shape Session 1 recorded, from a full delivery team to one person working with an AI assistant.
9
9
 
10
10
  **What We Cover:**
11
11
 
12
12
  1. **Team structure and roles**
13
13
  *Why it matters: role allocation is what the Session 11 build-order plan assumes has capacity to execute. Skip when: the team is already fully staffed and roles are fixed by contract.*
14
- - What roles are needed for the build phase (PO, Scrum Master, developers, QA, UX, architect)?
15
- - How many people are needed for each role?
14
+ - What roles are needed for the build phase (product owner, delivery lead, architect, developers, QA, UX)?
15
+ - How many people are needed for each role? In a small team one person holds several roles: list each role, with the same name against it. When an AI assistant does part of the work, give it its own row, with the person who reviews its output.
16
16
  - Which roles are filled by the client and which by the delivery partner? [needs-business-input]
17
17
  - Are there part-time or shared resources? What is their allocation?
18
18
 
19
19
  2. **Governance and decision-making**
20
20
  *Why it matters: governance structure determines how scope changes get approved mid-build, preventing later rework. Skip when: an existing PMO governance model already applies unchanged.*
21
- - What is the governance structure (steering committee, project board)?
21
+ - What is the governance structure (steering committee, project board, or a single sponsor)? Start from Session 1's **Approval Matrix**.
22
22
  - How often does the governance body meet?
23
23
  - What decisions require steering committee approval vs. team-level authority?
24
24
  - What is the escalation path for blockers or scope changes?
25
25
 
26
- 3. **Agile ceremonies and cadence**
27
- *Why it matters: cadence must match the sprint length assumed in Session 11's timeline. Skip when: the team already has an established ceremony rhythm from prior engagements.*
28
- - What agile framework will be followed (Scrum, Kanban, SAFe, hybrid)?
29
- - What is the sprint cadence and duration?
30
- - What ceremonies are planned (standup, sprint planning, review, retrospective, backlog refinement)?
26
+ 3. **Working rhythm and cadence**
27
+ *Why it matters: the rhythm must match the iteration model Session 11 chose. Skip when: the team already has an established rhythm from prior engagements.*
28
+ - What way of working will be followed (Scrum, Kanban, pp-core phases, hybrid)?
29
+ - What is the iteration cadence: the sprint length, or the pp-core phase rhythm Session 11 chose?
30
+ - Which meetings are held? For a pp-core phase rhythm, planning is `/pp-discuss-phase` plus `/pp-plan-phase` and review is `/pp-verify-work` with the client. A one-person team drops the meetings it has no one to hold; record each one dropped as `D-12-<n>`.
31
31
  - What tools will be used for backlog management (Jira, Azure DevOps, Linear)?
32
32
 
33
33
  4. **Communication and reporting**
34
34
  *Why it matters: reporting cadence sets stakeholder expectations for visibility into progress. Skip when: an existing status-reporting process already covers this project.*
35
- - How will progress be communicated to stakeholders (sprint review, status report, dashboard)?
35
+ - How will progress be communicated to stakeholders (iteration review, status report, dashboard)?
36
36
  - What is the reporting cadence (weekly, bi-weekly)?
37
37
  - What metrics will be tracked (velocity, burndown, defect rate, cycle time)?
38
38
 
@@ -50,12 +50,13 @@
50
50
  | Role | Name / TBD | Allocation (%) | Responsible Party (Client / Partner) | Start Date | Notes |
51
51
  |------|-----------|----------------|--------------------------------------|-----------|-------|
52
52
  | Product Owner | | | | | |
53
- | Scrum Master | | | | | |
53
+ | Delivery Lead (Scrum Master, or none) | | | | | |
54
54
  | Solution Architect | | | | | |
55
55
  | Frontend Developer | | | | | |
56
56
  | Backend Developer | | | | | |
57
57
  | QA Engineer | | | | | |
58
58
  | UX Designer | | | | | |
59
+ | AI assistant (reviewed by) | | | | | |
59
60
 
60
61
  **Governance Structure**
61
62
 
@@ -69,11 +70,13 @@
69
70
 
70
71
  | Ceremony | Cadence | Duration | Participants | Facilitator | Tool |
71
72
  |----------|---------|----------|--------------|-------------|------|
72
- | Daily standup | Daily | | | | |
73
- | Sprint planning | Per sprint | | | | |
74
- | Sprint review | Per sprint | | | | |
75
- | Retrospective | Per sprint | | | | |
76
- | Backlog refinement | Weekly | | | | |
73
+ | Daily sync | | | | | |
74
+ | Iteration planning | Per iteration | | | | |
75
+ | Iteration review / demo | Per iteration | | | | |
76
+ | Retrospective | Per iteration | | | | |
77
+ | Backlog refinement | | | | | |
78
+
79
+ An iteration is a sprint or a pp-core phase, as Session 11 chose. Write `—` in **Cadence** for a meeting the team does not hold.
77
80
 
78
81
  **Support Model**
79
82
 
@@ -85,12 +88,12 @@
85
88
 
86
89
  **Key Decisions**
87
90
 
88
- | # | Decision | Rationale | Owner | Date |
91
+ | ID | Decision | Rationale | Owner | Date |
89
92
  |---|----------|-----------|-------|------|
90
93
  | | | | | |
91
94
 
92
95
  **Action Items**
93
96
 
94
- | # | Action | Owner | Due Date | Status |
97
+ | ID | Action | Owner | Due Date | Status |
95
98
  |---|--------|-------|----------|--------|
96
99
  | | | | | |
@@ -19,11 +19,11 @@ Before facilitating any topics, execute the **Session 13: Cross-Reference Protoc
19
19
  - Which assumptions were validated and which were invalidated?
20
20
  - What issues were identified and resolved by the cross-reference analysis?
21
21
 
22
- 2. **Project Definition Document (PDD) review**
23
- *Why it matters: this is the client's last chance to catch a scoping or architecture error before build starts. Skip when: never — always required before go/no-go.*
24
- - Walk through the PDD structure and key sections
25
- - Are there sections requiring further refinement?
26
- - Does the client agree with documented scope, architecture, and approach?
22
+ 2. **Project Charter review**
23
+ *Why it matters: the charter (`docs/discovery/PROJECT-CHARTER.md`, drafted in Step 0.5 from `templates/project-charter.md`) is the one document every stakeholder signs, so this is the client's last chance to catch a scoping or architecture error before build starts. Skip when: never — always required before go/no-go.*
24
+ - Walk through the drafted charter section by section; every statement traces to a session, decision or requirement ID
25
+ - Are there sections requiring further refinement? Correct the charter in place; a correction that changes a recorded fact is a Key Decisions row `D-13-<n>` and a back-amend of the original line (Flow 2 Step 6)
26
+ - Does the client agree with documented scope, architecture, approach, deviations and conditions?
27
27
 
28
28
  3. **Go / No-Go assessment**
29
29
  *Why it matters: this is the literal decision gate that authorizes spend on the build phase. Skip when: never — always required.*
@@ -31,6 +31,7 @@ Before facilitating any topics, execute the **Session 13: Cross-Reference Protoc
31
31
  - Is the technical architecture validated and feasible?
32
32
  - Are there blocking risks or unresolved dependencies?
33
33
  - What is the confidence level for the proposed timeline and budget? [needs-business-input]
34
+ - Record the assessment in the Notes Template below; the Closing Step copies it into the charter § 17 and its frontmatter as recorded — the charter never re-judges it
34
35
 
35
36
  4. **Open items and parking lot**
36
37
  *Why it matters: unresolved items surfaced here become explicit known-gaps in the handoff, not silent omissions. Skip when: never — always required, even an empty parking lot is worth stating explicitly.*
@@ -64,11 +65,15 @@ Before facilitating any topics, execute the **Session 13: Cross-Reference Protoc
64
65
  | Stakeholder alignment | | |
65
66
  | **Overall Recommendation** | | |
66
67
 
68
+ This table is copied into the charter § 17 as recorded here — the charter never re-judges it. **Status** is `Green`, `Amber` or `Red`; **Overall Recommendation** is `Go`, `Go with conditions` or `No-Go` — `charter-check` compares these literals.
69
+
67
70
  **Open Items Register**
68
71
 
69
72
  | ID | Item | Source Session | Priority (H/M/L) | Must Resolve Before Build? | Owner | Target Date | Status |
70
73
  |----|------|---------------|-------------------|---------------------------|-------|-------------|--------|
71
- | OI-1 | | | | | | | |
74
+ | OI-01 | | | | | | | |
75
+
76
+ **Must Resolve Before Build?** starts with `Yes` or `No` (a reason may follow); **Status** starts with `Open`, `Closed`, `Resolved` or `Parked`. `charter-check` reads these literals: an item that must resolve before build and is not `Closed`/`Resolved` has to stand in the charter § 16 Conditions.
72
77
 
73
78
  **Cross-Reference Analysis Results**
74
79
 
@@ -103,18 +108,22 @@ Before facilitating any topics, execute the **Session 13: Cross-Reference Protoc
103
108
 
104
109
  **Key Decisions**
105
110
 
106
- | # | Decision | Rationale | Owner | Date |
111
+ | ID | Decision | Rationale | Owner | Date |
107
112
  |---|----------|-----------|-------|------|
108
113
  | | | | | |
109
114
 
110
115
  **Action Items**
111
116
 
112
- | # | Action | Owner | Due Date | Status |
117
+ | ID | Action | Owner | Due Date | Status |
113
118
  |---|--------|-------|----------|--------|
114
119
  | | | | | |
115
120
 
116
121
  ---
117
122
 
123
+ **Closing Step — charter for sign-off.** Run it after Step 7 and before Step 8, every time Session 13 completes, including a redo. Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/charter.md` § **Finish** and follow it: the Go / No-Go table and the Open Items Register are copied into `docs/discovery/PROJECT-CHARTER.md` as recorded, must-resolve items become § 16 conditions, the status becomes `For sign-off`, `pp_run query discovery.charter-check` exits 0, the DOCX and PDF are rendered next to the markdown, and all of it is committed.
124
+
125
+ ---
126
+
118
127
  ## Session 13: Cross-Reference Protocol
119
128
 
120
129
  **Run this protocol (Step 0) before facilitating Session 13 topics.**
@@ -134,7 +143,7 @@ Analyze all prior sessions in three groups. Use Explore agents if available, or
134
143
  | Technical | 5–8 (Architecture, Security, Identity, Integration) | Technology stack consistency, role/RBAC alignment, integration point definitions, API contracts |
135
144
  | Governance & Costs | 9–12 (QA, Infrastructure, Roadmap, Team) | Timeline feasibility, resource allocation, test strategy alignment, sprint capacity |
136
145
 
137
- For each group: read all session files AND `.planning/discovery/_context.md`. Cross-reference factual claims, role names, technology choices, integration points, and requirement IDs. Check for contradictions between sessions.
146
+ For each group: read all session files — their Notes Template sections and the registers they cite. Cross-reference factual claims, role names, technology choices, integration points, and requirement IDs. Check for contradictions between sessions.
138
147
 
139
148
  #### 0b. Issue Severity Categories
140
149
 
@@ -147,9 +156,11 @@ For each group: read all session files AND `.planning/discovery/_context.md`. Cr
147
156
 
148
157
  #### 0c. Cross-Reference Checklist
149
158
 
150
- - [ ] **Roles & RBAC:** Same role names, count, and permissions across all sessions (especially S5 vs S7)
159
+ - [ ] **Roles & RBAC:** Same role names, count, and permissions across all sessions (especially S5 vs S7); `discovery roles-check` exits 0 (every role a persona or step actor, every permission citing an existing entity and requirement, every screen row resolving)
151
160
  - [ ] **Technology stack:** Consistent tools/frameworks referenced (especially S5, S8, S10)
152
- - [ ] **Integration points:** Same systems, directions, and protocols across S5, S8, S10
161
+ - [ ] **Integration points:** Same systems, directions, and protocols across S5, S8, S10; `discovery integrations-check` and `discovery migration-check` exit 0 (every step-matrix `IF-` resolving, every contract and error row naming a known interface, every migration source in the Systems Landscape)
162
+ - [ ] **Deviations:** every Standards Applied `Deviation` that is not `none` is a `DEV-` row of `_deviations.md`; `discovery deviations-check` exits 0 (standard in the vault cache, approver in the Session 1 Approval Matrix, a decision on every approved or rejected row)
163
+ - [ ] **Session outputs:** `discovery session-check --all` exits 0 (every Notes Template section of every completed session present once, with a data row, prose or `None identified in Discovery.`)
153
164
  - [ ] **Requirements traceability:** Every S3 requirement addressable in S5 architecture
154
165
  - [ ] **Requirements roll-up:** `discovery rollup --check` exits 0 (totals block matches table)
155
166
  - [ ] **Pre-fill/confidential gate:** `discovery input-check` exits 0 (no unconfirmed markers, no tracked confidential files)
@@ -162,6 +173,8 @@ For each group: read all session files AND `.planning/discovery/_context.md`. Cr
162
173
  - [ ] **Test strategy:** S9 covers all S3 requirements and S5 components
163
174
  - [ ] **Timeline and capacity:** S11 roadmap feasible given S12 team and S9 test needs
164
175
  - [ ] **Action items:** No duplicates or contradictions in `_progress.md`
176
+ - [ ] **Back-amends:** every decision that changes an earlier record has `→ amended by D-<ss>-<n>` at the original line (Flow 2 Step 6)
177
+ - [ ] **Mid-sprint findings:** every finding `session-08.md` **Mid-Sprint Cross-Reference** left open is fixed or deferred again here
165
178
 
166
179
  #### 0d. Present Findings
167
180
 
@@ -191,7 +204,7 @@ Ask the user how to proceed (AskUserQuestion or text-mode numbered list):
191
204
  3. Review each finding one by one
192
205
  4. Skip cross-reference (not recommended)
193
206
 
194
- Apply fixes using Edit tool across affected session files. Update `.planning/discovery/_context.md` if key facts change.
207
+ Apply fixes using Edit tool across affected session files and registers — the original line, per the back-amend rule (Flow 2 Step 6).
195
208
 
196
209
  #### 0f. Record Cross-Reference Results
197
210
 
@@ -200,4 +213,8 @@ Capture in `.planning/discovery/session-13.md` notes:
200
213
  - List of all fixes applied (file, what changed, why)
201
214
  - Any findings deferred or noted but not fixed
202
215
 
216
+ #### 0.5. Draft the Project Charter
217
+
218
+ Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/charter.md` § **Draft** and follow it: the charter is written to `docs/discovery/PROJECT-CHARTER.md` from `templates/project-charter.md`, in the sprint language, every section from its source map, `status: Draft`, and `pp_run query discovery.charter-check` exits 0 before you go on. Topics 2 and 3 review and score that document, not a summary of the sessions.
219
+
203
220
  Then proceed to Step 5 (Facilitate Session 13 topics).
@@ -109,7 +109,9 @@ needs no knowledge of the vault's folders (PBI 75336).
109
109
 
110
110
  - **If `.planning/vault/SUMMARY.md` lists `INDEX.md`**, Read `.planning/vault/INDEX.md`. The
111
111
  selection index is `INDEX.md`. Take only its list lines of the form
112
- `` - `<path>` — <description> `` as candidates and ignore everything else in it.
112
+ `` - `<path>` — <description> `` as candidates and ignore everything else in it. A line whose
113
+ description starts with `[cross-cutting]` is a rule that binds every session — approval routes,
114
+ folder layout, naming — and is selected by the rule below, not by topic.
113
115
  - **Otherwise** select from the listing in `SUMMARY.md` itself (each path with its first heading).
114
116
  The selection index is `SUMMARY.md`. Print `vault: the vault ships no INDEX.md; selecting from
115
117
  the cache index` and continue.
@@ -132,7 +134,14 @@ or reordered session cannot move out from under its selection (D-11-16). Take th
132
134
  - Select a document when its index line bears on a decision one of this session's topics asks the
133
135
  client to make. Note the topic number; it is the "why" of the record.
134
136
  - Select at most **8** documents. When more qualify, keep the ones that bear on the most topics.
135
- - Selecting nothing is a valid outcome. Kick-off and wrap-up sessions often have nothing to select.
137
+ - **Always select every `[cross-cutting]` document as well**, outside the cap of 8 and whatever
138
+ the session's topics. The cap stops topic documents crowding each other out; it must never drop
139
+ a rule every decision answers to. A session can sign a deviation only the vault's approval route
140
+ may sign, or place a folder the layout rule forbids, without any of its topics naming that
141
+ document. Its record line says why: `` - `<path>` — cross-cutting: <what it governs> ``.
142
+ - Selecting nothing is a valid outcome when the index marks nothing `[cross-cutting]`. Wrap-up
143
+ sessions often have nothing to select; Session 1 selects the documents that state approval rules
144
+ or mandate a platform.
136
145
 
137
146
  **Bounds — the engine index decides what may be read.** Read a selected document only if
138
147
  `.planning/vault/SUMMARY.md` lists its path. The engine builds that listing with `isSecretFile`
@@ -182,7 +191,9 @@ answer in the session notes. The vault does not answer for the client; it puts t
182
191
  prior answer on the table. A loaded document that turns out to bear on no answer gets
183
192
  `— not used: <reason>` appended to its record line before the session closes. Flow 2 Step 7 runs
184
193
  `pp_run query discovery.vault-check <N>`, which fails while a recorded document is neither cited nor
185
- marked not used.
194
+ marked not used, and, when the record's index is `INDEX.md`, while a `[cross-cutting]` document has
195
+ no record line (`cross_cutting_missing`). A cross-cutting document that no answer drew on still
196
+ gets its line, marked `— not used: <reason>`; that line is the record that it was checked.
186
197
 
187
198
  ## 5. Return
188
199
 
@@ -1,7 +1,7 @@
1
1
  <purpose>
2
2
  Facilitate the 13-session Pareto Discovery Sprint. Guide each session topic-by-topic,
3
3
  capture outputs into structured notes templates, and write all artifacts to
4
- .planning/discovery/ (session-01.md … session-13.md, _progress.md, _context.md).
4
+ .planning/discovery/ (session-01.md … session-13.md, _progress.md and the registers).
5
5
  </purpose>
6
6
 
7
7
  <required_reading>
@@ -46,6 +46,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
46
46
  - Else if `FIRST_TOKEN` is `gap` → Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/gap-analysis.md` and follow it. Stop. The numeric token is a document accession number, not a session number — the 1–13 range check and `SESSION_INVALID` do not apply here (the subfile re-derives the accession from `$ARGUMENTS` in its Step 0).
47
47
  - Else if `FIRST_TOKEN` is `rebaseline` → Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/rebaseline.md` and follow it. Stop. The numeric token is a document accession number, not a session number — the 1–13 range check and `SESSION_INVALID` do not apply here (the subfile re-derives the accession from `$ARGUMENTS` in its Step 0).
48
48
  - Else if `FIRST_TOKEN` is `prototype` → Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/prototype.md` and follow it. Stop. It builds the clickable prototype from Sessions 1–4 and can be run at any moment, also after a No at the end of Session 4.
49
+ - Else if `FIRST_TOKEN` is `charter` → Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/charter.md` § Redraft and follow it. Stop. It records signatures on, or redrafts and re-exports, `docs/discovery/PROJECT-CHARTER.md`; the first draft is Session 13's Step 0.5.
49
50
  - Else if `--prefill` is in `$ARGUMENTS` → requires a session number: if `SESSION_ARG` is empty, say so politely and stop; else Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/prefill.md` and follow it. Stop.
50
51
  - Else if `SESSION_INVALID` is non-empty → show a usage error: "Session `$SESSION_INVALID` is out
51
52
  of range — valid sessions are 1–13." Do not run any session or the progress view.
@@ -77,7 +78,6 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
77
78
  **Artifact paths:**
78
79
  - Session files: `.planning/discovery/session-01.md` … `.planning/discovery/session-13.md`
79
80
  - Progress tracker: `.planning/discovery/_progress.md`
80
- - Context file: `.planning/discovery/_context.md`
81
81
  - Research track: `.planning/discovery/_research.md` (backlog), `.planning/discovery/_risks.md` (data-gathering), `.planning/discovery/_sparring.md` (positions)
82
82
  - Scope re-baseline matrix: `.planning/discovery/_rebaseline.md`
83
83
  - Prototype: `.planning/discovery/prototype/` (built by `/pp-discovery prototype`)
@@ -112,7 +112,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
112
112
  > "Confirm Session N — [Name] (pre-filled). Run `/pp-discovery N` to walk its `[TO CONFIRM]` markers."
113
113
  - Otherwise, find the first "Not Started" session whose dependencies are all "Completed":
114
114
  > "Next recommended session: Session N — [Name]. Run `/pp-discovery N` to start."
115
- - If every session is "Completed", say the Discovery Sprint is complete and point to Session 13's wrap-up output.
115
+ - If every session is "Completed", say the Discovery Sprint is complete and report the Project Charter: read the frontmatter of `docs/discovery/PROJECT-CHARTER.md` and state its `version`, `status` and `go_no_go` (`/pp-discovery charter` records signatures; `/pp-discovery-to-build` needs `Signed` or `Signed with conditions`). If the file does not exist, say so and point to `/pp-discovery 13` — its Step 0.5 drafts it.
116
116
 
117
117
  ---
118
118
 
@@ -127,9 +127,8 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
127
127
  1. Determine the session file path: `.planning/discovery/session-NN.md` (zero-padded, e.g. `session-03.md`).
128
128
  2. If the file does not exist, create it using the session template from the session content file.
129
129
  3. Read `.planning/discovery/_progress.md` (create if absent — use the **Bootstrap Templates** section near the end of this workflow for the literal schema).
130
- 4. Read `.planning/discovery/_context.md` (create if absent — use the **Bootstrap Templates** section near the end of this workflow for the literal schema).
131
- 5. Read `.planning/discovery/_risks.md` and `.planning/discovery/_sparring.md` when they exist — they are created on first need (see the research-track reference named in **Bootstrap Templates**). Surface as opening context every `DG-`/`SP-` item whose `Feeds:` names this session (D-40).
132
- 6. If the session content file carries a **Precondition**, run it now. When it stops, stop the session here — do not mark it In Progress.
130
+ 4. Read `.planning/discovery/_risks.md` and `.planning/discovery/_sparring.md` when they exist — they are created on first need (see the research-track reference named in **Bootstrap Templates**). Surface as opening context every `DG-`/`SP-` item whose `Feeds:` names this session (D-40).
131
+ 5. If the session content file carries a **Precondition**, run it now. When it stops, stop the session here — do not mark it In Progress.
133
132
 
134
133
  ### Step 2: Check Dependencies
135
134
 
@@ -182,18 +181,19 @@ For each numbered topic in the session's "What We Cover" section:
182
181
 
183
182
  ### Step 6: Key Decisions and Action Items
184
183
 
185
- Ask: "Any key decisions made?" → populate Key Decisions table.
186
- Ask: "Any action items to track?" → populate Action Items table and update `_progress.md`. (Parked-topic Action Items rows were already added in Step 5.3b — do not duplicate them here.)
184
+ Ask: "Any key decisions made?" → populate Key Decisions table; each row's **ID** is `D-<ss>-<n>`.
185
+ **Back-amend rule:** when a decision changes something an earlier session recorded — a decision, a requirement, a risk, a table value — edit the original line in the same step: keep its text and append `→ amended by D-<ss>-<n>`. A reader of the earlier session then sees the change where they read the old answer.
186
+ Ask: "Any action items to track?" → populate Action Items table (**ID** `A-<ss>-<n>`) and update `_progress.md`. (Parked-topic Action Items rows were already added in Step 5.3b — do not duplicate them here.)
187
187
  Ask: "Any positions taken that aren't decisions yet?" → append or update an `SP-<nn>` position block in `.planning/discovery/_sparring.md` with all seven fields (`Position` / `Key point` / `To nail down` / `DECISION` / `Residual risk accepted` / `Feeds:` / `Status:`). Evolve a position **in place** — never a second block for the same question, not even on a reversal (D-39).
188
188
 
189
189
  ### Step 7: Complete the Session
190
190
 
191
- 1. Update `.planning/discovery/session-NN.md` frontmatter: `status: "Completed"`, `completed_date: "[YYYY-MM-DD]"`, `completeness_score: [N]`. Compute `N = round(100 × topics_covered ÷ total_topics)` for this session — only use 100 when every topic was covered. If topics were skipped (see Edge Cases) **or parked** (Step 5.3), the score reflects the proportion actually completed — a session with parked items must read honestly below 100%. Topics whose captured answers still carry `[TO CONFIRM]` count as **not covered**, exactly like parked topics — a pre-filled session must read honestly below 100 until its markers are confirmed (D-18/D-19). A section carrying `⚠️ CONDITIONAL — <RS-nn|DG-nn>` counts as **covered** — the decision was made in the room and is knowingly contingent on outside work, the deliberate opposite of `[TO CONFIRM]` (D-47). Record the cited IDs in frontmatter as `conditional: [RS-03, DG-07]`, set the session's `Conditional` count in `_progress.md` and its `Conditional sections (open):` total (D-48).
191
+ 1. Update `.planning/discovery/session-NN.md` frontmatter: `status: "Completed"`, `completed_date: "[YYYY-MM-DD]"`, `completeness_score: [N]`. Compute `N = round(100 × topics_covered ÷ total_topics)` for this session — only use 100 when every topic was covered. A topic whose Notes Template section `pp_run query discovery.session-check <N>` (item 3) reports `empty_section` counts as **not covered**, however long it was discussed — the output is the measure, not the conversation (`references/discovery-session-output.md`). If topics were skipped (see Edge Cases) **or parked** (Step 5.3), the score reflects the proportion actually completed — a session with parked items must read honestly below 100%. Topics whose captured answers still carry `[TO CONFIRM]` count as **not covered**, exactly like parked topics — a pre-filled session must read honestly below 100 until its markers are confirmed (D-18/D-19). A section carrying `⚠️ CONDITIONAL — <RS-nn|DG-nn>` counts as **covered** — the decision was made in the room and is knowingly contingent on outside work, the deliberate opposite of `[TO CONFIRM]` (D-47). Record the cited IDs in frontmatter as `conditional: [RS-03, DG-07]`, set the session's `Conditional` count in `_progress.md` and its `Conditional sections (open):` total (D-48).
192
192
  2. Update `.planning/discovery/_progress.md`: set row to Completed with date and score.
193
- 3. Update `.planning/discovery/_context.md`: populate the session's output section with concise summaries.
193
+ 3. Run `pp_run query discovery.session-check <N>`. Exit 0 → continue. Non-zero → a Notes Template section is missing, repeated, off its template columns or still empty: fill it from what the room said, or write `None identified in Discovery.` on one line under its title when the session found nothing — never leave a template row blank and never record the answer in a second file. Re-run until 0, then set the score as item 1 says. Read `${PP_TOOLS%/bin/pp-tools.cjs}/references/discovery-session-output.md` for the contract.
194
194
  4. If the session content file carries a **Closing Step**, run it now, before Step 8.
195
195
  5. If `_feedback.md` exists, run `pp_run query discovery.screen-check --require-processed`. Non-zero: process the `Open` rows as `prototype.md` Step 7 describes before the session counts as closed.
196
- 6. If `session-NN.md` carries a `## Vault Context` section, run `pp_run query discovery.vault-check <N>`. Non-zero: cite each named document `[vault: <path>]` beside the answer it informed, or append `— not used: <reason>` to its record line, then re-run.
196
+ 6. If `session-NN.md` carries a `## Vault Context` section, run `pp_run query discovery.vault-check <N>`. Non-zero: cite each named document `[vault: <path>]` beside the answer it informed, or append `— not used: <reason>` to its record line; for `cross_cutting_missing`, add the named document's record line, read it against this session's decisions, and cite or mark it the same way. Then re-run.
197
197
 
198
198
  ### Step 8: Show Summary
199
199
 
@@ -222,29 +222,31 @@ Each session's Goal, "What We Cover" topics and Notes Template live in their own
222
222
 
223
223
  ## Context-Awareness Rules
224
224
 
225
- When facilitating sessions, reference prior session outputs from `.planning/discovery/_context.md`:
225
+ When facilitating sessions, reference prior session outputs from the earlier session files' Notes Template sections and from the registers they point at (`_requirements.md`, `_entities.md`, `_processes.md`, `_roles.md`, `_integrations.md`, `_deviations.md`) — never from a summary written at session close; the session tables are the single source:
226
226
 
227
227
  | Current Session | Reference From |
228
228
  |----------------|----------------|
229
229
  | Session 2 | Session 1: project context, vision, stakeholders |
230
230
  | Session 3 | Session 2: pain points, processes, personas, systems, data flows |
231
231
  | Session 4 | Session 1: vision, constraints. Session 2: personas, pain points. Session 3: processes, requirements, EPICs |
232
- | Session 5 | Session 3: requirements, scope. Session 4: UX decisions |
233
- | Session 6 | Session 5: architecture, technology stack |
232
+ | Session 5 | Session 1: platform decision. Session 3: requirements, scope. Session 4: UX decisions |
233
+ | Session 6 | Session 1: platform decision, approval routes. Session 5: architecture, technology stack |
234
234
  | Session 7 | Session 5: architecture. Session 6: security requirements |
235
235
  | Session 8 | Session 5: architecture, integration points |
236
236
  | Session 9 | Session 3: requirements. Session 5: architecture |
237
- | Session 10 | Session 5: architecture. Session 9: test environments |
238
- | Session 11 | Session 3: EPICs, scope. Session 5: architecture. Session 9: QA |
239
- | Session 12 | Session 11: roadmap, phases, timeline |
237
+ | Session 10 | Session 1: platform decision. Session 5: architecture. Session 9: test environments |
238
+ | Session 11 | Session 1: risks. Session 3: EPICs, scope. Session 5: architecture. Session 9: QA |
239
+ | Session 12 | Session 1: team shape, approval routes. Session 11: roadmap, iteration model, timeline |
240
240
  | Session 13 | All previous sessions — full context review |
241
241
 
242
+ **Shell you write yourself** (not a fence from this workflow): start every multi-line command with `[ -z "${ZSH_VERSION:-}" ] || emulate -R sh`, never begin a word with `=`, and use no GNU-only flags — the user's shell may be zsh on macOS. Read `${PP_TOOLS%/bin/pp-tools.cjs}/references/shell-portability.md` for why.
243
+
242
244
  ---
243
245
 
244
246
  ## Edge Cases
245
247
 
246
248
  - **Session file not found:** Create it from the session template content above.
247
- - **All sessions completed:** Congratulate the user and suggest reviewing `_context.md` for a full summary.
249
+ - **All sessions completed:** Congratulate the user and point at the Project Charter Session 13 drafted and at `/pp-discovery-to-build`.
248
250
  - **User wants to skip a topic:** Allow it. Note the topic was skipped and continue.
249
251
  - **User provides very brief answers:** Ask at least one follow-up question before accepting.
250
252
  - **Session 3:** ALWAYS use the Process-First Protocol (Steps 5A–5G) — never use the generic topic loop.
@@ -255,7 +257,7 @@ When facilitating sessions, reference prior session outputs from `.planning/disc
255
257
 
256
258
  ## Bootstrap Templates
257
259
 
258
- `/pp-discovery` is self-sufficient — it does not depend on any other skill or command having run first. When `.planning/discovery/_progress.md` or `.planning/discovery/_context.md` is absent (first-ever session on this project — see Flow 2 Step 1), create it verbatim from its schema: the `_progress.md` schema is below, and the `_context.md` schema is one lazy Read away under `workflows/discovery-sprint/templates/`. Both paths are fixed under `.planning/discovery/` (T-04-03) — never write to a root-level directory, an absolute path, or a path containing `..`.
260
+ `/pp-discovery` is self-sufficient — it does not depend on any other skill or command having run first. When `.planning/discovery/_progress.md` is absent (first-ever session on this project — see Flow 2 Step 1), create it verbatim from the schema below. The path is fixed under `.planning/discovery/` (T-04-03) — never write to a root-level directory, an absolute path, or a path containing `..`.
259
261
 
260
262
  **`.planning/discovery/_progress.md`** (Parked-aware schema — D-11):
261
263
 
@@ -310,16 +312,14 @@ When facilitating sessions, reference prior session outputs from `.planning/disc
310
312
 
311
313
  The Status column takes one of four values: Not Started / Pre-Filled / In Progress / Completed — "Pre-Filled" marks a session populated from source documents but not yet confirmed live. The `Parked` column tracks how many topics in that session were marked `PARKED — needs business/senior input` instead of being answered — increment it whenever a topic is parked, and add a matching row to the `Open Action Items` table (owner: `business/senior`). Decrement that session's `completeness_score` in Step 7 to reflect the parked topic as not-covered. Keep `Parked questions (open):` in the Summary block equal to the sum of the `Parked` column across all sessions, minus any parked items subsequently resolved. The `Conditional` column tracks how many sections in that session carry a `⚠️ CONDITIONAL — <RS-nn|DG-nn>` marker. Unlike a parked topic, a conditional section does **not** decrement that session's `completeness_score` — it counts as covered (D-47). Keep `Conditional sections (open):` equal to that column's sum across all sessions.
312
314
 
313
- **`.planning/discovery/_context.md`:** Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/templates/context-template.md` lazily and create the file verbatim from the schema it carries. The path is fixed under `.planning/discovery/` (T-04-03) — never a root-level directory, never an absolute path, never a path containing `..`.
314
-
315
- **Research track (`_research.md` / `_risks.md` / `_sparring.md`):** these three registers are created on first need exactly like `_progress.md` and `_context.md` — no sub-command bootstraps them (D-31). Read `${PP_TOOLS%/bin/pp-tools.cjs}/references/discovery-research-track.md` lazily for their three schemas, the `⚠️ CONDITIONAL —` marker grammar and the `research-check` parser contract; never `@`-import it, as with `discovery-id-conventions.md` (D-30).
315
+ **Research track (`_research.md` / `_risks.md` / `_sparring.md`):** these three registers are created on first need exactly like `_progress.md` — no sub-command bootstraps them (D-31). Read `${PP_TOOLS%/bin/pp-tools.cjs}/references/discovery-research-track.md` lazily for their three schemas, the `⚠️ CONDITIONAL —` marker grammar and the `research-check` parser contract; never `@`-import it, as with `discovery-id-conventions.md` (D-30).
316
316
 
317
317
  </process>
318
318
 
319
319
  <success_criteria>
320
320
  - All 13 sessions are facilitated as substantive guided steps with Goal, guiding questions, and notes templates, each held in its `sessions/` content file.
321
321
  - The Session 3 process-first protocol and Session 13 cross-reference protocol are present as text procedures in `sessions/03-to-be.md` and `sessions/13-wrap-up.md`.
322
- - All artifact writes resolve to `.planning/discovery/session-NN.md`, `.planning/discovery/_progress.md`, `.planning/discovery/_context.md`, `.planning/discovery/_research.md`, `.planning/discovery/_risks.md`, `.planning/discovery/_sparring.md`, the `.planning/discovery-input/` package family (incl. `00-README.md` and `confidential/.gitignore`), `.planning/discovery/gap-<accession>.md` gap reports, or the `.planning/discovery/prototype/` tree.
322
+ - All artifact writes resolve to `.planning/discovery/session-NN.md`, `.planning/discovery/_progress.md`, `.planning/discovery/_research.md`, `.planning/discovery/_risks.md`, `.planning/discovery/_sparring.md`, the `.planning/discovery-input/` package family (incl. `00-README.md` and `confidential/.gitignore`), `.planning/discovery/gap-<accession>.md` gap reports, or the `.planning/discovery/prototype/` tree.
323
323
  - No writes target a root-level capital-D Discovery directory, an absolute path, or a `..` path.
324
324
  - Text-mode fallback is documented for all AskUserQuestion steps.
325
325
  </success_criteria>