@pareto4/pp-core 1.21.1 → 1.22.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.
@@ -5,43 +5,62 @@
5
5
 
6
6
  ### Session 9: Quality Assurance & Testing Strategy
7
7
 
8
- **Goal:** Define the overall test strategy, confirm the testing tooling and quality gates against the client's standards, plan test environments, and design the UAT approach.
8
+ **Goal:** Decide where the testing effort goes. Review every story's acceptance criteria for testability, choose by risk which main processes get an end-to-end test, name the complex parts of the solution that need extra test attention, confirm the test levels, environments and gates against the client's standards, and agree how UAT is run and signed off.
9
+
10
+ **Who is in the room.** The client's test manager (or QA lead) leads this session; the product owner decides what "accepted" means; the architect knows where the solution is hard. Without a test manager, the product owner takes the risk calls and the session records that as a Key Decision.
11
+
12
+ **How testing works in this delivery — say this first, in a minute.** The agents write the tests, before the code, from the acceptance criteria; every change runs the same checks; an agent never marks its own work — a separate verifier reads the acceptance criteria verbatim and decides pass or fail. So this session does not choose test tools or write test cases. It makes the calls the agents cannot: what "done" means for each story, where the business risk is, which parts are hard enough that ordinary tests will miss their failures, and who signs off.
13
+
14
+ **Inputs — read before topic 1.** `.planning/discovery/_stories.md` (the acceptance criteria); `.planning/discovery/_processes.md` § As-is (`Criticality`), § To-be and § Steps; `.planning/discovery/_rules.md`; `.planning/discovery/_roles.md`; `.planning/discovery/_integrations.md` and `_migration.md` when they exist; `.planning/discovery/_entities.md` (the classification Session 6 copied in); `session-05.md` **Component Inventory**; `session-06.md` **Compliance Requirements Register**; `session-04.md` (the accessibility level); the `N-` rows of `_requirements.md`.
15
+
16
+ **The register.** Copy the bootstrap template of `${PP_TOOLS%/bin/pp-tools.cjs}/references/discovery-tests.md` to `.planning/discovery/_tests.md` before topic 2 (replace `[PROJECT_NAME]`). Topics 2–4 fill it; the reference holds the cell grammar and the risk matrix.
9
17
 
10
18
  **Standards first.** Where a document this session's `## Vault Context` record names already fixes a test level, a coverage bar, a tool, the environments, a merge or release gate, 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-09-<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.
11
19
 
12
20
  **What We Cover:**
13
21
 
