@metasession.co/devaudit-cli 0.1.66 → 0.1.67
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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/sdlc/ai-rules/INSTRUCTIONS-SDLC.md +8 -1
- package/sdlc/ai-rules/SDLC_RULES.md +16 -4
- package/sdlc/files/_common/1-plan-requirement.md +9 -1
- package/sdlc/files/_common/3-compile-evidence.md +86 -11
- package/sdlc/files/stacks/node/adapter.json +1 -1
- package/sdlc/files/stacks/node/hooks/prepare-commit-msg +55 -0
package/package.json
CHANGED
|
@@ -109,7 +109,14 @@ Upload to DevAudit (NEVER commit to git):
|
|
|
109
109
|
- E2E results (JSON), screenshots (PNG/JPG), SAST results (JSON), dependency audit (JSON), unit test output (TXT), test reports (HTML)
|
|
110
110
|
|
|
111
111
|
Keep in git (small markdown, needs PR review):
|
|
112
|
-
- compliance/RTM.md, test-scope.md, security-summary.md, ai-use-note.md, ai-prompts.md, release tickets
|
|
112
|
+
- compliance/RTM.md, test-scope.md, security-summary.md, ai-use-note.md (YAML frontmatter — devaudit-installer#197), ai-agent-handoff.md (if AI agent changed mid-implementation), ai-prompts.md, release tickets
|
|
113
|
+
|
|
114
|
+
### AI Contributor Tracking (devaudit-installer#197)
|
|
115
|
+
|
|
116
|
+
- `ai-use-note.md` uses YAML frontmatter with an `ai_contributors` list supporting multiple entries (tool, version, session_id, date_range, commits).
|
|
117
|
+
- The `prepare-commit-msg` git hook warns when the `Co-Authored-By` trailer changes between commits on the same branch, prompting creation of an `ai-agent-handoff.md` entry.
|
|
118
|
+
- The release ticket template includes an AI Contributors table with handoff and verification fields.
|
|
119
|
+
- Legacy `ai-use-note.md` files without YAML frontmatter are still accepted (portal falls back to text parsing).
|
|
113
120
|
|
|
114
121
|
### After Implementation
|
|
115
122
|
|
|
@@ -192,10 +192,20 @@ Tell the user: **"Let me create a test plan that maps the acceptance criteria to
|
|
|
192
192
|
|
|
193
193
|
### Step 9: Document AI involvement (if applicable)
|
|
194
194
|
|
|
195
|
-
Create `compliance/evidence/REQ-XXX/ai-use-note.md
|
|
195
|
+
Create `compliance/evidence/REQ-XXX/ai-use-note.md` with YAML frontmatter (devaudit-installer#197):
|
|
196
196
|
|
|
197
197
|
```markdown
|
|
198
|
-
|
|
198
|
+
---
|
|
199
|
+
ai_contributors:
|
|
200
|
+
- tool: "[tool name]"
|
|
201
|
+
version: "[tool version]"
|
|
202
|
+
session_id: "[session id]"
|
|
203
|
+
date_range: "[YYYY-MM-DD to YYYY-MM-DD]"
|
|
204
|
+
commits: []
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
# AI Use Record — REQ-XXX
|
|
208
|
+
|
|
199
209
|
Risk Classification Impact: [original risk] → [adjusted risk if AI involved]
|
|
200
210
|
Areas of AI involvement: [list]
|
|
201
211
|
```
|
|
@@ -391,7 +401,8 @@ Evidence uploaded to DevAudit project: [PROJECT_SLUG]
|
|
|
391
401
|
Verify these also exist in git:
|
|
392
402
|
- `compliance/evidence/REQ-XXX/test-scope.md` (from planning)
|
|
393
403
|
- `compliance/evidence/REQ-XXX/implementation-plan.md` (MEDIUM/HIGH risk — from implementation plan step)
|
|
394
|
-
- `compliance/evidence/REQ-XXX/ai-use-note.md` (if AI was used)
|
|
404
|
+
- `compliance/evidence/REQ-XXX/ai-use-note.md` (if AI was used — YAML frontmatter, devaudit-installer#197)
|
|
405
|
+
- `compliance/evidence/REQ-XXX/ai-agent-handoff.md` (if AI agent changed mid-implementation — devaudit-installer#197)
|
|
395
406
|
- `compliance/evidence/REQ-XXX/ai-prompts.md` (if AI was used, MEDIUM/HIGH risk)
|
|
396
407
|
|
|
397
408
|
### Step 4: Update RTM status
|
|
@@ -402,10 +413,11 @@ Change the requirement status from `DRAFT` or `IN PROGRESS` to `TESTED - PENDING
|
|
|
402
413
|
|
|
403
414
|
Create `compliance/pending-releases/RELEASE-TICKET-REQ-XXX.md` with:
|
|
404
415
|
- Summary of changes
|
|
416
|
+
- AI Contributors table (tool, version, session, commits, date range) — devaudit-installer#197
|
|
417
|
+
- AI handoffs (if any — reference `ai-agent-handoff.md`)
|
|
405
418
|
- Test changes (which test files were added/modified, what they cover, any gaps)
|
|
406
419
|
- Test evidence table (reference DevAudit portal for binary evidence)
|
|
407
420
|
- Security evidence (reference `security-summary.md` in git)
|
|
408
|
-
- AI involvement summary
|
|
409
421
|
- Post-deploy actions (data migrations, backfill scripts, or "None required")
|
|
410
422
|
- Audit trail
|
|
411
423
|
|
|
@@ -407,9 +407,17 @@ If AI will generate code (Medium/High risk):
|
|
|
407
407
|
|
|
408
408
|
```bash
|
|
409
409
|
cat > compliance/evidence/REQ-XXX/ai-use-note.md << 'EOF'
|
|
410
|
+
---
|
|
411
|
+
ai_contributors:
|
|
412
|
+
- tool: "[tool name]"
|
|
413
|
+
version: "[tool version]"
|
|
414
|
+
session_id: "[session id]"
|
|
415
|
+
date_range: "[YYYY-MM-DD to YYYY-MM-DD]"
|
|
416
|
+
commits: []
|
|
417
|
+
---
|
|
418
|
+
|
|
410
419
|
# AI Use Record — REQ-XXX
|
|
411
420
|
|
|
412
|
-
**AI Tool:** [tool name]
|
|
413
421
|
**Planned AI Use:** [implementation / test generation / both / none]
|
|
414
422
|
**Risk Classification Impact:** [note if risk was raised due to AI involvement]
|
|
415
423
|
EOF
|
|
@@ -260,19 +260,88 @@ For Medium/High risk, add access control and audit log verification to the secur
|
|
|
260
260
|
|
|
261
261
|
### Step 5: Save AI Evidence (If Applicable)
|
|
262
262
|
|
|
263
|
-
Verify `ai-use-note.md` and `ai-prompts.md` exist (if AI was used). If missing:
|
|
263
|
+
Verify `ai-use-note.md` and `ai-prompts.md` exist (if AI was used). If missing, create `ai-use-note.md` with YAML frontmatter (devaudit-installer#197):
|
|
264
264
|
|
|
265
265
|
```bash
|
|
266
266
|
cat > compliance/evidence/REQ-XXX/ai-use-note.md << 'EOF'
|
|
267
|
+
---
|
|
268
|
+
ai_contributors:
|
|
269
|
+
- tool: "[tool name]"
|
|
270
|
+
version: "[tool version]"
|
|
271
|
+
session_id: "[session id]"
|
|
272
|
+
date_range: "[YYYY-MM-DD to YYYY-MM-DD]"
|
|
273
|
+
commits: ["[commit sha]", "[commit sha]"]
|
|
274
|
+
---
|
|
275
|
+
|
|
267
276
|
# AI Use Record — REQ-XXX
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
277
|
+
|
|
278
|
+
## Summary
|
|
279
|
+
[Brief description of what the AI tool was used for]
|
|
280
|
+
|
|
281
|
+
## Code Generated By AI
|
|
282
|
+
- [list files]
|
|
283
|
+
|
|
284
|
+
## Human Reviewer
|
|
285
|
+
- **Name:** [name]
|
|
286
|
+
- **Review Date:** [date]
|
|
287
|
+
- **Regenerations:** [none / list]
|
|
288
|
+
|
|
289
|
+
## Risk Classification Impact
|
|
290
|
+
[original risk] → [adjusted risk if AI involved]
|
|
273
291
|
EOF
|
|
274
292
|
```
|
|
275
293
|
|
|
294
|
+
For multiple AI contributors (e.g. agent handoff mid-implementation), add additional entries to the `ai_contributors` YAML list:
|
|
295
|
+
|
|
296
|
+
```yaml
|
|
297
|
+
ai_contributors:
|
|
298
|
+
- tool: "OpenAI Codex"
|
|
299
|
+
version: "cascade-2024-06"
|
|
300
|
+
session_id: "cascade-13654549920348561833"
|
|
301
|
+
date_range: "2026-06-15 to 2026-06-17"
|
|
302
|
+
commits: ["b7c1d29", "5a538f6"]
|
|
303
|
+
- tool: "Claude"
|
|
304
|
+
version: "claude-3.5-sonnet"
|
|
305
|
+
session_id: "claude-987654321"
|
|
306
|
+
date_range: "2026-06-18"
|
|
307
|
+
commits: ["abc1234"]
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Backward compatibility:** Legacy `ai-use-note.md` files without YAML frontmatter are still accepted by the portal (falls back to text parsing). New files should use YAML.
|
|
311
|
+
|
|
312
|
+
If an AI agent handoff occurred mid-implementation, also create `ai-agent-handoff.md` (see Step 5b below).
|
|
313
|
+
|
|
314
|
+
### Step 5b: AI Agent Handoff Log (If Applicable)
|
|
315
|
+
|
|
316
|
+
If the AI tool changed mid-implementation (detected by the `prepare-commit-msg` git hook or observed manually), create `compliance/evidence/REQ-XXX/ai-agent-handoff.md`:
|
|
317
|
+
|
|
318
|
+
```markdown
|
|
319
|
+
# AI Agent Handoff Log — REQ-XXX
|
|
320
|
+
|
|
321
|
+
## Handoff 1
|
|
322
|
+
|
|
323
|
+
**Date:** [YYYY-MM-DD]
|
|
324
|
+
**From:** [tool name] (session [session id])
|
|
325
|
+
**To:** [tool name] (session [session id])
|
|
326
|
+
|
|
327
|
+
**Context Summary:**
|
|
328
|
+
- Completed: [what the previous agent finished]
|
|
329
|
+
- In Progress: [what was left incomplete]
|
|
330
|
+
- Blockers: [any known blockers]
|
|
331
|
+
|
|
332
|
+
**Files Modified by Previous Agent:**
|
|
333
|
+
- [list of files]
|
|
334
|
+
|
|
335
|
+
**Next Steps for New Agent:**
|
|
336
|
+
- [remaining tasks]
|
|
337
|
+
|
|
338
|
+
**Link to Full Context:**
|
|
339
|
+
- Previous session: [URL if available]
|
|
340
|
+
- REQ release ticket: compliance/pending-releases/RELEASE-TICKET-REQ-XXX.md
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
This file is uploaded as evidence with `evidence_type: compliance_document` and `evidence_category: ai_handoff` so the portal can query for it specifically.
|
|
344
|
+
|
|
276
345
|
### Step 6: Verify Test Scope and Implementation Plan
|
|
277
346
|
|
|
278
347
|
Review `compliance/evidence/REQ-XXX/test-scope.md` (created during PLAN stage). Confirm all testing items have been addressed:
|
|
@@ -331,11 +400,17 @@ Create `compliance/pending-releases/RELEASE-TICKET-REQ-XXX.md`:
|
|
|
331
400
|
## Summary
|
|
332
401
|
[1-3 sentences]
|
|
333
402
|
|
|
334
|
-
## AI
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
403
|
+
## AI Contributors
|
|
404
|
+
|
|
405
|
+
| Tool | Version | Session | Commits | Date Range |
|
|
406
|
+
|------|---------|---------|---------|------------|
|
|
407
|
+
| [tool / none] | [version] | [session id] | [N] | [YYYY-MM-DD to YYYY-MM-DD] |
|
|
408
|
+
|
|
409
|
+
**Handoffs:** [None / list — see `ai-agent-handoff.md` if applicable]
|
|
410
|
+
**Verification:** Claims match Co-Authored-By trailers in git history.
|
|
411
|
+
**AI-Generated Files:** [list, or "none"]
|
|
412
|
+
**Human Reviewer of AI Code:** [name]
|
|
413
|
+
**Components Regenerated:** [none / list]
|
|
339
414
|
|
|
340
415
|
## Implementation Details
|
|
341
416
|
**Files Modified:**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"manifest_file": "package.json",
|
|
6
6
|
"hook_framework": "husky",
|
|
7
7
|
"hook_install_dir": ".husky",
|
|
8
|
-
"hooks": ["commit-msg", "pre-commit", "pre-push"],
|
|
8
|
+
"hooks": ["commit-msg", "pre-commit", "pre-push", "prepare-commit-msg"],
|
|
9
9
|
"hook_config_files": ["commitlint.config.mjs", "lint-staged.config.mjs", ".prettierrc.json"],
|
|
10
10
|
"stack_scripts": ["check-requirement-jsdoc.sh"],
|
|
11
11
|
"required_dev_dependencies": [
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Husky prepare-commit-msg hook — detects AI agent changes mid-branch.
|
|
3
|
+
#
|
|
4
|
+
# When the Co-Authored-By trailer in the new commit message differs from
|
|
5
|
+
# the AI tool signature in the previous commit on the same branch, warns
|
|
6
|
+
# the operator to create an ai-agent-handoff.md entry (devaudit-installer#197).
|
|
7
|
+
#
|
|
8
|
+
# This is a WARNING-only hook — it never blocks the commit. The operator
|
|
9
|
+
# decides whether a handoff entry is warranted (e.g. same tool, different
|
|
10
|
+
# session → no handoff needed; different tool → handoff recommended).
|
|
11
|
+
#
|
|
12
|
+
# Install: cp this file to .husky/prepare-commit-msg && chmod +x .husky/prepare-commit-msg
|
|
13
|
+
#
|
|
14
|
+
# To disable: delete .husky/prepare-commit-msg or set DEVAUDIT_NO_AI_HOOK=1
|
|
15
|
+
|
|
16
|
+
# Allow opt-out
|
|
17
|
+
if [ -n "${DEVAUDIT_NO_AI_HOOK:-}" ]; then
|
|
18
|
+
exit 0
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
COMMIT_MSG_FILE="$1"
|
|
22
|
+
COMMIT_SOURCE="$2"
|
|
23
|
+
|
|
24
|
+
# Skip merge commits, squash, etc. — only check normal commits
|
|
25
|
+
if [ -n "$COMMIT_SOURCE" ] && [ "$COMMIT_SOURCE" != "message" ]; then
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Extract Co-Authored-By from the incoming commit message (if present)
|
|
30
|
+
CURRENT_AI=$(grep -i 'Co-Authored-By:' "$COMMIT_MSG_FILE" 2>/dev/null | head -1 | sed 's/.*Co-Authored-By:[[:space:]]*//' | tr -d '\r')
|
|
31
|
+
|
|
32
|
+
# Extract Co-Authored-By from the previous commit on this branch
|
|
33
|
+
LAST_AI=$(git log -1 --format='%b' 2>/dev/null | grep -i 'Co-Authored-By:' | head -1 | sed 's/.*Co-Authored-By:[[:space:]]*//' | tr -d '\r')
|
|
34
|
+
|
|
35
|
+
# Only warn if both exist and differ — a missing trailer on either side
|
|
36
|
+
# is not an agent change (the commitlint hook handles missing trailers)
|
|
37
|
+
if [ -z "$CURRENT_AI" ] || [ -z "$LAST_AI" ]; then
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
if [ "$CURRENT_AI" != "$LAST_AI" ]; then
|
|
42
|
+
echo ""
|
|
43
|
+
echo "⚠️ AI agent change detected (devaudit-installer#197):"
|
|
44
|
+
echo " Previous: $LAST_AI"
|
|
45
|
+
echo " Current: $CURRENT_AI"
|
|
46
|
+
echo ""
|
|
47
|
+
echo " Consider creating an ai-agent-handoff.md entry in"
|
|
48
|
+
echo " compliance/evidence/REQ-XXX/ to document the handoff."
|
|
49
|
+
echo " See SDLC/3-compile-evidence.md Step 5b for the template."
|
|
50
|
+
echo ""
|
|
51
|
+
echo " To suppress this warning: DEVAUDIT_NO_AI_HOOK=1"
|
|
52
|
+
echo ""
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
exit 0
|