universal-dev-standards 5.5.0 → 5.7.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 (123) hide show
  1. package/bundled/ai/options/testing/integration-testing.ai.yaml +2 -2
  2. package/bundled/ai/options/testing/unit-testing.ai.yaml +2 -2
  3. package/bundled/ai/standards/agent-communication-protocol.ai.yaml +8 -9
  4. package/bundled/ai/standards/agent-dispatch.ai.yaml +8 -9
  5. package/bundled/ai/standards/branch-completion.ai.yaml +8 -10
  6. package/bundled/ai/standards/browser-compatibility-standards.ai.yaml +63 -0
  7. package/bundled/ai/standards/capability-declaration.ai.yaml +4 -4
  8. package/bundled/ai/standards/change-batching-standards.ai.yaml +8 -10
  9. package/bundled/ai/standards/circuit-breaker.ai.yaml +7 -7
  10. package/bundled/ai/standards/contract-testing-standards.ai.yaml +62 -0
  11. package/bundled/ai/standards/cross-flow-regression.ai.yaml +61 -0
  12. package/bundled/ai/standards/disaster-recovery-drill.ai.yaml +1 -1
  13. package/bundled/ai/standards/dual-phase-output.ai.yaml +3 -3
  14. package/bundled/ai/standards/execution-history.ai.yaml +8 -10
  15. package/bundled/ai/standards/failure-source-taxonomy.ai.yaml +8 -10
  16. package/bundled/ai/standards/full-coverage-testing.ai.yaml +192 -0
  17. package/bundled/ai/standards/git-worktree.ai.yaml +1 -1
  18. package/bundled/ai/standards/governance-layer.ai.yaml +114 -0
  19. package/bundled/ai/standards/mock-boundary.ai.yaml +1 -1
  20. package/bundled/ai/standards/model-selection.ai.yaml +1 -1
  21. package/bundled/ai/standards/packaging-standards.ai.yaml +8 -8
  22. package/bundled/ai/standards/pipeline-integration-standards.ai.yaml +8 -9
  23. package/bundled/ai/standards/pipeline-security-gates.ai.yaml +4 -0
  24. package/bundled/ai/standards/recovery-recipe-registry.ai.yaml +6 -10
  25. package/bundled/ai/standards/release-readiness-gate.ai.yaml +77 -0
  26. package/bundled/ai/standards/security-decision.ai.yaml +3 -3
  27. package/bundled/ai/standards/server-ops-security.ai.yaml +1 -1
  28. package/bundled/ai/standards/standard-admission-criteria.ai.yaml +1 -1
  29. package/bundled/ai/standards/standard-lifecycle-management.ai.yaml +1 -1
  30. package/bundled/ai/standards/supply-chain-attestation.ai.yaml +1 -1
  31. package/bundled/ai/standards/testing.ai.yaml +20 -13
  32. package/bundled/ai/standards/token-budget.ai.yaml +3 -3
  33. package/bundled/ai/standards/workflow-enforcement.ai.yaml +8 -11
  34. package/bundled/ai/standards/workflow-state-protocol.ai.yaml +8 -10
  35. package/bundled/core/accessibility-standards.md +58 -0
  36. package/bundled/core/adversarial-test.md +1 -1
  37. package/bundled/core/agent-behavior-discipline.md +4 -4
  38. package/bundled/core/agent-communication-protocol.md +5 -5
  39. package/bundled/core/branch-completion.md +4 -0
  40. package/bundled/core/browser-compatibility-standards.md +220 -0
  41. package/bundled/core/checkin-standards.md +1 -0
  42. package/bundled/core/circuit-breaker.md +4 -4
  43. package/bundled/core/container-security.md +8 -8
  44. package/bundled/core/contract-testing-standards.md +182 -0
  45. package/bundled/core/cross-flow-regression.md +190 -0
  46. package/bundled/core/disaster-recovery-drill.md +3 -3
  47. package/bundled/core/dual-phase-output.md +1 -1
  48. package/bundled/core/failure-source-taxonomy.md +3 -3
  49. package/bundled/core/flow-based-testing.md +135 -2
  50. package/bundled/core/full-coverage-testing.md +183 -0
  51. package/bundled/core/git-worktree.md +1 -1
  52. package/bundled/core/governance-layer.md +151 -0
  53. package/bundled/core/llm-output-validation.md +2 -2
  54. package/bundled/core/mock-boundary.md +1 -1
  55. package/bundled/core/packaging-standards.md +14 -14
  56. package/bundled/core/performance-standards.md +65 -0
  57. package/bundled/core/policy-as-code-testing.md +9 -9
  58. package/bundled/core/recovery-recipe-registry.md +2 -2
  59. package/bundled/core/release-quality-manifest.md +58 -12
  60. package/bundled/core/release-readiness-gate.md +184 -0
  61. package/bundled/core/sast-advanced.md +5 -5
  62. package/bundled/core/secure-op.md +5 -5
  63. package/bundled/core/security-decision.md +1 -1
  64. package/bundled/core/server-ops-security.md +15 -15
  65. package/bundled/core/smoke-test.md +1 -1
  66. package/bundled/core/standard-admission-criteria.md +1 -1
  67. package/bundled/core/standard-lifecycle-management.md +1 -1
  68. package/bundled/core/supply-chain-attestation.md +4 -4
  69. package/bundled/core/token-budget.md +3 -3
  70. package/bundled/locales/zh-CN/CHANGELOG.md +51 -4
  71. package/bundled/locales/zh-CN/README.md +11 -27
  72. package/bundled/locales/zh-CN/core/agent-communication-protocol.md +5 -5
  73. package/bundled/locales/zh-CN/core/circuit-breaker.md +1 -1
  74. package/bundled/locales/zh-CN/core/git-worktree.md +1 -1
  75. package/bundled/locales/zh-CN/core/packaging-standards.md +14 -14
  76. package/bundled/locales/zh-CN/core/recovery-recipe-registry.md +6 -9
  77. package/bundled/locales/zh-CN/core/standard-admission-criteria.md +1 -1
  78. package/bundled/locales/zh-CN/core/standard-lifecycle-management.md +1 -1
  79. package/bundled/locales/zh-CN/core/token-budget.md +1 -1
  80. package/bundled/locales/zh-TW/CHANGELOG.md +51 -4
  81. package/bundled/locales/zh-TW/README.md +11 -27
  82. package/bundled/locales/zh-TW/core/agent-communication-protocol.md +5 -5
  83. package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +11 -0
  84. package/bundled/locales/zh-TW/core/capability-declaration.md +4 -4
  85. package/bundled/locales/zh-TW/core/circuit-breaker.md +7 -7
  86. package/bundled/locales/zh-TW/core/contract-testing-standards.md +11 -0
  87. package/bundled/locales/zh-TW/core/cross-flow-regression.md +11 -0
  88. package/bundled/locales/zh-TW/core/dual-phase-output.md +3 -3
  89. package/bundled/locales/zh-TW/core/failure-source-taxonomy.md +7 -9
  90. package/bundled/locales/zh-TW/core/governance-layer.md +159 -0
  91. package/bundled/locales/zh-TW/core/packaging-standards.md +14 -14
  92. package/bundled/locales/zh-TW/core/recovery-recipe-registry.md +6 -9
  93. package/bundled/locales/zh-TW/core/release-readiness-gate.md +11 -0
  94. package/bundled/locales/zh-TW/core/security-decision.md +3 -3
  95. package/bundled/locales/zh-TW/core/standard-admission-criteria.md +1 -1
  96. package/bundled/locales/zh-TW/core/standard-lifecycle-management.md +1 -1
  97. package/bundled/locales/zh-TW/core/token-budget.md +3 -3
  98. package/bundled/skills/README.md +23 -0
  99. package/bundled/skills/atdd-assistant/SKILL.md +4 -5
  100. package/bundled/skills/bdd-assistant/SKILL.md +4 -5
  101. package/bundled/skills/checkin-assistant/SKILL.md +4 -6
  102. package/bundled/skills/code-review-assistant/SKILL.md +4 -5
  103. package/bundled/skills/commands/observability.md +42 -0
  104. package/bundled/skills/commands/runbook.md +44 -0
  105. package/bundled/skills/commands/slo.md +45 -0
  106. package/bundled/skills/journey-test-assistant/SKILL.md +1 -1
  107. package/bundled/skills/orchestrate/SKILL.md +1 -1
  108. package/bundled/skills/plan/SKILL.md +1 -1
  109. package/bundled/skills/pr-automation-assistant/SKILL.md +4 -5
  110. package/bundled/skills/push/SKILL.md +1 -1
  111. package/bundled/skills/spec-driven-dev/SKILL.md +4 -5
  112. package/bundled/skills/sweep/SKILL.md +3 -3
  113. package/bundled/skills/tdd-assistant/SKILL.md +4 -5
  114. package/package.json +6 -6
  115. package/src/commands/check.js +43 -0
  116. package/src/commands/flow.js +7 -5
  117. package/src/commands/init.js +2 -1
  118. package/src/commands/start.js +7 -6
  119. package/src/commands/sweep.js +7 -6
  120. package/src/commands/update.js +10 -0
  121. package/src/commands/workflow.js +7 -6
  122. package/src/core/agent-communication-protocol.js +10 -3
  123. package/standards-registry.json +107 -51