14
- 1. **Test strategy and approach**
15
- *Why it matters: sets the coverage bar every EPIC (Session 3) gets built and verified against. Skip when: the client has an existing enterprise test strategy this project simply inherits.*
16
- - Test levels and coverage: the vault's coding standards and quality gates fix them when bound — does this product deviate, and why? Otherwise: unit, integration, system, E2E, performance, security, and which target per level?
17
- - How will TDD or BDD be applied?
18
- - What is the approach to regression testing?
19
- - How will non-functional testing be addressed (load, stress, soak, accessibility)?
20
-
21
- 2. **Testing tools and frameworks**
22
- *Why it matters: tooling choice affects CI/CD pipeline design in Session 10. Skip when: the vault's stack and quality gates fix every tool and the client deviates nowhere — record the rows and move on.*
23
- - Unit and E2E tooling: the vault's language standards fix the frameworks when bound — does this product deviate? Otherwise: Jest, xUnit, JUnit, PyTest; Cypress, Playwright, Selenium?
24
- - Performance tooling: the vault's sizing and release rules fix the performance test when bound — does this product deviate? Otherwise: k6, JMeter, Gatling?
25
- - Security scanning: the vault's quality gates fix the scanners when bound — does this product deviate, and with which substitute? Otherwise: OWASP ZAP, Snyk, SonarQube?
26
-
27
- 3. **Test environments**
28
- *Why it matters: environment count and refresh cadence feed Session 10's infrastructure sizing. Skip when: a single shared environment is acceptable for this scale of project.*
29
- - How many test environments are needed? When a vault is bound, start from the environments its naming standard defines and record only deviations; otherwise choose (dev, test, staging, pre-prod).
30
- - How will test data be provisioned (synthetic data, anonymized production data, seed scripts)?
31
- - How will environments be kept in sync with production?
32
-
33
- 4. **Quality gates and CI/CD integration**
34
- *Why it matters: gates here become the literal pass/fail criteria in Session 10's deployment pipeline. Skip when: never — always define at least a minimal merge gate.*
35
- - Merge gates: the vault's quality gates fix them when bound — does this product deviate, and why? Otherwise: code review, linting, unit tests, coverage threshold?
36
- - Release gates: the vault's release rules fix them when bound — does this product deviate? Otherwise: what must pass before a release is promoted?
37
- - How will automated testing be integrated into the CI/CD pipeline?
38
-
39
- 5. **UAT approach**
40
- *Why it matters: UAT sign-off criteria are what Session 13's go/no-go assessment checks against. Skip when: internal tool with no formal business acceptance step.*
41
- - Who will perform UAT (business users, product owner, dedicated UAT team)?
42
- - How will UAT scenarios be defined and managed?
43
- - What constitutes UAT sign-off (criteria, approvers)?
44
- - How will UAT defects be triaged and prioritized?
22
+ 1. **Test approach and standards**
23
+ *Why it matters: the levels, coverage bar and gates are what every change is checked against for the life of the product. Skip when: never — but with a vault bound this is a quick confirmation, not a discussion.*
24
+ - Walk the test levels — unit, integration, end-to-end, performance, security, accessibility — and for each say who writes the tests (agents), what runs them (the pipeline, on every change, or before a release) and what a person decides. Record it in **Test Approach**.
25
+ - Coverage bar and tooling: the vault's coding standards and quality gates fix them when bound — does this product deviate, and why? Otherwise: which coverage target, which frameworks? Settle it in one pass; tool choice is not this session's job.
26
+ - Does the client's test manager have an existing test policy or test strategy this product must follow? Note it in the Standards Applied row, cited as an input-package document `[NN]` when it is one.
27
+
28
+ 2. **Testability review of the acceptance criteria**
29
+ *Why it matters: the build's verifier reads each story's acceptance criteria verbatim as the test (`references/discovery-build-consumption.md`). Criteria it cannot check — "works correctly", "is user-friendly", "as in the old system" — pass whatever is built. Skip when: never.*
30
+ - Walk `_stories.md` § Stories with the test manager, story by story. For each: does it name an outcome someone can observe? With which data? As which role (a role of `_roles.md`)? Where does it end — what is on screen, in the data, sent to another system?
31
+ - A weak criterion is rewritten now, in `_stories.md`, with `→ amended by D-09-<n>` in the cell; the row in `_tests.md` § Acceptance reads `amended (D-09-<n>)`. One the room cannot settle gets an action `A-09-<n>` with an owner and reads `open (A-09-<n>)` — the handoff refuses it, so it has to be closed before the build starts.
32
+ - Fill one `## Acceptance` row per story: `Testable`, `Role`, `Test data`.
33
+
34
+ 3. **Risk-based selection of end-to-end processes**
35
+ *Why it matters: an end-to-end test proves that the steps of a process work together, across roles, screens, rules and interfaces — and it is the most expensive test to build and keep running. Spend it where a failure hurts most. Skip when: never; with one main process, assess the one.*
36
+ - For each main process of `_processes.md` § To-be, rate with the test manager:
37
+ - **Impact** — what breaks for the business if this process fails in production: money, legal or regulatory exposure, customers affected, data that cannot be repaired? Start from the `Criticality` of the as-is processes it replaces and the classification of the entities its steps touch.
38
+ - **Likelihood** — how likely is it to break: new rather than replaced, many steps, several interfaces or business rules in its step matrix, new technology, a migration feeding it, untested exception paths?
39
+ - The risk follows from the two by the matrix in `references/discovery-tests.md`. A `high` risk process gets an end-to-end test; not testing one end to end is a Key Decision `D-09-<n>` cited in the row's `Rationale`. A `medium` or `low` process may still get one when the room sees a reason.
40
+ - For every `yes`: as which roles does the test walk the process, and with what test data? Fill one `## Process risk` row per main process.
41
+
42
+ 4. **Complex components that need extra test attention**
43
+ *Why it matters: step tests written from acceptance criteria check the expected path. They miss the failures that live in branching rules, timing, concurrency, volume, money and other parties' systems — so those parts need tests designed for how they fail. Skip when: the architect and the test manager agree nothing is complex; write `None identified in Discovery.` under **Focus Areas**.*
44
+ - Ask the architect: which components of Session 5's **Component Inventory** are hardest — the most logic, state, concurrency or performance pressure?
45
+ - Walk the candidates the earlier sessions already flagged: business rules in `_rules.md` with many branches or thresholds; interfaces in `_integrations.md` that are asynchronous, at-least-once or owned by a party that changes them (Session 8's consistency model); `_migration.md` rows with large volumes or messy mappings; entities Session 6 classified `Restricted`.
46
+ - For each subject the room picks: what makes it complex, and what testing goes beyond the step tests — a test per row of a decision table, boundary values, property-based tests, contract tests against the provider, duplicate and out-of-order delivery, a migration rehearsal with reconciliation counts, a load test with a target number, a security test against a named threat? Fill one `## Focus areas` row per subject, with the requirements it realises.
47
+
48
+ 5. **Tests that follow from earlier sessions**
49
+ *Why it matters: the earlier sessions already decided much of what must be tested; the build derives those tests from the registers, so this session only confirms nothing is missing. Skip when: never — it takes minutes.*
50
+ - Present, do not re-ask: every role and screen in `_roles.md` gets a forbidden-path test (a role reaching what it may not); every `## Errors` row of `_integrations.md` a failure test; every Session 6 compliance requirement (`CR-`) and audit-logging row a security or audit test; Session 4's accessibility level an automated accessibility check; every `N-` requirement with a number (response time, volume, availability) a performance or availability test with that number.
51
+ - Ask the test manager: is a risk missing that none of these covers? Record it as a Focus areas row or a Key Decision.
52
+
53
+ 6. **Test environments and test data**
54
+ *Why it matters: environment count and refresh cadence feed Session 10's infrastructure sizing; test data decides whether the end-to-end tests and UAT can run at all. Skip when: a single shared environment is acceptable for this scale of project — still answer the test-data question.*
55
+ - Which environments: when a vault is bound, start from the environments its naming standard defines and record only deviations; otherwise choose (dev, test, acceptance, production).
56
+ - Where does test data come from — synthetic data, seed scripts, anonymised production data? Session 6's classification decides what may leave production: `Confidential` and `Restricted` data is never copied unmasked.
57
+ - Who refreshes the data, and how often?
58
+
59
+ 7. **UAT and sign-off**
60
+ *Why it matters: UAT sign-off is what Session 13's go/no-go and every release checks against. Skip when: an internal tool with no formal business acceptance step — record who accepts instead.*
61
+ - What does UAT consist of here: the end-to-end processes of topic 3, walked by business users, plus the stories accepted on their criteria? Which processes does the business walk by hand?
62
+ - Who performs UAT, who signs off, and on what criteria (for example: every high-risk process passed, no open severity-1 or severity-2 defects)?
63
+ - How are defects found in UAT classified and triaged, and who decides a release may go with known defects?
45
64
 
46
65
  **Notes Template:**
47
66
 
@@ -49,6 +68,7 @@
49
68
 
50
69
  | Area | Standard | Deviation | Decision |
51
70
  |------|----------|-----------|----------|
71
+ | Test policy | | | |
52
72
  | Test levels and coverage | | | |
53
73
  | Test tooling | | | |
54
74
  | Environments | | | |
@@ -56,58 +76,64 @@
56
76
  | Release gates | | | |
57
77
  | UAT and sign-off | | | |
58
78
 
59
- **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-09-<n>` that records the deviation or the decision taken for an uncovered area (`references/discovery-standards.md`).
79
+ **Standard** is the governing document's `[vault: <rel path>]` citation, the client's own test policy as an input-package citation `[NN]`, or `not in vault`. **Deviation** is `none` or the `DEV-<nn>` of the `_deviations.md` row. **Decision** is `—` or the `D-09-<n>` that records the deviation or the decision taken for an uncovered area (`references/discovery-standards.md`).
80
+
81
+ **Test Approach**
82
+
83
+ | Test level | What it proves | Written by | Runs | Person decides | Standard or target |
84
+ |-----------|----------------|------------|------|----------------|--------------------|
85
+ | Unit | | | | | |
86
+ | Integration | | | | | |
87
+ | End-to-end | | | | | |
88
+ | Performance | | | | | |
89
+ | Security | | | | | |
90
+ | Accessibility | | | | | |
91
+ | User acceptance | | | | | |
60
92
 
61
- **Test Strategy Matrix**
93
+ **Written by** is `Agents` for every automated level and `People` for user acceptance; **Runs** is `Every change`, `Before release` or a schedule; **Person decides** is what a human owns at that level (the coverage bar, the processes chosen, the sign-off). End-to-end proves the processes chosen in `_tests.md` § Process risk.
62
94
 
63
- | Test Level | Scope | Coverage Target | Automation Level | Tools | Responsible | When Executed |
64
- |-----------|-------|-----------------|-----------------|-------|-------------|---------------|
65
- | Unit | | | | | | |
66
- | Integration | | | | | | |
67
- | System / E2E | | | | | | |
68
- | Performance | | | | | | |
69
- | Security | | | | | | |
70
- | Accessibility | | | | | | |
95
+ **Acceptance Review**
71
96
 
72
- **Testing Toolchain**
97
+ The rows live in `.planning/discovery/_tests.md` § Acceptance. Record here only the totals and what the room learned: stories reviewed, how many were `yes`, `amended` and `open`, and the patterns behind the weak criteria (to feed back into Session 3's way of writing them).
73
98
 
74
- | Purpose | Tool | Version | License | Notes |
75
- |---------|------|---------|---------|-------|
76
- | Unit testing | | | | |
77
- | E2E testing | | | | |
78
- | Performance testing | | | | |
79
- | Security scanning | | | | |
80
- | Code quality | | | | |
99
+ **Process Risk**
100
+
101
+ The rows live in `.planning/discovery/_tests.md` § Process risk. Record here the main processes chosen for an end-to-end test, one line each with the reason, and any high-risk process deliberately left without one with its `D-09-<n>`.
102
+
103
+ **Focus Areas**
104
+
105
+ The rows live in `.planning/discovery/_tests.md` § Focus areas. Record here the subjects chosen, one line each, or `None identified in Discovery.`
81
106
 
82
107
  **Test Environment Plan**
83
108
 
84
109
  > **Environments:** when the bound vault names the environments (its naming standard, cited `[vault: <path>]` in this session's record), the rows below carry those names, in the vault's promotion order, and no others — an extra or renamed environment is a Key Decisions row `D-09-<n>`. The preset rows stand only when no vault is bound.
85
110
 
86
- | Environment | Purpose | Data Strategy | Refresh Cadence | Access | Infrastructure | Owner |
87
- |-------------|---------|---------------|-----------------|--------|---------------|-------|
88
- | Dev | | | | | | |
89
- | Test | | | | | | |
90
- | Staging | | | | | | |
91
- | Pre-prod | | | | | | |
111
+ | Environment | Purpose | Test data | Refresh cadence | Access | Owner |
112
+ |-------------|---------|-----------|-----------------|--------|-------|
113
+ | Dev | | | | | |
114
+ | Test | | | | | |
115
+ | Acceptance | | | | | |
92
116
 
93
117
  **Quality Gates**
94
118
 
95
- | Gate | Stage | Criteria | Threshold | Blocking? | Tool |
96
- |------|-------|----------|-----------|-----------|------|
97
- | Code review | PR merge | | | Yes | |
98
- | Unit test pass | PR merge | | | Yes | |
99
- | Code coverage | PR merge | | | Yes | |
100
- | Integration tests | Deploy to staging | | | Yes | |
119
+ | Gate | Stage | Criteria | Threshold | Blocking? | Standard |
120
+ |------|-------|----------|-----------|-----------|----------|
121
+ | Code review | | | | | |
122
+ | Unit and integration tests | | | | | |
123
+ | Code coverage | | | | | |
124
+ | End-to-end tests | | | | | |
125
+ | UAT sign-off | | | | | |
101
126
 
102
127
  **UAT Process**
103
128
 
104
129
  | Aspect | Decision | Notes |
105
130
  |--------|----------|-------|
106
131
  | UAT participants | | |
107
- | UAT scenario source | | |
132
+ | Processes walked by hand | | |
108
133
  | Sign-off criteria | | |
109
134
  | Sign-off approver(s) | | |
110
- | Defect triage process | | |
135
+ | Defect severity and triage | | |
136
+ | Release with known defects — who decides | | |
111
137
 
112
138
  **Key Decisions**
113
139
 
@@ -120,3 +146,7 @@
120
146
  | ID | Action | Owner | Due Date | Status |
121
147
  |---|--------|-------|----------|--------|
122
148
  | | | | | |
149
+
150
+ ---
151
+
152
+ **Closing Step.** Run `pp_run query discovery.tests-check` — exit 0, or fix the rows it names in `_tests.md`. Faults that mean a topic is unfinished: `process_not_assessed` (topic 3 skipped a main process), `story_not_reviewed` (topic 2 skipped a story), `high_risk_not_end_to_end` (a high-risk process without an end-to-end test and without a decision), `risk_mismatch` (the rating does not follow the matrix). `open` stories and focus areas without requirements are allowed here; the handoff refuses them (`--require-complete`), so each needs its action closed before Session 13.
@@ -162,6 +162,7 @@ For each group: read all session files — their Notes Template sections and the
162
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
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.`)
164
164
  - [ ] **Requirements traceability:** Every S3 requirement addressable in S5 architecture
