@metasession.co/devaudit-cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +13 -10
  2. package/dist/index.js +17 -5
  3. package/dist/index.js.map +1 -1
  4. package/package.json +9 -5
  5. package/scripts/upload-evidence.sh +225 -0
  6. package/sdlc/.claude/settings.local.json +11 -0
  7. package/sdlc/CLAUDE.md +73 -0
  8. package/sdlc/HOST_ADAPTER.md +127 -0
  9. package/sdlc/SKILLS.md +137 -0
  10. package/sdlc/STACK_ADAPTER.md +130 -0
  11. package/sdlc/ai-rules/INSTRUCTIONS-SDLC.md +172 -0
  12. package/sdlc/ai-rules/README.md +103 -0
  13. package/sdlc/ai-rules/SDLC_RULES.md +584 -0
  14. package/sdlc/ai-rules/claude/CLAUDE.md +192 -0
  15. package/sdlc/ai-rules/cursor/.cursorrules +167 -0
  16. package/sdlc/ai-rules/windsurf/.windsurfrules +167 -0
  17. package/sdlc/article.md +219 -0
  18. package/sdlc/files/_common/0-project-setup.md +410 -0
  19. package/sdlc/files/_common/1-plan-requirement.md +381 -0
  20. package/sdlc/files/_common/2-implement-and-test.md +276 -0
  21. package/sdlc/files/_common/3-compile-evidence.md +603 -0
  22. package/sdlc/files/_common/4-submit-for-review.md +362 -0
  23. package/sdlc/files/_common/5-deploy-main.md +251 -0
  24. package/sdlc/files/_common/Periodic_Security_Review_Schedule.md +169 -0
  25. package/sdlc/files/_common/README_TEMPLATE.md +441 -0
  26. package/sdlc/files/_common/Test_Architecture.md +461 -0
  27. package/sdlc/files/_common/Test_Plan_TEMPLATE.md +311 -0
  28. package/sdlc/files/_common/Test_Policy.md +277 -0
  29. package/sdlc/files/_common/Test_Strategy.md +359 -0
  30. package/sdlc/files/_common/github/ISSUE_TEMPLATE/bug.yml +75 -0
  31. package/sdlc/files/_common/github/ISSUE_TEMPLATE/config.yml +11 -0
  32. package/sdlc/files/_common/github/ISSUE_TEMPLATE/requirement.yml +75 -0
  33. package/sdlc/files/_common/github/ISSUE_TEMPLATE/task.yml +48 -0
  34. package/sdlc/files/_common/github/pull_request_template.md +69 -0
  35. package/sdlc/files/_common/implementing-an-sdlc-issue.md +413 -0
  36. package/sdlc/files/_common/scripts/derive-release-version.sh +40 -0
  37. package/sdlc/files/_common/scripts/derive-release-version.test.sh +98 -0
  38. package/sdlc/files/_common/scripts/submit-for-uat-review.sh +162 -0
  39. package/sdlc/files/_common/scripts/validate-commits.sh +83 -0
  40. package/sdlc/files/_common/scripts/validate-compliance-artifacts.sh +202 -0
  41. package/sdlc/files/_common/scripts/validate-compliance-artifacts.test.sh +202 -0
  42. package/sdlc/files/_common/skills/_schema/skill.schema.json +36 -0
  43. package/sdlc/files/_common/skills/e2e-test-engineer/SKILL.md +254 -0
  44. package/sdlc/files/_common/skills/e2e-test-engineer/references/bootstrap.md +244 -0
  45. package/sdlc/files/_common/skills/e2e-test-engineer/references/evidence.ts +40 -0
  46. package/sdlc/files/_common/skills/sdlc-implementer/SKILL.md +189 -0
  47. package/sdlc/files/_common/skills/sdlc-implementer/references/call-graph.md +64 -0
  48. package/sdlc/files/_common/skills/sdlc-implementer/references/change-request-loop.md +192 -0
  49. package/sdlc/files/_common/skills/sdlc-implementer/references/compliance-constraints.md +81 -0
  50. package/sdlc/files/ci/check-release-approval.yml.template +201 -0
  51. package/sdlc/files/ci/ci-status-fallback.yml.template +41 -0
  52. package/sdlc/files/ci/ci.yml.template +390 -0
  53. package/sdlc/files/ci/compliance-evidence.yml.template +161 -0
  54. package/sdlc/files/ci/compliance-validation.yml.template +34 -0
  55. package/sdlc/files/ci/post-deploy-prod.yml.template +159 -0
  56. package/sdlc/files/ci/python/ci.yml.template +335 -0
  57. package/sdlc/files/hosts/_schema/adapter.schema.json +103 -0
  58. package/sdlc/files/hosts/railway/adapter.json +32 -0
  59. package/sdlc/files/sdlc-config.example.json +74 -0
  60. package/sdlc/files/stacks/_schema/adapter.schema.json +151 -0
  61. package/sdlc/files/stacks/node/adapter.json +54 -0
  62. package/sdlc/files/stacks/node/hooks/.prettierrc.json +9 -0
  63. package/sdlc/files/stacks/node/hooks/commit-msg +7 -0
  64. package/sdlc/files/stacks/node/hooks/commitlint.config.mjs +64 -0
  65. package/sdlc/files/stacks/node/hooks/lint-staged.config.mjs +16 -0
  66. package/sdlc/files/stacks/node/hooks/pre-commit +13 -0
  67. package/sdlc/files/stacks/node/hooks/pre-push +15 -0
  68. package/sdlc/files/stacks/node/scripts/check-requirement-jsdoc.sh +54 -0
  69. package/sdlc/files/stacks/python/adapter.json +36 -0
  70. package/sdlc/files/stacks/python/hooks/.pre-commit-config.yaml +51 -0
