title: "Accountability Drift Audit — Weekly Cron" owner: Q domain: quality fr: FR-G3 spec: docs/plans/claude-surface-restructure/fr-g3-drift-audit-routine.md last_updated: 2026-04-21
Accountability Drift Audit — Weekly Cron
Owner: Q (Quality System Manager) Cadence: Weekly, Sunday at 05:00 (before Monday operational sweep) Script:
scripts/audit/accountability-drift.jsOutput:data/audits/accountability-drift-{YYYY-MM-DD}.json
This procedure documents the crontab setup for the FR-G3 weekly sweep on VFT-CommandCtr.
The script also runs on every git commit that touches .claude/agents/*.md via the post-commit hook (installed by scripts/session-hooks/install-git-hooks.sh).
Crontab Line
0 5 * * 0 cd /mnt/d/Projects/value-first-operations && node scripts/audit/accountability-drift.js --trigger weekly-cron >> /tmp/accountability-drift.log 2>&1
Expression breakdown:
| Field | Value | Meaning |
|---|---|---|
| minute | 0 |
At :00 |
| hour | 5 |
05:00 |
| day of month | * |
Any |
| month | * |
Any |
| day of week | 0 |
Sunday |
Installation Steps
Step 1: Open crontab editor
crontab -e
Status: NOT BUILT — crontab entry has not yet been installed on VFT-CommandCtr.
Step 2: Add the cron line
Paste the following line at the end of the crontab:
0 5 * * 0 cd /mnt/d/Projects/value-first-operations && node scripts/audit/accountability-drift.js --trigger weekly-cron >> /tmp/accountability-drift.log 2>&1
Status: NOT BUILT
Step 3: Save and exit
The crontab editor will install the entry on save (:wq for vi, Ctrl+X for nano).
Status: NOT BUILT
Step 4: Verify cron is installed
crontab -l | grep accountability-drift
Expected output:
0 5 * * 0 cd /mnt/d/Projects/value-first-operations && node scripts/audit/accountability-drift.js --trigger weekly-cron >> /tmp/accountability-drift.log 2>&1
Status: NOT BUILT
Step 5: Verify node is available in cron environment
Cron runs with a minimal PATH. Confirm node is at /usr/bin/node or add a PATH override:
which node # Should return a path like /usr/bin/node or /usr/local/bin/node
If node is at a non-standard path (e.g., via nvm), prefix the cron line with the full path:
0 5 * * 0 cd /mnt/d/Projects/value-first-operations && /home/chris/.nvm/versions/node/v20.x.x/bin/node scripts/audit/accountability-drift.js --trigger weekly-cron >> /tmp/accountability-drift.log 2>&1
Or add a PATH line at the top of the crontab:
PATH=/usr/local/bin:/usr/bin:/bin
Status: UNTESTED — node path in cron environment not yet verified.
Step 6: Install post-commit hook (if not already done)
The post-commit hook fires on every commit touching .claude/agents/*.md. Install once after clone:
bash scripts/session-hooks/install-git-hooks.sh
Status: ASSUMED — hook installer updated as part of FR-G3 implementation but not yet re-run on VFT-CommandCtr.
Verification
Manual test run
cd /mnt/d/Projects/value-first-operations
node scripts/audit/accountability-drift.js
Expected: Scans all non-excluded .claude/agents/*.md files, writes findings to data/audits/accountability-drift-{today}.json, exits 0 if fewer than 3 failures.
Status: VERIFIED — self-test run on 2026-04-21 as part of FR-G3 implementation (see self-test results in FR-G3 implementation handoff).
Confirm output file was written
ls -la /mnt/d/Projects/value-first-operations/data/audits/
Expected: accountability-drift-YYYY-MM-DD.json present.
Status: VERIFIED — output file written during self-test.
Check log after first cron run
tail -50 /tmp/accountability-drift.log
Expected: Timestamped output showing agents scanned, passed, failed counts.
Status: NOT BUILT — cron not yet installed; log file not yet created.
CAR Trigger Protocol
If the script exits with code 1 (car_triggered: true), Q acts:
- Read the findings JSON at
data/audits/accountability-drift-{date}.json - Run
/corrective-action-reportreferencing:- The findings file path
- The specific agent files listed in
findings[].agent_file - The specific check IDs listed in
findings[].checks_failed - Last-known-good state = the previous run's findings file (or FR-B2 completion if first failure post-B2)
- Assign remediation to the agent owner (typically Aegis for structural population, or the last git editor per
git log --follow .claude/agents/{name}.md)
Threshold: agents_failed >= 3 triggers a CAR. 1–2 failures do not trigger a CAR — Q reviews manually.
Exclusions
The script automatically excludes:
_template.md— not an agent definition- Files with
status: archivedorstatus: deactivatedin YAML frontmatter - Files with
surface: archivedin YAML frontmatter (e.g.,loom.md)
Retention
The script deletes audit files older than 30 days from data/audits/ at the start of each run. Files outside the accountability-drift-*.json pattern are not touched.
Checks Reference (G3-C1 through G3-C7)
| Check | Name | Pass | Fail |
|---|---|---|---|
| G3-C1 | Field presence | accountability: key exists in YAML frontmatter |
Key absent or misspelled |
| G3-C2 | Outcomes list | outcomes: list has at least one entry |
Empty list or key absent |
| G3-C3 | ID format | Each id matches ^[a-z][a-z0-9-]+-[0-9]+$ |
ID missing, empty, or wrong format |
| G3-C4 | Statement presence | statement: is a non-empty string |
Key missing or empty string |
| G3-C5 | Verification presence | verification: is a non-empty string |
Key missing or empty string |
| G3-C6 | No duplicate IDs | All id values within the agent are unique |
Two outcomes with identical IDs |
| G3-C7 | Codename prefix match | Each id prefix matches the agent's filename codename |
Prefix is a different agent's codename — copy-paste drift |
Change Log
| Date | Author | Change |
|---|---|---|
| 2026-04-21 | Squire | Initial document (FR-G3 implementation) |