165
+ - [ ] **Process coverage:** the S3 **Process Coverage** table names a process or a decision for every persona, entity, external system and scheduled job; `discovery process-check` and `discovery stories-check` exit 0 (every step in one sub-process and in its swimlane, every persona step covered by a story)
165
166
  - [ ] **Requirements roll-up:** `discovery rollup --check` exits 0 (totals block matches table)
166
167
  - [ ] **Pre-fill/confidential gate:** `discovery input-check` exits 0 (no unconfirmed markers, no tracked confidential files)
167
168
  - [ ] **Research-track gate:** `discovery research-check` exits 0 (no structural faults, no stale ⚠️ markers)
@@ -170,7 +171,7 @@ For each group: read all session files — their Notes Template sections and the
170
171
  - [ ] **Stakeholder names:** Consistent across all sessions
171
172
  - [ ] **KPIs and metrics:** Consistent definitions between S1, S3, S11
172
173
  - [ ] **Security constraints:** S6 constraints reflected in S5 and S10
173
- - [ ] **Test strategy:** S9 covers all S3 requirements and S5 components
174
+ - [ ] **Test strategy:** `discovery tests-check` exits 0 (every S3 main process risk-rated, every story reviewed for testability, every high-risk process tested end to end or decided otherwise); the S9 focus areas cover the S5 components the architect called complex
174
175
  - [ ] **Timeline and capacity:** S11 roadmap feasible given S12 team and S9 test needs
