WIP: Runner: write safe.directory entries to ~/.gitconfig.local, not ~/.gitconfig #603

Draft
toasterson wants to merge 2 commits from claude/wi-01a00afa-runner-write-safe-directory-entries-to-g into main
Owner

Anima work item 01a00afa-cfab-7873-9761-9573ba934f48.

Found on armini 2026-08-16: the anima-runner appends [safe] directory = /Users/toasty/ws/.anima-runner/worktrees/<uuid> entries (one per worktree, ~20 accumulated) directly to ~/.gitconfig. That file is a khepri-rendered file that hard-reverts on drift, so every hourly khepri apply silently drops the runner's entries (bit us 2026-08-16; restored by hand).

Fix in the runner: write the safe.directory entries to ~/.gitconfig.local instead — the khepri git render already includes it via [include] path = ~/.gitconfig.local and never manages it, so the runner stops racing the render.

Note: the dotfiles manifest is gaining a machine-scoped glob ([safe] directory = /Users/toasty/ws/.anima-runner/worktrees/*, supported since git 2.46; armini has Apple Git 2.50.1) rendered into ~/.gitconfig on armini, which makes the per-worktree entries redundant — the runner change is belt-and-braces so it degrades cleanly on machines without the glob, and stops mutating a khepri-owned file either way. Consider also pruning stale per-worktree entries the runner previously wrote to ~/.gitconfig.local when their worktrees are gone.

Anima work item `01a00afa-cfab-7873-9761-9573ba934f48`. Found on armini 2026-08-16: the anima-runner appends `[safe] directory = /Users/toasty/ws/.anima-runner/worktrees/<uuid>` entries (one per worktree, ~20 accumulated) directly to `~/.gitconfig`. That file is a khepri-rendered file that hard-reverts on drift, so every hourly `khepri apply` silently drops the runner's entries (bit us 2026-08-16; restored by hand). Fix in the runner: write the safe.directory entries to `~/.gitconfig.local` instead — the khepri git render already includes it via `[include] path = ~/.gitconfig.local` and never manages it, so the runner stops racing the render. Note: the dotfiles manifest is gaining a machine-scoped glob (`[safe] directory = /Users/toasty/ws/.anima-runner/worktrees/*`, supported since git 2.46; armini has Apple Git 2.50.1) rendered into ~/.gitconfig on armini, which makes the per-worktree entries redundant — the runner change is belt-and-braces so it degrades cleanly on machines without the glob, and stops mutating a khepri-owned file either way. Consider also pruning stale per-worktree entries the runner previously wrote to ~/.gitconfig.local when their worktrees are gone.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/wi-01a00afa-runner-write-safe-directory-entries-to-g:claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git switch claude/wi-01a00afa-runner-write-safe-directory-entries-to-g

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git switch claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git rebase main
git switch main
git merge --ff-only claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git switch claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git rebase main
git switch main
git merge --no-ff claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git switch main
git merge --squash claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git switch main
git merge --ff-only claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git switch main
git merge claude/wi-01a00afa-runner-write-safe-directory-entries-to-g
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!603
No description provided.