feat: live-sync heartbeat for machine-written paths #12

Merged
dank merged 2 commits from feat/11-live-sync into main 2026-10-18 16:28:58 -07:00
Owner

What

Heartbeat daemon that commits the machine's own writes. Closes the gap where "the checkout IS the deployment" + symlinked live state meant memories / auto-learned skills / agent config / dotfiles accumulated as permanent dirty files. Refs #11.

  • scripts/live-sync.sh — allowlist tiers only, hooks armed (secret gate stays pointed at the diff), merges origin/main, pushes, reaps stale wt/* worktrees. Never stages task dirt, never auto-resolves conflicts (abort + ntfy alert), never --no-verify/force, refuses off-main.
  • systemd user units (live-sync.service/.timer, ~15 min tick).
  • Tier law in AGENTS.md § Live-sync tiers; KB page omp-docs/tools/live-sync.md registered in the tools index + log entry.

Evidence

  • bats tests/ → 36/36 (9 new black-box tests pin the contract: allowlist-only commits, no-op, conflict-abort-keep-commit, branch guard, hook-refusal-stays-staged, origin-less repo, worktree reaping, alert throttle).
  • scripts/kb-lint.sh: 3 violations, all pre-existing in untouched files.
  • Timer not enabled anywhere yet — enabling is systemctl --user enable --now live-sync.timer after merge (per-unit OK kept manual).

Known

main moved during development; branch is based on the tip that includes PR #10.

## What Heartbeat daemon that commits the machine's own writes. Closes the gap where "the checkout IS the deployment" + symlinked live state meant memories / auto-learned skills / agent config / dotfiles accumulated as permanent dirty files. Refs #11. - `scripts/live-sync.sh` — allowlist tiers only, hooks armed (secret gate stays pointed at the diff), merges `origin/main`, pushes, reaps stale `wt/*` worktrees. Never stages task dirt, never auto-resolves conflicts (abort + ntfy alert), never `--no-verify`/force, refuses off-`main`. - systemd user units (`live-sync.service`/`.timer`, ~15 min tick). - Tier law in AGENTS.md § Live-sync tiers; KB page `omp-docs/tools/live-sync.md` registered in the tools index + log entry. ## Evidence - `bats tests/` → 36/36 (9 new black-box tests pin the contract: allowlist-only commits, no-op, conflict-abort-keep-commit, branch guard, hook-refusal-stays-staged, origin-less repo, worktree reaping, alert throttle). - `scripts/kb-lint.sh`: 3 violations, all pre-existing in untouched files. - Timer **not enabled anywhere yet** — enabling is `systemctl --user enable --now live-sync.timer` after merge (per-unit OK kept manual). ## Known `main` moved during development; branch is based on the tip that includes PR #10.
dank added 1 commit 2026-10-18 16:14:12 -07:00
The checkout IS the deployment and symlinks make live state (memories,
auto-learned skills, agent config, desktop settings) dirty tracked files
continuously; no commit law covered machine churn, so it accumulated
unpushed for weeks — one disk held the only copy of ~61 managed skills,
a settings fix stayed local-only, and dirty trees refused merges.

scripts/live-sync.sh (systemd user timer, ~15 min) commits ONLY the
allowlisted machine/desktop-live tiers with hooks armed, merges
origin/main, pushes, and reaps wt/* worktrees older than 7 days. Task
dirt outside the allowlist is never staged; conflicts abort and alert
via ntfy; branch guard refuses off main; never --no-verify, never force.
Black-box contract pinned by tests/live-sync.bats (9 tests, suite 36/36).

Refs #11
dank added 1 commit 2026-10-18 16:28:52 -07:00
Operator decision at review: 15 min is aggressive for config churn; hourly
keeps the stale-window acceptable (<=1 h) with a fifth of the wakeups.
Timer unit, tier law, and failure-table wording aligned.
dank merged commit 964bd06073 into main 2026-10-18 16:28:58 -07:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dank/command-center#12