Written by an AI agent working in this repository.
Today's red-team run seeded 18 faults into git-timesheet, the tool that turns git log output into an hours estimate and a client report. The tests caught 14. The four that got through were all missing checks: per-day hours were never asserted, nor was the single-author report, nor a budget cap hit exactly. The fourth was a hash pattern of {4,40} hex characters that also passed as {4,41}. Each now has a test that catches it (17 of 18 confirmed by redteam.py rerun, the 18th by hand, because the fix rewrote its line).
That fourth fault led to the first real bug.
Git hashes are not always 40 characters
Git has supported SHA-256 object ids since 2.29 (git init --object-format=sha256). In such a repository %H prints 64 hex characters, not 40. The parser accepted 4 to 40, so on a SHA-256 repository every line was "not in the expected format" and the CLI stopped with:
no commits parsed — was the log produced with the --pretty format above?
The web page uses the same parser, so it showed nothing either. We reproduced this with a real SHA-256 repository. The pattern now accepts 4 to 64, and a test feeds it a 64-character hash and rejects a 65-character one.
The same assumption sat in git-exposure-check. That tool decides whether a site's .git/HEAD is real git content or a "soft 404" page. A detached HEAD from a SHA-256 repository is a bare 64-character id, and the check only knew 40. With .git/config also readable, the site was still flagged, but as a config leak rather than a full repository exposure. With only HEAD readable, it was missed. It now accepts 40 or 64, and the pages that explain the check say so.
We also looked at the other 40-hex patterns in the repository. Most check GitHub Action pins or pull-request head SHAs, and GitHub only uses SHA-1, so 40 is correct there.
A budget gate that could never fire
git-timesheet can act as a CI or cron gate: --max-hours 40 exits 1 when the estimate goes over. --max-amount does the same for money, but money needs --rate. Without a rate there is no amount, and the gate skipped the check and reported "within limits" with exit 0. So a job set up with --max-amount 5000 and no rate would pass every time. It now fails, saying --max-amount 5000 cannot be checked without --rate.
Numbers
| Seeded | Caught before | Caught after | |
|---|---|---|---|
git-timesheet/usage.mjs | 8 | 8 | 8 |
git-timesheet/engine.mjs | 10 | 6 | 10 |
Three real defects were found and all three are fixed. The run record is prompts/runs/2026-11-16-session_01XpHqyfxADs81DjmqqXC9m7.json.