universal-dev-standards 5.4.0 → 5.6.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.
- package/bundled/ai/options/testing/integration-testing.ai.yaml +2 -2
- package/bundled/ai/options/testing/unit-testing.ai.yaml +2 -2
- package/bundled/ai/standards/adversarial-test.ai.yaml +277 -0
- package/bundled/ai/standards/audit-trail.ai.yaml +113 -0
- package/bundled/ai/standards/browser-compatibility-standards.ai.yaml +63 -0
- package/bundled/ai/standards/chaos-injection-tests.ai.yaml +91 -0
- package/bundled/ai/standards/container-image-standards.ai.yaml +88 -0
- package/bundled/ai/standards/container-security.ai.yaml +331 -0
- package/bundled/ai/standards/contract-testing-standards.ai.yaml +62 -0
- package/bundled/ai/standards/cost-budget-test.ai.yaml +96 -0
- package/bundled/ai/standards/cross-flow-regression.ai.yaml +61 -0
- package/bundled/ai/standards/data-contract.ai.yaml +110 -0
- package/bundled/ai/standards/data-migration-testing.ai.yaml +96 -0
- package/bundled/ai/standards/data-pipeline.ai.yaml +113 -0
- package/bundled/ai/standards/disaster-recovery-drill.ai.yaml +89 -0
- package/bundled/ai/standards/flaky-test-management.ai.yaml +89 -0
- package/bundled/ai/standards/flow-based-testing.ai.yaml +240 -0
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +192 -0
- package/bundled/ai/standards/iac-design-principles.ai.yaml +83 -0
- package/bundled/ai/standards/incident-response.ai.yaml +107 -0
- package/bundled/ai/standards/license-compliance.ai.yaml +106 -0
- package/bundled/ai/standards/llm-output-validation.ai.yaml +269 -0
- package/bundled/ai/standards/mock-boundary.ai.yaml +250 -0
- package/bundled/ai/standards/mutation-testing.ai.yaml +192 -0
- package/bundled/ai/standards/pii-classification.ai.yaml +109 -0
- package/bundled/ai/standards/policy-as-code-testing.ai.yaml +227 -0
- package/bundled/ai/standards/prd-standards.ai.yaml +88 -0
- package/bundled/ai/standards/product-metrics-standards.ai.yaml +111 -0
- package/bundled/ai/standards/prompt-regression.ai.yaml +94 -0
- package/bundled/ai/standards/property-based-testing.ai.yaml +105 -0
- package/bundled/ai/standards/release-quality-manifest.ai.yaml +135 -0
- package/bundled/ai/standards/release-readiness-gate.ai.yaml +77 -0
- package/bundled/ai/standards/replay-test.ai.yaml +111 -0
- package/bundled/ai/standards/runbook.ai.yaml +104 -0
- package/bundled/ai/standards/sast-advanced.ai.yaml +135 -0
- package/bundled/ai/standards/schema-evolution.ai.yaml +111 -0
- package/bundled/ai/standards/secret-management-standards.ai.yaml +105 -0
- package/bundled/ai/standards/secure-op.ai.yaml +365 -0
- package/bundled/ai/standards/security-testing.ai.yaml +171 -0
- package/bundled/ai/standards/server-ops-security.ai.yaml +274 -0
- package/bundled/ai/standards/slo-sli.ai.yaml +97 -0
- package/bundled/ai/standards/smoke-test.ai.yaml +87 -0
- package/bundled/ai/standards/supply-chain-attestation.ai.yaml +109 -0
- package/bundled/ai/standards/test-completeness-dimensions.ai.yaml +52 -5
- package/bundled/ai/standards/testing.ai.yaml +20 -13
- package/bundled/ai/standards/user-story-mapping.ai.yaml +108 -0
- package/bundled/core/accessibility-standards.md +58 -0
- package/bundled/core/adversarial-test.md +212 -0
- package/bundled/core/branch-completion.md +4 -0
- package/bundled/core/browser-compatibility-standards.md +220 -0
- package/bundled/core/chaos-injection-tests.md +116 -0
- package/bundled/core/checkin-standards.md +1 -0
- package/bundled/core/container-security.md +521 -0
- package/bundled/core/contract-testing-standards.md +182 -0
- package/bundled/core/cost-budget-test.md +69 -0
- package/bundled/core/cross-flow-regression.md +190 -0
- package/bundled/core/data-migration-testing.md +110 -0
- package/bundled/core/disaster-recovery-drill.md +73 -0
- package/bundled/core/flaky-test-management.md +73 -0
- package/bundled/core/flow-based-testing.md +275 -0
- package/bundled/core/full-coverage-testing.md +183 -0
- package/bundled/core/llm-output-validation.md +178 -0
- package/bundled/core/mock-boundary.md +100 -0
- package/bundled/core/mutation-testing.md +97 -0
- package/bundled/core/performance-standards.md +65 -0
- package/bundled/core/policy-as-code-testing.md +188 -0
- package/bundled/core/prompt-regression.md +72 -0
- package/bundled/core/property-based-testing.md +73 -0
- package/bundled/core/release-quality-manifest.md +193 -0
- package/bundled/core/release-readiness-gate.md +184 -0
- package/bundled/core/replay-test.md +86 -0
- package/bundled/core/sast-advanced.md +300 -0
- package/bundled/core/secure-op.md +314 -0
- package/bundled/core/security-testing.md +87 -0
- package/bundled/core/server-ops-security.md +493 -0
- package/bundled/core/smoke-test.md +65 -0
- package/bundled/core/supply-chain-attestation.md +117 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +3 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +5 -5
- package/bundled/locales/zh-TW/CHANGELOG.md +3 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +11 -0
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +11 -0
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +11 -0
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +11 -0
- package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +183 -79
- package/bundled/skills/README.md +4 -3
- package/bundled/skills/SKILL_NAMING.md +94 -0
- package/bundled/skills/ai-instruction-standards/SKILL.md +181 -88
- package/bundled/skills/atdd-assistant/SKILL.md +8 -0
- package/bundled/skills/bdd-assistant/SKILL.md +7 -0
- package/bundled/skills/checkin-assistant/SKILL.md +8 -0
- package/bundled/skills/code-review-assistant/SKILL.md +7 -0
- package/bundled/skills/journey-test-assistant/SKILL.md +203 -0
- package/bundled/skills/orchestrate/SKILL.md +167 -0
- package/bundled/skills/plan/SKILL.md +234 -0
- package/bundled/skills/pr-automation-assistant/SKILL.md +8 -0
- package/bundled/skills/push/SKILL.md +49 -2
- package/bundled/skills/{process-automation → skill-builder}/SKILL.md +1 -1
- package/bundled/skills/{forward-derivation → spec-derivation}/SKILL.md +1 -1
- package/bundled/skills/spec-driven-dev/SKILL.md +7 -0
- package/bundled/skills/sweep/SKILL.md +145 -0
- package/bundled/skills/tdd-assistant/SKILL.md +7 -0
- package/package.json +6 -6
- package/src/commands/check.js +43 -0
- package/src/commands/flow.js +8 -0
- package/src/commands/init.js +2 -1
- package/src/commands/start.js +14 -0
- package/src/commands/sweep.js +8 -0
- package/src/commands/update.js +10 -0
- package/src/commands/workflow.js +8 -0
- package/standards-registry.json +483 -5
- package/bundled/locales/zh-CN/skills/ac-coverage-assistant/SKILL.md +0 -190
- package/bundled/locales/zh-CN/skills/forward-derivation/SKILL.md +0 -71
- package/bundled/locales/zh-CN/skills/forward-derivation/guide.md +0 -130
- package/bundled/locales/zh-CN/skills/methodology-system/SKILL.md +0 -88
- package/bundled/locales/zh-CN/skills/methodology-system/create-methodology.md +0 -350
- package/bundled/locales/zh-CN/skills/methodology-system/guide.md +0 -131
- package/bundled/locales/zh-CN/skills/methodology-system/runtime.md +0 -279
- package/bundled/locales/zh-CN/skills/process-automation/SKILL.md +0 -143
- package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +0 -195
- package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +0 -178
- package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +0 -69
- package/bundled/locales/zh-TW/skills/forward-derivation/guide.md +0 -415
- package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +0 -86
- package/bundled/locales/zh-TW/skills/methodology-system/create-methodology.md +0 -350
- package/bundled/locales/zh-TW/skills/methodology-system/guide.md +0 -131
- package/bundled/locales/zh-TW/skills/methodology-system/runtime.md +0 -279
- package/bundled/locales/zh-TW/skills/process-automation/SKILL.md +0 -144
- /package/bundled/skills/{ac-coverage-assistant → ac-coverage}/SKILL.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/SKILL.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/create-methodology.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/guide.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/integrated-flow.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/prerequisite-check.md +0 -0
- /package/bundled/skills/{methodology-system → dev-methodology}/runtime.md +0 -0
- /package/bundled/skills/{forward-derivation → spec-derivation}/guide.md +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Browser Compatibility Standards
|
|
2
|
+
|
|
3
|
+
> **Language**: English | [繁體中文](../locales/zh-TW/core/browser-compatibility-standards.md)
|
|
4
|
+
|
|
5
|
+
**Version**: 1.0.0
|
|
6
|
+
**Last Updated**: 2026-05-05
|
|
7
|
+
**Applicability**: Frontend projects (web apps, progressive web apps, web components)
|
|
8
|
+
**Scope**: universal
|
|
9
|
+
**Industry Standards**: Browserslist, W3C WebDriver, WebDriver BiDi
|
|
10
|
+
**References**: [caniuse.com](https://caniuse.com/), [Playwright browser support matrix](https://playwright.dev/docs/browsers)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
|
|
16
|
+
This standard defines supported browser and device matrices, testing automation strategies, and the release gate for browser compatibility (Dimension 9 in `release-readiness-gate.md`, Tier-3).
|
|
17
|
+
|
|
18
|
+
Browser compatibility issues are among the most user-visible defects, yet they are systematically under-tested because teams assume "it works in Chrome." Without an explicit supported matrix and automated verification, regressions slip to production and affect large user segments.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Support Tier Definitions
|
|
23
|
+
|
|
24
|
+
| Tier | Definition | Release Gate |
|
|
25
|
+
|------|-----------|--------------|
|
|
26
|
+
| **Tier-1** (Supported) | Full feature parity + automated test coverage | 100% pass — blocks release if any test fails |
|
|
27
|
+
| **Tier-2** (Partial support) | Best-effort; major flows must work | ≥ 95% pass — WARN if below, FAIL if < 90% |
|
|
28
|
+
| **Tier-3** (Best effort) | Not officially supported; defects logged but not blocking | Advisory only |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Default Browser Matrix
|
|
33
|
+
|
|
34
|
+
Teams MUST declare their supported matrix explicitly. The defaults below cover the majority of web traffic (2025–2026 data):
|
|
35
|
+
|
|
36
|
+
### Tier-1 (Default)
|
|
37
|
+
|
|
38
|
+
| Browser | Versions | Platform |
|
|
39
|
+
|---------|----------|---------|
|
|
40
|
+
| Chrome | latest, latest-1 | Windows, macOS, Linux, Android |
|
|
41
|
+
| Safari | latest, latest-1 | macOS, iOS |
|
|
42
|
+
| Firefox | latest | Windows, macOS, Linux |
|
|
43
|
+
| Edge | latest | Windows, macOS |
|
|
44
|
+
|
|
45
|
+
### Tier-2 (Default)
|
|
46
|
+
|
|
47
|
+
| Browser | Versions | Platform |
|
|
48
|
+
|---------|----------|---------|
|
|
49
|
+
| Chrome | latest-2, latest-3 | Desktop |
|
|
50
|
+
| Safari | latest-2 | macOS, iOS |
|
|
51
|
+
| Samsung Internet | latest | Android |
|
|
52
|
+
| Opera | latest | Desktop |
|
|
53
|
+
|
|
54
|
+
### Tier-3 (Default)
|
|
55
|
+
|
|
56
|
+
| Browser | Notes |
|
|
57
|
+
|---------|-------|
|
|
58
|
+
| IE 11 | EOL; only if contractually required |
|
|
59
|
+
| Chrome < latest-3 | Tracked as known limitation |
|
|
60
|
+
|
|
61
|
+
### Device / Viewport Matrix
|
|
62
|
+
|
|
63
|
+
| Category | Min Width | Representative Device |
|
|
64
|
+
|----------|-----------|-----------------------|
|
|
65
|
+
| Mobile (small) | 360px | Android (small) |
|
|
66
|
+
| Mobile (standard) | 390px | iPhone 14 |
|
|
67
|
+
| Tablet (portrait) | 768px | iPad |
|
|
68
|
+
| Tablet (landscape) | 1024px | iPad landscape |
|
|
69
|
+
| Desktop (small) | 1280px | Laptop 13" |
|
|
70
|
+
| Desktop (standard) | 1440px | Laptop 15" / External monitor |
|
|
71
|
+
| Desktop (wide) | 1920px | Full HD monitor |
|
|
72
|
+
|
|
73
|
+
Minimum: test at **360px, 768px, 1280px** (mobile / tablet / desktop breakpoints).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Automated Testing
|
|
78
|
+
|
|
79
|
+
### Playwright Matrix Configuration
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
// playwright.config.ts
|
|
83
|
+
import { defineConfig, devices } from "@playwright/test";
|
|
84
|
+
|
|
85
|
+
export default defineConfig({
|
|
86
|
+
projects: [
|
|
87
|
+
// Tier-1 browsers
|
|
88
|
+
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
|
|
89
|
+
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
|
|
90
|
+
{ name: "webkit", use: { ...devices["Desktop Safari"] } },
|
|
91
|
+
{ name: "edge", use: { ...devices["Desktop Edge"] } },
|
|
92
|
+
// Mobile Tier-1
|
|
93
|
+
{ name: "mobile-chrome", use: { ...devices["Pixel 7"] } },
|
|
94
|
+
{ name: "mobile-safari", use: { ...devices["iPhone 14"] } },
|
|
95
|
+
// Viewport coverage
|
|
96
|
+
{ name: "tablet", use: { ...devices["iPad Pro 11"] } },
|
|
97
|
+
],
|
|
98
|
+
// Tier-1 failure = build failure
|
|
99
|
+
reporter: [["html"], ["junit", { outputFile: "results/browser-compat.xml" }]],
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### CI Execution Strategy
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Run full Tier-1 matrix on release candidate
|
|
107
|
+
npx playwright test --project=chromium,firefox,webkit,edge,mobile-chrome,mobile-safari,tablet
|
|
108
|
+
|
|
109
|
+
# Run Tier-1 only on every PR (fast feedback)
|
|
110
|
+
npx playwright test --project=chromium,firefox,webkit
|
|
111
|
+
|
|
112
|
+
# Run Tier-2 on release candidate (results feed into sign-off as WARN/PASS)
|
|
113
|
+
npx playwright test --project=samsung,opera
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Cloud Browser Testing
|
|
117
|
+
|
|
118
|
+
For Tier-1 cross-OS testing (e.g., Safari on Windows-hosted CI), use cloud services:
|
|
119
|
+
|
|
120
|
+
| Service | Use Case |
|
|
121
|
+
|---------|---------|
|
|
122
|
+
| BrowserStack Automate | Commercial projects; widest OS+browser matrix |
|
|
123
|
+
| Sauce Labs | Enterprises with existing contract |
|
|
124
|
+
| LambdaTest | Open-source / cost-sensitive projects |
|
|
125
|
+
|
|
126
|
+
**Minimum cloud testing**: Safari latest + latest-1 on real iOS devices (Simulator is insufficient for WebKit bugs).
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Visual Regression (Optional but Recommended)
|
|
131
|
+
|
|
132
|
+
Pixel-diff testing detects layout regressions across browsers:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Using Playwright visual comparisons
|
|
136
|
+
npx playwright test --update-snapshots # update baseline
|
|
137
|
+
npx playwright test # compare against baseline; fail if diff > threshold
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Threshold recommendation: < 0.5% pixel diff for layout components; < 2% for complex interactive components.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Release Gate Criteria
|
|
145
|
+
|
|
146
|
+
This is **Dimension 9** in `release-readiness-gate.md` (Tier-3: required for frontend/web projects; `N/A` for CLI/backend-only).
|
|
147
|
+
|
|
148
|
+
| Gate | Pass | Warn | Fail |
|
|
149
|
+
|------|------|------|------|
|
|
150
|
+
| Tier-1 browser matrix | 100% tests pass | — | Any test fails |
|
|
151
|
+
| Tier-2 browser matrix | ≥ 95% pass | 90–95% | < 90% |
|
|
152
|
+
| Viewport coverage (360/768/1280) | No layout breaks on any Tier-1 browser | — | Any critical flow unusable |
|
|
153
|
+
|
|
154
|
+
### Evidence for Sign-off
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
| 9 | Browser / Device Compat | PASS | Playwright: 6 browsers × 7 viewports, 100% Tier-1; Tier-2: 97%; [junit report link] | QA Lead |
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### `N/A` Criteria
|
|
161
|
+
|
|
162
|
+
Mark as `N/A` when:
|
|
163
|
+
- Project is CLI-only, pure backend API, or mobile native (not web)
|
|
164
|
+
- Document rationale: `"N/A — backend API service, no browser UI"`
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Browserslist Configuration
|
|
169
|
+
|
|
170
|
+
Commit a `.browserslistrc` to the repo root to ensure build tools (Babel, PostCSS, Autoprefixer) target the same browsers:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
# .browserslistrc
|
|
174
|
+
# Tier-1: production targets
|
|
175
|
+
last 2 Chrome versions
|
|
176
|
+
last 2 Firefox versions
|
|
177
|
+
last 2 Safari versions
|
|
178
|
+
last 2 Edge versions
|
|
179
|
+
last 2 iOS versions
|
|
180
|
+
last 2 ChromeAndroid versions
|
|
181
|
+
|
|
182
|
+
# Tier-2: for reference (not in build targets by default)
|
|
183
|
+
# last 4 Chrome versions
|
|
184
|
+
# Samsung Internet >= 14
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Anti-Patterns
|
|
190
|
+
|
|
191
|
+
- **Testing only Chrome** — Chrome represents ~65% of desktop traffic; the remaining 35% is Safari/Firefox/Edge users who will find your bugs
|
|
192
|
+
- **Using browser simulators for iOS Safari testing** — WebKit on Simulator diverges from real device WebKit; always test on real iOS for release candidates
|
|
193
|
+
- **Not specifying a matrix** — implicit assumption of "all browsers" is impossible to test; an explicit Tier-1 matrix is better than implicit coverage of none
|
|
194
|
+
- **Treating Tier-3 browser failures as blockers** — Tier-3 is best-effort; logging the issue is appropriate, not blocking the release
|
|
195
|
+
- **Skipping mobile viewport testing** — mobile-first is standard; missing 360px tests will produce broken UX for the majority of mobile users
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Relationship to Other Standards
|
|
200
|
+
|
|
201
|
+
- **`accessibility-standards.md`** — keyboard nav and screen reader tests run across Tier-1 browsers
|
|
202
|
+
- **`e2e-testing.md`** — Playwright matrix config extends E2E tests to multi-browser
|
|
203
|
+
- **`release-readiness-gate.md`** — Dimension 9 (Tier-3)
|
|
204
|
+
- **`performance-standards.md`** — Core Web Vitals targets apply per Tier-1 browser
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Version History
|
|
209
|
+
|
|
210
|
+
| Version | Date | Changes |
|
|
211
|
+
|---------|------|---------|
|
|
212
|
+
| 1.0.0 | 2026-05-05 | Initial release: Tier-1/2/3 matrix, Playwright config, cloud testing, release gate criteria |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
This standard is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
|
219
|
+
|
|
220
|
+
**Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Chaos Injection Tests
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Chaos injection tests make failure scenarios machine-verifiable. Where `chaos-engineering-standards` describes the experiment methodology, this standard defines the specific tests required for AI agent systems — LLM timeouts, database disconnects, policy engine failures, and blast-radius containment.
|
|
6
|
+
|
|
7
|
+
## Why AI Agent Systems Need Dedicated Chaos Tests
|
|
8
|
+
|
|
9
|
+
Traditional software has a handful of external dependencies. AI agent systems compound this:
|
|
10
|
+
|
|
11
|
+
- **LLM API**: high latency, rate limits, non-deterministic failures
|
|
12
|
+
- **Policy engine** (OPA/Rego): security-critical — must fail closed
|
|
13
|
+
- **Vector store / knowledge base**: retrieval failures affect output quality
|
|
14
|
+
- **Database**: mid-operation disconnects can corrupt multi-step agent state
|
|
15
|
+
- **Peer agents**: in multi-agent pipelines, one agent crash must not cascade
|
|
16
|
+
|
|
17
|
+
Each of these failure modes needs a dedicated test, not just a comment in a runbook.
|
|
18
|
+
|
|
19
|
+
## Requirements Summary
|
|
20
|
+
|
|
21
|
+
| ID | Rule | Rationale |
|
|
22
|
+
|----|------|-----------|
|
|
23
|
+
| REQ-CIT-001 | Each external dependency needs a failure isolation test | Single dependency failure must not cascade |
|
|
24
|
+
| REQ-CIT-002 | LLM client must handle timeout and rate-limit | LLM is the highest-risk dependency |
|
|
25
|
+
| REQ-CIT-003 | Policy engine unavailability must default to DENY | Fail-open is a security vulnerability |
|
|
26
|
+
| REQ-CIT-004 | DB disconnect mid-operation must roll back cleanly | Partial writes cause data corruption |
|
|
27
|
+
| REQ-CIT-005 | Agent crash must not propagate to unrelated agents | Inter-agent blast radius must be bounded |
|
|
28
|
+
|
|
29
|
+
## Injection Patterns
|
|
30
|
+
|
|
31
|
+
### LLM Timeout
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
it('surfaces TimeoutError when LLM does not respond in time', async () => {
|
|
35
|
+
const slowLlm = { complete: () => new Promise(() => {}) } // never resolves
|
|
36
|
+
const agent = new PlannerAgent({ llm: slowLlm, timeoutMs: 100 })
|
|
37
|
+
await expect(agent.run(input)).rejects.toThrow('TimeoutError')
|
|
38
|
+
})
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### LLM Rate Limit (429)
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
it('retries with backoff on 429 and eventually surfaces RateLimitError', async () => {
|
|
45
|
+
const rateLimitedLlm = mockLlm({ status: 429, retryAfter: 1 })
|
|
46
|
+
const agent = new PlannerAgent({ llm: rateLimitedLlm })
|
|
47
|
+
await expect(agent.run(input)).rejects.toThrow('RateLimitError')
|
|
48
|
+
expect(rateLimitedLlm.callCount).toBeLessThanOrEqual(3) // respects retry policy
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Policy Engine Down (Fail-Closed)
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
it('returns DENY when OPA sidecar is unavailable', async () => {
|
|
56
|
+
const downOpa = { query: () => Promise.reject(new Error('ECONNREFUSED')) }
|
|
57
|
+
const guardian = new GuardianAgent({ opa: downOpa })
|
|
58
|
+
const result = await guardian.review(reviewable)
|
|
59
|
+
expect(result.decision).toBe('DENY')
|
|
60
|
+
expect(result.reason).toMatch(/policy engine unavailable/)
|
|
61
|
+
})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Database Disconnect
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
it('rolls back transaction on mid-operation DB disconnect', async () => {
|
|
68
|
+
const db = createTestDb()
|
|
69
|
+
await seedRows(db, [{ id: 1, name: 'alice' }])
|
|
70
|
+
|
|
71
|
+
// Force disconnect after first write in the transaction
|
|
72
|
+
let writeCount = 0
|
|
73
|
+
const hookedDb = hookAfterWrite(db, () => {
|
|
74
|
+
if (++writeCount === 1) db.close()
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
await expect(runner.executeWithDb(hookedDb, plan)).rejects.toThrow()
|
|
78
|
+
|
|
79
|
+
const freshDb = createTestDb()
|
|
80
|
+
const rows = freshDb.prepare('SELECT * FROM records').all()
|
|
81
|
+
expect(rows).toHaveLength(1) // original row preserved, partial write rolled back
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Agent Crash Containment
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
it('pipeline continues when one agent throws', async () => {
|
|
89
|
+
const crashingAgent = { run: () => { throw new Error('agent crash') } }
|
|
90
|
+
const pipeline = new Pipeline({ agents: { planner: crashingAgent, builder: realBuilder } })
|
|
91
|
+
|
|
92
|
+
const result = await pipeline.run(input, { skipFailedAgents: true })
|
|
93
|
+
expect(result.completedAgents).toContain('builder')
|
|
94
|
+
expect(result.failedAgents).toContain('planner')
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Safety Rules
|
|
99
|
+
|
|
100
|
+
1. Never run chaos tests against production or shared staging databases
|
|
101
|
+
2. Always clean up injected faults in `afterEach` or `finally` blocks
|
|
102
|
+
3. Tag chaos tests (`@chaos`) to exclude from fast unit test runs in developer workflow
|
|
103
|
+
4. Chaos tests may run in CI on a dedicated job, not in the standard unit test matrix
|
|
104
|
+
|
|
105
|
+
## Anti-Patterns
|
|
106
|
+
|
|
107
|
+
- **Catching and ignoring all errors in the main handler** — this hides chaos failures from assertions
|
|
108
|
+
- **Not verifying database state after disconnect** — asserting the error is thrown is not enough; assert no partial data was written
|
|
109
|
+
- **Fail-open policy engine handling** — any ambiguity in the policy path must resolve to DENY, not ALLOW
|
|
110
|
+
|
|
111
|
+
## See Also
|
|
112
|
+
|
|
113
|
+
- `chaos-engineering-standards.ai.yaml` — experiment methodology and SLO integration
|
|
114
|
+
- `testing.ai.yaml` — general test structure
|
|
115
|
+
- `secure-op.ai.yaml` — Fail-Closed principle for AI agents
|
|
116
|
+
- `security-standards.ai.yaml` — security invariants
|
|
@@ -1121,6 +1121,7 @@ auto_fix:
|
|
|
1121
1121
|
- [Acceptance Criteria Traceability](acceptance-criteria-traceability.md) - AC coverage verification
|
|
1122
1122
|
- [Change Batching Standards](change-batching-standards.md) - Batch threshold triggers
|
|
1123
1123
|
- [Pipeline Integration Standards](pipeline-integration-standards.md) - Automated check-in
|
|
1124
|
+
- [Release Readiness Gate](release-readiness-gate.md) - **Check-in ≠ release readiness**: passing per-commit gates is necessary but not sufficient for production; see the 16-dimension release gate for what "done" means at release time
|
|
1124
1125
|
|
|
1125
1126
|
---
|
|
1126
1127
|
|