Skip to main content

Git Audit Scheduled Hook

Periodic trigger for scripts/git_audit.py to maintain Git repository hygiene across the CODITECT ecosystem.


Purpose

Automatically run Git audit scans on a schedule to:

  1. Detect uncommitted work — Flag repos with changes at risk of data loss
  2. Identify stale repos — Surface repositories with no recent activity
  3. Monitor submodule health — Catch drift between submodule pointers and actual state
  4. Generate trend reports — Track hygiene metrics over time

Trigger

Event: Scheduled (cron/launchd)

ScheduleScopeThreshold
Daily (8am)Active project dirs7 days
Weekly (Monday)All project dirs30 days
Pre-releaseFull submodule tree14 days

Configuration

macOS (launchd)

<!-- ~/Library/LaunchAgents/com.coditect.git-audit.plist -->
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.coditect.git-audit</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>scripts/git_audit.py</string>
<string>/Users/halcasteel/PROJECTS</string>
<string>--output</string>
<string>/Users/halcasteel/PROJECTS/.coditect-data/audit-reports/git-audit-latest.md</string>
<string>--days</string>
<string>30</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>8</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>WorkingDirectory</key>
<string>/Users/halcasteel/PROJECTS/coditect-rollout-master/submodules/core/coditect-core</string>
</dict>
</plist>

Linux (cron)

# Daily at 8am — audit all projects
0 8 * * * cd ~/coditect-core && python3 scripts/git_audit.py ~/PROJECTS --output ~/.coditect-data/audit-reports/git-audit-$(date +\%Y\%m\%d).md --days 30

Output Location

~/.coditect-data/audit-reports/
├── git-audit-latest.md # Most recent report
├── git-audit-20260215.md # Daily snapshots
└── git-audit-20260215.json # JSON for dashboarding

Integration

ComponentRole
scripts/git_audit.pyAudit engine
/git-audit commandOn-demand invocation
skills/git-audit-patternsUsage patterns and workflow
hooks/git-audit-pre-push.mdPush-time guard

Behavior

  1. Run python3 scripts/git_audit.py <root> --output <report> --days <threshold>
  2. Parse results for critical issues (UNSTAGED, STAGED_UNCOMMITTED)
  3. If critical issues found in active project repos, surface warning on next session start
  4. Archive report with date suffix for trend analysis