@metasession.co/devaudit-cli 0.1.1 → 0.1.3

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 (69) 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.md +73 -0
  7. package/sdlc/HOST_ADAPTER.md +127 -0
  8. package/sdlc/SKILLS.md +137 -0
  9. package/sdlc/STACK_ADAPTER.md +130 -0
  10. package/sdlc/ai-rules/INSTRUCTIONS-SDLC.md +172 -0
  11. package/sdlc/ai-rules/README.md +103 -0
  12. package/sdlc/ai-rules/SDLC_RULES.md +584 -0
  13. package/sdlc/ai-rules/claude/CLAUDE.md +192 -0
  14. package/sdlc/ai-rules/cursor/.cursorrules +167 -0
  15. package/sdlc/ai-rules/windsurf/.windsurfrules +167 -0
  16. package/sdlc/article.md +219 -0
  17. package/sdlc/files/_common/0-project-setup.md +410 -0
  18. package/sdlc/files/_common/1-plan-requirement.md +381 -0
  19. package/sdlc/files/_common/2-implement-and-test.md +276 -0
  20. package/sdlc/files/_common/3-compile-evidence.md +603 -0
  21. package/sdlc/files/_common/4-submit-for-review.md +362 -0
  22. package/sdlc/files/_common/5-deploy-main.md +251 -0
  23. package/sdlc/files/_common/Periodic_Security_Review_Schedule.md +169 -0
  24. package/sdlc/files/_common/README_TEMPLATE.md +441 -0
  25. package/sdlc/files/_common/Test_Architecture.md +461 -0
  26. package/sdlc/files/_common/Test_Plan_TEMPLATE.md +311 -0
  27. package/sdlc/files/_common/Test_Policy.md +277 -0
  28. package/sdlc/files/_common/Test_Strategy.md +359 -0
  29. package/sdlc/files/_common/github/ISSUE_TEMPLATE/bug.yml +75 -0
  30. package/sdlc/files/_common/github/ISSUE_TEMPLATE/config.yml +11 -0
  31. package/sdlc/files/_common/github/ISSUE_TEMPLATE/requirement.yml +75 -0
  32. package/sdlc/files/_common/github/ISSUE_TEMPLATE/task.yml +48 -0
  33. package/sdlc/files/_common/github/pull_request_template.md +69 -0
  34. package/sdlc/files/_common/implementing-an-sdlc-issue.md +413 -0
  35. package/sdlc/files/_common/scripts/derive-release-version.sh +40 -0
  36. package/sdlc/files/_common/scripts/derive-release-version.test.sh +98 -0
  37. package/sdlc/files/_common/scripts/submit-for-uat-review.sh +162 -0
  38. package/sdlc/files/_common/scripts/validate-commits.sh +83 -0
  39. package/sdlc/files/_common/scripts/validate-compliance-artifacts.sh +202 -0
  40. package/sdlc/files/_common/scripts/validate-compliance-artifacts.test.sh +202 -0
  41. package/sdlc/files/_common/skills/_schema/skill.schema.json +36 -0
  42. package/sdlc/files/_common/skills/e2e-test-engineer/SKILL.md +254 -0
  43. package/sdlc/files/_common/skills/e2e-test-engineer/references/bootstrap.md +244 -0
  44. package/sdlc/files/_common/skills/e2e-test-engineer/references/evidence.ts +40 -0
  45. package/sdlc/files/_common/skills/sdlc-implementer/SKILL.md +189 -0
  46. package/sdlc/files/_common/skills/sdlc-implementer/references/call-graph.md +64 -0
  47. package/sdlc/files/_common/skills/sdlc-implementer/references/change-request-loop.md +192 -0
  48. package/sdlc/files/_common/skills/sdlc-implementer/references/compliance-constraints.md +81 -0
  49. package/sdlc/files/ci/check-release-approval.yml.template +201 -0
  50. package/sdlc/files/ci/ci-status-fallback.yml.template +41 -0
  51. package/sdlc/files/ci/ci.yml.template +390 -0
  52. package/sdlc/files/ci/compliance-evidence.yml.template +161 -0
  53. package/sdlc/files/ci/compliance-validation.yml.template +34 -0
  54. package/sdlc/files/ci/post-deploy-prod.yml.template +159 -0
  55. package/sdlc/files/ci/python/ci.yml.template +335 -0
  56. package/sdlc/files/hosts/_schema/adapter.schema.json +103 -0
  57. package/sdlc/files/hosts/railway/adapter.json +32 -0
  58. package/sdlc/files/sdlc-config.example.json +74 -0
  59. package/sdlc/files/stacks/_schema/adapter.schema.json +151 -0
  60. package/sdlc/files/stacks/node/adapter.json +54 -0
  61. package/sdlc/files/stacks/node/hooks/.prettierrc.json +9 -0
  62. package/sdlc/files/stacks/node/hooks/commit-msg +7 -0
  63. package/sdlc/files/stacks/node/hooks/commitlint.config.mjs +64 -0
  64. package/sdlc/files/stacks/node/hooks/lint-staged.config.mjs +16 -0
  65. package/sdlc/files/stacks/node/hooks/pre-commit +13 -0
  66. package/sdlc/files/stacks/node/hooks/pre-push +15 -0
  67. package/sdlc/files/stacks/node/scripts/check-requirement-jsdoc.sh +54 -0
  68. package/sdlc/files/stacks/python/adapter.json +36 -0
  69. package/sdlc/files/stacks/python/hooks/.pre-commit-config.yaml +51 -0
