bmad-method-test-architecture-enterprise 4.0.1 → 4.0.2

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 generation in red and expand modes with automatic run-and-heal, combined framework and CI setup, CI/CD quality gates, and structured testing education. Existing CI and ATDD customizations can be migrated to the new skill names. Part of the BMad Method ecosystem.",
34
- "version": "4.0.1",
34
+ "version": "4.0.2",
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": "4.0.1",
4
+ "version": "4.0.2",
5
5
  "description": "Master Test Architect for quality strategy, test automation, and release gates",
6
6
  "keywords": [
7
7
  "bmad",
@@ -21,7 +21,7 @@ This is an **isolated subagent** running in parallel with E2E red-phase test gen
21
21
 
22
22
  **When `use_playwright_utils` is `true`, `playwright-utils-mandate.md` binds this worker.** A red-phase scaffold is real test code; generate it in the playwright-utils style without being asked.
23
23
 
24
- **If `use_pactjs_utils` is enabled AND the relevance gate opened in Step 1 AND `@seontechnologies/pactjs-utils` is installed:** Also generate consumer contract tests alongside API tests. All three are required. The flag on its own means "write Pact this way when you write it", never "this story needs a contract test", and scaffolding against an uninstalled package produces imports that do not resolve. When any of the three is false, generate the API tests and say in the output which condition was missing. `pactjs-utils-mandate.md` binds them: `.given(...createProviderState({ name, params }))`, `setJsonContent` / `setJsonBody` for builder callbacks, `createRequestFilter` for auth injection, `zodToPactMatchers` where a Zod schema exists, and the `pact-consumer-di.md` injection so `executeTest` exercises the real client instead of raw `fetch`. A red-phase contract test is still the file the developer keeps. Use the loaded pactjs-utils fragments (`pactjs-utils-overview`, `pactjs-utils-consumer-helpers`, `pactjs-utils-provider-verifier`, `pactjs-utils-request-filter`, `pact-consumer-di`, `pact-consumer-framework-setup`) for patterns. When generating consumer tests, enforce **one `pact.addInteraction()` per `it()` block** (see `pactjs-utils-consumer-helpers.md` Example 6) — PactV4's Rust FFI non-deterministically drops interactions if multiple are chained in one test. Gate broker calls on `pact_mcp_reachable`, not on `pact_mcp`. When it is `true`, use the SmartBear MCP tools (Fetch Provider States, Generate Pact Tests). When it is `false`, take provider states from `pact_fallback_source` and say so in the output. Step 1 probed once; do not probe again.
24
+ **If `use_pactjs_utils` is enabled AND the relevance gate opened in Step 1 AND `@seontechnologies/pactjs-utils` is installed:** Also generate consumer contract tests alongside API tests. All three are required. The flag on its own means "write Pact this way when you write it", never "this story needs a contract test", and scaffolding against an uninstalled package produces imports that do not resolve. When any of the three is false, generate the API tests and say in the output which condition was missing. `pactjs-utils-mandate.md` binds them: `.given(...createProviderState({ name, params }))`, `setJsonContent` / `setJsonBody` for builder callbacks, `createRequestFilter` for auth injection, `zodToPactMatchers` where a Zod schema exists, and the `pact-consumer-di.md` injection so `executeTest` exercises the real client instead of raw `fetch`. A red-phase contract test is still the file the developer keeps. Use the loaded pactjs-utils fragments (`pactjs-utils-overview`, `pactjs-utils-consumer-helpers`, `pactjs-utils-provider-verifier`, `pactjs-utils-request-filter`, `pact-consumer-di`, `pact-consumer-framework-setup`) for patterns. When generating consumer tests, enforce **one `pact.addInteraction()` per `it()` block** (see `pactjs-utils-consumer-helpers.md` Example 6) — PactV4's Rust FFI non-deterministically drops interactions if multiple are chained in one test. Gate broker calls on `pact_mcp_reachable`, not on `pact_mcp`. When it is `true`, use the read-only SmartBear MCP tools (`contract-testing_get_provider_states`, `contract-testing_list_pacticipants`). Call `contract-testing_generate_pact_tests` only when the user asked for PactFlow AI output: it sends code to the hosted service and spends workspace credits (`pact-mcp.md` § PactFlow AI tools need an explicit request). When it is `false`, take provider states from `pact_fallback_source` and say so in the output. Step 1 probed once; do not probe again.
25
25
 
26
26
  **Your task:** Generate API test scaffolds for the feature's expected behavior. They stay in `test.skip()` until the developer activates them for the current task (TDD RED PHASE).
27
27
 
@@ -177,7 +177,7 @@ When generating Pact consumer contract tests in the ATDD red phase, provider scr
177
177
  **Graceful degradation when provider source is inaccessible:**
178
178
 
179
179
  1. **OpenAPI/Swagger spec available**: Use the spec as the source of truth for response shapes, status codes, and field names
180
- 2. **Pact Broker available** (when `pact_mcp` is `"mcp"`): Use SmartBear MCP tools to fetch existing provider states and verified interactions as reference
180
+ 2. **Pact Broker available** (when `pact_mcp_reachable` is `true`): Use the read-only SmartBear MCP tools to fetch existing provider states and verified interactions as reference
181
181
  3. **Neither available**: For new endpoints, use acceptance criteria; for existing endpoints, use consumer-side types. Mark with `// Provider endpoint: TODO — provider source not accessible, verify manually` and set `provider_scrutiny: "pending"` in output JSON
182
182
  4. **Never silently guess**: Document all assumptions in the scrutiny evidence block
183
183
 
@@ -32,7 +32,7 @@ Apply pactjs-utils conventions from the loaded fragments (`pactjs-utils-overview
32
32
  - **Consumer `package.json`**: generate both `test:pact:consumer` (determinism gate calling `scripts/check-pact-determinism.sh`) and `test:pact:consumer:run` (inner vitest invocation).
33
33
  - **Publish script**: `scripts/publish-pact.sh` normalizes interactions with `jq -S '.interactions |= sort_by(...)'` before `pact-broker publish`.
34
34
 
35
- Gate broker calls on `pact_mcp_reachable`, not on `pact_mcp`. The mode says the user allows a broker; the probe result says whether one answered. When `pact_mcp_reachable` is `true`, use the SmartBear MCP tools (Fetch Provider States, Generate Pact Tests) to inform generation. When it is `false`, take provider states from `pact_fallback_source` and say so in the output. Do not probe again: Step 1 already did, once.
35
+ Gate broker calls on `pact_mcp_reachable`, not on `pact_mcp`. The mode says the user allows a broker; the probe result says whether one answered. When `pact_mcp_reachable` is `true`, use the read-only SmartBear MCP tools (`contract-testing_get_provider_states`, `contract-testing_list_pacticipants`) to inform generation. Call `contract-testing_generate_pact_tests` only when the user asked for PactFlow AI output: it sends code to the hosted service and spends workspace credits (`pact-mcp.md` § PactFlow AI tools need an explicit request). When it is `false`, take provider states from `pact_fallback_source` and say so in the output. Do not probe again: Step 1 already did, once.
36
36
 
37
37
  ---
38
38
 
@@ -218,7 +218,7 @@ The seven points to verify for each interaction:
218
218
 
219
219
  6. **Graceful degradation** when provider source is not accessible (follows the canonical four-step protocol from `contract-testing.md`):
220
220
  1. **OpenAPI/Swagger spec available**: Use the spec as the source of truth for response shapes, status codes, and field names
221
- 2. **Pact Broker available** (when `pact_mcp` is `"mcp"` in `subagentContext.config`): Use SmartBear MCP tools to fetch existing provider states and verified interactions as reference
221
+ 2. **Pact Broker available** (when `pact_mcp_reachable` is `true` in `subagentContext.config`): Use the read-only SmartBear MCP tools to fetch existing provider states and verified interactions as reference
222
222
  3. **Neither available**: Generate from consumer types but use the TODO form of the mandatory comment: `// Provider endpoint: TODO — provider source not accessible, verify manually`. Set `provider_scrutiny: "pending"` in output JSON
223
223
  4. **Never silently guess**: Document all assumptions in the scrutiny evidence block
224
224
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [bmod]
4
4
  code = "tea"
5
- version = "4.0.1"
5
+ version = "4.0.2"
6
6
  update_source = "github:bmad-code-org/bmad-method-test-architecture-enterprise/skills"
7
7
  skills = [
8
8
  "bmad-tea",
@@ -20,16 +20,16 @@ For a release gate, the order is: `bmad-tea-test-review` (optional), `bmad-tea-n
20
20
 
21
21
  TEA works on its own. When the method module is installed too, these routes add testing to its flow. Name a method skill only when it is installed, and a TEA skill only when it is installed; otherwise give the route without the missing step, and say which TEA skill would fill it once installed. Depth follows risk: a small, low-risk change needs none of this beyond the checks its build runs.
22
22
 
23
- | The user is | Recommend | Because |
24
- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
25
- | Planning an initiative whose risk, compliance or reach calls for a test strategy | `bmad-tea-test-design` at system level, once the PRD and architecture exist | Testability concerns reach the architecture while it can still change. |
26
- | About to build the stories of an epic | `bmad-tea-test-design` at epic level, then `bmad-tea-framework` when the project has no test framework | The epic's plan sets priorities for every story in it. |
27
- | About to build one story with settled criteria, and wants test-first work | `bmad-tea-automate` in red mode, then `bmad-build` | The builder turns the red tests green; the checklist lists them for the story's plan. Red mode takes the story's ref (`1.2`), its title, or its leaf file, and reads the ticket through the method's ticket tools; on v6 it takes the story file. |
28
- | Done with `bmad-build` and wants a maintained test suite for the work | `bmad-tea-automate` in expand mode | It writes tests that follow the project's framework and fixtures, runs them, and heals test defects. `bmad-qa-generate-e2e-tests` remains the fit for a quick, one-off set of end-to-end tests. |
29
- | Upgraded a v6 project with `bmad migrate method` and has TEA checklists, matrices or reports from before | `bmad migrate tea`, after the method migration | It moves each story output onto its v7 ticket's key from exact evidence, keeps historical citations, and lists anything it cannot map. |
30
- | Has `bmad-tea-atdd` or `bmad-tea-ci` customizations, or `bmad setup` cleanup listed them as unused | `bmad migrate tea` (migration 3), before cleanup when you can | It moves red settings into `[workflow.red]` of `bmad-tea-automate.toml` and CI settings into `[workflow.ci]` of `bmad-tea-framework.toml`, reading the cleanup backup when cleanup already removed a file. Keep the `.v6-v7-migration-backup-*` folder until it has run. |
31
- | Has tests whose quality is in doubt | `bmad-tea-test-review` | A scored audit names the flaky, slow or weak tests. |
32
- | Closing an epic or preparing a release | The release-gate order above | Trace gives the gate decision; Test Review and NFR are added when risk calls for them. |
23
+ | The user is | Recommend | Because |
24
+ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | Planning an initiative whose risk, compliance or reach calls for a test strategy | `bmad-tea-test-design` at system level, once the PRD and architecture exist | Testability concerns reach the architecture while it can still change. |
26
+ | About to build the stories of an epic | `bmad-tea-test-design` at epic level, then `bmad-tea-framework` when the project has no test framework | The epic's plan sets priorities for every story in it. |
27
+ | About to build one story with settled criteria, and wants test-first work | `bmad-tea-automate` in red mode, then `bmad-build` | The builder turns the red tests green; the checklist lists them for the story's plan. Red mode takes the story's ref (`1.2`), its title, or its leaf file, and reads the ticket through the method's ticket tools; on v6 it takes the story file. When the ticket has only a `Verify:` line, the criteria come from the build's plan: stop `bmad-build` at its plan checkpoint with Approve and stop, run red mode, then run `bmad-build` again. A team that wants this in every build sets `bmad-build`'s `before_implement` hook to run red mode. |
28
+ | Done with `bmad-build` and wants a maintained test suite for the work | `bmad-tea-automate` in expand mode | It writes tests that follow the project's framework and fixtures, runs them, and heals test defects. `bmad-qa-generate-e2e-tests` remains the fit for a quick, one-off set of end-to-end tests. |
29
+ | Upgraded a v6 project with `bmad migrate method` and has TEA checklists, matrices or reports from before | `bmad migrate tea`, after the method migration | It moves each story output onto its v7 ticket's key from exact evidence, keeps historical citations, and lists anything it cannot map. |
30
+ | Has `bmad-tea-atdd` or `bmad-tea-ci` customizations, or `bmad setup` cleanup listed them as unused | `bmad migrate tea` (migration 3), before cleanup when you can | It moves red settings into `[workflow.red]` of `bmad-tea-automate.toml` and CI settings into `[workflow.ci]` of `bmad-tea-framework.toml`, reading the cleanup backup when cleanup already removed a file. Keep the `.v6-v7-migration-backup-*` folder until it has run. |
31
+ | Has tests whose quality is in doubt | `bmad-tea-test-review` | A scored audit names the flaky, slow or weak tests. |
32
+ | Closing an epic or preparing a release | The release-gate order above | Trace gives the gate decision; Test Review and NFR are added when risk calls for them. |
33
33
 
34
34
  The story's status is never TEA's to change. Red mode hands its tests to the builder, the builder records the work in the story's plan, and the user or an orchestrator marks the ticket done.
35
35
 
@@ -2,36 +2,68 @@
2
2
 
3
3
  ## Principle
4
4
 
5
- Use the SmartBear MCP server to enable AI agent interaction with PactFlow/Pact Broker during contract testing workflows. The MCP server provides tools for generating pact tests, fetching provider states, reviewing test quality, and checking deployment safety — all accessible through the Model Context Protocol.
5
+ Use the SmartBear MCP server to give TEA live, read-only knowledge of a PactFlow or Pact Broker workspace: which provider states exist, which pacticipants depend on a provider, what the verification matrix says, and whether a version can deploy. TEA writes, reviews and gates contract tests itself; the broker supplies facts those decisions rest on.
6
6
 
7
7
  ## Rationale
8
8
 
9
9
  ### Why MCP for contract testing?
10
10
 
11
- - **Live broker queries**: AI agents can fetch existing provider states, verification results, and deployment status directly from PactFlow
12
- - **Test generation assistance**: MCP tools generate consumer and provider tests based on existing contracts, OpenAPI specs, or templates
13
- - **Automated review**: MCP-powered review checks tests against best practices without manual inspection
14
- - **Deployment safety**: `can-i-deploy` checks integrated into agent workflows for real-time compatibility verification
11
+ - **Live broker queries**: provider states, verification results, deployed versions and the integration network come straight from the workspace instead of being guessed from consumer code
12
+ - **Deployment safety**: `can-i-deploy` and the matrix can be queried while designing a pipeline or diagnosing a failed gate
13
+ - **Blast radius**: the pacticipant network shows every consumer of a provider, which feeds risk scoring in test design
15
14
 
16
15
  ### When TEA uses it
17
16
 
18
- - **test-design workflow**: Fetch existing provider states to understand current contract landscape
19
- - **automate workflow**: Generate pact tests using broker knowledge and existing contracts
20
- - **test-review workflow**: Review pact tests against best practices with automated feedback
21
- - **ci workflow**: Reference can-i-deploy and matrix tools for pipeline guidance
17
+ - **test-design workflow**: provider states and the pacticipant network inform contract scope and risk
18
+ - **automate workflow**: existing provider states and exact pacticipant names shape generated consumer tests
19
+ - **test-review workflow**: provider states and verification results check that reviewed tests match the broker
20
+ - **ci workflow**: can-i-deploy, matrix and deployed-version queries inform pipeline gates and failure diagnosis
22
21
 
23
- ## Available Tools
22
+ ## Tool Names
24
23
 
25
- | # | Tool | Description | When Used |
26
- | --- | ------------------------- | ----------------------------------------------------------------------- | --------------------- |
27
- | 1 | **Generate Pact Tests** | Create consumer/provider tests from code, OpenAPI, or templates | automate workflow |
28
- | 2 | **Fetch Provider States** | List all provider states from broker for a given consumer-provider pair | test-design, automate |
29
- | 3 | **Review Pact Tests** | Analyze tests against contract testing best practices | test-review |
30
- | 4 | **Can I Deploy** | Check deployment safety via broker verification matrix | ci workflow |
31
- | 5 | **Matrix** | Query consumer-provider verification matrix | ci, test-design |
32
- | 6 | **PactFlow AI Status** | Check AI credits and permissions (PactFlow Cloud only) | diagnostics |
33
- | 7 | **Metrics - All** | Workspace-wide contract testing metrics | reporting |
34
- | 8 | **Metrics - Team** | Team-level adoption statistics (PactFlow Cloud only) | reporting |
24
+ Every Pact tool the server registers carries the `contract-testing_` prefix. Clients add their own server prefix in front, so Claude Code shows `mcp__smartbear__contract-testing_can_i_deploy` for a server registered as `smartbear`. Match on the `contract-testing_` part.
25
+
26
+ `@smartbear/mcp` 0.44.0 registers 104 `contract-testing_*` tools. 60 carry `readOnlyHint: true`, 15 carry `destructiveHint: true`, and the rest write to the workspace: publishing, recording deployments, webhooks, secrets, labels, environments, and an `admin_*` family that manages users, roles, teams, system accounts and API tokens. Names change between server releases, so read them from the session's tool list rather than from memory.
27
+
28
+ ## Tools TEA Calls
29
+
30
+ All of these are read-only.
31
+
32
+ | Tool | Purpose | Used in |
33
+ | ------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------- |
34
+ | `contract-testing_get_provider_states` | Provider states already defined for a provider | test-design, automate, test-review |
35
+ | `contract-testing_list_pacticipants` | Exact pacticipant names as registered | automate, ci |
36
+ | `contract-testing_get_pacticipant_network` | Every consumer and provider connected to a pacticipant | test-design (risk, blast radius) |
37
+ | `contract-testing_list_integrations` | All consumer-provider pairs in the workspace | test-design |
38
+ | `contract-testing_get_pacts_for_verification` | Pacts a provider build would verify for given selectors | ci, test-review |
39
+ | `contract-testing_can_i_deploy` | Whether a version is safe to deploy to an environment | ci |
40
+ | `contract-testing_matrix` | Verification results between consumer and provider versions | ci, test-review |
41
+ | `contract-testing_list_environments` | Environment names and UUIDs | ci |
42
+ | `contract-testing_get_currently_deployed_versions` | What runs in an environment now | ci |
43
+ | `contract-testing_get_currently_supported_versions` | Released versions still supported (mobile apps, libraries) | ci |
44
+ | `contract-testing_get_metrics`, `contract-testing_get_team_metrics` | Workspace and team adoption figures (team metrics are PactFlow Cloud only) | reporting |
45
+
46
+ List tools page their results: `contract-testing_get_provider_states`, `contract-testing_get_pacticipant_network` and `contract-testing_get_currently_deployed_versions` return 5 rows per page by default. Raise `pageSize` or follow `pageNumber` until a page comes back short; reading only the first page silently drops provider states and consumers. `contract-testing_matrix` takes `latestby: "cvpv"` for a two-selector query and `"cvp"` for one.
47
+
48
+ ## Safety Rules
49
+
50
+ ### Read-only by default
51
+
52
+ TEA calls only tools whose `readOnlyHint` is true. Publishing contracts, recording deployments or releases, creating or deleting pacticipants, branches, environments, webhooks, secrets or labels, executing webhooks, and every `admin_*` tool change shared state that other teams' pipelines depend on. Those belong in CI, driven by the Pact CLI or the pipeline the ci workflow generates.
53
+
54
+ TEA calls a write tool only when the user asks for that specific change in the current conversation, names the target, and confirms. A workflow step never decides to write on its own, and a headless run never writes.
55
+
56
+ Recommend a read-only API token for agent use. A read/write token exposes every write and `admin_*` tool to the agent session.
57
+
58
+ ### PactFlow AI tools need an explicit request
59
+
60
+ `contract-testing_generate_pact_tests` and `contract-testing_review_pact_tests` are PactFlow Cloud features. Each call sends the supplied code, specs or test files to the hosted service and spends the workspace's PactFlow AI credits. TEA generates and reviews contract tests with its own knowledge fragments, so it does not call either tool unless the user asks for PactFlow AI output.
61
+
62
+ When the user does ask:
63
+
64
+ - Fetch provider states first and pass them in, so generated tests reuse existing state names.
65
+ - Treat the output as a draft. It must still pass the provider scrutiny checklist in `contract-testing.md` and, when `tea_use_pactjs_utils` is active, the substitutions in `pactjs-utils-mandate.md`.
66
+ - On a 401 or a credit error, call `contract-testing_check_pactflow_ai_entitlements` once and report what it says.
35
67
 
36
68
  ## Installation
37
69
 
@@ -132,49 +164,54 @@ Add to `.vscode/mcp.json` (note: uses `servers` key, not `mcpServers`):
132
164
 
133
165
  ## Pattern Examples
134
166
 
135
- ### Example 1: Fetching Provider States During Test Design
136
-
137
- When designing contract tests, use MCP to query existing provider states:
167
+ ### Example 1: Provider States During Test Design
138
168
 
139
169
  ```text
140
- # Agent queries SmartBear MCP during test-design workflow:
141
- # → Fetch Provider States for consumer="movie-web", provider="SampleMoviesAPI"
142
- # ← Returns: ["movie with id 1 exists", "no movies exist", "user is authenticated"]
170
+ # → contract-testing_get_provider_states provider="SampleMoviesAPI"
171
+ # ← ["movie with id 1 exists", "no movies exist", "user is authenticated"]
143
172
  #
144
- # Agent uses this to generate comprehensive consumer tests covering all states
173
+ # Consumer tests reuse these names exactly; a new state is proposed to the provider team, never invented silently.
145
174
  ```
146
175
 
147
- ### Example 2: Reviewing Pact Tests
148
-
149
- During test-review workflow, use MCP to evaluate test quality:
176
+ ### Example 2: Blast Radius for Risk Scoring
150
177
 
151
178
  ```text
152
- # Agent submits test file to SmartBear MCP Review tool:
153
- # → Review Pact Tests with test file content
154
- # ← Returns: feedback on matcher usage, state coverage, interaction naming
179
+ # → contract-testing_get_pacticipant_network pacticipantName="SampleMoviesAPI"
180
+ # ← consumers: movie-web, movie-mobile, recommendations-service
155
181
  #
156
- # Agent incorporates feedback into review report
182
+ # A breaking change to this provider touches three consumers; impact scores reflect that.
157
183
  ```
158
184
 
159
- ### Example 3: Can I Deploy Check in CI
160
-
161
- During CI workflow design, reference the can-i-deploy tool:
185
+ ### Example 3: Diagnosing a Failed can-i-deploy
162
186
 
163
187
  ```text
164
- # Agent generates CI pipeline with can-i-deploy gate:
165
- # → Can I Deploy: pacticipant="SampleMoviesAPI", version="${GITHUB_SHA}", to="production"
166
- # ← Returns: { ok: true/false, reason: "..." }
188
+ # → contract-testing_can_i_deploy pacticipant="movie-web" version="${GITHUB_SHA}" environment="production"
189
+ # ← ok: false, "no verified pact between movie-web and the version of SampleMoviesAPI in production"
167
190
  #
168
- # Agent designs pipeline to block deployment if can-i-deploy fails
191
+ # → contract-testing_list_environments (find the production UUID)
192
+ # → contract-testing_get_currently_deployed_versions environmentId=<uuid>
193
+ # → contract-testing_matrix q=[{pacticipant:"movie-web", version:"${GITHUB_SHA}"},
194
+ # {pacticipant:"SampleMoviesAPI", environment:"production"}]
195
+ # latestby="cvpv"
169
196
  ```
170
197
 
198
+ Read the matrix result:
199
+
200
+ | Matrix result | Meaning | Fix |
201
+ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
202
+ | No row, consumer version is new | No provider build has verified this pact yet | Trigger verification on pact publish with a `contract_requiring_verification_published` webhook (`pact-broker-webhooks.md`), and make the provider's selectors include the consumer's branch |
203
+ | No row, provider is the one deploying | The provider never verified the consumer versions already in the environment | Add `{ deployedOrReleased: true }` to the provider's consumer version selectors |
204
+ | Row whose verification result is `success: false` | Verification ran and failed: a real contract break | Fix the consumer expectation or the provider |
205
+ | Row whose verification result is `success: true`, gate still fails | Another integration of the same pacticipant is unverified | Repeat the matrix query for each integration |
206
+ | Provider version absent from the environment | The deployment was never recorded | Record it from the deploy pipeline with `pact-broker record-deployment` |
207
+
171
208
  ## When the Tools Are Not Reachable
172
209
 
173
210
  `tea_pact_mcp` defaults to `"mcp"`, so every contract-testing step reaches this fragment on a normal install. Most installs have no broker. That is expected, and it must cost nothing.
174
211
 
175
212
  ### The probe is a tool-list check, never a broker call
176
213
 
177
- Reachability means **the SmartBear MCP tools are present in this session's tool list**. Nothing else. Do not call `Can I Deploy`, `Matrix`, or any other tool to discover whether the broker answers: a missing server is instant and free to detect, while a misconfigured or unreachable broker is a network round trip that can hang the step. The two failure modes have very different costs and only the free one is worth probing for.
214
+ Reachability means **at least one tool whose name contains `contract-testing_` is present in this session's tool list**. Nothing else. Do not call `contract-testing_can_i_deploy`, `contract-testing_matrix`, or any other tool to discover whether the broker answers: a missing server is instant and free to detect, while a misconfigured or unreachable broker is a network round trip that can hang the step. The two failure modes have very different costs and only the free one is worth probing for.
178
215
 
179
216
  Credentials are likewise not probed. `PACT_BROKER_BASE_URL` and `PACT_BROKER_TOKEN` being unset is a reason the first real tool call will fail, not a reason to make one.
180
217
 
@@ -210,14 +247,15 @@ Everything above applies to the tools in this fragment only. It has no bearing o
210
247
  - **Per-project install recommended**: Different projects may target different PactFlow tenants — match TEA's per-project config philosophy
211
248
  - **Env vars are project-specific**: `PACT_BROKER_BASE_URL` and `PACT_BROKER_TOKEN` vary by project/team
212
249
  - **Node.js 20+ required**: SmartBear MCP server requires Node.js 20 or higher
213
- - **PactFlow Cloud features**: Some tools (AI Status, Team Metrics) are only available with PactFlow Cloud, not self-hosted Pact Broker
250
+ - **PactFlow Cloud features**: PactFlow AI generation and review, bi-directional contract testing queries, team metrics and the `admin_*` tools need PactFlow Cloud; a self-hosted Pact Broker exposes the rest
251
+ - **Read-only token for agents**: a read/write token hands every write and admin tool to the session
214
252
  - **Complements pactjs-utils**: MCP provides broker interaction during design/review; pactjs-utils provides runtime utilities for test code
215
253
 
216
254
  ## Related Fragments
217
255
 
218
256
  - `pactjs-utils-overview.md` — runtime utilities that pact tests import
219
257
  - `pactjs-utils-provider-verifier.md` — verifier options that reference broker config
220
- - `pact-broker-webhooks.md` — PactFlow → GitHub webhook auth pattern and staleness monitoring; `Metrics - All` / `Matrix` MCP tools are useful here for dashboards
258
+ - `pact-broker-webhooks.md` — PactFlow → GitHub webhook auth pattern and staleness monitoring; `contract-testing_get_metrics` and `contract-testing_matrix` are useful here for dashboards
221
259
  - `contract-testing.md` — foundational contract testing patterns
222
260
 
223
261
  ## Anti-Patterns
@@ -234,9 +272,16 @@ Everything above applies to the tools in this fragment only. It has no bearing o
234
272
  ```text
235
273
  # ✅ Use MCP during planning and review:
236
274
  # - Fetch provider states to inform test design
237
- # - Generate test scaffolds from existing contracts
238
- # - Review tests for best practice compliance
239
- # - Check can-i-deploy during CI pipeline design
275
+ # - Map the pacticipant network for risk scoring
276
+ # - Check can-i-deploy and the matrix during CI pipeline design and failure diagnosis
277
+ ```
278
+
279
+ ### Wrong: Letting an agent write to the broker
280
+
281
+ ```text
282
+ # ❌ Agent calls contract-testing_publish_consumer_contracts or contract-testing_record_deployment
283
+ # from a workstation. The broker now holds a version no pipeline built, and can-i-deploy answers for it.
284
+ # ✅ Publishing and deployment records come from CI, with the commit SHA and branch of the build.
240
285
  ```
241
286
 
242
- _Source: SmartBear MCP documentation, PactFlow developer docs._
287
+ _Source: SmartBear MCP documentation, PactFlow developer docs, and the tool list of `@smartbear/mcp` 0.44.0 read over MCP `tools/list`._
@@ -40,7 +40,7 @@ pactjs-utils-zod-to-pact,Pact.js Utils Zod to Pact,"zodToPactMatchers for consum
40
40
  pactjs-utils-consumer-helpers,Pact.js Utils Consumer Helpers,"createProviderState, toJsonMap, setJsonContent, setJsonBody; PactV4 one-interaction-per-it() determinism rule","pactjs-utils,consumer,contract-testing,pact,api,determinism,pactv4",specialized,pactjs-utils-consumer-helpers.md
41
41
  pactjs-utils-provider-verifier,Pact.js Utils Provider Verifier,"Verifier builders, scoped consumerBranch selectors, provider revision metadata, isBreakingChangeTolerantBranch, and FFI-safe Vitest config","pactjs-utils,provider,consumer,contract-testing,pact,api,backend,ci,vitest,ffi,consumer-branch,provider-branch,short-lived-branch,selectors,release-branch,breaking-change",specialized,pactjs-utils-provider-verifier.md
42
42
  pactjs-utils-request-filter,Pact.js Utils Request Filter,"createRequestFilter, noOpRequestFilter for auth injection","pactjs-utils,auth,contract-testing,pact",specialized,pactjs-utils-request-filter.md
43
- pact-mcp,Pact MCP Server,"SmartBear MCP for PactFlow: generate tests, review, can-i-deploy, provider states","pact,mcp,pactflow,contract-testing,broker",specialized,pact-mcp.md
43
+ pact-mcp,Pact MCP Server,"SmartBear MCP for PactFlow: verified contract-testing_ tool names, read-only use, provider states, pacticipant network, can-i-deploy diagnosis, paging, PactFlow AI opt-in","pact,mcp,pactflow,contract-testing,broker",specialized,pact-mcp.md
44
44
  pact-consumer-framework-setup,Pact Consumer CDC Framework Setup,"Directory structure, FFI-safe vitest config, deterministic publishing, PR-only provider branch detection, and additive branch-aware can-i-deploy","pactjs-utils,consumer,contract-testing,pact,ci,framework,setup,vitest,shell-scripts,jq,pactv4,ffi,file-organization,one-file-per-pair,provider-branch,can-i-deploy,short-lived-branch",specialized,pact-consumer-framework-setup.md
45
45
  pact-broker-webhooks,Pact Broker Webhooks,"PactFlow → GitHub repository_dispatch auth, exact registered provider target checkout, staleness monitoring, and PAT rotation","pact,pactflow,broker,webhooks,github,auth,pat,ci,operations,security,provider-branch,short-lived-branch",specialized,pact-broker-webhooks.md
46
46
  adr-quality-readiness-checklist,ADR Quality Readiness Checklist,"8-category 29-criteria framework for ADR testability and NFR evidence audit","nfr,testability,adr,quality,assessment,checklist",extended,adr-quality-readiness-checklist.md