The sidecar was one-way and git-authoritative: it force-overwrote local edits to
the synced config paths, so changes made inside HA (code-server, the UI
automation/script editors) were reverted on the next tick.
Now it is two-way:
- PUSH: changes to the tracked config paths are committed (bot identity) onto a
dedicated `live` branch, pushed, and a PR `live -> main` is kept open (via the
gitea token already in the remote URL). Live edits stay live AND are captured
for review.
- PULL: when `main` advances (merged PR / external push) the commits are merged
back into `live`/the working tree and HA reloads.
Conflicts are left to git: a conflicting merge is ABORTED (never written into the
live files, which would break HA) and logged to resolve in the PR. Reloads fire
only on changes pulled from main (local edits are already applied by HA).
Also fixes the reload race: reload_all now retries until HA is serving, instead
of failing once right after a pod start. Scope unchanged (config paths only; rest
of www/ and untracked runtime state untouched); auto-gc still disabled.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgbyKgrN1yYWrkAA32rJE5