@@ -0,0 +1,182 @@
1
+ # Contract Testing Standards
2
+
3
+ > **Language**: English | [繁體中文](../locales/zh-TW/core/contract-testing-standards.md)
4
+
5
+ **Version**: 1.0.0
6
+ **Last Updated**: 2026-05-05
7
+ **Applicability**: Projects with API consumers (service-to-service, frontend-to-backend, public API)
8
+ **Scope**: universal
9
+ **Industry Standards**: Consumer-Driven Contract Testing (CDCT), Pact Specification v3
10
+ **References**: [pact.io](https://docs.pact.io/), [Spring Cloud Contract](https://spring.io/projects/spring-cloud-contract)
11
+
12
+ ---
13
+
14
+ ## Purpose
15
+
16
+ Contract testing verifies that a provider (API server) and its consumers (clients) agree on the exact interface — request format, response schema, and status codes — without requiring both sides to be deployed simultaneously.
17
+
18
+ Without contract testing:
19
+ - Provider changes silently break consumers in production
20
+ - Integration tests between services require full environments
21
+ - API versioning decisions are made without evidence of actual usage
22
+
23
+ This standard formalizes consumer-driven contract testing as a **release gate** (Dimension 4 in `release-readiness-gate.md`, Tier-3).
24
+
25
+ ---
26
+
27
+ ## Consumer-Driven Contract Flow
28
+
29
+ ```
30
+ Consumer writes interaction expectations
31
+
32
+ Consumer publishes contract to Pact Broker
33
+
34
+ Provider CI fetches consumer contracts
35
+
36
+ Provider verifies it can fulfill each interaction
37
+
38
+ Pact Broker records: can-i-deploy result
39
+
40
+ Release gate: ALL consumer contracts GREEN before provider deploy
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Contract Scope
46
+
47
+ A contract covers:
48
+
49
+ | Element | Must Specify | Notes |
50
+ |---------|-------------|-------|
51
+ | Request method | Yes | GET / POST / PUT / PATCH / DELETE |
52
+ | Request path | Yes | Including path params |
53
+ | Request headers | Required only | Do not over-specify optional headers |
54
+ | Request body schema | Yes (for write operations) | Schema-level, not literal values |
55
+ | Response status | Yes | All expected status codes |
56
+ | Response body schema | Yes | Schema-level; use matchers not literals |
57
+ | Response headers | Required only | e.g., `Content-Type` |
58
+
59
+ **Under-specification is preferred over over-specification.** Only assert what the consumer actually uses.
60
+
61
+ ---
62
+
63
+ ## Backward Compatibility Window
64
+
65
+ | Release Type | Compatibility Requirement |
66
+ |-------------|--------------------------|
67
+ | Patch | 100% backward compatible; no contract changes expected |
68
+ | Minor | N-1 consumer contract version must still pass |
69
+ | Major | Deprecation period required; consumers notified; old contract archived |
70
+
71
+ **Breaking change policy**: A provider MAY NOT deploy if any active consumer contract is red. Breaking changes require:
72
+ 1. New provider version with additive-only changes
73
+ 2. Consumer migration to new version
74
+ 3. Old contract explicitly deprecated and archived
75
+
76
+ ---
77
+
78
+ ## Release Gate Criteria
79
+
80
+ | Criterion | Hard Minimum | Warn Band |
81
+ |-----------|-------------|-----------|
82
+ | All active consumer contracts | 100% green | — (binary: all or nothing) |
83
+ | N-1 backward compatibility | 100% green | — |
84
+ | Deprecated contract cleanup | Old contracts archived within 30 days | > 30 days = WARN |
85
+
86
+ The `can-i-deploy` command in the Pact Broker encapsulates this gate:
87
+
88
+ ```bash
89
+ pact-broker can-i-deploy \
90
+ --pacticipant <provider-service> \
91
+ --version <version> \
92
+ --to-environment production
93
+ ```
94
+
95
+ Exit code 0 = PASS; non-zero = FAIL (blocks release).
96
+
97
+ ---
98
+
99
+ ## Implementation Guidelines
100
+
101
+ ### Consumer Side
102
+
103
+ ```typescript
104
+ // Pact consumer test (TypeScript example)
105
+ const interaction = {
106
+ state: "user 42 exists",
107
+ uponReceiving: "a request for user 42",
108
+ withRequest: {
109
+ method: "GET",
110
+ path: "/users/42",
111
+ headers: { Accept: "application/json" },
112
+ },
113
+ willRespondWith: {
114
+ status: 200,
115
+ headers: { "Content-Type": "application/json" },
116
+ body: like({ // schema matcher, not literal
117
+ id: integer(),
118
+ name: string(),
119
+ email: email(),
120
+ }),
121
+ },
122
+ };
123
+ ```
124
+
125
+ ### Provider Side
126
+
127
+ ```bash
128
+ # Provider verification in CI
129
+ PACT_BROKER_BASE_URL=https://pact-broker.internal \
130
+ PACT_PROVIDER_VERSION=$GIT_SHA \
131
+ npm run test:pact:provider
132
+ ```
133
+
134
+ ### Pact Broker Tags
135
+
136
+ | Tag | Meaning |
137
+ |-----|---------|
138
+ | `main` | Latest from main branch |
139
+ | `production` | Currently deployed to production |
140
+ | `<feature-branch>` | Feature branch contracts (transient) |
141
+
142
+ ---
143
+
144
+ ## Anti-Patterns
145
+
146
+ - **Testing the full API surface** — test only what consumers actually consume; over-specification causes unnecessary contract breaks
147
+ - **Literal value matching** — use schema matchers (`like()`, `eachLike()`, `integer()`) not exact values; contracts should tolerate realistic data variation
148
+ - **Skipping provider verification** — publishing a consumer contract without provider verification means the contract has no enforcement value
149
+ - **Not running `can-i-deploy`** — checking individual contract status is insufficient; `can-i-deploy` evaluates the entire deployment matrix
150
+
151
+ ---
152
+
153
+ ## Relationship to Other Standards
154
+
155
+ - **`api-design-standards.md`** — contract testing enforces backwards-compat guarantees stated in API design
156
+ - **`release-readiness-gate.md`** — Dimension 4 (Tier-3: applies when API consumers exist)
157
+ - **`integration-testing.md`** — contract tests complement but do not replace integration tests
158
+ - **`versioning.md`** — semantic versioning interacts with backward compatibility window above
159
+
160
+ ---
161
+
162
+ ## See Also
163
+
164
+ - [Pact Documentation](https://docs.pact.io/)
165
+ - [Can I Deploy](https://docs.pact.io/pact_broker/can_i_deploy)
166
+ - [Consumer-Driven Contracts](https://martinfowler.com/articles/consumerDrivenContracts.html) — Martin Fowler
167
+
168
+ ---
169
+
170
+ ## Version History
171
+
172
+ | Version | Date | Changes |
173
+ |---------|------|---------|
174
+ | 1.0.0 | 2026-05-05 | Initial release: consumer-driven contract flow, backward compat window, release gate criteria |
175
+
176
+ ---
177
+
178
+ ## License
179
+
180
+ This standard is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
181
+
182
+ **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
@@ -0,0 +1,190 @@
1
+ # Cross-Flow Regression
2
+
3
+ > **Language**: English | [繁體中文](../locales/zh-TW/core/cross-flow-regression.md)
4
+
5
+ **Version**: 1.0.0
6
+ **Last Updated**: 2026-05-05
7
+ **Applicability**: All software projects with multiple user flows or business processes
8
+ **Scope**: universal
9
+ **Industry Standards**: ISTQB Advanced Test Analyst (Regression Test Strategy)
10
+ **References**: `core/flow-based-testing.md`, `core/testing-standards.md`
11
+
12
+ ---
13
+
14
+ ## Purpose
15
+
16
+ This standard defines cross-flow regression testing — verifying that changes to one flow do not break other flows, and that **combinations of flows** behave correctly when executed in sequence.
17
+
18
+ ### Boundary with `flow-based-testing.md`
19
+
20
+ | Standard | Scope | What It Catches |
21
+ |----------|-------|----------------|
22
+ | `flow-based-testing.md` (Multi-Gate Model) | Single flow: Decision Points, Terminal States, Decision Table | Intra-flow branch coverage gaps |
23
+ | **This standard** | Multiple flows: interaction, shared state, sequential composition | Inter-flow contamination, accumulated-state bugs, regression across flows |
24
+
25
+ These are complementary, not overlapping. A project needs both.
26
+
27
+ ---
28
+
29
+ ## Why Cross-Flow Bugs Are Distinct
30
+
31
+ Intra-flow testing (Multi-Gate) proves that "Login" handles all 7 terminal states. But it cannot detect:
32
+
33
+ - **State contamination**: after a failed "Create Order" (FAIL_QUOTA_EXCEEDED), the quota counter is corrupted → next "Create Order" attempt fails even after quota resets
34
+ - **Shared resource conflicts**: "Report Generation" and "Data Export" running concurrently corrupt a shared temp directory
35
+ - **Sequential dependency**: "Cancel Subscription" succeeds, but the subsequent "Reactivate" flow assumes subscription still exists → NullPointerException
36
+
37
+ ---
38
+
39
+ ## Cross-Flow Test Suite Definition
40
+
41
+ ### Tier-1: Critical User Journeys (CUJ)
42
+
43
+ Critical User Journeys are end-to-end sequences spanning ≥ 2 flows that represent core business value paths. Every release must include a CUJ regression suite.
44
+
45
+ **CUJ identification**:
46
+ 1. List all flows (from requirement-template §2.4)
47
+ 2. Identify pairs/triples that share state or are commonly executed in sequence
48
+ 3. Tag business-critical combinations (purchase, onboarding, authentication + downstream)
49
+
50
+ **CUJ Coverage Requirement**:
51
+
52
+ | Metric | Tier-2 Threshold (default) | Tier-1 Critical Path |
53
+ |--------|--------------------------|---------------------|
54
+ | CUJ pass rate | ≥ 95% | 100% |
55
+ | Business-critical flow combos | 100% | 100% |
56
+
57
+ ### Tier-2: Regression on Flow Change
58
+
59
+ When any flow's §2.4 (Decision Points, Terminal States) is modified, the full CUJ suite must re-run — not just the tests for the changed flow. The triggering logic:
60
+
61
+ ```bash
62
+ # In CI: detect flow spec changes
63
+ changed_flows=$(git diff origin/main... --name-only | grep -E "requirement-template|SPEC.*\.md")
64
+ if [ -n "$changed_flows" ]; then
65
+ npm run test:cross-flow-regression
66
+ fi
67
+ ```
68
+
69
+ ### Tier-3: Concurrency and Shared Resource Tests
70
+
71
+ For projects with concurrent user operations:
72
+ - Two users executing the same flow simultaneously
73
+ - Flow A and Flow B sharing a write resource
74
+ - Long-running Flow (async) interacting with a short Flow result
75
+
76
+ ---
77
+
78
+ ## Test Structure
79
+
80
+ Cross-flow regression tests use **sequential state threading** across flows (extending the `ctx` pattern from `flow-based-testing.md`):
81
+
82
+ ```typescript
83
+ describe("CUJ: Register → Verify Email → Create First Order", () => {
84
+ const ctx: {
85
+ userId?: string
86
+ token?: string
87
+ orderId?: string
88
+ } = {}
89
+
90
+ // Flow 1: Register
91
+ it("Flow-1 Step 1: Register new user", async () => {
92
+ ctx.userId = await registerUser({ email: testEmail, plan: "trial" })
93
+ expect(ctx.userId).toBeDefined()
94
+ })
95
+
96
+ // Flow 2: Email Verification (depends on Flow 1 output)
97
+ it("Flow-2 Step 1: Verify email token", async () => {
98
+ const token = await getEmailToken(ctx.userId!)
99
+ ctx.token = await verifyEmail(token)
100
+ expect(ctx.token).toBeDefined()
101
+ })
102
+
103
+ // Flow 3: Create Order (depends on Flow 2 auth token)
104
+ it("Flow-3 Step 1: Create first order", async () => {
105
+ ctx.orderId = await createOrder(ctx.token!, orderPayload)
106
+ expect(ctx.orderId).toMatch(/^ord-/)
107
+ })
108
+
109
+ // Cross-flow verification: order state reflects trial plan limits
110
+ it("Cross-flow: Trial plan quota enforced on first order", async () => {
111
+ const order = await getOrder(ctx.token!, ctx.orderId!)
112
+ expect(order.quota_applied).toBe("trial")
113
+ })
114
+ })
115
+ ```
116
+
117
+ ### Cross-Flow Failure Isolation
118
+
119
+ When a cross-flow test fails, the failure message must identify **which flow** introduced the state corruption:
120
+
121
+ ```typescript
122
+ // BAD: generic assertion
123
+ expect(result).toBe("success")
124
+
125
+ // GOOD: includes flow context
126
+ expect(result).toBe("success") // Flow-3 depends on Flow-2 token being valid
127
+ // If this fails, check Flow-2 email verification output
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Release Gate Integration
133
+
134
+ Cross-flow regression is **Dimension 6** in `release-readiness-gate.md` (Tier-2).
135
+
136
+ ### Trigger Conditions
137
+
138
+ | Trigger | Scope |
139
+ |---------|-------|
140
+ | Every release candidate | Full CUJ suite |
141
+ | PR modifying any flow §2.4 | Full CUJ suite (pre-merge) |
142
+ | Post-deploy to staging | Smoke subset of CUJ |
143
+ | Post-deploy to production | Critical path CUJ only (canary) |
144
+
145
+ ### Evidence for Sign-off
146
+
147
+ ```
148
+ | 6 | Cross-flow Regression | PASS | CUJ suite: 47/47 passed; 0 flow-interaction failures | QA Lead |
149
+ ```
150
+
151
+ ### WARN Threshold
152
+
153
+ - ≥ 95% CUJ pass rate but < 100% → WARN with specific failed CUJ documented and root-caused
154
+ - < 95% CUJ pass rate → FAIL (release blocked)
155
+ - Business-critical combo fails → FAIL regardless of overall rate
156
+
157
+ ---
158
+
159
+ ## Anti-Patterns
160
+
161
+ - **Running cross-flow tests only when CI is slow** — they must run on every release candidate by definition
162
+ - **Testing each flow in isolation and calling it "regression"** — flow isolation is covered by Multi-Gate; cross-flow must have inter-flow state dependencies
163
+ - **Reusing the same `ctx` object across unrelated `describe` blocks** — each CUJ needs a clean, isolated `ctx`; contamination between CUJs masks bugs
164
+ - **No flow attribution in failure messages** — cross-flow failures are hard to debug; always indicate which upstream flow produced the corrupted state
165
+ - **Treating CUJ failures as flaky** — cross-flow state bugs are deterministic; "flaky" cross-flow tests are almost always a symptom of shared state corruption
166
+
167
+ ---
168
+
169
+ ## Relationship to Other Standards
170
+
171
+ - **`flow-based-testing.md`** — intra-flow gate (prerequisite for cross-flow)
172
+ - **`testing-standards.md`** — regression layer in the testing pyramid
173
+ - **`release-readiness-gate.md`** — Dimension 6 (Tier-2)
174
+ - **`e2e-testing.md`** — CUJ tests typically run at E2E or System Test level
175
+
176
+ ---
177
+
178
+ ## Version History
179
+
180
+ | Version | Date | Changes |
181
+ |---------|------|---------|
182
+ | 1.0.0 | 2026-05-05 | Initial release: CUJ definition, sequential state threading, release gate criteria, Tier-1/2/3 classification |
183
+
184
+ ---
185
+
186
+ ## License
187
+
188
+ This standard is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
189
+
190
+ **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
@@ -8,7 +8,7 @@ An untested DR plan is a false sense of security. Teams that have never executed
8
8
 
9
9
  Define these before writing the runbook:
10
10
 
11
- | Metric | Definition | VibeOps Commercial Target |
11
+ | Metric | Definition | Commercial-grade Target |
12
12
  |--------|-----------|--------------------------|
13
13
  | RTO (Recovery Time Objective) | Max acceptable downtime | < 1 hour |
14
14
  | RPO (Recovery Point Objective) | Max acceptable data loss | < 24 hours (daily backup) |
@@ -20,9 +20,9 @@ Define these before writing the runbook:
20
20
  # scripts/backup-restore.sh — DR drill backup restore verification
21
21
  set -euo pipefail
22
22
 
23
- BACKUP_DIR="${BACKUP_DIR:-/var/backups/vibeops}"
23
+ BACKUP_DIR="${BACKUP_DIR:-/var/backups/app}"
24
24
  RESTORE_DIR="${RESTORE_DIR:-/tmp/dr-restore}"
25
- DB_FILE="${DB_FILE:-vibeops.db}"
25
+ DB_FILE="${DB_FILE:-app.db}"
26
26
 
27
27
  echo "=== DR Drill: Backup Restore Verification ==="
28
28
  echo "Source: ${BACKUP_DIR}/${DB_FILE}.backup"
@@ -47,7 +47,7 @@ Applications may add fields inside `<summary>` but must not remove core fields:
47
47
  |----------|---------|
48
48
  | Single review | 1000–3500 tokens |
49
49
  | Fix Loop (3× retries) | 3000–10500 tokens |
50
- | VibeOps pipeline (evaluator + guardian) | 2000–7000 tokens per run |
50
+ | Multi-agent pipeline (evaluator + guardian; adoption layer) | 2000–7000 tokens per run |
51
51
 
52
52
  ## References
53
53
 
@@ -55,12 +55,12 @@ interface FailureDetail {
55
55
  - `failureSource` is an **optional** field — must not break existing code without this field
56
56
  - Select the most fundamental source as `failureSource` in a single failure event
57
57
  - `failureSource` should be set by the component that detects the failure
58
- - DevAP and VibeOps each define `FailureSource` type independently (AGPL isolation)
58
+ - Adoption layers each define their own `FailureSource` type independently (license isolation)
59
59
 
60
60
  ## Applicable Scenarios
61
61
 
62
- - DevAP QualityGate failure result enrichment
63
- - VibeOps PipelineRunner `agent:error` event payload
62
+ - Quality Gate (adoption layer) failure result enrichment
63
+ - Pipeline Runner (adoption layer) `agent:error` event payload
64
64
  - Recovery Recipe Registry (XSPEC-046) match key
65
65
  - Telemetry failure analytics dimension
66
66
 
@@ -1,7 +1,7 @@
1
1
  # Flow-Based Testing
2
2
 
3
- **Version**: 1.0.0
4
- **Last Updated**: 2026-05-04
3
+ **Version**: 1.3.0
4
+ **Last Updated**: 2026-05-05
5
5
  **Applicability**: All software projects with multi-step workflows
6
6
  **Scope**: universal
7
7
  **Industry Standards**: ISO/IEC/IEEE 29119-4 (Test Techniques), ISTQB Foundation Syllabus
@@ -118,6 +118,139 @@ describe("Flow Branch: Quota exceeded path", () => {
118
118
 
119
119
  ---
120
120
 
121
+ ## Multi-Gate Flow Verification Model
122
+
123
+ Flow coverage is not a single pre-release check — it is a **progressive verification chain** across the entire SDLC. There are two fundamentally different questions that must be answered at different stages:
124
+
125
+ | Verification Type | Question | Executor | Timing |
126
+ |------------------|----------|----------|--------|
127
+ | **Coverage** | Are all terminal states tested? | Automated CI | Dev → Staging → Pre-UAT |
128
+ | **Correctness** | Are the terminal state definitions right? | Human UAT | UAT phase |
129
+
130
+ Confusing the two wastes UAT cycles on technical coverage issues that CI should have caught.
131
+
132
+ ### Gate 0 — PRD Sign-off (Before Implementation Starts)
133
+
134
+ The three testability elements MUST be written into the PRD before a single line of code is written. Use `templates/requirement-template.md` §2.4 and §9.4:
135
+
136
+ | Element | PRD Section | When Required |
137
+ |---------|-------------|---------------|
138
+ | Preconditions + Ordered Steps | §2.4 | Flows with ≥ 3 steps |
139
+ | Decision Points list | §2.4 | Every branch condition |
140
+ | Terminal States list | §2.4 | All distinct end states |
141
+ | Decision Table (Each-Choice) | §9.4 | All flows |
142
+ | Upgrade to All-Combinations | §9.4 | Auth / payment / security |
143
+ | UAT acceptance script (pre-filled) | §9.4 | Before PRD approval |
144
+
145
+ > **Why at PRD stage?** Test engineers cannot derive branch coverage from a spec that only describes the happy path. Discovering missing decision points during test design wastes a full sprint.
146
+
147
+ ### Gate 1 — PR Merge (Per Feature Branch)
148
+
149
+ Every PR that touches a flow with ≥ 3 steps MUST include automated tests covering the terminal states introduced or modified by that PR. Reviewers block merge if terminal states are added to §2.4 without corresponding tests.
150
+
151
+ ### Gate 3 — Pre-UAT Deployment (Automated + QA Lead Sign-off)
152
+
153
+ CI must prove coverage completeness **before** UAT begins. UAT is for correctness validation, not technical testing.
154
+
155
+ Required CI checks:
156
+ - All Decision Table scenarios have a passing automated test
157
+ - Zero terminal states without test coverage
158
+ - Branch coverage ≥ 90% (or project-defined threshold)
159
+ - All-Combinations fully passing for auth / payment / security flows
160
+
161
+ > Deploying to UAT without Gate 3 forces business stakeholders to act as technical QA — a costly and demoralizing misuse of UAT time.
162
+
163
+ ### Gate 4 — UAT Sign-off (Business Correctness, Pre-Production)
164
+
165
+ UAT validates that terminal state **definitions are correct** against real business rules, not that they are covered. Use the UAT Acceptance Script in §9.4 (derived directly from the Decision Table — no separate script creation needed):
166
+
167
+ - Business stakeholders sign off each row (terminal state)
168
+ - If UAT reveals a previously undefined terminal state: add it to §2.4 + Decision Table + automated test, re-run Gate 3, then resume UAT
169
+ - No new terminal states discovered during UAT = strong signal that §2.4 was thorough
170
+
171
+ ### Gate Model Summary
172
+
173
+ ```
174
+ PRD Sign-off
175
+ │ Gate 0: §2.4 + §9.4 complete (Decision Points, Terminal States,
176
+ │ Decision Table, UAT script pre-filled)
177
+
178
+ Implementation + PR Reviews
179
+ │ Gate 1: Each PR covering a flow includes terminal state tests
180
+
181
+ Staging / Integration
182
+ │ (no formal gate — CI green is sufficient)
183
+
184
+ Pre-UAT Deployment
185
+ │ Gate 3: CI proves 100% terminal state coverage + branch coverage ≥ 90%
186
+
187
+ UAT Execution
188
+ │ Gate 4: Business sign-off on terminal state correctness
189
+ │ New terminal states → back to Gate 3 before proceeding
190
+
191
+ Production
192
+ ```
193
+
194
+ ---
195
+
196
+ ## RQM Integration
197
+
198
+ Gate 3 (Pre-UAT CI coverage gate) MUST produce a **`flow_gate_report.json`** artifact consumed by the Release Quality Manifest (`release-quality-manifest.md`, field `flow_gate_report`).
199
+
200
+ ### flow_gate_report.json Schema
201
+
202
+ ```json
203
+ {
204
+ "generated_at": "2026-05-05T04:00:00Z",
205
+ "commit": "abc1234",
206
+ "flows": [
207
+ {
208
+ "flow_id": "login-authentication",
209
+ "spec_ref": "docs/specs/SPEC-001.md#2.4",
210
+ "decision_points": 3,
211
+ "terminal_states": 7,
212
+ "gate_0_complete": true,
213
+ "gate_1_pr_coverage": true,
214
+ "gate_3": {
215
+ "all_scenarios_green": true,
216
+ "terminal_states_covered": 7,
217
+ "terminal_states_defined": 7,
218
+ "branch_coverage_pct": 94,
219
+ "coverage_target": 90,
220
+ "all_combinations_required": false,
221
+ "status": "pass"
222
+ },
223
+ "gate_4_uat_signoff": true
224
+ }
225
+ ],
226
+ "summary": {
227
+ "total_flows": 5,
228
+ "gate_0_complete": true,
229
+ "gate_1_pr_coverage": true,
230
+ "gate_3_ci_pass": true,
231
+ "gate_4_uat_signoff": true,
232
+ "status": "pass"
233
+ }
234
+ }
235
+ ```
236
+
237
+ ### Generation Script Hook
238
+
239
+ Add to CI after test run (Gate 3):
240
+
241
+ ```bash
242
+ # scripts/generate-flow-gate-report.sh
243
+ node scripts/generate-flow-gate-report.mjs \
244
+ --coverage-report coverage/coverage-summary.json \
245
+ --flow-specs "docs/specs/**/*.md" \
246
+ --uat-signoffs ".release-readiness/*.md" \
247
+ --output flow_gate_report.json
248
+ ```
249
+
250
+ The `summary.status` field feeds into `release-quality-manifest.yaml` under `flow_gate_report.status`.
251
+
252
+ ---
253
+
121
254
  ## Quick Reference Checklist
122
255
 
123
256
  ```