Add scripts/commit_check.sh weekly commit-cadence guard

Mechanical nudge for the policy in AGENTS.md -> "Commit Cadence": it measures
how long the working tree has been dirty (oldest mtime among staged, unstaged
and untracked files) and exits 1 once that exceeds --days (default 7).

- Ignores submodule working-tree dirt (separate repo); still surfaces a moved
  submodule pointer.
- Reports dirty age, last edit, last commit; prints a reminder block.
- --quiet silences the clean case only; --help documents exit codes.
- Bash 3.2 compatible (macOS /bin/bash); no external deps.
- Verified: clean/dirty/old-dirt/threshold/bad-args/quiet all behave.

Also cross-reference it from AGENTS.md and README.md.
This commit is contained in:
B.D. Murphy
2026-09-21 07:04:52 -07:00
parent df36dad8aa
commit 2ea2b7c065
3 changed files with 166 additions and 0 deletions

View File

@@ -36,6 +36,14 @@ pytest tests/ -v
> month) of work uncommitted — a single accidental `git checkout` on 2026-09-20 wiped out a
> month of changes to `umbraaudio/web/routes.py`. See `AGENTS.md` → *Commit Cadence*.
`scripts/commit_check.sh` enforces the nudge: it exits non-zero once the tree has been dirty
longer than a week.
```bash
scripts/commit_check.sh # warn if dirty > 7 days
scripts/commit_check.sh --days 3 # tighter threshold
```
## Rebuilding from source
The repo tracks source only; large runtime data is reconstructed as needed.