Skip to content

fix(dotagents): keep global agent rules fresh on switch and fleet - #3133

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/fleet-dotagents-sync
Oct 19, 2026
Merged

shunkakinoki merged 1 commit into
mainfrom
fix/fleet-dotagents-sync

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • dotagents-switch-sync (used by make switch) ran ruler-dotdirs-sync last and never ran ruler-apply-global, so stale gitignored repo-local Ruler outputs overwrote ~/.claude/CLAUDE.md and 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 and ruler-apply-global last; the CI branch of dotagents-sync uses the same order.
  • dotfiles-updater only ran make install, which never syncs dotagents, so fleet hosts kept whatever agent rules they were provisioned with. It now runs make dotagents-switch-sync after install. A failure there is logged and does not block the installed-commit marker. bun, jq, and rsync are added to the service PATH on Linux and Darwin.
  • Bumps dotagents to 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-sync exits 0 locally; ~/.claude/CLAUDE.md contains the co-author rule.

🤖 Generated with Claude Code


Summary by cubic

Fixes agent rule sync so make switch stops overwriting ~/.claude/CLAUDE.md and other global Ruler outputs with stale repo-local copies, and makes fleet hosts pick up current agent rules on update.

  • dotagents-switch-sync now runs ruler-dotdirs-sync first and ruler-apply-global last; the CI branch of dotagents-sync uses the same order.
  • dotfiles-updater now runs make dotagents-switch-sync after install so hosts get fresh agent rules, skills, and MCP configs; a sync failure is logged and does not block the installed-commit marker.
  • Adds bun, jq, and rsync to the service PATH on Linux and Darwin.
  • Bumps the dotagents submodule for sync ordering and dead-skill removals.

Written for commit b8445cf. Summary will update on new commits.

View guided diff

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>
@shunkakinoki
shunkakinoki merged commit 7d91d3f into main Oct 19, 2026
2 checks passed
@indent

indent Bot commented Oct 19, 2026

Copy link
Copy Markdown

Warning

This organization's free trial has ended, so Indent couldn't start this review. Manage billing to resume reviews on this repository.

Review agents

Select any unchecked box below to run or rerun that agent.

Pending (1)
  • Indent Review Agent · This agent has not run.
Full results

Indent Review Agent

  • Summary: This agent has not run.
  • Latest resultNo result — this agent has not run.

@shunkakinoki
shunkakinoki deleted the fix/fleet-dotagents-sync branch October 19, 2026 18:37
@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

SHUN-24986

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc21933d-d35e-4819-81cb-b42733bc3728
📥 Commits

Reviewing files that changed from the base of the PR and between 6a9f6af and b8445cf.

📒 Files selected for processing: 5
  • Makefile
  • dotagents
  • home-manager/services/dotfiles-updater/default.nix
  • home-manager/services/dotfiles-updater/update.sh
  • spec/dotfiles_updater_spec.sh
+-----------------------------------------------------------------------------------------+
| If you don't make mistakes, you're not working on hard enough problems. - Frank Wilczek |
+-----------------------------------------------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • dotagents sync ordering fix: The dotagents-switch-sync target now runs ruler-dotdirs-sync first and ruler-apply-global last. The non-CI dotagents-sync delegates to the upstream sync target (via submodule bump) which already has the correct ordering. The CI branch mirrors the same core order (dotdirs before commands/skills/mcp) but omits ruler-apply-global (appropriate for CI). Verified the bumped submodule (8990316) contains ruler-apply-global and the sync target with the correct sequence.
  • Fleet updater calls dotagents sync: home-manager/services/dotfiles-updater/update.sh now runs make dotagents-switch-sync after ./install.sh. A failure is logged and does not block the installed-commit marker. This ensures fleet hosts pick up fresh agent rules on update.
  • PATH additions: Added bun, jq, rsync to both Darwin (launchd) and Linux (systemd) service PATHs — required by the dotagents Makefile targets (bun for ruler-apply-global and skills install; jq for skills-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 includes pkgs.gnumake but the Darwin launchd PATH does not. The new make dotagents-switch-sync call in update.sh bypasses install.sh's nix-shell fallback for missing make. On macOS without Xcode CLT, make resolves to the system Apple make 3.81 (or is missing entirely) — this could silently skip agent rule sync on Darwin fleet hosts. Consider adding pkgs.gnumake to the launchd PATH for parity.
  • Non-blocking failure means no retry until next commit: Since make dotagents-switch-sync failure 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 separate dotagents-synced marker if retry-on-failure is desired later.
  • CI branch omits ruler-apply-global and skills-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.

Pullfrog  | View workflow run | Using free | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant