bmad-method-test-architecture-enterprise 1.27.2-next.2 → 1.27.2-next.3

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.
@@ -31,7 +31,7 @@
31
31
  "name": "bmad-method-test-architecture-enterprise",
32
32
  "source": "./",
33
33
  "description": "Master Test Architect module for quality strategy, test automation, CI/CD quality gates, and structured testing education. Part of the BMad Method ecosystem.",
34
- "version": "1.27.2-next.2",
34
+ "version": "1.27.2-next.3",
35
35
  "author": {
36
36
  "name": "Murat K Ozcan (TEA Creator) & Brian (BMad) Madison"
37
37
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "bmad-method-test-architecture-enterprise",
4
- "version": "1.27.2-next.2",
4
+ "version": "1.27.2-next.3",
5
5
  "description": "Master Test Architect for quality strategy, test automation, and release gates",
6
6
  "keywords": [
7
7
  "bmad",
@@ -109,49 +109,11 @@ From `{config_source}`:
109
109
 
110
110
  ---
111
111
 
112
- ### Tiered Knowledge Loading
112
+ ### Deterministic Knowledge Selection
113
113
 
114
- Load fragments based on their `tier` classification in `tea-index.csv`:
114
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions under **Load Knowledge Base Fragments**, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
115
115
 
116
- 1. **Core tier** (always load): Foundational fragments required for this workflow
117
- 2. **Extended tier** (load on-demand): Load when deeper analysis is needed or when the user's context requires it
118
- 3. **Specialized tier** (load only when relevant): Load only when the specific use case matches (e.g., contract-testing only for microservices, email-auth only for email flows)
119
-
120
- > **Context Efficiency**: Loading only core fragments reduces context usage by 40-50% compared to loading all fragments.
121
-
122
- ### Playwright Utils Loading Profiles
123
-
124
- **If `tea_use_playwright_utils` is enabled**, load `playwright-utils-mandate.md` FIRST, before any profile below. It is the binding rule for this run: playwright-utils is the default implementation for every capability it covers, and a vanilla Playwright equivalent is a deviation that must be justified in the output. Red-phase scaffolds are still real test code, so the mandate applies to them exactly as it applies to green tests.
125
-
126
- Then select the appropriate loading profile:
127
-
128
- - **API-only profile** (when `{detected_stack}` is `backend` or no `page.goto`/`page.locator` found in test files):
129
- Load: `playwright-utils-mandate`, `overview`, `api-request`, `auth-session`, `recurse` (~2,100 lines)
130
-
131
- - **Full UI+API profile** (when `{detected_stack}` is `frontend`/`fullstack` or browser tests detected):
132
- Load: `playwright-utils-mandate` plus all Playwright Utils core fragments (~4,800 lines)
133
-
134
- **Detection**: Scan `{test_dir}` for files containing `page.goto` or `page.locator`. If none found, use API-only profile.
135
-
136
- ### Pact.js Utils Loading
137
-
138
- **If `tea_use_pactjs_utils` is enabled** (and `{detected_stack}` is `backend` or `fullstack`, or a microservices layout is detected, `pactjs-utils-mandate.md`'s own definition: two or more independently deployable services in this repo that call each other):
139
-
140
- Load `pactjs-utils-mandate.md` FIRST. It is the binding rule for any Pact artifact this run produces, and it carries the relevance gate: the flag defaults to `true` and means "use these utilities when contract tests are written", never "add contract tests to this project".
141
-
142
- Then load: `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`, `pactjs-utils-zod-to-pact.md`, `pact-consumer-di.md`, `pact-consumer-framework-setup.md`, `pact-broker-webhooks.md`
143
-
144
- **If `tea_use_pactjs_utils` is disabled** but contract testing is relevant:
145
-
146
- Load: `contract-testing.md`
147
-
148
- ### Pact MCP Loading
149
-
150
- **If `tea_pact_mcp` is `"mcp"`:**
151
-
152
- Load: `pact-mcp.md`
153
-
154
- **`tea_pact_mcp` defaults to `"mcp"`, and Pact artifacts are gated on relevance, not on this flag.** Follow `pact-mcp.md` § _When the Tools Are Not Reachable_: the probe is a tool-list check and never a broker call, its result is recorded once per run as `pact_mcp_reachable`, and the fallback order is provider source, then an OpenAPI spec, then `confidence-gate.md`. Report the outcome once and continue; never block, never retry, never present inferred provider states as broker data.
116
+ Contract testing is relevant only when repository facts show existing Pact artifacts, dependencies, configuration, or broker variables, or when the task explicitly requests contract testing. A service count or target-state architecture alone does not open a contract branch.
155
117
 
156
118
  ## 5. Load Knowledge Base Fragments
157
119
 
@@ -169,7 +131,7 @@ Use `{knowledgeIndex}` to load:
169
131
  - `selector-resilience.md`
170
132
  - `timing-debugging.md`
171
133
 
172
- **Playwright Utils (if enabled and {detected_stack} is `frontend` or `fullstack`):**
134
+ **Playwright Utils (if enabled, `@seontechnologies/playwright-utils` is in `package.json`, the test files run on the Playwright runner, and {detected_stack} is `frontend` or `fullstack`):**
173
135
 
174
136
  - `playwright-utils-mandate.md` (load first — it governs how the fragments below are applied)
175
137
  - `overview.md`, `api-request.md`, `network-recorder.md`, `auth-session.md`, `intercept-network-call.md`, `recurse.md`, `log.md`, `file-utils.md`, `network-error-monitor.md`, `fixtures-composition.md`
@@ -183,7 +145,7 @@ Use `{knowledgeIndex}` to load:
183
145
 
184
146
  - (existing MCP-related fragments, if any are added in future)
185
147
 
186
- **Traditional Patterns (if utils disabled and {detected_stack} is `frontend` or `fullstack`):**
148
+ **Traditional Patterns (if the Playwright Utils applicability gate above did not open and {detected_stack} is `frontend` or `fullstack`):**
187
149
 
188
150
  - `fixture-architecture.md`
189
151
  - `network-first.md`
@@ -194,16 +156,16 @@ Use `{knowledgeIndex}` to load:
194
156
  - `test-priorities-matrix.md`
195
157
  - `ci-burn-in.md`
196
158
 
197
- **Pact.js Utils (if enabled and contract testing is relevant):**
159
+ **Pact.js Utils (if enabled, `@seontechnologies/pactjs-utils` is in `package.json`, and contract testing is relevant):**
198
160
 
199
161
  - `pactjs-utils-mandate.md` (load first — it governs how the fragments below are applied)
200
162
  - `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`, `pactjs-utils-zod-to-pact.md`, `pact-consumer-di.md`, `pact-consumer-framework-setup.md`, `pact-broker-webhooks.md`
201
163
 
202
- **Contract Testing (if pactjs-utils disabled but relevant):**
164
+ **Contract Testing (if Pact.js Utils is disabled or not installed, and contract testing is relevant):**
203
165
 
204
166
  - `contract-testing.md`
205
167
 
206
- **Pact MCP (if tea_pact_mcp is "mcp"):**
168
+ **Pact MCP (if tea_pact_mcp is "mcp" and contract testing is relevant):**
207
169
 
208
170
  - `pact-mcp.md`
209
171
 
@@ -113,56 +113,11 @@ If required framework configuration is missing: **HALT** with message "Run `fram
113
113
 
114
114
  ---
115
115
 
116
- ### Tiered Knowledge Loading
116
+ ### Deterministic Knowledge Selection
117
117
 
118
- Load fragments based on their `tier` classification in `tea-index.csv`:
118
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions under **Load Knowledge Base Fragments**, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
119
119
 
120
- 1. **Core tier** (always load): Foundational fragments required for this workflow
121
- 2. **Extended tier** (load on-demand): Load when deeper analysis is needed or when the user's context requires it
122
- 3. **Specialized tier** (load only when relevant): Load only when the specific use case matches (e.g., contract-testing only for microservices, email-auth only for email flows)
123
-
124
- > **Context Efficiency**: Loading only core fragments reduces context usage by 40-50% compared to loading all fragments.
125
-
126
- ### Playwright Utils Loading Profiles
127
-
128
- **If `tea_use_playwright_utils` is enabled**, load `playwright-utils-mandate.md` FIRST, before any profile below. It is the binding rule for this run: playwright-utils is the default implementation for every capability it covers, and a vanilla Playwright equivalent is a deviation that must be justified in the output. Every worker step dispatched from this workflow inherits that rule.
129
-
130
- Then select the appropriate loading profile:
131
-
132
- - **API-only profile** (when `{detected_stack}` is `backend` or no `page.goto`/`page.locator` found in test files):
133
- Load: `playwright-utils-mandate`, `overview`, `api-request`, `auth-session`, `recurse` (~2,100 lines)
134
-
135
- - **Full UI+API profile** (when `{detected_stack}` is `frontend`/`fullstack` or browser tests detected):
136
- Load: `playwright-utils-mandate` plus all Playwright Utils core fragments (~4,800 lines)
137
-
138
- - **Mobile profile** (when `{detected_stack}` is `mobile`):
139
- Load: `mobile-test-strategy`, `maestro-flows`, `mobile-ci-device-lab`, `test-levels-framework`, `test-priorities-matrix`, `test-quality`, plus `playwright-utils-mandate`, `overview`, `api-request`, `auth-session`, `recurse` for the app's HTTP boundary.
140
- Do NOT load the browser fragments (`network-first`, `playwright-config`, `intercept-network-call`, `selector-resilience`): a device flow has no DOM and no request interceptor, and loading them invites browser patterns into a Maestro flow.
141
- The mandate is loaded here for the HTTP-boundary tests only. It has no bearing on a Maestro flow, and its own scope section says so.
142
-
143
- **Detection**: Scan `{test_dir}` for files containing `page.goto` or `page.locator`. If none found, use API-only profile. A `maestro/` or `.maestro/` directory selects the mobile profile regardless of what `{test_dir}` holds.
144
-
145
- ### Pact.js Utils Loading
146
-
147
- **If `tea_use_pactjs_utils` is enabled** (and `{detected_stack}` is `backend` or `fullstack`, or a microservices layout is detected, `pactjs-utils-mandate.md`'s own definition: two or more independently deployable services in this repo that call each other):
148
-
149
- Load `pactjs-utils-mandate.md` FIRST. It is the binding rule for any Pact artifact this run produces, and it carries the relevance gate: the flag defaults to `true` and means "use these utilities when contract tests are written", never "add contract tests to this project".
150
-
151
- Then load: `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`, `pactjs-utils-zod-to-pact.md` (~1,100 lines)
152
-
153
- **If `tea_use_pactjs_utils` is disabled** but contract testing is relevant (a microservices layout detected per the definition above, or existing Pact config found):
154
-
155
- Load: `contract-testing.md` (~960 lines)
156
-
157
- **Detection**: Scan `{project-root}` for Pact indicators: `pact/` directory, `@pact-foundation/pact` in `package.json`, `pactUrls` in test files, `PACT_BROKER` in env files.
158
-
159
- ### Pact MCP Loading
160
-
161
- **If `tea_pact_mcp` is `"mcp"`:**
162
-
163
- Load: `pact-mcp.md` (~150 lines) — enables agent to use SmartBear MCP tools for fetching provider states and generating pact tests during automation.
164
-
165
- **`tea_pact_mcp` defaults to `"mcp"`, and Pact artifacts are gated on relevance, not on this flag.** Follow `pact-mcp.md` § _When the Tools Are Not Reachable_: the probe is a tool-list check and never a broker call, its result is recorded once per run as `pact_mcp_reachable`, and the fallback order is provider source, then an OpenAPI spec, then `confidence-gate.md`. Report the outcome once and continue; never block, never retry, never present inferred provider states as broker data.
120
+ Contract testing is relevant only when repository facts show existing Pact artifacts, dependencies, configuration, or broker variables, or when the task explicitly requests contract testing. A service count or target-state architecture alone does not open a contract branch.
166
121
 
167
122
  ## 4. Load Knowledge Base Fragments
168
123
 
@@ -177,27 +132,33 @@ Use `{knowledgeIndex}` and load only what is required.
177
132
  - `ci-burn-in.md`
178
133
  - `test-quality.md`
179
134
 
180
- **Playwright Utils (if enabled):**
135
+ **Mobile (if `{detected_stack}` is `mobile`):**
136
+
137
+ - `mobile-test-strategy.md`
138
+ - `maestro-flows.md`
139
+ - `mobile-ci-device-lab.md`
140
+
141
+ **Playwright Utils (if enabled, `@seontechnologies/playwright-utils` is in `package.json`, and the test files run on the Playwright runner):**
181
142
 
182
143
  - `playwright-utils-mandate.md` (load first — it governs how the fragments below are applied)
183
144
  - `overview.md`, `api-request.md`, `network-recorder.md`, `auth-session.md`, `intercept-network-call.md`, `recurse.md`, `log.md`, `file-utils.md`, `burn-in.md`, `network-error-monitor.md`, `fixtures-composition.md`
184
145
  - `fixture-architecture.md` and `network-first.md` for their principles only. Under the mandate the mechanism comes from the playwright-utils fragments: interception is `interceptNetworkCall` declared before `page.goto`, and composition is `mergeTests`.
185
146
 
186
- **Traditional Patterns (if Playwright Utils disabled):**
147
+ **Traditional Patterns (if the Playwright Utils applicability gate above did not open and the test files run on the Playwright runner):**
187
148
 
188
149
  - `fixture-architecture.md`
189
150
  - `network-first.md`
190
151
 
191
- **Pact.js Utils (if enabled and contract testing is relevant):**
152
+ **Pact.js Utils (if enabled, `@seontechnologies/pactjs-utils` is in `package.json`, and contract testing is relevant):**
192
153
 
193
154
  - `pactjs-utils-mandate.md` (load first — it governs how the fragments below are applied)
194
155
  - `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`, `pactjs-utils-zod-to-pact.md`
195
156
 
196
- **Contract Testing (if pactjs-utils disabled but relevant):**
157
+ **Contract Testing (if Pact.js Utils is disabled or not installed, and contract testing is relevant):**
197
158
 
198
159
  - `contract-testing.md`
199
160
 
200
- **Pact MCP (if tea_pact_mcp is "mcp"):**
161
+ **Pact MCP (if tea_pact_mcp is "mcp" and contract testing is relevant):**
201
162
 
202
163
  - `pact-mcp.md`
203
164
 
@@ -207,7 +168,7 @@ Use `{knowledgeIndex}` and load only what is required.
207
168
  - `selector-resilience.md`
208
169
  - `timing-debugging.md`
209
170
 
210
- **Playwright CLI (if tea_browser_automation is "cli" or "auto"):**
171
+ **Playwright CLI (if tea_browser_automation is "cli" or "auto" and the test files run on the Playwright runner):**
211
172
 
212
173
  - `playwright-cli.md`
213
174
 
@@ -164,7 +164,7 @@ Include stages:
164
164
 
165
165
  - lint
166
166
  - test (parallel shards)
167
- - contract-test (if `tea_use_pactjs_utils` enabled)
167
+ - contract-test (if `tea_use_pactjs_utils` is enabled and Step 1 found contract testing relevant)
168
168
  - burn-in (flaky detection)
169
169
  - report (aggregate + publish)
170
170
 
@@ -197,9 +197,9 @@ Write the selected pipeline configuration to the resolved output path from step
197
197
  - **Artifacts**: upload the per-step statuses, hierarchy dumps, screenshots, video, AND device logs on failure, resolving the newest run directory rather than globbing a flat filename that recent versions no longer write. The hierarchy dump captured at failure is what identifies a selector break; the failure screenshot is taken after teardown and frequently shows the launcher, so do not lead with it.
198
198
  - **Cache**: Gradle or CocoaPods plus the JS toolchain for React Native and Expo.
199
199
 
200
- ### Contract Testing Pipeline (if `tea_use_pactjs_utils` enabled)
200
+ ### Contract Testing Pipeline (if `tea_use_pactjs_utils` is enabled and Step 1 found contract testing relevant)
201
201
 
202
- **If `tea_use_pactjs_utils` is enabled**, use `{knowledgeIndex}` to load:
202
+ **If `tea_use_pactjs_utils` is enabled and Step 1 found contract testing relevant**, use `{knowledgeIndex}` to load:
203
203
 
204
204
  - `pact-consumer-framework-setup.md` — determinism gate, `jq -S` publish normalization, PR-only provider branch detection, additive branch-aware `can-i-deploy`, 1:1 local/CI parity
205
205
  - `pactjs-utils-consumer-helpers.md` — one-interaction-per-`it()` determinism rule
@@ -207,7 +207,7 @@ Write the selected pipeline configuration to the resolved output path from step
207
207
  - `pactjs-utils-request-filter.md` — `createRequestFilter` auth injection patterns for CI pipeline auth setup
208
208
  - `pact-broker-webhooks.md` — PactFlow → GitHub webhook auth, exact registered provider target checkout, rotation runbook, and staleness monitoring
209
209
 
210
- When `tea_use_pactjs_utils` is enabled, add a `contract-test` stage after `test`:
210
+ When `tea_use_pactjs_utils` is enabled and Step 1 found contract testing relevant, add a `contract-test` stage after `test`:
211
211
 
212
212
  **Required env block** (add to the generated pipeline):
213
213
 
@@ -256,7 +256,7 @@ env:
256
256
 
257
257
  Required CI secrets: `PACT_BROKER_BASE_URL`, `PACT_BROKER_TOKEN`
258
258
 
259
- **If `tea_pact_mcp` is `"mcp"`:** Reference the SmartBear MCP `Can I Deploy` and `Matrix` tools for pipeline guidance in `pact-mcp.md`.
259
+ **If `tea_pact_mcp` is `"mcp"` and contract testing is relevant:** Reference the SmartBear MCP `Can I Deploy` and `Matrix` tools for pipeline guidance in `pact-mcp.md`.
260
260
 
261
261
  **`tea_pact_mcp` defaults to `"mcp"`, and Pact artifacts are gated on relevance, not on this flag.** Follow `pact-mcp.md` § _When the Tools Are Not Reachable_: the probe is a tool-list check and never a broker call, its result is recorded once per run as `pact_mcp_reachable`, and the fallback order is provider source, then an OpenAPI spec, then `confidence-gate.md`. Report the outcome once and continue; never block, never retry, never present inferred provider states as broker data.
262
262
 
@@ -290,7 +290,7 @@ For this step, treat these work units as parallelizable when `resolvedMode` is `
290
290
 
291
291
  - Worker A: resolve platform path/template and produce base pipeline skeleton (section 1)
292
292
  - Worker B: construct stage definitions and test execution blocks (sections 2-3)
293
- - Worker C: contract-testing block (only when `tea_use_pactjs_utils` is true)
293
+ - Worker C: contract-testing block (only when `tea_use_pactjs_utils` is true and Step 1 found contract testing relevant)
294
294
 
295
295
  If `resolvedMode` is `sequential`, execute sections 1→4 in order.
296
296
 
@@ -36,6 +36,12 @@ Configure burn-in loops, quality thresholds, and notification hooks.
36
36
 
37
37
  **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
38
38
 
39
+ ### Deterministic Knowledge Selection
40
+
41
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions in the numbered sections below, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
42
+
43
+ Contract testing is relevant only when repository facts show existing Pact artifacts, dependencies, configuration, or broker variables, or when the task explicitly requests contract testing. A service count or target-state architecture alone does not open a contract branch.
44
+
39
45
  ## 1. Burn-In Configuration
40
46
 
41
47
  Use `{knowledgeIndex}` to load `ci-burn-in.md` guidance:
@@ -65,7 +71,7 @@ Skip this for Cypress, Maestro, and non-Playwright backend suites; those keep th
65
71
  - **Backend only** (`test_stack_type` is `backend`): Skip burn-in by default. Backend tests (unit, integration, API) are deterministic and rarely exhibit UI-related flakiness. If the user explicitly requests burn-in for backend, honor that override.
66
72
  - **Mobile** (`test_stack_type` is `mobile`): Enable burn-in by default, and scope it to new and changed Maestro flows only. Device flows are the most flake-prone level in any suite (emulator boot, app install, animation timing, real network), so a new flow that has not survived repeated runs is not evidence. Never burn in the whole flow suite on a PR: run the changed flows N times on the primary target, and leave the full matrix to the nightly job.
67
73
 
68
- **The gate must be able to fail.** Per `evidence-integrity.md`, `continue-on-error` belongs on artifact collection and never on a step that runs tests, and a runner manifest that names a subset of the discovered test files is a silent coverage hole rather than a configuration choice. Reconcile the executed count against the discovered count in the job, so a suite that quietly stopped running most of itself fails instead of passing faster.
74
+ **The gate must be able to fail.** `continue-on-error` belongs on artifact collection and never on a step that runs tests, and a runner manifest that names a subset of the discovered test files is a silent coverage hole rather than a configuration choice. Reconcile the executed count against the discovered count in the job, so a suite that quietly stopped running most of itself fails instead of passing faster.
69
75
 
70
76
  **Security: Script injection prevention for reusable burn-in workflows:**
71
77
 
@@ -100,7 +106,7 @@ Define:
100
106
  - Fail CI on critical test failures
101
107
  - Optional: require traceability or nfr-assess output before release
102
108
 
103
- **Contract testing gate** (if `tea_use_pactjs_utils` is enabled):
109
+ **Contract testing gate** (if `tea_use_pactjs_utils` is enabled and contract testing is relevant):
104
110
 
105
111
  Use `{knowledgeIndex}` to load:
106
112
 
@@ -236,6 +236,12 @@ Create the idiomatic version file for the detected language:
236
236
 
237
237
  Read `{config_source}` and use `{knowledgeIndex}` to load fragments based on `{detected_stack}`:
238
238
 
239
+ ### Deterministic Knowledge Selection
240
+
241
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions in this section, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions elsewhere in this step, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
242
+
243
+ Contract testing is relevant only when repository facts show existing Pact artifacts, dependencies, configuration, or broker variables, or when the task explicitly requests contract testing. A service count or target-state architecture alone does not open a contract branch.
244
+
239
245
  **If `{detected_stack}` is `mobile`:**
240
246
 
241
247
  - `mobile-test-strategy.md` (CRITICAL: load this first — it decides which behaviors become device flows at all, and most should not)
@@ -289,7 +295,7 @@ Read `{config_source}` and use `{knowledgeIndex}` to load fragments based on `{d
289
295
 
290
296
  - `contract-testing.md`
291
297
 
292
- **If Pact MCP enabled** (`config.tea_pact_mcp` is `"mcp"`):
298
+ **If Pact MCP is enabled and the relevance gate in section 1 opened** (`config.tea_pact_mcp` is `"mcp"`):
293
299
 
294
300
  - `pact-mcp.md`
295
301
 
@@ -54,15 +54,9 @@ From `{config_source}`:
54
54
 
55
55
  ---
56
56
 
57
- ### Tiered Knowledge Loading
57
+ ### Deterministic Knowledge Selection
58
58
 
59
- Load fragments based on their `tier` classification in `tea-index.csv`:
60
-
61
- 1. **Core tier** (always load): Foundational fragments required for this workflow
62
- 2. **Extended tier** (load on-demand): Load when deeper analysis is needed or when the user's context requires it
63
- 3. **Specialized tier** (load only when relevant): Load only when the specific use case matches (e.g., contract-testing only for microservices, email-auth only for email flows)
64
-
65
- > **Context Efficiency**: Loading only core fragments reduces context usage by 40-50% compared to loading all fragments.
59
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions under **Load Knowledge Base Fragments**, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
66
60
 
67
61
  ## 3. Load Knowledge Base Fragments
68
62
 
@@ -125,49 +125,11 @@ Store artifacts under `{test_artifacts}/exploration/`
125
125
 
126
126
  ---
127
127
 
128
- ### Tiered Knowledge Loading
128
+ ### Deterministic Knowledge Selection
129
129
 
130
- Load fragments based on their `tier` classification in `tea-index.csv`:
130
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions under **Load Knowledge Base Fragments**, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
131
131
 
132
- 1. **Core tier** (always load): Foundational fragments required for this workflow
133
- 2. **Extended tier** (load on-demand): Load when deeper analysis is needed or when the user's context requires it
134
- 3. **Specialized tier** (load only when relevant): Load only when the specific use case matches (e.g., contract-testing only for microservices, email-auth only for email flows)
135
-
136
- > **Context Efficiency**: Loading only core fragments reduces context usage by 40-50% compared to loading all fragments.
137
-
138
- ### Playwright Utils Loading Profiles
139
-
140
- **If `tea_use_playwright_utils` is enabled**, load `playwright-utils-mandate.md` FIRST, before any profile below. Every code example this workflow puts into a design document is a pattern a developer will copy, so the examples follow the mandate: `apiRequest` rather than the raw `request` fixture, `interceptNetworkCall` rather than `page.route`, `test` imported from the project's merged fixtures with `expect` still from `@playwright/test`.
141
-
142
- Then select the appropriate loading profile:
143
-
144
- - **API-only profile** (when `{detected_stack}` is `backend` or no `page.goto`/`page.locator` found in test files):
145
- Load: `playwright-utils-mandate`, `overview`, `api-request`, `auth-session`, `recurse` (~2,100 lines)
146
-
147
- - **Full UI+API profile** (when `{detected_stack}` is `frontend`/`fullstack` or browser tests detected):
148
- Load: `playwright-utils-mandate` plus all Playwright Utils core fragments (~4,800 lines)
149
-
150
- **Detection**: Scan `{test_dir}` for files containing `page.goto` or `page.locator`. If none found, use API-only profile.
151
-
152
- ### Pact.js Utils Loading
153
-
154
- **If `tea_use_pactjs_utils` is enabled** and contract testing is relevant. Relevance is not a stack question: the consumer side of a contract is most often a `frontend`, and gating on `backend`/`fullstack` alone skips exactly the case Pact exists for. Load when `{detected_stack}` is `backend` or `fullstack`, **or** when Pact artifacts are present on any stack (a `pact/` or `tests/contract/` directory, `.pacttest.ts` files, `@pact-foundation/pact` in `package.json`, `PACT_BROKER_*` in the environment), **or** when a microservices layout is detected, `pactjs-utils-mandate.md`'s own definition: two or more independently deployable services in this repo that call each other. A target-state architecture description naming a service count, with no repo to inspect yet, does not satisfy this on its own:
155
-
156
- Load `pactjs-utils-mandate.md` FIRST. Every Pact code example this workflow puts into a design document is a pattern a developer will copy, so the examples follow the mandate: `createProviderState` rather than a hand-cast `.given()`, `buildVerifierOptions` rather than a literal options object. The mandate also carries the relevance gate: the flag defaults to `true` and never means "add contract tests to this project".
157
-
158
- Then load: `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`, `pactjs-utils-zod-to-pact.md`
159
-
160
- **If `tea_use_pactjs_utils` is disabled** but contract testing is relevant:
161
-
162
- Load: `contract-testing.md`
163
-
164
- ### Pact MCP Loading
165
-
166
- **If `tea_pact_mcp` is `"mcp"`:**
167
-
168
- Load: `pact-mcp.md` — enables agent to use SmartBear MCP "Fetch Provider States" and "Matrix" tools to understand existing contract landscape during test design.
169
-
170
- **`tea_pact_mcp` defaults to `"mcp"`, and Pact artifacts are gated on relevance, not on this flag.** Follow `pact-mcp.md` § _When the Tools Are Not Reachable_: the probe is a tool-list check and never a broker call, its result is recorded once per run as `pact_mcp_reachable`, and the fallback order is provider source, then an OpenAPI spec, then `confidence-gate.md`. Report the outcome once and continue; never block, never retry, never present inferred provider states as broker data.
132
+ Contract testing is relevant only when repository facts show existing Pact artifacts, dependencies, configuration, or broker variables, or when the task explicitly requests contract testing. A service count or target-state architecture alone does not open a contract branch.
171
133
 
172
134
  ## 4. Load Knowledge Base Fragments
173
135
 
@@ -201,15 +163,15 @@ Use `{knowledgeIndex}` to select and load only relevant fragments.
201
163
 
202
164
  - (existing MCP-related fragments, if any are added in future)
203
165
 
204
- **Pact.js Utils (if enabled — both System-Level and Epic-Level):**
166
+ **Pact.js Utils (if enabled, `@seontechnologies/pactjs-utils` is in `package.json`, and contract testing is relevant, in either mode):**
205
167
 
206
- - `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`
168
+ - `pactjs-utils-mandate.md`, `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`
207
169
 
208
- **Contract Testing (if pactjs-utils disabled but relevant):**
170
+ **Contract Testing (if Pact.js Utils is disabled or not installed, and contract testing is relevant):**
209
171
 
210
172
  - `contract-testing.md`
211
173
 
212
- **Pact MCP (if tea_pact_mcp is "mcp"):**
174
+ **Pact MCP (if tea_pact_mcp is "mcp" and contract testing is relevant):**
213
175
 
214
176
  - `pact-mcp.md`
215
177
 
@@ -61,55 +61,9 @@ Read `test_stack_type` from `{config_source}`. If `"auto"` or not configured, in
61
61
 
62
62
  ---
63
63
 
64
- ### Tiered Knowledge Loading
64
+ ### Deterministic Knowledge Selection
65
65
 
66
- Load fragments based on their `tier` classification in `tea-index.csv`:
67
-
68
- 1. **Core tier** (always load): Foundational fragments required for this workflow
69
- 2. **Extended tier** (load on-demand): Load when deeper analysis is needed or when the user's context requires it
70
- 3. **Specialized tier** (load only when relevant): Load only when the specific use case matches (e.g., contract-testing only for microservices, email-auth only for email flows)
71
-
72
- > **Context Efficiency**: Loading only core fragments reduces context usage by 40-50% compared to loading all fragments.
73
-
74
- ### Playwright Utils Loading Profiles
75
-
76
- **If `tea_use_playwright_utils` is enabled**, load `playwright-utils-mandate.md` FIRST, before any profile below. It supplies the firing predicate for registry rows M9 and L9: which vanilla calls have a required substitution, which are legitimate exceptions, and which utilities are recommended rather than required and therefore never deduct.
77
-
78
- Then select the appropriate loading profile:
79
-
80
- - **API-only profile** (when `{detected_stack}` is `backend` or no `page.goto`/`page.locator` found in test files):
81
- Load: `playwright-utils-mandate`, `overview`, `api-request`, `auth-session`, `recurse` (~2,100 lines)
82
-
83
- - **Full UI+API profile** (when `{detected_stack}` is `frontend`/`fullstack` or browser tests detected):
84
- Load: `playwright-utils-mandate` plus all Playwright Utils core fragments (~4,800 lines)
85
-
86
- **Detection**: Scan `{test_dir}` for files containing `page.goto` or `page.locator`. If none found, use API-only profile.
87
-
88
- The profiles above assume a JavaScript/TypeScript suite on the Playwright runner. For a Cypress project, a Maestro flow set, or a backend suite in pytest, JUnit, Go test, xUnit, or RSpec, skip them entirely whatever the flag says: the mandate does not bind those runners, so loading its fragments only spends context and invites rows that cannot fire. Decide by the runner the reviewed files execute under, not by the language of the code they test.
89
-
90
- **Also record whether `@seontechnologies/playwright-utils` is in the project's `package.json`.** Carry it into `subagentContext` as `playwright_utils_installed`. The M9 gate needs both the flag and the package: the flag alone is an intention, and deducting against an uninstalled library produces findings nobody can act on file by file. When the flag is true and the package is missing, say so once in the report and recommend the `framework` workflow.
91
-
92
- ### Pact.js Utils Loading
93
-
94
- **If `tea_use_pactjs_utils` is enabled** (and contract tests detected in review scope):
95
-
96
- Load `pactjs-utils-mandate.md` FIRST. It supplies the firing predicate for registry row M10: which raw-Pact constructs have a required substitution, which are legitimate exceptions, and which utilities are recommended rather than required and therefore never deduct.
97
-
98
- **Also record whether `@seontechnologies/pactjs-utils` is in the project's `package.json`.** Carry it into `subagentContext` as `pactjs_utils_installed`. The M10 gate needs both the flag and the package, for the same reason M9 does.
99
-
100
- Then load: `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md` (one-interaction-per-`it()` determinism rule), `pactjs-utils-provider-verifier.md` (vitest `pool: 'forks'` + `singleFork` — applies to BOTH consumer and provider), `pactjs-utils-request-filter.md`, `pactjs-utils-zod-to-pact.md`, `pact-consumer-framework-setup.md` (consumer Vitest `fileParallelism: false` + `pool: 'forks'` + `singleFork: true`, determinism gate, `jq` publish normalization), `pact-broker-webhooks.md` (webhook auth, PAT rotation, staleness monitoring — relevant if CI failure patterns include `can-i-deploy` timeouts with no verification).
101
-
102
- **If `tea_use_pactjs_utils` is disabled** but contract tests are in review scope:
103
-
104
- Load: `contract-testing.md`
105
-
106
- ### Pact MCP Loading
107
-
108
- **If `tea_pact_mcp` is `"mcp"`:**
109
-
110
- Load: `pact-mcp.md` — enables agent to use SmartBear MCP "Review Pact Tests" tool for automated best-practice feedback during test review.
111
-
112
- **`tea_pact_mcp` defaults to `"mcp"`, and Pact artifacts are gated on relevance, not on this flag.** Follow `pact-mcp.md` § _When the Tools Are Not Reachable_: the probe is a tool-list check and never a broker call, its result is recorded once per run as `pact_mcp_reachable`, and the fallback order is provider source, then an OpenAPI spec, then `confidence-gate.md`. Report the outcome once and continue; never block, never retry, never present inferred provider states as broker data.
66
+ The fragment list for this step is a closed set. Start empty, evaluate the complete conditions under **Load Knowledge Base**, and add every fragment from each matching list. A config flag opens a branch only when every stack, runner, package, and relevance condition on that branch also matches. Do not add fragments from tier labels, index descriptions, nearby mentions, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
113
67
 
114
68
  ## 2. Load Knowledge Base
115
69
 
@@ -134,12 +88,12 @@ Read `{config_source}` and check `tea_use_playwright_utils`, `tea_use_pactjs_uti
134
88
 
135
89
  Without these, a flow is reviewed against browser predicates that cannot match it, which is how a flow used to score 100 by matching nothing.
136
90
 
137
- **If Playwright Utils enabled:**
91
+ **If Playwright Utils is enabled, installed, and the reviewed files run on the Playwright runner:**
138
92
 
139
93
  - `playwright-utils-mandate.md`: required to score rows M9 and L9
140
94
  - `overview.md`, `api-request.md`, `network-recorder.md`, `auth-session.md`, `intercept-network-call.md`, `recurse.md`, `log.md`, `file-utils.md`, `burn-in.md`, `network-error-monitor.md`, `fixtures-composition.md`
141
95
 
142
- **If disabled:**
96
+ **If Playwright Utils is disabled and the reviewed files run on the Playwright runner:**
143
97
 
144
98
  - `fixture-architecture.md`
145
99
  - `network-first.md`
@@ -147,7 +101,7 @@ Without these, a flow is reviewed against browser predicates that cannot match i
147
101
  - `component-tdd.md`
148
102
  - `ci-burn-in.md`
149
103
 
150
- **Playwright CLI (if `tea_browser_automation` is "cli" or "auto"):**
104
+ **Playwright CLI (if `tea_browser_automation` is "cli" or "auto" and the reviewed files run on the Playwright runner):**
151
105
 
152
106
  - `playwright-cli.md`
153
107
 
@@ -155,15 +109,15 @@ Without these, a flow is reviewed against browser predicates that cannot match i
155
109
 
156
110
  - (existing MCP-related fragments, if any are added in future)
157
111
 
158
- **Pact.js Utils (if enabled and contract tests in review scope):**
112
+ **Pact.js Utils (if enabled, `@seontechnologies/pactjs-utils` is in `package.json`, and contract tests are in review scope):**
159
113
 
160
114
  - `pactjs-utils-overview.md`, `pactjs-utils-consumer-helpers.md`, `pactjs-utils-provider-verifier.md`, `pactjs-utils-request-filter.md`, `pact-consumer-di.md`, `pact-consumer-framework-setup.md`, `pact-broker-webhooks.md`
161
115
 
162
- **Contract Testing (if pactjs-utils disabled but contract tests in review scope):**
116
+ **Contract Testing (if Pact.js Utils is disabled or not installed, and contract tests are in review scope):**
163
117
 
164
118
  - `contract-testing.md`
165
119
 
166
- **Pact MCP (if tea_pact_mcp is "mcp"):**
120
+ **Pact MCP (if tea_pact_mcp is "mcp" and contract tests are in review scope):**
167
121
 
168
122
  - `pact-mcp.md`
169
123
 
@@ -97,6 +97,10 @@ If none of the four oracle types can be resolved, **HALT** and request the small
97
97
 
98
98
  From `{knowledgeIndex}` load:
99
99
 
100
+ ### Deterministic Knowledge Selection
101
+
102
+ The fragment list for this step is a closed set. Start empty and add every fragment in the list below. Do not add fragments from tier labels, index descriptions, nearby mentions elsewhere in this step, general usefulness, or possible future need. Deduplicate while preserving the order below. Identical facts and config must produce an identical list.
103
+
100
104
  - `test-priorities-matrix.md`
101
105
  - `risk-governance.md`
102
106
  - `probability-impact.md`