@@ -0,0 +1,311 @@
1
+ # Test Plan — [PROJECT NAME]
2
+
3
+ **Document Type:** Test Plan (Project-Specific) | **Version:** 1.0 | **Effective Date:** [DATE]
4
+
5
+ **Project:** [PROJECT NAME] | **Repository:** `[org/repo-name]`
6
+
7
+ **Parent Documents:** Test Policy, Test Strategy, Test Architecture (all Tier 1, in devaudit/sdlc/files/)
8
+
9
+ ---
10
+
11
+ ## Purpose
12
+
13
+ This Test Plan defines project-specific testing details for [PROJECT NAME]. It implements the universal standards from Tier 1 with concrete environment details, test suites, entry/exit criteria, and compliance artifacts.
14
+
15
+ For testing philosophy and governance: Test Policy (`sdlc/files/Test_Policy.md` in DevAudit).
16
+ For testing methodology and approach: Test Strategy.
17
+ For tools, patterns, and code standards: Test Architecture.
18
+
19
+ ---
20
+
21
+ ## Project Overview
22
+
23
+ | Attribute | Value |
24
+ |---|---|
25
+ | Application | [PROJECT NAME — brief description] |
26
+ | Stack | [e.g., TypeScript, Next.js, MongoDB, Socket.IO] |
27
+ | Hosting | [e.g., Railway, Vercel, AWS] (auto-deploy from `main`) |
28
+ | Production URL | [URL] |
29
+ | Health Endpoint | [e.g., /api/health] |
30
+ | Database | [e.g., MongoDB — connection details] |
31
+ | Runtime | [e.g., node_modules/.bin/tsx server.ts] |
32
+ | Build | [e.g., Multi-stage Dockerfile, 3-5 min] |
33
+
34
+ ---
35
+
36
+ ## Branching Strategy
37
+
38
+ Trunk-based with develop branch (per Test Strategy branching patterns):
39
+
40
+ - **`main`** — Production. Auto-deploys to hosting platform. PR approval + all checks required.
41
+ - **`develop`** — Working branch. All implementation here. Permanent, never deleted.
42
+ - Merge commits (not squash) for `develop` → `main` to preserve audit history.
43
+
44
+ ---
45
+
46
+ ## Test Suites
47
+
48
+ ### E2E Tests (Playwright)
49
+
50
+ | Attribute | Value |
51
+ |---|---|
52
+ | Framework | Playwright (per Test Architecture standard) |
53
+ | Test count | [TOTAL] tests across [N] projects |
54
+ | Unauthenticated (CI) | [COUNT] (run in CI on PR to main) |
55
+ | Authenticated (local only) | [COUNT] (require credentials) |
56
+ | Browser | Chromium |
57
+ | Prerequisite | [e.g., npx tsx scripts/seed-e2e-admins.ts] |
58
+
59
+ ### Unit Tests
60
+
61
+ | Attribute | Value |
62
+ |---|---|
63
+ | Framework | [Jest / Vitest] |
64
+ | Coverage target | 70% for critical modules |
65
+ | Run command | [e.g., npx vitest run] |
66
+
67
+ ### TypeScript Compilation
68
+
69
+ ```bash
70
+ npx tsc --noEmit # 0 errors required
71
+ ```
72
+
73
+ ### SAST Scanning
74
+
75
+ | Attribute | Value |
76
+ |---|---|
77
+ | Tool | Semgrep (per Test Architecture) |
78
+ | Config | auto |
79
+ | Scan scope | [e.g., src/] |
80
+
81
+ ```bash
82
+ npx semgrep scan --config auto [SOURCE_DIR]/ --severity ERROR --severity WARNING
83
+ ```
84
+
85
+ ### Dependency Auditing
86
+
87
+ ```bash
88
+ npm audit --audit-level=high
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Entry and Exit Criteria
94
+
95
+ ### Entry
96
+
97
+ - On `develop`, up to date with remote
98
+ - Dev server starts
99
+ - Database running locally
100
+ - Playwright browsers installed
101
+ - Test data seeded
102
+
103
+ ### Exit (Before PR)
104
+
105
+ | Gate | Local | CI (PR) | Threshold |
106
+ |---|---|---|---|
107
+ | TypeScript | Yes | Yes | 0 errors |
108
+ | SAST (high/critical) | Yes | Yes | 0 findings |
109
+ | Dependencies (high/critical) | Yes | Yes | 0 vulnerabilities |
110
+ | E2E tests | [TOTAL]/[TOTAL] | [UNAUTH]/[UNAUTH] | All pass |
111
+ | Severity-1 defects | — | — | 0 open |
112
+ | Human review | — | PR approved | Approved |
113
+
114
+ Additional for Medium/High risk (per Test Strategy risk matrix):
115
+
116
+ | Gate | Threshold |
117
+ |---|---|
118
+ | Access control tests | RBAC endpoints return correct 401/403 |
119
+ | Audit log tests | Auditable actions produce log entries |
120
+
121
+ ---
122
+
123
+ ## CI/CD
124
+
125
+ ### Pipeline Configuration
126
+
127
+ | Trigger | What Runs | Independent Evidence |
128
+ |---|---|---|
129
+ | Push to `develop` | TypeScript check + build | Compilation clean |
130
+ | PR to `main` | TypeScript + SAST + dependency audit + E2E (unauthenticated) | All gates independently verified by GitHub |
131
+ | Merge to `main` | Auto-deploy to hosting platform | Deployment triggered |
132
+
133
+ CI workflow file: `.github/workflows/ci.yml` (created during project setup — see `0-project-setup.md`)
134
+
135
+ CI prerequisites: [e.g., E2E tests require seeding even for unauthenticated subset]
136
+
137
+ ### PR Pipeline Execution Order
138
+
139
+ 1. TypeScript check — fast, no database
140
+ 2. SAST scan — fast, no database
141
+ 3. Dependency audit — fast, no database
142
+ 4. Seed test data — required before E2E
143
+ 5. E2E tests — slow, requires database
144
+
145
+ Steps 1-3 can run in parallel. Step 4 must complete before step 5.
146
+
147
+ ### Evidence Model
148
+
149
+ **Local evidence** (in `compliance/evidence/REQ-XXX/`) — comprehensive, developer-produced, covers all tests. Committed to repository.
150
+
151
+ **CI evidence** (in GitHub Actions logs + artifacts) — independent, GitHub-produced, covers unauthenticated subset. Tamper-resistant.
152
+
153
+ Both required. Local proves comprehensive testing. CI proves it independently.
154
+
155
+ ---
156
+
157
+ ## AI Use — Project Configuration
158
+
159
+ Per Test Policy AI governance:
160
+
161
+ | Tool | Permitted Use |
162
+ |---|---|
163
+ | [e.g., Claude (Anthropic) — Opus 4.6, Sonnet 4.6] | [e.g., Code generation, test generation, documentation, review] |
164
+
165
+ Documentation requirements (per Test Strategy AI methodology):
166
+
167
+ | Risk | Commit | Evidence | Prompts |
168
+ |---|---|---|---|
169
+ | Low | `Co-Authored-By` tag | Not required | Not required |
170
+ | Medium | Same | Summary in evidence dir | Summary |
171
+ | High | Same | Detailed record | Detailed |
172
+
173
+ Elevated review required for: [list security-sensitive code categories for this project, e.g., authentication, payment processing, user data/PII, API security, database schema changes]
174
+
175
+ ---
176
+
177
+ ## Requirements Traceability
178
+
179
+ **Format:** `compliance/RTM.md`, Part B:
180
+
181
+ ```markdown
182
+ | REQ-XXX | #NNN | Risk | Evidence | Status | Approver | Date |
183
+ ```
184
+
185
+ **Status lifecycle:** DRAFT → IN PROGRESS → TESTED - PENDING SIGN-OFF → APPROVED - DEPLOYED
186
+
187
+ **JSDoc headers:** `@requirement REQ-XXX - Brief description` in modified source files.
188
+
189
+ ---
190
+
191
+ ## Compliance Artifacts
192
+
193
+ ```
194
+ compliance/
195
+ ├── RTM.md
196
+ ├── test-plan.md # This document
197
+ ├── test-cases.md
198
+ ├── test-summary-report.md
199
+ ├── pending-releases/
200
+ │ └── RELEASE-TICKET-REQ-XXX.md
201
+ ├── approved-releases/
202
+ │ └── RELEASE-TICKET-REQ-XXX.md
203
+ └── evidence/
204
+ ├── REQ-XXX/
205
+ │ ├── test-scope.md # Test plan for this requirement (PLAN stage)
206
+ │ ├── e2e-results.json
207
+ │ ├── sast-results.json
208
+ │ ├── dependency-audit.json
209
+ │ ├── security-summary.md
210
+ │ ├── ai-use-note.md
211
+ │ └── ai-prompts.md
212
+ └── periodic/
213
+ ├── sast-quarterly/
214
+ ├── dependency-audit/
215
+ ├── access-control/
216
+ ├── audit-log/
217
+ ├── pentest/
218
+ ├── dr-test/
219
+ └── third-party/
220
+ ```
221
+
222
+ ### Per-Requirement Test Scope
223
+
224
+ Every tracked requirement gets a `test-scope.md` created during the PLAN stage **before implementation**. Scope scales with risk:
225
+
226
+ | Risk | Content |
227
+ |---|---|
228
+ | Low | Standard gates + acceptance criteria. A few lines. |
229
+ | Medium | Above + targeted testing (access control, audit logging, dependency review), validation approach. Half a page. |
230
+ | High | Above + security testing detail, independent review plan, pen test consideration, business validation, AI detail. One page. |
231
+
232
+ Templates in workflow 1 (`1-plan-requirement.md`).
233
+
234
+ ---
235
+
236
+ ## Post-Deploy Verification
237
+
238
+ ```bash
239
+ # Health check
240
+ curl -s [PRODUCTION_URL]/[HEALTH_ENDPOINT]
241
+
242
+ # Smoke test
243
+ curl -s [PRODUCTION_URL]/[PUBLIC_ENDPOINT] | head -c 200
244
+ curl -s -o /dev/null -w "%{http_code}" [PRODUCTION_URL]/
245
+
246
+ # Security verification (per Test Strategy post-deploy requirements)
247
+ curl -s -o /dev/null -w "%{http_code}" [PRODUCTION_URL]/[ADMIN_ENDPOINT]
248
+ # Expected: 401 or 403
249
+
250
+ curl -s -I [PRODUCTION_URL]/ | grep -iE 'x-frame-options|strict-transport'
251
+
252
+ curl -s [PRODUCTION_URL]/[NONEXISTENT_ENDPOINT]
253
+ # Expected: generic error, NOT stack trace
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Disaster Recovery
259
+
260
+ | Metric | Target |
261
+ |---|---|
262
+ | RTO | [e.g., 4 hours] |
263
+ | RPO | [e.g., 24 hours] |
264
+
265
+ Recovery procedures:
266
+ 1. **Application failure:** [e.g., Redeploy previous version from hosting dashboard]
267
+ 2. **Database recovery:** [e.g., Restore from backup]
268
+ 3. **Full rebuild:** [e.g., Deploy from main to fresh environment]
269
+
270
+ ---
271
+
272
+ ## Periodic Review — Project Procedures
273
+
274
+ Per the Periodic Security Review Schedule (Tier 1):
275
+
276
+ ```bash
277
+ # Quarterly SAST
278
+ semgrep scan --config auto --config p/security-audit --config p/owasp-top-ten [SOURCE_DIR]/ --json > compliance/evidence/periodic/sast-quarterly/sast-full-$(date -I).json
279
+
280
+ # Quarterly dependencies
281
+ npm audit --json > compliance/evidence/periodic/dependency-audit/npm-audit-$(date -I).json
282
+ npm outdated --json > compliance/evidence/periodic/dependency-audit/outdated-$(date -I).json
283
+
284
+ # Quarterly access control
285
+ npx playwright test --grep "access control\|unauthorized\|forbidden\|RBAC"
286
+ ```
287
+
288
+ Annual pen test scope: [PRODUCTION_URL], API endpoints, auth mechanism, [database-specific injection testing], [other scope items]
289
+
290
+ ---
291
+
292
+ ## Workflow Files
293
+
294
+ | # | File | Purpose |
295
+ |---|---|---|
296
+ | 0 | `0-project-setup.md` | One-time: repository, CI, compliance setup |
297
+ | 1 | `1-plan-requirement.md` | Create REQ, classify risk, generate test scope |
298
+ | 2 | `2-implement-and-test.md` | Code, commit, run all local gates |
299
+ | 3 | `3-compile-evidence.md` | Gather test + security + AI evidence |
300
+ | 4 | `4-submit-for-review.md` | Create PR (triggers CI independent verification) |
301
+ | 5 | `5-deploy-main.md` | Merge, deploy, verify, finalize |
302
+
303
+ ---
304
+
305
+ ## Document Control
306
+
307
+ | Version | Date | Author | Changes |
308
+ |---|---|---|---|
309
+ | 1.0 | [DATE] | [AUTHOR] | Initial plan |
310
+
311
+ **Parent Documents:** Test Policy, Test Strategy, Test Architecture, Periodic Security Review Schedule (in devaudit/sdlc/files/)
@@ -0,0 +1,277 @@
1
+ # Test Policy
2
+
3
+ **Document Type:** Policy | **Version:** 3.0 | **Effective Date:** March 2026 | **Review Cycle:** Annual
4
+
5
+ **Owner:** Engineering Leadership | **Approved By:** Executive Team
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ This Test Policy establishes Metasession's organizational commitment to quality assurance and testing excellence. It defines our philosophy, principles, accountability standards, and governance for all testing activities — including AI-assisted development.
12
+
13
+ This policy answers **"why we test"** and **"what we commit to."** For how we approach testing methodically, see the Test Strategy (`sdlc/files/Test_Strategy.md` in DevAudit). For what tools and patterns we use, see the Test Architecture.
14
+
15
+ ---
16
+
17
+ ## Scope
18
+
19
+ This policy applies to:
20
+
21
+ - All Metasession products and client service delivery engagements
22
+ - Internal systems and infrastructure
23
+ - All team members involved in software development, quality assurance, and product delivery
24
+ - All code regardless of authorship — human-written, AI-generated, or AI-assisted
25
+
26
+ ---
27
+
28
+ ## Testing Philosophy
29
+
30
+ **Core Principle:** We test to ensure zero critical defects reach production and to maintain the trust of our customers, partners, and end users.
31
+
32
+ Metasession believes that:
33
+
34
+ - **Quality is non-negotiable** — Testing is not optional; it is an integral part of our definition of done
35
+ - **Prevention over detection** — We invest in early testing, automation, and continuous quality practices to prevent defects rather than finding them late
36
+ - **Risk-based approach** — Testing resources are allocated based on business risk, compliance requirements, and customer impact
37
+ - **Continuous improvement** — We regularly review and enhance our testing practices based on metrics, retrospectives, and industry best practices
38
+ - **Compliance-first mindset** — All testing activities support our ISO 27001, GDPR, and other regulatory compliance objectives
39
+ - **Accountability regardless of authorship** — The human who commits code is responsible for it, whether they wrote it manually, generated it with AI, or received it from a third party
40
+
41
+ ---
42
+
43
+ ## Strategic Alignment
44
+
45
+ This policy directly supports Metasession's strategic plan:
46
+
47
+ **Operational Excellence & Compliance** — Testing provides documented evidence for ISO 27001 certification audits, demonstrates adherence to secure SDLC practices, and produces automated audit trails.
48
+
49
+ **Service Market Development** — Our testing expertise differentiates Metasession as a premium QA partner and builds credibility with clients in regulated industries.
50
+
51
+ **Product Portfolio Growth** — Consistent testing standards ensure quality across all products while automation enables rapid iteration without sacrificing reliability.
52
+
53
+ ---
54
+
55
+ ## Organizational Commitments
56
+
57
+ ### What Every Release Must Include
58
+
59
+ 1. **Test planning** — Documented scope, resources, entry/exit criteria, and risks
60
+ 2. **Test design** — Test cases with traceability to requirements
61
+ 3. **Test execution** — Recorded evidence with timestamps, results, and responsible parties
62
+ 4. **Security scanning** — Static analysis and dependency auditing on every change
63
+ 5. **Defect management** — All defects tracked with severity and closure verification
64
+ 6. **Test reporting** — Completion reports with pass/fail metrics and release recommendations
65
+
66
+ ### Compliance Framework
67
+
68
+ Metasession's testing practices conform to:
69
+
70
+ - **ISO/IEC 29119-3** — Software testing documentation
71
+ - **ISO 27001** — Information security management
72
+ - **GDPR** — Data protection and privacy
73
+ - Industry best practices for agile testing and DevOps
74
+
75
+ ### Periodic Security Commitments
76
+
77
+ Beyond per-change scanning, Metasession commits to:
78
+
79
+ - **Quarterly:** Full codebase security review, dependency deep audit, access control review, audit log integrity check
80
+ - **Annually:** Penetration testing by qualified third party, disaster recovery testing, third-party security assessment, AI use policy review
81
+
82
+ Specific schedules and procedures are defined in the Periodic Security Review Schedule.
83
+
84
+ ---
85
+
86
+ ## AI-Assisted Development Governance
87
+
88
+ ### Policy Statement
89
+
90
+ Metasession embraces AI as a development tool while recognizing that AI-generated code introduces specific compliance risks requiring explicit controls. AI assistance does not reduce testing requirements — it increases them.
91
+
92
+ ### The Risk Profile
93
+
94
+ AI-generated code presents risks distinct from human-authored code:
95
+
96
+ - **Confident incorrectness** — Plausible-looking code with subtle logic errors or security flaws
97
+ - **Hallucinated dependencies** — Fabricated, outdated, or vulnerable packages
98
+ - **Non-determinism** — The same prompt may produce different code on different runs
99
+ - **Training data contamination** — Reproduction of insecure patterns
100
+ - **No inherent audit trail** — No default record of what was asked or generated
101
+
102
+ ### Mandatory Controls
103
+
104
+ 1. **Human review as a formal compliance gate** — Every AI-generated piece of code must be reviewed by a qualified human before entering the test pipeline. The review must be logged with reviewer identity, date, and scope.
105
+
106
+ 2. **Automated security scanning on every commit** — AI-generated code must pass the same SAST and dependency scanning gates as human-authored code. These are mandatory, not optional.
107
+
108
+ 3. **Dependency and supply chain verification** — All dependencies in AI-assisted changes must be verified as real, current, and vulnerability-free.
109
+
110
+ 4. **Regeneration triggers full retest** — If a developer regenerates a component from scratch (not incremental editing), that triggers full retest of the component and dependents. Functional equivalence cannot be assumed.
111
+
112
+ 5. **Documentation proportional to risk** — Each project's Test Plan defines AI tool permissions, review requirements, and prompt/output retention based on risk level.
113
+
114
+ ### Permitted AI Tools
115
+
116
+ | Tool | Permitted Use | Restrictions |
117
+ |---|---|---|
118
+ | Claude (Anthropic) | Code generation, test generation, documentation, review assistance | No deployment without human review |
119
+ | GitHub Copilot | Inline code suggestions | Same review requirements as any AI-generated code |
120
+
121
+ Adding a new tool requires Engineering Leadership approval and updates to this policy, the Test Strategy, and relevant project Test Plans.
122
+
123
+ ### What AI May and May Not Generate
124
+
125
+ **Permitted (with mandatory human review):** Application logic, UI components, test code, database queries, migration scripts, documentation, configuration, utility functions.
126
+
127
+ **Requires elevated review (senior developer + security):** Authentication/authorization logic, cryptographic operations, payment processing, data validation for user input, API security middleware, database schema changes affecting PII.
128
+
129
+ **Prohibited (must be human-authored):** Security credentials or secrets, production environment configuration values, compliance policy documents.
130
+
131
+ ### Accountability
132
+
133
+ The human who commits AI-generated code is accountable for its correctness, security, and compliance. The PR reviewer who approves it shares accountability for having verified its quality. "The AI wrote it" is not an acceptable explanation.
134
+
135
+ ### EU AI Act Preparedness
136
+
137
+ Metasession monitors evolving AI regulation. For projects under high-risk classification (healthcare, employment, critical infrastructure), using AI to build the system may require disclosure and conformity assessment. Project Test Plans must address this where applicable.
138
+
139
+ ---
140
+
141
+ ## Risk-Based Testing
142
+
143
+ Testing effort is prioritized by risk level, determined at planning time:
144
+
145
+ **High Priority** — Sensitive data handling, security-critical functionality, regulatory compliance features, core revenue capabilities, production infrastructure changes, AI-generated code in any of these categories.
146
+
147
+ **Medium Priority** — New feature development, significant refactoring, third-party integrations, performance optimizations, AI-generated code for non-security features.
148
+
149
+ **Low Priority** — Minor UI updates, configuration changes, documentation, internal tools with limited impact.
150
+
151
+ AI involvement in Medium or High categories raises risk by one level. The Test Strategy defines specific testing depth requirements per level.
152
+
153
+ ---
154
+
155
+ ## Roles & Responsibilities
156
+
157
+ ### Engineering Leadership
158
+ - Approve and maintain this policy
159
+ - Allocate testing resources
160
+ - Review metrics and drive improvement
161
+ - Approve AI tool additions
162
+
163
+ ### QA Team / Test Engineers
164
+ - Design and execute strategies and plans
165
+ - Develop and maintain automated suites
166
+ - Report defects and verify fixes
167
+ - Generate reports and maintain evidence repositories
168
+ - Verify security scan results
169
+
170
+ ### Developers
171
+ - Write unit tests for all changes
172
+ - Execute local testing before committing (including security scans)
173
+ - Fix identified defects
174
+ - Review and take accountability for all AI-generated code committed
175
+ - Document AI use per project requirements
176
+
177
+ ### Product Managers / Business Analysts
178
+ - Define clear acceptance criteria
179
+ - Participate in test planning and risk assessment
180
+ - Review and approve completion reports
181
+ - Sign off on release readiness
182
+
183
+ ---
184
+
185
+ ## Metrics & Continuous Improvement
186
+
187
+ Metasession tracks:
188
+
189
+ - **Test coverage** — Percentage of requirements with associated tests
190
+ - **Automation rate** — Automated vs. manual tests
191
+ - **Defect detection rate** — Defects found per testing phase
192
+ - **Defect escape rate** — Production defects not caught during testing
193
+ - **Test execution rate** — Planned tests executed
194
+ - **Pass/fail trends** — Historical results over time
195
+ - **Security findings** — SAST and dependency findings per release
196
+ - **AI code review rate** — AI-generated code formally reviewed before merge
197
+
198
+ Quarterly reviews assess trends and identify improvements. Findings feed into retrospectives and annual planning.
199
+
200
+ ---
201
+
202
+ ## Compliance & Audit Support
203
+
204
+ All test artifacts must be:
205
+
206
+ - **Traceable** — Linked to requirements, user stories, or risk assessments
207
+ - **Timestamped** — With date, time, and responsible party
208
+ - **Retained** — Minimum 3 years for ISO audits and compliance reviews
209
+ - **Accessible** — Retrievable within 24 hours for audit requests
210
+
211
+ AI use documentation is retained alongside other evidence for the same period.
212
+
213
+ ---
214
+
215
+ ## Policy Exceptions
216
+
217
+ Exceptions require:
218
+
219
+ 1. Written justification with risk assessment
220
+ 2. Documented risk acceptance by Engineering Leadership
221
+ 3. Compensating controls to mitigate risk
222
+ 4. Time-bound with defined remediation date
223
+
224
+ All exceptions logged and reviewed quarterly. Exceptions to AI governance controls are not permitted for High risk changes.
225
+
226
+ ---
227
+
228
+ ## Training & Awareness
229
+
230
+ All team members receive:
231
+
232
+ - **Onboarding** — Testing standards and tools
233
+ - **Annual refresher** — Policy changes, new tools, compliance updates
234
+ - **Role-specific** — Specialized training for QA, developers, PMs
235
+ - **Compliance** — ISO 27001, GDPR, secure testing practices
236
+ - **AI-assisted development** — Responsible use, review requirements, recognizing AI failure modes
237
+
238
+ Training completion is tracked as ISO 27001 evidence.
239
+
240
+ ---
241
+
242
+ ## Document Hierarchy
243
+
244
+ ```
245
+ Test Policy (this document)
246
+ → WHY we test, WHAT we commit to, WHO is responsible
247
+
248
+ Test Strategy
249
+ → HOW we approach testing methodically
250
+
251
+ Test Architecture
252
+ → WHAT we build tests with, HOW we structure the code
253
+
254
+ Periodic Security Review Schedule
255
+ → WHEN periodic security activities happen
256
+
257
+ Project Test Plans (per product)
258
+ → WHERE and WHEN for specific products
259
+ ```
260
+
261
+ ---
262
+
263
+ ## Document Control
264
+
265
+ | Version | Date | Author | Changes |
266
+ |---|---|---|---|
267
+ | 1.0 | January 2026 | Engineering Leadership | Initial creation |
268
+ | 2.0 | March 2026 | Engineering Leadership | Added AI governance, security commitments |
269
+ | 3.0 | March 2026 | Engineering Leadership | Clean boundary split — removed content now owned by Test Strategy (methodology) and Test Architecture (tooling) |
270
+
271
+ **Next Review Date:** March 2027
272
+
273
+ **Related Documents:** Test Strategy, Test Architecture, Periodic Security Review Schedule, Project Test Plans (in devaudit/sdlc/files/)
274
+
275
+ ---
276
+
277
+ **Policy Status:** Approved | **Effective Date:** March 2026