175
176
  - [ ] **Action items:** No duplicates or contradictions in `_progress.md`
176
177
  - [ ] **Back-amends:** every decision that changes an earlier record has `→ amended by D-<ss>-<n>` at the original line (Flow 2 Step 6)
@@ -222,7 +222,7 @@ 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 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:
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`, `_tests.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
  |----------------|----------------|
@@ -233,7 +233,7 @@ When facilitating sessions, reference prior session outputs from the earlier ses
233
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
- | Session 9 | Session 3: requirements. Session 5: architecture |
236
+ | Session 9 | Session 2: as-is criticality. Session 3: processes, stories, rules. Session 4: accessibility. Session 5: components. Session 6: classification, compliance. Session 7: roles. Session 8: interfaces, migration |
237
237
  | Session 10 | Session 1: platform decision. Session 5: architecture. Session 9: test environments |
238
238
  | Session 11 | Session 1: risks. Session 3: EPICs, scope. Session 5: architecture. Session 9: QA |
239
239
  | Session 12 | Session 1: team shape, approval routes. Session 11: roadmap, iteration model, timeline |
@@ -5,7 +5,7 @@
5
5
  > of them ends the handoff. They are the only hard blocks in the workflow — every other check in
6
6
  > Step 2 is a confirmation prompt. Four gates: the screen-inventory contract, the element sweep,
