live-sync: heartbeat daemon for machine-written (symlinked) config paths #11

Closed
opened 2026-10-18 16:06:09 -07:00 by dank · 1 comment
Owner

Problem

The checkout is the deployment and many tracked files are live state written through symlinks by the harness, auto-learn, GUI apps, and agents mid-session (memories, managed-skills, agent/config.yml, agent/models.yml, dotfiles/**). The commit-hygiene doctrine ("a dirty tracked file is a half-deployed config") has no pressure valve for this continuous machine churn, so it accumulates silently.

Observed cost, 2026-10-18:

  • 24 modified + 63 untracked files sitting unpushed in ~/.omp; ~61 auto-learned managed-skills existed only on one disk.
  • A settings fix (features.unexpectedStopDetection: smart -> mechanical) stayed local-only; other workstations pulling today inherit the broken value.
  • Push rejected because remote moved AND local tree was dirty -> merge refused across the exact files PR #8 touched; 10 files were byte-identical ghosts of upstream edits.
  • 7 stale wt/* worktrees never reaped.

Proposal: scripts/live-sync.sh heartbeat daemon

Allowlist-driven auto-commit of machine-written paths, main checkout only:

Tier Paths Law
Human prose AGENTS.md, omp-docs/**, scripts/** unchanged (branch -> PR -> Frank OK)
Machine live agent/memories, agent/managed-skills, agent/config.yml, agent/models.yml auto-commit daemon
Desktop live dotfiles/** auto-commit daemon

Behavior:

  • flock'd, quiet-exit when nothing allowlisted is dirty; stages ONLY allowlist paths (git add -A -- <paths>), never sweeps task dirt.
  • Commits WITH hooks (secret gate stays armed; a block is an alert, never a bypass).
  • git fetch + merge origin/<branch>; on conflict: merge --abort, keep local commit, ntfy alert, stop. Never auto-resolve, never force, never --no-verify.
  • Refuses to run on any branch other than main/develop (alerts).
  • Reaps wt/wt-* worktrees older than 7 days + git worktree prune.
  • ntfy topic from a mode-600 file, failure-throttled state file; no token inline.
  • systemd user timer: OnBootSec=5min, OnUnitActiveSec=15min.

Non-goals: no separate repo/submodule for machine state; no auto-merge/auto-rebase/auto-push-to-tags; non-allowlist dirt is never committed, only surfaced.

Acceptance

  • bats tests/live-sync.bats green against a fixture origin: allowlist-only commits, no-op when clean, conflict -> abort + exit 1 + alert, branch guard refuses, non-allowlist dirt untouched.
  • AGENTS.md documents the tier table + daemon; omp-docs page registered in its index.
## Problem The checkout is the deployment and many tracked files are **live state** written through symlinks by the harness, auto-learn, GUI apps, and agents mid-session (memories, managed-skills, `agent/config.yml`, `agent/models.yml`, `dotfiles/**`). The commit-hygiene doctrine ("a dirty tracked file is a half-deployed config") has no pressure valve for this continuous machine churn, so it accumulates silently. Observed cost, 2026-10-18: - 24 modified + 63 untracked files sitting unpushed in `~/.omp`; ~61 auto-learned managed-skills existed **only on one disk**. - A settings fix (`features.unexpectedStopDetection: smart -> mechanical`) stayed local-only; other workstations pulling today inherit the broken value. - Push rejected because remote moved AND local tree was dirty -> merge refused across the exact files PR #8 touched; 10 files were byte-identical ghosts of upstream edits. - 7 stale `wt/*` worktrees never reaped. ## Proposal: `scripts/live-sync.sh` heartbeat daemon Allowlist-driven auto-commit of machine-written paths, main checkout only: | Tier | Paths | Law | |---|---|---| | Human prose | `AGENTS.md`, `omp-docs/**`, `scripts/**` | unchanged (branch -> PR -> Frank OK) | | Machine live | `agent/memories`, `agent/managed-skills`, `agent/config.yml`, `agent/models.yml` | auto-commit daemon | | Desktop live | `dotfiles/**` | auto-commit daemon | Behavior: - flock'd, quiet-exit when nothing allowlisted is dirty; stages ONLY allowlist paths (`git add -A -- <paths>`), never sweeps task dirt. - Commits WITH hooks (secret gate stays armed; a block is an alert, never a bypass). - `git fetch` + merge `origin/<branch>`; on conflict: `merge --abort`, keep local commit, ntfy alert, stop. Never auto-resolve, never force, never `--no-verify`. - Refuses to run on any branch other than `main`/`develop` (alerts). - Reaps `wt/wt-*` worktrees older than 7 days + `git worktree prune`. - ntfy topic from a mode-600 file, failure-throttled state file; no token inline. - systemd user timer: `OnBootSec=5min`, `OnUnitActiveSec=15min`. Non-goals: no separate repo/submodule for machine state; no auto-merge/auto-rebase/auto-push-to-tags; non-allowlist dirt is never committed, only surfaced. ## Acceptance - `bats tests/live-sync.bats` green against a fixture origin: allowlist-only commits, no-op when clean, conflict -> abort + exit 1 + alert, branch guard refuses, non-allowlist dirt untouched. - AGENTS.md documents the tier table + daemon; omp-docs page registered in its index.
Author
Owner

Complete — landed via PR #12 (feat/11-live-sync), enabled and verified in production 2026-10-18:

  • scripts/live-sync.sh merged to trunk; black-box suite tests/live-sync.bats 9/9 (repo suite 36/36).
  • systemd user timer linked and enabled (live-sync.timer, hourly per operator decision at review — supersedes the 15-min figure in the proposal; cadence corrected in AGENTS.md + KB page).
  • First manual heartbeat 979e9ef: 173 files / +3,844 lines — entire only-copy managed-skills library, memories, live config, dotfiles — committed with hooks armed, pushed; allowlist scope audited clean (0 non-allowlist files).
  • Deployment checkout went from 24 dirty + 63 untracked to fully clean; origin in sync.
  • Tier law in AGENTS.md § Live-sync tiers; omp-docs/tools/live-sync.md registered in tools index; bundle log entries filed.

cwd: /home/blank/.omp/wt/wt-20261018-132036-7c8a99d · session: 01a150ac-541a-7276-ad04-fd4dfa942803

Complete — landed via PR #12 (feat/11-live-sync), enabled and verified in production 2026-10-18: - `scripts/live-sync.sh` merged to trunk; black-box suite `tests/live-sync.bats` 9/9 (repo suite 36/36). - systemd user timer linked and enabled (`live-sync.timer`, hourly per operator decision at review — supersedes the 15-min figure in the proposal; cadence corrected in AGENTS.md + KB page). - First manual heartbeat `979e9ef`: 173 files / +3,844 lines — entire only-copy managed-skills library, memories, live config, dotfiles — committed with hooks armed, pushed; allowlist scope audited clean (0 non-allowlist files). - Deployment checkout went from 24 dirty + 63 untracked to fully clean; origin in sync. - Tier law in AGENTS.md § Live-sync tiers; `omp-docs/tools/live-sync.md` registered in tools index; bundle log entries filed. --- cwd: /home/blank/.omp/wt/wt-20261018-132036-7c8a99d · session: 01a150ac-541a-7276-ad04-fd4dfa942803
dank closed this issue 2026-10-18 16:51:05 -07:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dank/command-center#11