Repository navigation
fix(dotagents): keep global agent rules fresh on switch and fleet - #3133
Conversation
make switch ran ruler-dotdirs-sync last and never ran ruler-apply-global, so stale gitignored Ruler outputs overwrote ~/.claude/CLAUDE.md on every switch. The fleet updater only runs make install, which never syncs dotagents at all. - switch/CI: run ruler-dotdirs-sync first, ruler-apply-global last - dotfiles-updater: run dotagents-switch-sync after install (non-fatal) and provide bun, jq, rsync on its PATH - bump dotagents for the sync ordering and dead-skill fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning This organization's free trial has ended, so Indent couldn't start this review. Manage billing to resume reviews on this repository.
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 5
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- dotagents sync ordering fix: The
dotagents-switch-synctarget now runsruler-dotdirs-syncfirst andruler-apply-globallast. The non-CIdotagents-syncdelegates to the upstreamsynctarget (via submodule bump) which already has the correct ordering. The CI branch mirrors the same core order (dotdirs before commands/skills/mcp) but omitsruler-apply-global(appropriate for CI). Verified the bumped submodule (8990316) containsruler-apply-globaland thesynctarget with the correct sequence. - Fleet updater calls dotagents sync:
home-manager/services/dotfiles-updater/update.shnow runsmake dotagents-switch-syncafter./install.sh. A failure is logged and does not block theinstalled-commitmarker. This ensures fleet hosts pick up fresh agent rules on update. - PATH additions: Added
bun,jq,rsyncto both Darwin (launchd) and Linux (systemd) service PATHs — required by the dotagents Makefile targets (bun forruler-apply-globaland skills install; jq forskills-lock; rsync for all sync targets). - Test coverage: New shellspec case
'syncs dotagents after install without blocking the marker'validates the non-blocking failure behavior and marker advancement.
Observations (not blocking)
- Darwin launchd PATH missing
pkgs.gnumake: The Linux systemd PATH includespkgs.gnumakebut the Darwin launchd PATH does not. The newmake dotagents-switch-synccall inupdate.shbypassesinstall.sh's nix-shell fallback for missing make. On macOS without Xcode CLT,makeresolves to the system Apple make 3.81 (or is missing entirely) — this could silently skip agent rule sync on Darwin fleet hosts. Consider addingpkgs.gnumaketo the launchd PATH for parity. - Non-blocking failure means no retry until next commit: Since
make dotagents-switch-syncfailure does not block the marker, a transient failure (network, missing make, etc.) leaves the host with stale agent rules until the next upstream commit lands. This is an intentional trade-off documented in the PR; consider a separatedotagents-syncedmarker if retry-on-failure is desired later. - CI branch omits
ruler-apply-globalandskills-install: This is intentional and correct for CI (ephemeral runners, no external skill install needed). The PR body's "same order" claim is slightly imprecise but the core ordering (dotdirs first) is preserved.
All shellspec tests pass (26 examples, 0 failures per PR body). The fix correctly addresses the reported bug where stale repo-local ruler-dotdirs-sync outputs overwrote ~/.claude/CLAUDE.md on every make switch.
free | 𝕏

Summary
dotagents-switch-sync(used bymake switch) ranruler-dotdirs-synclast and never ranruler-apply-global, so stale gitignored repo-local Ruler outputs overwrote~/.claude/CLAUDE.mdand other agent rules on every switch. That is why sessions still saw "No co-authorship" weeks after feat(rules): include AI co-author trailer on agent commits dotagents#213. It now runs dotdirs first andruler-apply-globallast; the CI branch ofdotagents-syncuses the same order.dotfiles-updateronly ranmake install, which never syncs dotagents, so fleet hosts kept whatever agent rules they were provisioned with. It now runsmake dotagents-switch-syncafter install. A failure there is logged and does not block the installed-commit marker.bun,jq, andrsyncare added to the service PATH on Linux and Darwin.dotagentsto fix(sync): apply global rules last and keep syncing on failure dotagents#215 (sync ordering, non-aborting sync, removal of dead BetterWright skills).Verification
shellspec spec/dotfiles_updater_spec.sh: 26 examples, 0 failures (new case covers the sync call and the non-blocking failure).make dotagents-switch-syncexits 0 locally;~/.claude/CLAUDE.mdcontains the co-author rule.🤖 Generated with Claude Code
Summary by cubic
Fixes agent rule sync so
make switchstops overwriting~/.claude/CLAUDE.mdand other global Ruler outputs with stale repo-local copies, and makes fleet hosts pick up current agent rules on update.dotagents-switch-syncnow runsruler-dotdirs-syncfirst andruler-apply-globallast; the CI branch ofdotagents-syncuses the same order.dotfiles-updaternow runsmake dotagents-switch-syncafter install so hosts get fresh agent rules, skills, and MCP configs; a sync failure is logged and does not block the installed-commit marker.bun,jq, andrsyncto the service PATH on Linux and Darwin.dotagentssubmodule for sync ordering and dead-skill removals.Written for commit b8445cf. Summary will update on new commits.