7
7
  > the artifact gates (data model, processes, rules, stories, phase plan, roles, integrations,
8
- > migration, deviations) and the signed charter.
8
+ > migration, deviations, tests) and the signed charter.
9
9
 
10
10
  **Screen-inventory contract gate (D-53)**
11
11
 
@@ -66,13 +66,13 @@ The check ran in the first fence above.
66
66
 
67
67
  **If `SWEEP_STATUS` is 0:** Continue with the artifact gates below.
68
68
 
69
- **Artifact gates (data model, processes, rules, stories, phase plan, roles, integrations, migration, deviations)**
69
+ **Artifact gates (data model, processes, rules, stories, phase plan, roles, integrations, migration, deviations, tests)**
70
70
 
71
71
  The build's planner reads `_entities.md`, `_processes.md`, `_rules.md`, `_stories.md`, `_roles.md`,
72
- `_integrations.md` and `_migration.md` by requirement ID, Step 5f copies `_phases.md` into ROADMAP.md
72
+ `_integrations.md`, `_migration.md` and `_tests.md` by requirement ID, Step 5f copies `_phases.md` into ROADMAP.md
73
73
  verbatim, and `pp-vault-review` reads `_deviations.md` for the deviations on file. A pending `—` cell,
74
74
  an uncited step, interface or migration row, an MVP requirement with no story or no phase, or a
