bmad-method-test-architecture-enterprise 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.github/workflows/publish.yaml +168 -0
  3. package/README.md +95 -83
  4. package/package.json +5 -6
  5. package/src/agents/bmad-tea/resources/knowledge/contract-testing.md +32 -15
  6. package/src/agents/bmad-tea/resources/knowledge/pact-broker-webhooks.md +237 -0
  7. package/src/agents/bmad-tea/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  8. package/src/agents/bmad-tea/resources/knowledge/pact-mcp.md +1 -0
  9. package/src/agents/bmad-tea/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  10. package/src/agents/bmad-tea/resources/knowledge/pactjs-utils-overview.md +15 -12
  11. package/src/agents/bmad-tea/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  12. package/src/agents/bmad-tea/resources/knowledge/pactjs-utils-zod-to-pact.md +262 -0
  13. package/src/agents/bmad-tea/resources/tea-index.csv +6 -4
  14. package/src/workflows/testarch/README.md +5 -3
  15. package/src/workflows/testarch/bmad-teach-me-testing/SKILL.md +118 -4
  16. package/src/workflows/testarch/bmad-teach-me-testing/checklist.md +3 -2
  17. package/src/workflows/testarch/bmad-teach-me-testing/customize.toml +40 -0
  18. package/src/workflows/testarch/bmad-teach-me-testing/instructions.md +7 -0
  19. package/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md +8 -0
  20. package/src/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md +8 -0
  21. package/src/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md +10 -1
  22. package/src/workflows/testarch/bmad-testarch-atdd/SKILL.md +74 -4
  23. package/src/workflows/testarch/bmad-testarch-atdd/customize.toml +40 -0
  24. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/contract-testing.md +32 -15
  25. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pact-broker-webhooks.md +237 -0
  26. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  27. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pact-mcp.md +1 -0
  28. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  29. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pactjs-utils-overview.md +15 -12
  30. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  31. package/src/workflows/testarch/bmad-testarch-atdd/resources/knowledge/pactjs-utils-zod-to-pact.md +262 -0
  32. package/src/workflows/testarch/bmad-testarch-atdd/resources/tea-index.csv +6 -4
  33. package/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-01-preflight-and-context.md +2 -2
  34. package/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-04a-subagent-api-failing.md +1 -1
  35. package/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md +8 -0
  36. package/src/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md +8 -0
  37. package/src/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md +8 -0
  38. package/src/workflows/testarch/bmad-testarch-automate/SKILL.md +74 -4
  39. package/src/workflows/testarch/bmad-testarch-automate/customize.toml +40 -0
  40. package/src/workflows/testarch/bmad-testarch-automate/resources/knowledge/contract-testing.md +18 -2
  41. package/src/workflows/testarch/bmad-testarch-automate/resources/knowledge/pact-broker-webhooks.md +237 -0
  42. package/src/workflows/testarch/bmad-testarch-automate/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  43. package/src/workflows/testarch/bmad-testarch-automate/resources/knowledge/pact-mcp.md +1 -0
  44. package/src/workflows/testarch/bmad-testarch-automate/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  45. package/src/workflows/testarch/bmad-testarch-automate/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  46. package/src/workflows/testarch/bmad-testarch-automate/resources/tea-index.csv +5 -4
  47. package/src/workflows/testarch/bmad-testarch-automate/steps-c/step-03a-subagent-api.md +9 -1
  48. package/src/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md +8 -0
  49. package/src/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md +8 -0
  50. package/src/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md +8 -0
  51. package/src/workflows/testarch/bmad-testarch-ci/SKILL.md +74 -4
  52. package/src/workflows/testarch/bmad-testarch-ci/customize.toml +40 -0
  53. package/src/workflows/testarch/bmad-testarch-ci/resources/knowledge/contract-testing.md +18 -2
  54. package/src/workflows/testarch/bmad-testarch-ci/resources/knowledge/pact-broker-webhooks.md +237 -0
  55. package/src/workflows/testarch/bmad-testarch-ci/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  56. package/src/workflows/testarch/bmad-testarch-ci/resources/knowledge/pact-mcp.md +1 -0
  57. package/src/workflows/testarch/bmad-testarch-ci/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  58. package/src/workflows/testarch/bmad-testarch-ci/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  59. package/src/workflows/testarch/bmad-testarch-ci/resources/tea-index.csv +5 -4
  60. package/src/workflows/testarch/bmad-testarch-ci/steps-c/step-02-generate-pipeline.md +14 -6
  61. package/src/workflows/testarch/bmad-testarch-ci/steps-c/step-03-configure-quality-gates.md +6 -1
  62. package/src/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md +8 -0
  63. package/src/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md +8 -0
  64. package/src/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md +8 -0
  65. package/src/workflows/testarch/bmad-testarch-framework/SKILL.md +74 -4
  66. package/src/workflows/testarch/bmad-testarch-framework/customize.toml +40 -0
  67. package/src/workflows/testarch/bmad-testarch-framework/resources/knowledge/contract-testing.md +18 -2
  68. package/src/workflows/testarch/bmad-testarch-framework/resources/knowledge/pact-broker-webhooks.md +237 -0
  69. package/src/workflows/testarch/bmad-testarch-framework/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  70. package/src/workflows/testarch/bmad-testarch-framework/resources/knowledge/pact-mcp.md +1 -0
  71. package/src/workflows/testarch/bmad-testarch-framework/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  72. package/src/workflows/testarch/bmad-testarch-framework/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  73. package/src/workflows/testarch/bmad-testarch-framework/resources/tea-index.csv +5 -4
  74. package/src/workflows/testarch/bmad-testarch-framework/steps-c/step-03-scaffold-framework.md +10 -6
  75. package/src/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md +8 -0
  76. package/src/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md +8 -0
  77. package/src/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md +8 -0
  78. package/src/workflows/testarch/bmad-testarch-nfr/SKILL.md +74 -4
  79. package/src/workflows/testarch/bmad-testarch-nfr/customize.toml +40 -0
  80. package/src/workflows/testarch/bmad-testarch-nfr/resources/knowledge/contract-testing.md +18 -2
  81. package/src/workflows/testarch/bmad-testarch-nfr/resources/knowledge/pact-broker-webhooks.md +237 -0
  82. package/src/workflows/testarch/bmad-testarch-nfr/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  83. package/src/workflows/testarch/bmad-testarch-nfr/resources/knowledge/pact-mcp.md +1 -0
  84. package/src/workflows/testarch/bmad-testarch-nfr/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  85. package/src/workflows/testarch/bmad-testarch-nfr/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  86. package/src/workflows/testarch/bmad-testarch-nfr/resources/tea-index.csv +5 -4
  87. package/src/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md +8 -0
  88. package/src/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md +8 -0
  89. package/src/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md +8 -0
  90. package/src/workflows/testarch/bmad-testarch-test-design/SKILL.md +76 -4
  91. package/src/workflows/testarch/bmad-testarch-test-design/customize.toml +40 -0
  92. package/src/workflows/testarch/bmad-testarch-test-design/resources/knowledge/contract-testing.md +18 -2
  93. package/src/workflows/testarch/bmad-testarch-test-design/resources/knowledge/pact-broker-webhooks.md +237 -0
  94. package/src/workflows/testarch/bmad-testarch-test-design/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  95. package/src/workflows/testarch/bmad-testarch-test-design/resources/knowledge/pact-mcp.md +1 -0
  96. package/src/workflows/testarch/bmad-testarch-test-design/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  97. package/src/workflows/testarch/bmad-testarch-test-design/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  98. package/src/workflows/testarch/bmad-testarch-test-design/resources/tea-index.csv +5 -4
  99. package/src/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md +8 -0
  100. package/src/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md +8 -0
  101. package/src/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md +8 -0
  102. package/src/workflows/testarch/bmad-testarch-test-review/SKILL.md +74 -4
  103. package/src/workflows/testarch/bmad-testarch-test-review/customize.toml +40 -0
  104. package/src/workflows/testarch/bmad-testarch-test-review/resources/knowledge/contract-testing.md +18 -2
  105. package/src/workflows/testarch/bmad-testarch-test-review/resources/knowledge/pact-broker-webhooks.md +237 -0
  106. package/src/workflows/testarch/bmad-testarch-test-review/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  107. package/src/workflows/testarch/bmad-testarch-test-review/resources/knowledge/pact-mcp.md +1 -0
  108. package/src/workflows/testarch/bmad-testarch-test-review/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  109. package/src/workflows/testarch/bmad-testarch-test-review/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  110. package/src/workflows/testarch/bmad-testarch-test-review/resources/tea-index.csv +5 -4
  111. package/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-01-load-context.md +2 -2
  112. package/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-03a-subagent-determinism.md +43 -0
  113. package/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md +8 -0
  114. package/src/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md +8 -0
  115. package/src/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md +8 -0
  116. package/src/workflows/testarch/bmad-testarch-trace/SKILL.md +76 -4
  117. package/src/workflows/testarch/bmad-testarch-trace/customize.toml +40 -0
  118. package/src/workflows/testarch/bmad-testarch-trace/resources/knowledge/contract-testing.md +18 -2
  119. package/src/workflows/testarch/bmad-testarch-trace/resources/knowledge/pact-broker-webhooks.md +237 -0
  120. package/src/workflows/testarch/bmad-testarch-trace/resources/knowledge/pact-consumer-framework-setup.md +134 -12
  121. package/src/workflows/testarch/bmad-testarch-trace/resources/knowledge/pact-mcp.md +1 -0
  122. package/src/workflows/testarch/bmad-testarch-trace/resources/knowledge/pactjs-utils-consumer-helpers.md +111 -1
  123. package/src/workflows/testarch/bmad-testarch-trace/resources/knowledge/pactjs-utils-provider-verifier.md +83 -1
  124. package/src/workflows/testarch/bmad-testarch-trace/resources/tea-index.csv +5 -4
  125. package/src/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md +8 -0
  126. package/src/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md +8 -0
  127. package/src/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md +8 -0
  128. package/test/test-installation-components.js +39 -40
  129. package/.github/workflows/manual-release.yaml +0 -216
  130. package/src/workflows/testarch/bmad-teach-me-testing/workflow.md +0 -98
  131. package/src/workflows/testarch/bmad-testarch-atdd/workflow.md +0 -49
  132. package/src/workflows/testarch/bmad-testarch-automate/workflow.md +0 -49
  133. package/src/workflows/testarch/bmad-testarch-ci/workflow.md +0 -49
  134. package/src/workflows/testarch/bmad-testarch-framework/workflow.md +0 -49
  135. package/src/workflows/testarch/bmad-testarch-nfr/workflow.md +0 -49
  136. package/src/workflows/testarch/bmad-testarch-test-design/workflow.md +0 -51
  137. package/src/workflows/testarch/bmad-testarch-test-review/workflow.md +0 -49
  138. package/src/workflows/testarch/bmad-testarch-trace/workflow.md +0 -51
