sync-daily --verify caught a commit stamped 23:59:52 that the daily count had silently dropped. The git log --until bound for the day was 23:59:00, so anything committed in the last minute of the day fell outside it.
How the sweep counts a day
sync-daily does one git log per repo over the whole date range and buckets the results by date. The sweeps share one SweepCache, and per-date results are memoised instead of rescanned for each date.
Nothing in that path raised an error. A commit that landed after 23:59:00 simply never showed up in any bucket, and the count looked complete.
Adding --verify
We added a --verify flag. It recounts each day from raw git and transcripts and from the written SYNC block, and exits 1 on a mismatch. Run against the sweep, it found the 23:59:52 commit that the bucketed count had missed.
The fix: both bounds to 23:59:59
The --until bounds are now 23:59:59, where they had been 23:59:00. The bizops outcomes query got the same change. Its git log --until now uses <D> 23:59:59, inclusive, so a midnight commit is not counted in two windows. Both changes shipped with tests.
The old bound cut off everything after 23:59:00, so it dropped a day’s last-minute commits without a word. Now sync-daily --verify exits 1 whenever its recount disagrees with the written SYNC block.
AI Skills
Use this lesson with the AI assistant you already use
A commit stamped 23:59:52 was missing from the daily count because the git log until bound for the day was 23:59:00. A new verify flag in sync-daily recounted from raw git and caught the gap.
Paste the prompt, share only the context needed to answer it, and treat the result as a draft for your review. Do not include confidential information or let an AI assistant make changes without your approval.
Optional: for a visual report and saved memory, run /dxdev first.
Don’t have it? Get it at dxdev.com/skills/dxdev. The prompt works without it.
dxdev LESSON · paste into your AI coding agent
LESSON: Make Day Boundary Bounds Inclusive Of The Final Second And Verify Counts By Recounting From Raw Sources
SOURCE: dxdev.com/blog/last-minute-commit-of-the-day
WHAT HAPPENED: The sync-daily sweep runs one git log per repo over the whole date range and buckets results by date. The until bound for each day was 23:59:00, so any commit in the last minute of the day fell outside it and was dropped without any error. The new verify flag recounts each day from raw git and transcripts and from the written SYNC block, and it exits 1 on a mismatch. Run against the sweep, it surfaced the 23:59:52 commit. Both bounds were moved to 23:59:59, and the bizops outcomes query got the same inclusive bound so a midnight commit is not counted in two windows. Both changes shipped with tests.
THE RULE: A time window that is meant to cover a whole day must include the final second, and a derived count should be checked by an independent recount from the raw source that fails loudly on disagreement. Silent undercounting at a boundary only shows up when something recounts it.
CHECK MY CODE, then report PASS or FAIL with file:line for each:
1. Every day-range query that uses an until or end bound ends at 23:59:59 inclusive, or uses an exclusive bound at the next midnight, so no commit in the last minute is excluded.
2. Adjacent windows are checked so that a commit exactly at midnight lands in exactly one window and is never counted in two.
3. A verify step recounts each day from the raw source and compares it with the written summary, and the process exits nonzero on any mismatch.
THEN PRINT: a table (check, PASS/FAIL, evidence, fix) + a verdict (applies / partially / OUT_OF_SCOPE / no) + the single most important next action.