75
- hard-to-reverse deviation nobody has approved at this point is a fact the build would have to invent,
75
+ hard-to-reverse deviation nobody has approved, or a story whose acceptance criteria nobody can test at this point is a fact the build would have to invent,
76
76
  so the same checks that only report at Sessions 8, 11 and 13 hard-block here with their strict flags.
77
77
 
78
78
  ```bash
@@ -103,20 +103,27 @@ echo "MIGRATION_STATUS=$MIGRATION_STATUS"
103
103
  pp_run query discovery.deviations-check --require-approved
104
104
  DEVIATIONS_STATUS=$?
105
105
  echo "DEVIATIONS_STATUS=$DEVIATIONS_STATUS"
106
+ pp_run query discovery.tests-check --require-complete
107
+ TESTS_STATUS=$?
108
+ echo "TESTS_STATUS=$TESTS_STATUS"
106
109
  pp_run query discovery.session-check --all
107
110
  SESSION_STATUS=$?
108
111
  echo "SESSION_STATUS=$SESSION_STATUS"
109
112
  ```
110
113
 
111
- **If all ten are 0:** Continue with the charter gate below. An artifact that does not exist exits
114
+ **If all eleven are 0:** Continue with the charter gate below. An artifact that does not exist exits
112
115
  0 by itself (an engagement that predates it), so every pre-existing engagement is unaffected.
113
116
 
114
117
  **If any is non-zero:** Stop with no option to proceed. Report the fault list the check printed,
115
118
  verbatim — `incomplete_cell` and `attributes_missing` mean Session 5 or 6 did not finish the data
116
- model; `uncited_step` means Step 5D did not back-fill a step; `mvp_requirement_without_story` means
117
- Step 5E skipped a requirement; `mvp_requirement_unplanned` means Session 11's Closing Step left a
119
+ model; `uncited_step` means Step 5D did not back-fill a step; `step_without_subprocess` and
120
+ `step_not_in_flow` mean Step 5C left a step out of its sub-processes or its swimlane;
121
+ `mvp_requirement_without_story`, `step_without_story` and `no_source_step` mean Step 5E skipped a
122
+ requirement or a persona step, or left a story tied to no step; `mvp_requirement_unplanned` means Session 11's Closing Step left a
118
123
  requirement out of the Phase Plan; `uncited_interface`, `step_integration_unlinked` and
