Skip to content

feat(autosync): rill autosync for hooks, GUI timers, and scheduled jobs - #103

Merged
tarr1124 merged 4 commits into
mainfrom
feat/rill-sync
Oct 20, 2026
Merged

tarr1124 merged 4 commits into
mainfrom
feat/rill-sync

Conversation

@tarr1124

Copy link
Copy Markdown
Contributor

Adds rill autosync <mode> so Claude Code hooks, a GUI timer, and scheduled jobs can keep a vault and its remote main in step without racing each other.

  • hook-stop / hook-start for the Stop and SessionStart hooks (background run with failure reporting via systemMessage; waiting run at session start)
  • run / check / status with --json for GUI use; check is one ls-remote plus local status
  • one lock in .git/ for every caller, stale-lock takeover, a 10s minimum gap between background pushes (delayed, never dropped), pause/resume for jobs that push once at the end
  • skips off the sync branch unless RILL_PUSH_BRANCH is set; CLAUDE_CODE_REMOTE=true defaults it for cloud sessions

rill sync is already the plugin adapter command, hence the new name.

Tests: test/cli/test-autosync.sh (32/32), test-push-rebase.sh (51/51), test-cli-smoke.sh (50/50), PII and CJK guards clean, shellcheck clean at warning.

🤖 Generated with Claude Code

tarr1124 and others added 4 commits October 20, 2026 10:56
Adds `rill autosync <mode>`, which keeps a vault and one branch of its
push remote (main by default) in step for callers that run unattended.
Each run is `rill push` under a lock in .git/ shared by every caller of
the clone, with the result kept in .git/rill-autosync.last.

- hook-stop: Claude Code Stop hook; starts a detached background run in
  its own process group and returns at once; reports the previous
  failure once as a systemMessage; background pushes stay >=10s apart
  (delayed, never dropped)
- hook-start: SessionStart hook; runs and waits
- run/check/status [--json]: for a GUI timer and manual use; check is
  one ls-remote plus local status, nothing fetched
- pause/resume: hold runs while the calling process lives
- skips off the sync branch unless RILL_PUSH_BRANCH is set; RILL_AUTOSYNC=0
  turns hooks off; CLAUDE_CODE_REMOTE=true defaults RILL_PUSH_BRANCH

Writer resolution moves to a shared _rill_writer helper. New test
test/cli/test-autosync.sh (32 assertions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…keover, push as own process, named sync branch, JSON control chars, interval under lock); Claude-Session trailer for cloud commits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ranch setting, no drop on lock timeout, per-process pauses, pipefail audit, PII allowlist)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no SIGPIPE in failure report, capped JSON message, unpushed without tracking ref, absolute RILL_HOME)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tarr1124
tarr1124 merged commit 97c6fc1 into main Oct 20, 2026
4 checks passed
@tarr1124
tarr1124 deleted the feat/rill-sync branch October 20, 2026 02:27
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