@@ -12,7 +12,7 @@
12
12
  "name": "bmad-method-test-architecture-enterprise",
13
13
  "source": "./",
14
14
  "description": "Master Test Architect module for quality strategy, test automation, CI/CD quality gates, and structured testing education. Part of the BMad Method ecosystem.",
15
- "version": "1.13.0",
15
+ "version": "1.14.0",
16
16
  "author": {
17
17
  "name": "Murat K Ozcan (TEA Creator) & Brian (BMad) Madison"
18
18
  },
@@ -0,0 +1,168 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - "src/**"
8
+ - "package.json"
9
+ - "package-lock.json"
10
+ workflow_dispatch:
11
+ inputs:
12
+ channel:
13
+ description: "Publish channel"
14
+ required: true
15
+ default: "latest"
16
+ type: choice
17
+ options:
18
+ - latest
19
+ - next
20
+ bump:
21
+ description: "Version bump type (latest channel only)"
22
+ required: false
23
+ default: "patch"
24
+ type: choice
25
+ options:
26
+ - patch
27
+ - minor
28
+ - major
29
+
30
+ concurrency:
31
+ group: publish-${{ github.event_name }}-${{ github.ref_name }}-${{ inputs.channel || 'push' }}
32
+ cancel-in-progress: ${{ github.event_name == 'push' }}
33
+
34
+ permissions:
35
+ id-token: write
36
+ contents: write
37
+
38
+ jobs:
39
+ publish:
40
+ if: github.repository == 'bmad-code-org/bmad-method-test-architecture-enterprise' && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main')
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - name: Generate GitHub App token
44
+ id: app-token
45
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
46
+ uses: actions/create-github-app-token@v2
47
+ with:
48
+ app-id: ${{ secrets.RELEASE_APP_ID }}
49
+ private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
50
+
51
+ - name: Checkout
52
+ uses: actions/checkout@v4
53
+ with:
54
+ fetch-depth: 0
55
+ token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
56
+
57
+ - name: Setup Node
58
+ uses: actions/setup-node@v4
59
+ with:
60
+ node-version-file: ".nvmrc"
61
+ cache: "npm"
62
+ registry-url: "https://registry.npmjs.org"
63
+
64
+ - name: Ensure trusted publishing toolchain
65
+ run: |
66
+ # npm trusted publishing requires modern npm on the runner.
67
+ npm install --global npm@11.6.2
68
+
69
+ - name: Configure git user
70
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
71
+ run: |
72
+ git config user.name "github-actions[bot]"
73
+ git config user.email "github-actions[bot]@users.noreply.github.com"
74
+
75
+ - name: Install dependencies
76
+ run: npm ci
77
+
78
+ - name: Run tests
79
+ run: npm test
80
+
81
+ - name: Derive next prerelease version
82
+ if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next')
83
+ run: |
84
+ NEXT_VER=$(npm view bmad-method-test-architecture-enterprise@next version 2>/dev/null || echo "")
85
+ LATEST_VER=$(npm view bmad-method-test-architecture-enterprise@latest version 2>/dev/null || echo "")
86
+
87
+ BASE=$(node -e "
88
+ const semver = require('semver');
89
+ const next = process.argv[1] || null;
90
+ const latest = process.argv[2] || null;
91
+ if (!next && !latest) process.exit(0);
92
+ if (!next) { console.log(latest); process.exit(0); }
93
+ if (!latest) { console.log(next); process.exit(0); }
94
+ const nextBase = next.replace(/-next\.\d+$/, '');
95
+ console.log(semver.gte(latest, nextBase) ? latest : next);
96
+ " "$NEXT_VER" "$LATEST_VER")
97
+
98
+ if [ -n "$BASE" ]; then
99
+ npm version "$BASE" --no-git-tag-version --allow-same-version
100
+ fi
101
+ npm version prerelease --preid=next --no-git-tag-version
102
+
103
+ - name: Bump stable version
104
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
105
+ run: npm version "${{ inputs.bump }}" --no-git-tag-version
106
+
107
+ - name: Sync marketplace version
108
+ run: |
109
+ node <<'NODE'
110
+ const fs = require('node:fs');
111
+
112
+ const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
113
+ const marketplacePath = '.claude-plugin/marketplace.json';
114
+ const marketplace = JSON.parse(fs.readFileSync(marketplacePath, 'utf8'));
115
+ const plugin = (marketplace.plugins || []).find((entry) => entry && entry.name === packageJson.name);
116
+
117
+ if (!plugin) {
118
+ throw new Error(`Marketplace entry not found for ${packageJson.name}`);
119
+ }
120
+
121
+ plugin.version = packageJson.version;
122
+ fs.writeFileSync(marketplacePath, `${JSON.stringify(marketplace, null, 2)}\n`);
123
+ NODE
124
+
125
+ - name: Validate release metadata
126
+ run: npm run test:release-metadata
127
+
128
+ - name: Publish prerelease to npm
129
+ if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next')
130
+ run: npm publish --tag next --provenance
131
+
132
+ - name: Commit version bump
133
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
134
+ run: |
135
+ VERSION=$(node -p 'require("./package.json").version')
136
+ git add package.json package-lock.json .claude-plugin/marketplace.json
137
+ git commit -m "release: bump to v${VERSION} [skip ci]"
138
+ git tag -a "v${VERSION}" -m "Release v${VERSION}"
139
+
140
+ - name: Push version commit and tag
141
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
142
+ run: git push origin main --follow-tags
143
+
144
+ - name: Publish stable release to npm
145
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
146
+ run: npm publish --tag latest --provenance
147
+
148
+ - name: Create GitHub Release
149
+ if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
150
+ run: |
151
+ TAG="v$(node -p 'require("./package.json").version')"
152
+ VERSION="${TAG#v}"
153
+ BODY=$(awk -v ver="$VERSION" '
154
+ /^## / {
155
+ if (found) exit
156
+ if ($0 ~ ("^##[[:space:]]*\\[?[[:space:]]*v?" ver "[[:space:]]*\\]?([[:space:]]*-[[:space:]].*)?$")) found=1
157
+ next
158
+ }
159
+ found { print }
160
+ ' CHANGELOG.md)
161
+ if [ -z "$BODY" ]; then
162
+ echo "::warning::No CHANGELOG.md entry for $TAG — falling back to auto-generated notes"
163
+ gh release create "$TAG" --generate-notes
164
+ else
165
+ gh release create "$TAG" --notes "$BODY"
166
+ fi
167
+ env:
168
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/README.md CHANGED
@@ -28,26 +28,28 @@ BMad is a small **agent + workflow engine**. There is no external orchestrator
28
28
 
29
29
  ### Building Blocks
30
30
 
31
- Each workflow directory contains these files, and each has a specific job:
32
-
33
- | File | What it does | When it loads |
34
- | ----------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
35
- | `SKILL.md` | Expert persona — identity, principles, critical actions, capabilities table | First — always in context |
36
- | `workflow.yaml` | Machine-readable metadataconfig variables, required tools, tags | Second resolves `{project-root}`, `{config_source}`, `{test_artifacts}` |
37
- | `workflow.md` | Human-readable entry point goals, mode menu (Create/Edit/Validate), routes to first step | Second presents mode choice |
38
- | `instructions.md` | Workflow-specific rules and context (optional, supplements workflow.md) | On demand |
39
- | `steps-c/*.md` | **Create** stepsprimary execution, 5-9 sequential files | One at a time (just-in-time) |
40
- | `steps-e/*.md` | **Edit** steps always 2 files: assess target, apply edit | One at a time |
41
- | `steps-v/*.md` | **Validate** steps — always 1 file: evaluate against checklist | On demand |
42
- | `checklist.md` | Validation criteriawhat "done" looks like for this workflow | Read by steps-v |
43
- | `*-template.md` | Output skeleton with `{PLACEHOLDER}` vars steps fill these in to produce the final artifact | Read by steps-c when generating output |
44
- | `tea-index.csv` | Knowledge fragment index id, name, tags, tier (core/extended/specialized), file path | Read by step-01 to decide which fragments to load |
45
- | `knowledge/*.md` | 40 reusable fragments standards, patterns, API references (e.g., `data-factories.md`, `pactjs-utils-overview.md`) | Selectively read into context based on tier + config flags |
31
+ TEA has two layers of files, and each has a specific job:
32
+
33
+ | File / Scope | What it does | When it loads |
34
+ | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
35
+ | `src/agents/bmad-tea/SKILL.md` | Murat's persona — identity, principles, critical actions, capabilities table | First — activates the TEA agent |
36
+ | `src/agents/bmad-tea/customize.toml` | Agent customization surface menu items, persistent facts, activation hooks | During agent activation |
37
+ | `src/workflows/testarch/<workflow>/SKILL.md` | Workflow entrypointresolves workflow customization, picks mode, routes to the first step | When a TEA workflow is invoked |
38
+ | `src/workflows/testarch/<workflow>/customize.toml` | Workflow customization surface activation hooks, persistent facts, optional `on_complete` behavior | During workflow activation |
39
+ | `src/workflows/testarch/<workflow>/workflow.yaml` | Machine-readable workflow metadata descriptions, defaults, tool hints, output paths | Used by installer/tooling and workflow metadata lookups |
40
+ | `instructions.md` | Workflow-specific summary and operator notes | On demand |
41
+ | `steps-c/*.md` | **Create** steps — primary execution, 5-9 sequential files | One at a time (just-in-time) |
42
+ | `steps-e/*.md` | **Edit** stepsalways 2 files: assess target, apply edit | One at a time |
43
+ | `steps-v/*.md` | **Validate** stepsalways 1 file: evaluate against checklist | On demand |
44
+ | `checklist.md` | Validation criteriawhat "done" looks like for this workflow | Read by steps-v |
45
+ | `*-template.md` | Output skeleton with `{PLACEHOLDER}` vars steps fill these in to produce the final artifact | Read by steps-c when generating output |
46
+ | `src/agents/bmad-tea/resources/tea-index.csv` | Knowledge fragment index — id, name, tags, tier (core/extended/specialized), file path | Read to decide which shared TEA fragments to load |
47
+ | `resources/knowledge/*.md` | Reusable fragments — standards, patterns, API references | Selectively read into context based on tier + config |
46
48
 
47
49
  ```mermaid
48
50
  flowchart LR
49
51
  U[User] --> A[Agent Persona]
50
- A --> W[Workflow Entry: workflow.md]
52
+ A --> W[Workflow Entry: workflow SKILL.md]
51
53
  W --> S[Step Files: steps-c / steps-e / steps-v]
52
54
  S --> K[Knowledge Fragments<br/>tea-index.csv → knowledge/*.md]
53
55
  S --> T[Templates & Checklists<br/>*-template.md, checklist.md]
@@ -59,8 +61,8 @@ flowchart LR
59
61
 
60
62
  1. **Trigger** — Direct commands are `/bmad:tea:automate` (Claude/Cursor/Windsurf) and `$bmad-tea-testarch-automate` (Codex). Load the conversational TEA menu with `$bmad-tea` in Codex. `TA` is an agent-menu trigger available only after TEA is activated; the capabilities table in `SKILL.md` maps `TA` to the `bmad-testarch-automate` skill.
61
63
  2. **Agent loads** — `SKILL.md` injects the persona (identity, principles, critical actions) into the context window.
62
- 3. **Workflow loads** — `workflow.yaml` resolves config variables and `workflow.md` presents the mode menu (Create / Edit / Validate), then routes to the first step file.
63
- 4. **Step-by-step execution** — Only the current step file is in context (just-in-time loading). Each step explicitly names the next one (`nextStepFile: './step-02-...'`). The LLM reads, executes, saves output, then loads the next step. No future steps are ever preloaded.
64
+ 3. **Workflow loads** — The workflow's `SKILL.md` becomes the entrypoint. It resolves the workflow block from `customize.toml`, loads persistent facts and config, decides the mode (Create / Edit / Validate), then routes to the first step file.
65
+ 4. **Step-by-step execution** — Only the current step file is in context (just-in-time loading). Each step explicitly names the next one with a `{skill-root}`-anchored path. The LLM reads, executes, saves output, then loads the next step. No future steps are ever preloaded.
64
66
  5. **Knowledge injection** — Step-01 reads `tea-index.csv` and selectively loads fragments by **tier** (core = always, extended = on-demand, specialized = only when relevant) and **config flags** (e.g., `tea_use_pactjs_utils`). This is deliberate context engineering: a backend project loads ~1,800 lines of fragments; a fullstack project loads ~4,500 lines. Conditional loading cuts context usage by 40-50%.
65
67
  6. **Templates** — When a step produces output (e.g., a traceability matrix or test review report), it reads the `*-template.md` file and fills in the `{PLACEHOLDER}` values with computed results. The template provides consistent structure; the step provides the content.
66
68
  7. **Subagent isolation** — Heavy workflows (e.g., `automate`) spawn parallel subagents that each run in an isolated context. Subagents write structured JSON to temp files. An aggregation step reads the JSON outputs — only the results enter the main context, not the full subagent history.
@@ -84,12 +86,12 @@ BMad workflows and Claude Code Skills solve different problems at different scal
84
86
 
85
87
  The key insight is that there is **no external runtime engine** — the LLM _is_ the engine. BMad workflows are structured markdown that the LLM follows as instructions: "read this file, execute it completely, save your output, load the next file." Skills are a single tool in a toolbox; BMad workflows are a workshop with a process manual.
86
88
 
87
- **How workflows become commands.** When you run `npx bmad-method install`, the installer generates tool-specific artifacts for your runtime (for example, Claude Code uses `.claude/commands/`, while Codex uses `.agents/skills/`). In Claude Code, `bmad-tea-testarch-automate.md` tells the LLM: "load the core workflow engine (`workflow.xml`), pass it this workflow config (`automate/workflow.yaml`), follow the instructions exactly." That launcher artifact is the bridge it triggers the workflow entry point; the multi-step engine takes over from there.
89
+ **How workflows become commands.** When you run `npx bmad-method install`, the installer generates tool-specific artifacts for your runtime (for example, Claude Code uses `.claude/commands/`, while Codex uses `.agents/skills/`). Those launchers bridge into the installed TEA agent or workflow package. Once invoked, the workflow's `SKILL.md` is the conversational entrypoint, and the step-file process takes over from there.
88
90
 
89
91
  ```text
90
92
  .claude/commands/ # Generated by installer
91
93
  ├── bmad-tea.md # /tea → loads agent persona + menu
92
- ├── bmad-tea-testarch-automate.md # /automate → loads workflow.xml + workflow.yaml
94
+ ├── bmad-tea-testarch-automate.md # /automate → invokes the automate workflow package
93
95
  ├── bmad-tea-testarch-test-design.md # /test-design → ...
94
96
  ├── bmad-bmm-create-prd.md # /create-prd → BMM workflow
95
97
  └── ... (61 commands total across all installed modules)
@@ -174,7 +176,12 @@ Workflows load only the fragments required for the current task to stay focused
174
176
  src/
175
177
  ├── module.yaml
176
178
  ├── agents/
177
- │ └── bmad-tea/ # Native skill: SKILL.md + bmad-skill-manifest.yaml
179
+ │ └── bmad-tea/
180
+ │ ├── SKILL.md
181
+ │ ├── customize.toml
182
+ │ └── resources/
183
+ │ ├── tea-index.csv
184
+ │ └── knowledge/
178
185
  ├── workflows/
179
186
  │ └── testarch/
180
187
  │ ├── bmad-teach-me-testing/
@@ -186,11 +193,6 @@ src/
186
193
  │ ├── bmad-testarch-test-design/
187
194
  │ ├── bmad-testarch-test-review/
188
195
  │ └── bmad-testarch-trace/
189
- └── agents/
190
- └── bmad-tea/
191
- └── resources/
192
- ├── tea-index.csv
193
- └── knowledge/
194
196
  ```
195
197
 
196
198
  ## Extending TEA
@@ -214,17 +216,28 @@ See `CONTRIBUTING.md` for guidelines.
214
216
 
215
217
  ## Publishing TEA to NPM
216
218
 
217
- TEA uses an automated release workflow that handles versioning, metadata sync, tagging, NPM publishing, and GitHub releases.
219
+ TEA uses an automated publish workflow modeled after the main `BMAD-METHOD` repo. It supports:
220
+
221
+ - `next` prereleases published automatically from `main`
222
+ - manual stable releases on the `latest` dist-tag
223
+ - trusted npm publishing (no `NPM_TOKEN` secret)
224
+ - metadata sync for `package.json`, `package-lock.json`, and `.claude-plugin/marketplace.json`
218
225
 
219
226
  ### Prerequisites (One-Time Setup)
220
227
 
221
- 1. **NPM Token Configuration:**
222
- - Generate NPM automation token: [npmjs.com/settings/tokens](https://www.npmjs.com/settings/your-username/tokens)
223
- - Add to GitHub Secrets: `Settings` `Secrets and variables` `Actions` → `New repository secret`
224
- - Name: `NPM_TOKEN`
225
- - Value: [your token]
228
+ 1. **npm Trusted Publishing:**
229
+ - In npm package settings for `bmad-method-test-architecture-enterprise`, configure Trusted Publishers for this GitHub repository
230
+ - Allow publishes from the `bmad-code-org/bmad-method-test-architecture-enterprise` repo and the `.github/workflows/publish.yaml` workflow
231
+ - GitHub Actions must be able to request an OIDC token (`id-token: write`), which the workflow already does
232
+
233
+ 2. **GitHub App Secrets for Stable Releases:**
234
+ - Add `RELEASE_APP_ID`
235
+ - Add `RELEASE_APP_PRIVATE_KEY`
236
+ - Install the corresponding GitHub App on this repository with contents write access
237
+ - If `main` is protected, ensure the app is allowed to push the release commit and tag
238
+ - These are used only for manual stable releases so the workflow can push the version bump commit and tag back to `main`
226
239
 
227
- 2. **Verify Package Configuration:**
240
+ 3. **Verify Package Configuration:**
228
241
  ```bash
229
242
  # Check package.json settings
230
243
  cat package.json | grep -A 3 "publishConfig"
@@ -240,71 +253,61 @@ TEA uses an automated release workflow that handles versioning, metadata sync, t
240
253
 
241
254
  #### Option 1: Using npm Scripts (Recommended)
242
255
 
243
- From your local terminal after merging to the release branch you want to publish, typically `main`:
256
+ From your local terminal after merging to `main`:
244
257
 
245
258
  ```bash
246
- # Beta release (first release or testing)
247
- npm run release:beta
248
-
249
- # Alpha release (early testing)
250
- npm run release:alpha
259
+ # Publish the next prerelease from current main
260
+ npm run release:next
251
261
 
252
- # Patch release (bug fixes)
262
+ # Publish a stable patch release
253
263
  npm run release:patch
254
264
 
255
- # Minor release (new features, backwards compatible)
265
+ # Publish a stable minor release
256
266
  npm run release:minor
257
267
 
258
- # Major release (breaking changes)
268
+ # Publish a stable major release
259
269
  npm run release:major
260
270
  ```
261
271
 
262
272
  #### Option 2: Manual Workflow Trigger
263
273
 
264
274
  1. Go to **Actions** tab in GitHub
265
- 2. Click **"Manual Release"** workflow
275
+ 2. Click **"Publish"** workflow
266
276
  3. Click **"Run workflow"**
267
277
  4. Choose the branch to release, typically `main`
268
- 5. Select version bump type (alpha, beta, patch, minor, major)
269
- 6. Click **"Run workflow"**
278
+ 5. Select channel:
279
+ - `next` for a prerelease publish
280
+ - `latest` for a stable release
281
+ 6. If using `latest`, choose the bump type (`patch`, `minor`, `major`)
282
+ 7. Click **"Run workflow"**
270
283
 
271
284
  ### What Happens Automatically
272
285
 
273
286
  The workflow performs these steps:
274
287
 
275
288
  1. ✅ **Validation**: Runs the full `npm test` suite, including schema checks, install tests, knowledge checks, linting, markdown linting, formatting, and release metadata validation
276
- 2. ✅ **Version Bump**: Updates `package.json`, `package-lock.json`, and `.claude-plugin/marketplace.json`
277
- - `beta`: 1.12.3 1.12.4-beta.0
278
- - `alpha`: 1.12.3 1.12.4-alpha.0
279
- - `patch`: 1.12.3 1.12.4
280
- - `minor`: 1.12.3 1.13.0
281
- - `major`: 1.12.3 2.0.0
282
- 3. **Commit**: Creates version bump commit
283
- 4. ✅ **Tag**: Creates git tag (e.g., v1.12.4-beta.0)
284
- 5. ✅ **Publish**: Publishes to NPM registry
285
- - Alpha → dist-tag `alpha` (`npm install bmad-method-test-architecture-enterprise@alpha`)
286
- - Beta → dist-tag `beta` (`npm install bmad-method-test-architecture-enterprise@beta`)
287
- - Stable dist-tag `latest` (`npm install bmad-method-test-architecture-enterprise`)
288
- 6. **Push**: Pushes the version bump commit back to the selected branch when permitted, and always pushes the tag
289
- 7. **GitHub Release**: Creates release with auto-generated notes
290
- 8. **Summary**: Displays installation instructions and distribution links
291
-
292
- ### Version Bump Strategy
293
-
294
- **For TEA Module:**
295
-
296
- - **Beta (`1.12.x-beta.x`)**: Release candidate testing on the next patch line
297
- - **Alpha (`1.12.x-alpha.x`)**: Early development and experimental validation
298
- - **Patch (`1.12.x`)**: Bug fixes, no breaking changes
299
- - **Minor (`1.x.0`)**: New features, backwards compatible
300
- - **Major (`x.0.0`)**: Breaking changes
289
+ 2. ✅ **Version Bump**:
290
+ - `next`: derives the next prerelease version and publishes it with dist-tag `next`
291
+ - `latest`: bumps the stable version (`patch`, `minor`, or `major`)
292
+ 3. **Metadata Sync**: Updates `.claude-plugin/marketplace.json` to match the package version before publishing
293
+ 4. **Publish**: Publishes to npm with provenance enabled
294
+ - `next``npm publish --tag next --provenance`
295
+ - `latest` `npm publish --tag latest --provenance`
296
+ 5. ✅ **Stable Release Finalization**: For `latest`, creates a version bump commit, tags it, pushes it to `main`, and creates a GitHub Release
297
+
298
+ ### Channel Strategy
299
+
300
+ - **`next`**: prerelease channel for the newest merged changes
301
+ - **`latest`**: stable channel for intentional releases
302
+ - **`patch`**: bug fixes, no breaking changes
303
+ - **`minor`**: new features, backwards compatible
304
+ - **`major`**: breaking changes
301
305
 
302
306
  **Recommended Release Path:**
303
307
 
304
- 1. `1.12.3` `1.12.4-beta.0` (first beta)
305
- 2. Test beta with early adopters
306
- 3. `1.12.4-beta.0` `1.12.4-beta.1` (fixes)
307
- 4. When stable: `1.12.4-beta.1` → `1.12.4`
308
+ 1. Merge releasable work to `main`
309
+ 2. Let `next` publish for early validation
310
+ 3. When ready, cut a stable `latest` release via `patch`, `minor`, or `major`
308
311
 
309
312
  ### Verify Publication
310
313
 
@@ -312,6 +315,7 @@ The workflow performs these steps:
312
315
 
313
316
  ```bash
314
317
  npm view bmad-method-test-architecture-enterprise
318
+ npm view bmad-method-test-architecture-enterprise dist-tags
315
319
  ```
316
320
 
317
321
  **Install TEA:**
@@ -335,24 +339,31 @@ If you need to unpublish a version:
335
339
 
336
340
  ```bash
337
341
  # Unpublish specific version (within 72 hours)
338
- npm unpublish bmad-method-test-architecture-enterprise@1.12.4-beta.0
342
+ npm unpublish bmad-method-test-architecture-enterprise@1.13.2-next.0
339
343
 
340
344
  # Deprecate version (preferred for older releases)
341
- npm deprecate bmad-method-test-architecture-enterprise@1.12.4-beta.0 "Use version X.Y.Z instead"
345
+ npm deprecate bmad-method-test-architecture-enterprise@1.13.2-next.0 "Use version X.Y.Z instead"
342
346
  ```
343
347
 
344
348
  ### Troubleshooting
345
349
 
346
- **"NPM_TOKEN not found":**
350
+ **Trusted publishing failed:**
347
351
 
348
- - Verify secret is set: GitHub repo Settings Secrets and variables → Actions
349
- - Secret name must be exactly: `NPM_TOKEN`
352
+ - Verify npm Trusted Publishing is configured for this repository and workflow
353
+ - Verify the workflow has `id-token: write`
354
+ - Confirm the publish is running from the canonical repository, not a fork
350
355
 
351
356
  **"Package already exists":**
352
357
 
353
358
  - Check if package name is already taken on NPM
354
359
  - Update `name` in `package.json` if needed
355
360
 
361
+ **"Version push failed":**
362
+
363
+ - Verify `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` are configured
364
+ - Verify the GitHub App is installed on this repository with contents write access
365
+ - If branch protection is enabled on `main`, verify the app is allowed to push the release commit and tag
366
+
356
367
  **"Tests failed":**
357
368
 
358
369
  - Fix failing tests before release
@@ -360,9 +371,9 @@ npm deprecate bmad-method-test-architecture-enterprise@1.12.4-beta.0 "Use versio
360
371
 
361
372
  **"Git push failed (protected branch)":**
362
373
 
363
- - This is expected for a protected release branch
364
- - The tag and version bump are still created
365
- - You may need to manually merge the version bump commit
374
+ - This is not expected once the release GitHub App is configured correctly
375
+ - Verify branch protection allows the app to push the release commit and tag
376
+ - If needed, create the GitHub Release manually after resolving the app permissions
366
377
 
367
378
  ### Release Checklist
368
379
 
@@ -373,7 +384,8 @@ Before releasing:
373
384
  - [ ] CHANGELOG.md updated
374
385
  - [ ] No uncommitted changes
375
386
  - [ ] On `main` branch
376
- - [ ] NPM token configured in GitHub Secrets
387
+ - [ ] npm Trusted Publishing configured
388
+ - [ ] `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` configured
377
389
  - [ ] Package name available on NPM
378
390
 
379
391
  After releasing:
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.13.0",
4
+ "version": "1.14.0",
5
5
  "description": "Master Test Architect for quality strategy, test automation, and release gates",
6
6
  "keywords": [
7
7
  "bmad",
@@ -33,11 +33,10 @@
33
33
  "lint:fix": "eslint . --fix",
34
34
  "lint:md": "markdownlint-cli2 '**/*.md'",
35
35
  "prepare": "command -v husky >/dev/null 2>&1 && husky || exit 0",
36
- "release:alpha": "gh workflow run manual-release.yaml -f version_bump=alpha",
37
- "release:beta": "gh workflow run manual-release.yaml -f version_bump=beta",
38
- "release:major": "gh workflow run manual-release.yaml -f version_bump=major",
39
- "release:minor": "gh workflow run manual-release.yaml -f version_bump=minor",
40
- "release:patch": "gh workflow run manual-release.yaml -f version_bump=patch",
36
+ "release:major": "gh workflow run publish.yaml -f channel=latest -f bump=major",
37
+ "release:minor": "gh workflow run publish.yaml -f channel=latest -f bump=minor",
38
+ "release:next": "gh workflow run publish.yaml -f channel=next",
39
+ "release:patch": "gh workflow run publish.yaml -f channel=latest -f bump=patch",
41
40
  "test": "npm run test:schemas && npm run test:install && npm run test:knowledge && npm run test:release-metadata && npm run test:tea-workflow-descriptions && npm run validate:schemas && npm run lint && npm run lint:md && npm run format:check",
42
41
  "test:coverage": "c8 npm test",
43
42
  "test:install": "node test/test-installation-components.js",
@@ -167,7 +167,8 @@ describe('User API Contract', () => {
167
167
  ```json
168
168
  {
169
169
  "scripts": {
170
- "test:pact:consumer": "vitest run --config vitest.config.pact.ts",
170
+ "test:pact:consumer": "./scripts/check-pact-determinism.sh 'npm run test:pact:consumer:run' 3 ./pacts",
171
+ "test:pact:consumer:run": "vitest run --config vitest.config.pact.ts",
171
172
  "publish:pact": ". ./scripts/env-setup.sh && ./scripts/publish-pact.sh"
172
173
  }
173
174
  }
@@ -1024,7 +1025,7 @@ Before implementing contract testing, verify:
1024
1025
  ## Integration Points
1025
1026
 
1026
1027
  - Used in workflows: `*automate` (integration test generation), `*ci` (contract CI setup)
1027
- - Related fragments: `test-levels-framework.md`, `ci-burn-in.md`, `pact-consumer-framework-setup.md`
1028
+ - Related fragments: `test-levels-framework.md`, `ci-burn-in.md`, `pact-consumer-framework-setup.md` (consumer vitest `fileParallelism: false` + `pool: 'forks'` + `singleFork: true`), `pactjs-utils-consumer-helpers.md` (PactV4 one-interaction-per-`it()` rule), `pactjs-utils-provider-verifier.md` (provider vitest `pool: 'forks'` + `singleFork: true` — same rule as consumer), `pact-broker-webhooks.md` (PactFlow → GitHub webhook auth, PAT rotation, staleness monitoring)
1028
1029
  - Tools: Pact.js, Pact Broker (Pactflow or self-hosted), Pact CLI
1029
1030
 
1030
1031
  ---
@@ -1033,18 +1034,34 @@ Before implementing contract testing, verify:
1033
1034
 
1034
1035
  When `tea_use_pactjs_utils` is enabled, the following utilities replace manual boilerplate:
1035
1036
 
1036
- | Manual Pattern (raw Pact.js) | Pact.js Utils Equivalent | Benefit |
1037
- | -------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
1038
- | Manual `JsonMap` casting for `.given()` params | `createProviderState({ name, params })` | Type-safe, auto-conversion of Date/null/nested objects |
1039
- | Repeated builder callbacks for query/header/body | `setJsonContent({ query, headers, body })` | Reusable callback for `.withRequest(...)` and `.willRespondWith(...)` |
1040
- | Inline body lambda `(builder) => builder.jsonBody(body)` | `setJsonBody(body)` | Body-only shorthand for cleaner response builders |
1041
- | 30+ lines of `VerifierOptions` assembly | `buildVerifierOptions({ provider, port, includeMainAndDeployed, stateHandlers })` | One-call setup, env-aware, flow auto-detection |
1042
- | Manual broker URL + selector logic from env vars | `handlePactBrokerUrlAndSelectors({ ..., options })` | Mutates options in-place with broker URL and selectors |
1043
- | DIY Express middleware for auth injection | `createRequestFilter({ tokenGenerator })` | Bearer prefix contract prevents double-prefix bugs |
1044
- | Manual CI branch/tag extraction | `getProviderVersionTags()` | CI-aware (GitHub Actions, GitLab CI, etc.) |
1045
- | Message verifier config assembly | `buildMessageVerifierOptions({ provider, messageProviders })` | Same one-call pattern for Kafka/async contracts |
1046
- | Inline no-op filter `(req, res, next) => next()` | `noOpRequestFilter` | Pre-built pass-through for no-auth providers |
1047
-
1048
- See the `pactjs-utils-*.md` knowledge fragments for complete examples and anti-patterns.
1037
+ | Manual Pattern (raw Pact.js) | Pact.js Utils Equivalent | Benefit |
1038
+ | -------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
1039
+ | Manual `JsonMap` casting for `.given()` params | `createProviderState({ name, params })` | Type-safe, auto-conversion of Date/null/nested objects |
1040
+ | Repeated builder callbacks for query/header/body | `setJsonContent({ query, headers, body })` | Reusable callback for `.withRequest(...)` and `.willRespondWith(...)` |
1041
+ | Inline body lambda `(builder) => builder.jsonBody(body)` | `setJsonBody(body)` | Body-only shorthand for cleaner response builders |
1042
+ | 30+ lines of `VerifierOptions` assembly | `buildVerifierOptions({ provider, port, includeMainAndDeployed, stateHandlers })` | One-call setup, env-aware, flow auto-detection |
1043
+ | Manual broker URL + selector logic from env vars | `handlePactBrokerUrlAndSelectors({ ..., options })` | Mutates options in-place with broker URL and selectors |
1044
+ | DIY Express middleware for auth injection | `createRequestFilter({ tokenGenerator })` | Bearer prefix contract prevents double-prefix bugs |
1045
+ | Manual CI branch/tag extraction | `getProviderVersionTags()` | CI-aware (GitHub Actions, GitLab CI, etc.) |
1046
+ | Message verifier config assembly | `buildMessageVerifierOptions({ provider, messageProviders })` | Same one-call pattern for Kafka/async contracts |
1047
+ | Inline no-op filter `(req, res, next) => next()` | `noOpRequestFilter` | Pre-built pass-through for no-auth providers |
1048
+ | Hand-written matcher helper duplicating a Zod/TS type | `zodToPactMatchers(ConsumerMovieSchema, example)` | Single source of truth for response shape; consumer-curated scope keeps contracts lean and consumer-driven |
1049
+
1050
+ See the `pactjs-utils-*.md` knowledge fragments for complete examples and anti-patterns (`pactjs-utils-zod-to-pact.md` covers the consumer-curated schema pattern).
1051
+
1052
+ ### PactV4 Determinism & FFI Safety (Mandatory)
1053
+
1054
+ Four rules that together prevent both (a) non-deterministic pact generation failures that cause `Cannot change pact content for already published pact` errors at PactFlow publish, and (b) "request was expected but not received" flakes observed on Linux CI once a consumer+provider pair has more than one `.pacttest.ts` file:
1055
+
1056
+ 1. **Consumer Vitest `fileParallelism: false`** in `vitest.config.pact.ts` — prevents parallel workers from racing on the shared pact JSON. See `pact-consumer-framework-setup.md` Example 2.
1057
+ 2. **Consumer Vitest `pool: 'forks'` + `poolOptions.forks.singleFork: true`** in `vitest.config.pact.ts` — same config as the provider side (`pactjs-utils-provider-verifier.md` Example 7). Best current understanding: the `@pact-foundation/pact` napi-rs binding is not robust across Vitest worker threads sharing a process; serialization alone (via `fileParallelism: false`) is insufficient on the default threads pool in Vitest v1. Forks + `singleFork: true` runs every pact file in one subprocess with a coherent FFI handle and eliminated a reproducible Linux-CI flake on two repos (`pactjs-utils`, `seon-mcp-server`). Single-file consumer suites have not been observed to flake; this rule is still recommended as a future-proof. See `pact-consumer-framework-setup.md` Example 2.
1058
+ 3. **One `addInteraction()` per `it()` block** — see `pactjs-utils-consumer-helpers.md` Example 6.
1059
+ 4. **Determinism gate** runs the consumer suite N times and fails on byte-different pact JSON before publish — see `pact-consumer-framework-setup.md` Example 10 (`scripts/check-pact-determinism.sh`).
1060
+
1061
+ Provider suites require the same `pool: 'forks'` + `singleFork: true` combination — see `pactjs-utils-provider-verifier.md` Example 7.
1062
+
1063
+ ### Webhook Auth & Staleness
1064
+
1065
+ When `can-i-deploy` in a consumer repo times out with `There is no verified pact between <consumer> and the version of <provider> currently in <env>` — check the provider's PactFlow webhook. Silent failures from an expired/revoked GitHub PAT are the most common non-code cause of this symptom. See `pact-broker-webhooks.md` for the dedicated-machine-user pattern, classic-PAT-with-`repo`-scope rationale, rotation runbook, and staleness monitoring options.
1049
1066
 
1050
1067
  _Source: Pact consumer/provider sample repos, Murat contract testing blog, Pact official documentation, @seontechnologies/pactjs-utils library_