119
124
  `uncited_migration` mean Session 8 did not finish `_integrations.md` or `_migration.md`;
125
+ `story_not_testable` and `uncited_focus` mean Session 9 left a story's acceptance criteria open or a
126
+ focus area without requirements — close the `A-09-<n>` action and amend the row;
120
127
  `hard_deviation_unapproved` means a hard-to-reverse deviation still waits for its architect — get the
121
128
  signature and set the row `Approved` with its decision, or set it `Rejected` and rework;
122
129
  `empty_section` and `missing_section` mean a session closed without its Notes Template output — fill
@@ -124,8 +131,8 @@ the named section in that session file, or write `None identified in Discovery.`
124
131
  (`references/discovery-session-output.md`); anything else
125
132
  is a malformed artifact (vocabularies in `references/discovery-data-model.md`,
126
133
  `references/discovery-processes.md`, `references/discovery-build-consumption.md`,
127
- `references/discovery-access.md`, `references/discovery-integrations.md` and
128
- `references/discovery-standards.md`). Fix the artifact, re-run its check, then re-run
134
+ `references/discovery-access.md`, `references/discovery-integrations.md`,
135
+ `references/discovery-standards.md` and `references/discovery-tests.md`). Fix the artifact, re-run its check, then re-run
129
136
  `/pp-discovery-to-build`. Neither `--skip-validation` nor `--unsigned` covers these gates.
130
137
 
131
138
  **If `SWEEP_STATUS` is non-zero:** Stop with no option to proceed. Report the fault list the check
@@ -53,5 +53,5 @@ This project has a completed Discovery Sprint in `.planning/discovery/`. pp-core
53
53
  - Deviations from the client's standards → `.planning/discovery/_deviations.md`
54
54
  - UI/UX → Session 4 (`.planning/discovery/session-04.md`) + `.planning/discovery/prototype/`
55
55
  - Security → Session 6 (`.planning/discovery/session-06.md`)
