SIGN IN SIGN UP

feat(daemon): periodic untraced commit fixup worker

Run the untraced-commit fixup on a timer so commits from JGit/libgit2
clients, sandboxes, or a daemon-off period are attributed without anyone
asking: every `GIT_AI_DAEMON_UNTRACED_FIXUP_INTERVAL_MS` (10 s, first tick
at startup) the worker stats the `HEAD` reflog of every known worktree and
schedules a pass only where it grew, at most 32 worktrees per tick,
rotating so none starve. A tick is skipped while trace frames are still
queued, so a pass never runs ahead of the commands those frames describe.
Combined with the 5 s minimum record age an untraced commit is attributed
within about 15 s; a restarted daemon catches up on remembered families at
once.

The worker is gated by the new `untraced_commit_fixup` feature flag (on in
debug and release); `fixup.scan` keeps working regardless. `status.daemon`
and the heartbeat report `known_repo_families`. Test daemons default the
interval to an hour so only opt-in tests see the timer. The design is
documented in docs/untraced-commit-fixup-spec.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
S
Sasha Varlamov committed
db46762000773da845a768990e3d18f55dd1b081
Parent: e8cf505