@@ -0,0 +1,169 @@
1
+ # Periodic Security Review Schedule
2
+
3
+ **Document Type:** Schedule | **Version:** 1.1 | **Effective Date:** March 2026 | **Review Cycle:** Quarterly
4
+
5
+ **Owner:** Engineering Leadership | **Approved By:** Executive Team
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ This document defines the security activities that occur on a schedule rather than per-feature. Per-commit security scanning (SAST and SCA) is defined in the Test Strategy (`sdlc/files/Test_Strategy.md` in DevAudit). Specific tooling for those scans is defined in the Test Architecture. This document covers the periodic activities: penetration testing, full codebase review, disaster recovery testing, dependency deep audits, and third-party assessments.
12
+
13
+ ---
14
+
15
+ ## Scope
16
+
17
+ This schedule applies to all Metasession products and client engagements. Project-specific procedures (URLs, databases, endpoints) are in each project's Test Plan.
18
+
19
+ ---
20
+
21
+ ## Schedule Overview
22
+
23
+ | Activity | Frequency | Owner | Evidence Location |
24
+ |---|---|---|---|
25
+ | Full codebase SAST review | Quarterly | QA / Security Lead | `compliance/evidence/periodic/sast-quarterly/` |
26
+ | Dependency deep audit | Quarterly | QA / Security Lead | `compliance/evidence/periodic/dependency-audit/` |
27
+ | Access control review | Quarterly | QA / Security Lead | `compliance/evidence/periodic/access-control/` |
28
+ | Audit log integrity review | Quarterly | QA / Security Lead | `compliance/evidence/periodic/audit-log/` |
29
+ | Penetration test | Annually | Third party | `compliance/evidence/periodic/pentest/` |
30
+ | Disaster recovery test | Annually | Engineering Lead | `compliance/evidence/periodic/dr-test/` |
31
+ | Third-party security assessment | Annually | Third party | `compliance/evidence/periodic/third-party/` |
32
+ | AI use policy review | Annually | Engineering Leadership | Test Policy revision history |
33
+ | Full compliance document review | Annually | Engineering Leadership | `compliance/` directory |
34
+
35
+ ---
36
+
37
+ ## Quarterly Activities
38
+
39
+ ### Full Codebase SAST Review
40
+
41
+ **Purpose:** Catch vulnerability patterns spanning multiple changes that per-commit scanning may miss in isolation.
42
+
43
+ **Procedure:**
44
+ 1. Run comprehensive SAST with expanded rule sets (including OWASP Top 10) across entire codebase
45
+ 2. Compare against previous quarter to identify trends
46
+ 3. Triage all findings by severity
47
+ 4. Create remediation tickets for high/critical
48
+ 5. Document accepted risks with justification for medium
49
+
50
+ **Evidence:** Full scan output (JSON), summary with trends, reviewer sign-off.
51
+
52
+ **Exit criteria:** 0 unresolved high/critical. Medium documented with plan or acceptance.
53
+
54
+ ### Dependency Deep Audit
55
+
56
+ **Purpose:** Go beyond per-commit auditing to review the full tree for unmaintained packages, license issues, and supply chain risks.
57
+
58
+ **Procedure:**
59
+ 1. Standard vulnerability check across all projects
60
+ 2. Check for outdated direct dependencies
61
+ 3. Review tree for unexpected or unnecessary packages
62
+ 4. Flag unmaintained dependencies (no updates 12+ months)
63
+ 5. Verify license compatibility
64
+ 6. Re-evaluate dependencies originally introduced by AI suggestion
65
+
66
+ **Evidence:** Audit output, outdated report, summary with actions.
67
+
68
+ ### Access Control Review
69
+
70
+ **Purpose:** Verify RBAC is correctly enforced across all protected endpoints.
71
+
72
+ **Procedure:**
73
+ 1. Run automated access control test suites
74
+ 2. Manual spot-check of key endpoints
75
+ 3. Review new endpoints added since last quarter
76
+ 4. Verify access control matrix is current
77
+
78
+ **Evidence:** Test results, endpoint verification matrix, findings.
79
+
80
+ ### Audit Log Integrity Review
81
+
82
+ **Purpose:** Confirm audit logs are generated correctly, complete, and tamper-resistant.
83
+
84
+ **Procedure:**
85
+ 1. Verify all auditable actions produce log entries
86
+ 2. Confirm entries contain: timestamp, user identity, action, resource
87
+ 3. Test that logs cannot be modified by application users
88
+ 4. Review retention compliance
89
+ 5. Sample-check entries for completeness
90
+
91
+ **Evidence:** Sample entries, completeness checklist, integrity results.
92
+
93
+ ---
94
+
95
+ ## Annual Activities
96
+
97
+ ### Penetration Testing
98
+
99
+ **Scope:** External-facing application, API (auth and unauth), authentication/session management, input validation, server configuration.
100
+
101
+ **Requirements:** Qualified third party. Black-box by default.
102
+
103
+ **Remediation SLAs:**
104
+
105
+ | Severity | Deadline |
106
+ |---|---|
107
+ | Critical | 7 days |
108
+ | High | 30 days |
109
+ | Medium | 90 days |
110
+ | Low | Next quarterly review |
111
+
112
+ ### Disaster Recovery Test
113
+
114
+ **Standard scenarios:**
115
+ 1. **Application failure** — Simulate, recover, verify, record time
116
+ 2. **Database recovery** — Restore from backup, verify integrity, record loss
117
+ 3. **Full environment rebuild** — Deploy from repo to fresh infrastructure, identify gaps
118
+
119
+ RTO and RPO targets are defined per project in their Test Plans.
120
+
121
+ ### Third-Party Security Assessment
122
+
123
+ **Scope:** Infrastructure config, secrets management, CI/CD security, dependency supply chain, AI use policy compliance.
124
+
125
+ **Required if:** Targeting SOC 2, processing regulated data, or contractually required.
126
+
127
+ ### AI Use Policy Review
128
+
129
+ **Checklist:** Current tools listed? Deprecated tools removed? Regulatory changes? Incidents this year? Retention requirements appropriate? Regeneration protocol followed?
130
+
131
+ ---
132
+
133
+ ## Unscheduled Triggers
134
+
135
+ | Event | Triggered Activity |
136
+ |---|---|
137
+ | Security incident or breach | Full SAST + pen test + access control review |
138
+ | Critical CVE in direct dependency | Immediate audit + patch |
139
+ | Significant architecture change | Access control review + SAST |
140
+ | New AI tool adopted | AI use policy review |
141
+ | Regulatory change | Full compliance document review |
142
+ | Production rollback | Root cause analysis + relevant review |
143
+
144
+ ---
145
+
146
+ ## Compliance Framework Mapping
147
+
148
+ | Framework | Control | Covered By |
149
+ |---|---|---|
150
+ | SOC 2 (CC7.1) | System monitoring | Quarterly SAST + audit log review |
151
+ | SOC 2 (CC6.1) | Logical access | Quarterly access control review |
152
+ | SOC 2 (CC8.1) | Change management | Per-feature pipeline + quarterly reviews |
153
+ | ISO 27001 (A.12.6) | Vulnerability management | SAST + dependency audit (quarterly + per-commit) |
154
+ | ISO 27001 (A.17.1) | Business continuity | Annual DR test |
155
+ | PCI-DSS (11.3) | Penetration testing | Annual pen test |
156
+ | OWASP | Top 10 coverage | SAST config includes OWASP rules |
157
+
158
+ ---
159
+
160
+ ## Document Control
161
+
162
+ | Version | Date | Author | Changes |
163
+ |---|---|---|---|
164
+ | 1.0 | March 2026 | Engineering Leadership | Initial schedule |
165
+ | 1.1 | March 2026 | Engineering Leadership | Updated document references for clean boundary split |
166
+
167
+ **Next Review Date:** June 2026 (quarterly)
168
+
169
+ **Related Documents:** Test Policy, Test Strategy, Test Architecture, Project Test Plans (in devaudit/sdlc/files/)
@@ -0,0 +1,441 @@
1
+ # [PROJECT NAME] — Development & Compliance Workflow System
2
+
3
+ **Standard:** ISO/IEC/IEEE 29119-3:2021 | **Version:** 1.0 | **Date:** [DATE]
4
+
5
+ ---
6
+
7
+ ## Document Structure
8
+
9
+ ### Tier 1 — Universal (Metasession-wide)
10
+
11
+ | Document | Owns |
12
+ |----------|------|
13
+ | **Test Policy** | Why we test, commitments, AI governance, roles, accountability |
14
+ | **Test Strategy** | How we approach testing — methodology, risk classification, security, AI protocol |
15
+ | **Test Architecture** | What we build with — tools, patterns, code standards, CI config |
16
+ | **Periodic Security Review** | When periodic security activities happen |
17
+
18
+ ### Tier 2 — Project-Specific
19
+
20
+ | Document | Purpose |
21
+ |----------|---------|
22
+ | **Project Setup** | One-time: repository, CI, compliance configuration |
23
+ | **Test Plan** | Environment, test suites, exit criteria, AI config, evidence |
24
+ | **Workflows 0-5** | Operational pipeline procedures |
25
+
26
+ ---
27
+
28
+ ## Pipeline
29
+
30
+ ```
31
+ 0. SETUP One-time: repo, CI, compliance dirs, tooling (0-project-setup.md)
32
+ 1. PLAN Define requirement, classify risk, generate test scope
33
+ 2. IMPLEMENT Code on develop, run all local gates
34
+ 3. EVIDENCE Compile test + security + AI evidence
35
+ 4. PR Create PR → CI runs independent verification automatically
36
+ 5. REVIEW Human reviews code + CI results + evidence
37
+ 6. APPROVE PR approval = formal sign-off
38
+ 7. MERGE Auto-deploy to production
39
+ 8. VERIFY Health + security verification
40
+ 9. FINALIZE RTM closed, release ticket approved
41
+ ```
42
+
43
+ ## Quick Reference
44
+
45
+ | Scenario | Workflows |
46
+ |----------|-----------|
47
+ | New project setup | 0 (once) |
48
+ | New feature (tracked) | 1 → 2 → 3 → 4 → (CI + review) → 5 |
49
+ | Bug fix / docs / config | 2 → 4 → (CI + review) → 5 |
50
+
51
+ ## Mandatory Gates
52
+
53
+ | Gate | Local | CI (PR) | Threshold |
54
+ |------|-------|---------|-----------|
55
+ | TypeScript | Yes | Yes | 0 errors |
56
+ | SAST | Yes | Yes | 0 high/critical |
57
+ | Dependencies | Yes | Yes | 0 high/critical |
58
+ | E2E (Playwright) | All | Unauthenticated subset | All pass |
59
+ | Human review | — | PR approved | Approved |
60
+
61
+ ## Risk Levels
62
+
63
+ | Level | Extra Requirements |
64
+ |-------|-------------------|
65
+ | Low | Standard gates |
66
+ | Medium | + access control + audit log testing |
67
+ | High | + pen test consideration + independent review |
68
+
69
+ AI in Medium/High categories raises risk one level.
70
+
71
+ ## CI/CD
72
+
73
+ | Trigger | What Runs |
74
+ |---------|-----------|
75
+ | Push to `develop` | TypeScript + build |
76
+ | PR to `main` | TypeScript + SAST + deps + E2E (unauthenticated) |
77
+ | Merge to `main` | Auto-deploy |
78
+
79
+ CI is the independent verification gate — evidence produced by GitHub, not the developer. See Test Plan for details.
80
+
81
+ ---
82
+
83
+ ## How to Use: Prompt Guide
84
+
85
+ This system is designed to be driven by prompts to your AI assistant. Each workflow is triggered by giving the AI the right context and instruction. The AI reads the workflow file, follows the steps, and produces the required artifacts.
86
+
87
+ ### Starting a New Project
88
+
89
+ ```
90
+ Read 0-project-setup.md and execute the full project setup for [PROJECT NAME].
91
+
92
+ The project is a [brief description] built with [stack]. It's hosted on [platform]
93
+ at [URL]. The database is [database type].
94
+
95
+ Set up the repository structure, branch protection, CI pipeline, compliance
96
+ directories, and create the project Test Plan from the template.
97
+ ```
98
+
99
+ ### Workflow 1: Planning a New Feature
100
+
101
+ **Simple feature (likely Low risk):**
102
+
103
+ ```
104
+ Read 1-plan-requirement.md and plan a new requirement.
105
+
106
+ I want to add [describe the feature]. Follow the workflow: determine the next
107
+ REQ ID, classify the risk level, add the RTM entry, create the evidence
108
+ directory, generate the test scope, and commit.
109
+ ```
110
+
111
+ **Feature touching sensitive areas (likely Medium/High):**
112
+
113
+ ```
114
+ Read 1-plan-requirement.md and plan a new requirement.
115
+
116
+ I want to modify the [authentication/payment/user data] system to [describe
117
+ the change]. This touches [security-sensitive area] so classify risk
118
+ appropriately. Follow the full workflow including the AI use note since
119
+ you'll be generating the implementation code.
120
+ ```
121
+
122
+ ### Workflow 2: Implementation
123
+
124
+ **Standard implementation:**
125
+
126
+ ```
127
+ Read 2-implement-and-test.md and implement REQ-XXX.
128
+
129
+ Refer to the test scope in compliance/evidence/REQ-XXX/test-scope.md for
130
+ what needs to be tested. Implement the feature, add JSDoc headers, run all
131
+ local gates (TypeScript, SAST, dependency audit, E2E tests), and push to develop.
132
+ ```
133
+
134
+ **Resuming after a break:**
135
+
136
+ ```
137
+ Read 2-implement-and-test.md. I'm continuing work on REQ-XXX.
138
+
139
+ Check the current state: verify we're on develop, review what's been done so
140
+ far, check what items remain in the test scope, and continue implementation.
141
+ Run all gates before pushing.
142
+ ```
143
+
144
+ **Fixing a failing gate:**
145
+
146
+ ```
147
+ Read 2-implement-and-test.md. The SAST scan found issues after my last commit.
148
+
149
+ Review the findings, fix the legitimate issues, document any false positives
150
+ in compliance/evidence/REQ-XXX/sast-review.md, and re-run all gates.
151
+ ```
152
+
153
+ ### Workflow 3: Compiling Evidence
154
+
155
+ **After implementation is complete:**
156
+
157
+ ```
158
+ Read 3-compile-evidence.md and compile all evidence for REQ-XXX.
159
+
160
+ Verify all gates pass, save test evidence, save security evidence (SAST +
161
+ dependency audit), verify AI use documentation is complete, check that all
162
+ test scope items are addressed, update the RTM, generate the release ticket,
163
+ and commit everything.
164
+ ```
165
+
166
+ ### Workflow 4: Submitting for Review
167
+
168
+ **Creating the PR:**
169
+
170
+ ```
171
+ Read 4-submit-for-review.md and create the PR for REQ-XXX.
172
+
173
+ Verify develop is ready, review what will be in the PR, create it with the
174
+ full compliance checklist, and link it to the release ticket. Then check
175
+ that CI starts running.
176
+ ```
177
+
178
+ **After CI fails on the PR:**
179
+
180
+ ```
181
+ Read 4-submit-for-review.md, Step 4 (Wait for CI). CI failed on the PR.
182
+
183
+ Check which job failed using gh pr checks, diagnose the issue, fix it,
184
+ re-run local gates to confirm, and push so CI re-runs.
185
+ ```
186
+
187
+ **After reviewer requests changes:**
188
+
189
+ ```
190
+ Read 4-submit-for-review.md, Step 7 (Handle Feedback). The reviewer
191
+ requested changes: [describe the feedback].
192
+
193
+ Make the requested changes, re-run all local gates, update security evidence
194
+ if needed, and push to develop.
195
+ ```
196
+
197
+ ### Workflow 5: Deploying
198
+
199
+ **After PR is approved:**
200
+
201
+ ```
202
+ Read 5-deploy-main.md and deploy REQ-XXX.
203
+
204
+ Merge the PR, sync branches, verify the deployment (health check, smoke test,
205
+ security verification), finalize the compliance artifacts (move release ticket,
206
+ update RTM, add audit trail entries), and do the final sync.
207
+ ```
208
+
209
+ **If deployment fails:**
210
+
211
+ ```
212
+ Read 5-deploy-main.md, Rollback section. The deployment is failing.
213
+
214
+ [Describe the symptoms]. Execute the rollback procedure and document it in
215
+ the release ticket audit trail.
216
+ ```
217
+
218
+ ### Untracked Changes (No REQ — Bug Fixes, Docs, Config)
219
+
220
+ **Quick fix:**
221
+
222
+ ```
223
+ Read 2-implement-and-test.md. I need to fix a bug: [describe the bug].
224
+
225
+ This doesn't need a tracked requirement. Implement the fix, run all local gates,
226
+ commit, and push. Then read 4-submit-for-review.md and create a PR with the
227
+ simplified untracked changes template.
228
+ ```
229
+
230
+ ### Periodic Security Reviews
231
+
232
+ **Quarterly review:**
233
+
234
+ ```
235
+ Read the Periodic Security Review Schedule and execute the quarterly review
236
+ for this project.
237
+
238
+ Run the full codebase SAST scan, dependency deep audit, access control review,
239
+ and audit log integrity check. Save all evidence to the periodic directories.
240
+ ```
241
+
242
+ **Annual penetration test prep:**
243
+
244
+ ```
245
+ Read the Periodic Security Review Schedule, annual penetration testing section.
246
+
247
+ Prepare the scope document for the pen tester based on our project's Test Plan.
248
+ List the target URLs, API endpoints, authentication mechanism, and any specific
249
+ areas of concern.
250
+ ```
251
+
252
+ ### Tips for Effective Prompts
253
+
254
+ **Always reference the workflow file.** Starting with "Read [workflow].md" ensures the AI follows the documented process rather than improvising.
255
+
256
+ **Provide context the AI needs.** The AI knows the workflow steps but doesn't know what you're building unless you tell it. Describe the feature, the area of the codebase, and any constraints.
257
+
258
+ **Let the AI classify risk.** Don't pre-classify unless you're certain. The AI applies the risk matrix from the Test Strategy consistently. If you disagree with its classification, discuss it — the human always has final say.
259
+
260
+ **Chain workflows naturally.** You don't need to complete one workflow in a single prompt. Break long sessions across multiple prompts. The compliance artifacts (RTM, evidence directory, test scope) maintain state between sessions.
261
+
262
+ **Use "continue" for long workflows.** Implementation (workflow 2) often spans multiple sessions:
263
+
264
+ ```
265
+ Continue with REQ-XXX. Where did we leave off? Check the test scope
266
+ and resume from there.
267
+ ```
268
+
269
+ **For the full pipeline in one session** (small features):
270
+
271
+ ```
272
+ Read the workflow files 1 through 5. I want to implement [small feature].
273
+
274
+ Run through the entire pipeline: plan the requirement, implement it, compile
275
+ evidence, create the PR, and after approval, deploy. This is a straightforward
276
+ change so it should be Low risk.
277
+ ```
278
+
279
+ ---
280
+
281
+ ## DevAudit Integration
282
+
283
+ DevAudit is the centralised compliance evidence portal for all Metasession projects. It replaces git-based evidence storage with a web application that provides secure, auditor-accessible evidence management.
284
+
285
+ **What changes when DevAudit is active:**
286
+
287
+ ### Evidence Storage (Workflow 3: Compile Evidence)
288
+
289
+ Evidence artifacts are uploaded to DevAudit instead of being committed to git.
290
+
291
+ | Before (git-based) | After (DevAudit) |
292
+ |---------------------|---------------------|
293
+ | `cp e2e-results.json compliance/evidence/REQ-XXX/` | CLI script or CI uploads to DevAudit |
294
+ | `git add compliance/evidence/REQ-XXX/` | Binary artifacts excluded via `.gitignore` |
295
+ | Evidence only visible to repo collaborators | Evidence visible to anyone with an access grant |
296
+ | Screenshots bloat git history permanently | Files stored in Supabase Storage, not git |
297
+
298
+ **What stays in git:**
299
+ - `compliance/RTM.md` — source of truth for requirement tracking
300
+ - `compliance/test-plan.md` — project test plan
301
+ - `compliance/test-cases.md` — test case specifications
302
+ - `compliance/test-summary-report.md` — test execution summary
303
+ - `compliance/evidence/REQ-XXX/test-scope.md` — pre-implementation test scope (text, not binary)
304
+ - `compliance/evidence/REQ-XXX/ai-use-note.md` — AI involvement records (text)
305
+ - `compliance/evidence/REQ-XXX/security-summary.md` — security summary (text)
306
+ - Release tickets in `compliance/pending-releases/` and `compliance/approved-releases/`
307
+
308
+ **What moves to DevAudit:**
309
+ - Screenshots (PNG, JPEG) from E2E test runs
310
+ - `e2e-results.json` and other generated test result files
311
+ - `sast-results.json` and `dependency-audit.json`
312
+ - Playwright HTML reports
313
+ - Any other binary or generated artifacts
314
+
315
+ ### Compliance Document Syncing
316
+
317
+ CI automatically uploads read-only snapshots of the compliance source documents (RTM, test plan, test cases, test summary report) to DevAudit on every merge to `main`. Auditors see the full compliance picture — planning documents alongside evidence — in one place, without needing repository access.
318
+
319
+ The source of truth for these documents remains in git. Developers continue to edit them as part of the normal workflow. DevAudit holds read-only copies tagged with the git SHA they were synced from.
320
+
321
+ ### CI Pipeline Changes
322
+
323
+ The sync script generates CI workflows from templates. The main CI pipeline (`ci.yml`) registers the release in DevAudit in parallel with quality gates, then uploads evidence after gates pass (including Playwright HTML reports and Jest coverage). A separate `compliance-evidence.yml` handles compliance-only pushes (e.g. RTM updates, release tickets) without running the full quality gate suite.
324
+
325
+ For manual integration, add the DevAudit evidence upload step to your CI workflow, after tests pass. The upload script is available at `scripts/upload-evidence.sh`.
326
+
327
+ ```yaml
328
+ # Add to .github/workflows/ci.yml, after the E2E test job
329
+ upload-evidence:
330
+ name: Upload Evidence to DevAudit
331
+ runs-on: ubuntu-latest
332
+ needs: [e2e-tests]
333
+ if: github.event_name == 'pull_request'
334
+ steps:
335
+ - uses: actions/checkout@v4
336
+
337
+ # Upload test artifacts
338
+ - name: Upload E2E evidence
339
+ run: |
340
+ ./scripts/upload-evidence.sh \
341
+ --project [PROJECT_SLUG] \
342
+ --requirement "${{ github.event.pull_request.title }}" \
343
+ --type e2e_result \
344
+ --git-sha "${{ github.sha }}" \
345
+ --ci-run-id "${{ github.run_id }}" \
346
+ --path playwright-report/
347
+ env:
348
+ DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
349
+ DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
350
+
351
+ # Upload security evidence
352
+ - name: Upload SAST evidence
353
+ run: |
354
+ ./scripts/upload-evidence.sh \
355
+ --project [PROJECT_SLUG] \
356
+ --requirement "${{ github.event.pull_request.title }}" \
357
+ --type test_report \
358
+ --git-sha "${{ github.sha }}" \
359
+ --path sast-results.json
360
+ env:
361
+ DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
362
+ DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
363
+
364
+ # Sync compliance docs on merge to main
365
+ sync-compliance-docs:
366
+ name: Sync Compliance Documents
367
+ runs-on: ubuntu-latest
368
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
369
+ steps:
370
+ - uses: actions/checkout@v4
371
+ - name: Upload compliance documents
372
+ run: |
373
+ for doc in compliance/RTM.md compliance/test-plan.md compliance/test-cases.md compliance/test-summary-report.md; do
374
+ [ -f "$doc" ] && ./scripts/upload-evidence.sh \
375
+ --project [PROJECT_SLUG] \
376
+ --requirement _compliance-docs \
377
+ --type compliance_document \
378
+ --git-sha "${{ github.sha }}" \
379
+ --path "$doc"
380
+ done
381
+ env:
382
+ DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
383
+ DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
384
+ ```
385
+
386
+ ### .gitignore Updates
387
+
388
+ Add to your project's `.gitignore` to stop tracking binary evidence:
389
+
390
+ ```gitignore
391
+ # Compliance binary evidence (stored in DevAudit)
392
+ compliance/evidence/**/*.json
393
+ compliance/evidence/**/*.png
394
+ compliance/evidence/**/*.jpeg
395
+ compliance/evidence/**/*.html
396
+ compliance/evidence/**/screenshots/
397
+ compliance/evidence/**/playwright-report/
398
+ compliance/evidence/adhoc-*/
399
+ ```
400
+
401
+ ### Workflow 3 Prompt (Updated)
402
+
403
+ When DevAudit is active, the evidence compilation prompt changes:
404
+
405
+ ```
406
+ Read 3-compile-evidence.md and compile all evidence for REQ-XXX.
407
+
408
+ Verify all gates pass. For binary evidence (screenshots, JSON results,
409
+ HTML reports), upload to DevAudit using the CLI script instead of
410
+ committing to git. Keep text-based evidence (test-scope.md, security-summary.md,
411
+ ai-use-note.md) in git. Update the RTM, generate the release ticket, and commit.
412
+ ```
413
+
414
+ ### Access for Auditors
415
+
416
+ Project admins manage auditor access through DevAudit:
417
+
418
+ 1. Navigate to the project in DevAudit
419
+ 2. Go to Access Management
420
+ 3. Enter the auditor's email, select "viewer" role, set an optional expiry date
421
+ 4. The auditor receives a magic link email — no password required
422
+ 5. Revoke access at any time from the same page
423
+
424
+ For one-off reviews, generate a time-limited share link instead of creating an account.
425
+
426
+ ### Required Secrets and Variables
427
+
428
+ Add these to your GitHub repository (Settings → Secrets and variables → Actions):
429
+
430
+ | Setting | Tab | Value | Source |
431
+ |--------|-----|-------|--------|
432
+ | `DEVAUDIT_BASE_URL` | Variables | The deployed DevAudit URL, e.g. `https://devaudit.metasession.co` | The hosting team |
433
+ | `DEVAUDIT_API_KEY` | Secrets | Project-scoped API key (`mc_…`) with `uploader` role | DevAudit → Project Settings → API Keys → New key |
434
+
435
+ ### Project Registration
436
+
437
+ Before CI can upload evidence, the project must be registered in DevAudit:
438
+
439
+ 1. Sign in to DevAudit as an admin
440
+ 2. Create a new project with the project slug matching `[PROJECT_SLUG]` used in CI
441
+ 3. The storage namespace and access grants are created automatically