56
- - Testing → Session 9 (`.planning/discovery/session-09.md`)
56
+ - Testing → `.planning/discovery/_tests.md` (end-to-end processes by risk, focus areas, testability of every story); levels, environments, gates and UAT sign-off: Session 9 (`.planning/discovery/session-09.md`)
57
57
  ```
@@ -151,7 +151,15 @@ row for row — never summarise them. Without a screen inventory or prototype, w
151
151
  | {system} | {in/out/bi} | {REST/webhook} | {data} | {when} |
152
152
 
153
153
  ## Quality & Testing Strategy
154
- {From Session 9: framework, coverage target, test types, UAT, quality gates}
154
+ {From `.planning/discovery/_tests.md` when it exists: the main processes tested end to end (the `yes` rows of § Process risk, with their risk) and the § Focus areas subjects with their extra testing; from Session 9: Test Approach, Quality Gates, UAT Process (participants, sign-off criteria, approvers)}
155
+
156
+ | Process | Risk | Roles | Test data |
157
+ |---------|------|-------|-----------|
158
+ | {MP-nn — name} | {high/medium/low} | {roles} | {data} |
159
+
160
+ | Focus area | Extra testing |
161
+ |------------|---------------|
162
+ | {subject} | {what beyond the step tests} |
155
163
 
156
164
  ## Infrastructure & Deployment
157
165
  {From Session 10: environments, deployment approach, monitoring, backup/DR}
@@ -226,8 +226,8 @@ Read these files (skip any that don't exist):
226
226
  7. `.planning/discovery/_stories.md`, `.planning/discovery/_phases.md`,
227
227
  `.planning/discovery/_entities.md`, `.planning/discovery/_processes.md`,
228
228
  `.planning/discovery/_rules.md`, `.planning/discovery/_roles.md`,
229
- `.planning/discovery/_integrations.md`, `.planning/discovery/_migration.md` and
230
- `.planning/discovery/_deviations.md` — the registers Steps 5e and 5f copy from
229
+ `.planning/discovery/_integrations.md`, `.planning/discovery/_migration.md`,
230
+ `.planning/discovery/_deviations.md` and `.planning/discovery/_tests.md` — the registers Steps 5e and 5f copy from
231
231
  (`references/discovery-build-consumption.md`)
232
232
 
233
233
  **Spawn an Explore agent to read all session files in parallel** and extract every
@@ -64,13 +64,13 @@ role, a flow step, a screen, an acceptance criterion, a phase's requirement set)
64
64
 
65
65
  1. **Amend the register row in place.** Edit the cell in the artifact (`_entities.md`,
66
66
  `_rules.md`, `_processes.md`, `_screens.md`, `_stories.md`, `_requirements.md`, `_phases.md`,
67
- `_roles.md`, `_integrations.md`, `_migration.md`, `_deviations.md`)
67
+ `_roles.md`, `_integrations.md`, `_migration.md`, `_deviations.md`, `_tests.md`)
68
68
  and append `→ amended by D-P${PADDED_PHASE}-<n>` to it, `<n>` being the decision's sequence in
69
69
  this CONTEXT.md. Never add a second row for the new fact, never strike the old cell: one row,
70
70
  amended.
71
71
  2. **Re-run the artifact's check** — `pp_run query discovery.entity-check`, `process-check`,
72
72
  `rules-check`, `screen-check`, `stories-check`, `phases-check`, `roles-check`,
73
- `integrations-check`, `migration-check`, `deviations-check`, or `rollup --check` for
73
+ `integrations-check`, `migration-check`, `deviations-check`, `tests-check`, or `rollup --check` for
74
74
  `_requirements.md` — exit 0 before continuing. A build decision that departs from a vault
75
75
  standard is a new `DEV-` row of `_deviations.md` with `Decision` = `D-P${PADDED_PHASE}-<n>`.
76
76
  3. **Bump the charter.** In `docs/discovery/PROJECT-CHARTER.md` raise `version` and add a § 20
@@ -507,13 +507,16 @@ function main() {
507
507
  // makes a chunk's `node --test` child hang ~150s on Windows AFTER its last test
508
508
  // prints; two such stalls push the windows full lane past its 20m cap and the
509
509
  // job is CANCELLED with no failed step — a false-negative gate (#1051, recurrence
510
- // of #869). --test-force-exit (Node >=22; engines requires >=22.0.0) exits the
511
- // runner once all tests finish regardless of lingering handles. The leaking
512
- // tests are also fixed at the source; this is the defensive backstop.
513
- // RUN_TESTS_NO_FORCE_EXIT=1 disables it (used by the harness regression test to
514
- // observe the pre-fix hang).
510
+ // of #869). --test-force-exit (Node >=22) exits the runner once all tests
511
+ // finish regardless of lingering handles — but it exits before the reporter has
512
+ // written everything, so it DROPS reported tests: a 180-file chunk reported
513
+ // 4,688 / 4,726 / 4,705 tests with it and 4,759 every time without it (Linux,
514
+ // 1.5 CPUs, 2026-11-10), and on GitHub runners it cut whole chunk summaries
515
+ // (PR #31/#32). The leaking tests were fixed at the source and no CI lane runs
516
+ // Windows any more, so it is now OPT-IN: RUN_TESTS_FORCE_EXIT=1. The per-chunk
517
+ // timeout below still bounds a genuine hang, loudly.
515
518
  const nodeMajor = Number(process.versions.node.split('.')[0]);
516
- const forceExit = nodeMajor >= 22 && !process.env.RUN_TESTS_NO_FORCE_EXIT;
519
+ const forceExit = nodeMajor >= 22 && process.env.RUN_TESTS_FORCE_EXIT === '1';
517
520
 
518
521
  const FIXED_OVERHEAD = process.execPath.length + '--test'.length + concurrency.length + (forceExit ? '--test-force-exit'.length + 1 : 0) + 8;
519
522
  const chunks = [];