Commit bd0da35
authored
Add apl-feed config sync subcommand and metadata-LWW apply gate (#83)
* feat(apply): gate writes with metadata last-write-wins
Skip per-key writes whose incoming edited_at is not strictly newer than the on-disk feed.meta.json entry, with a bogus-future heal exception. Symmetric with the server-side LWW in /api/feeders/config/sync.
* feat(apl-feed): add config sync subcommand and systemd timer
Periodic ~60s poll of POST /api/feeders/config/sync that pushes the local snapshot and applies the server's merged response. Authenticates with the existing Bearer alv1 token. Hardening: tight ReadWritePaths, jitter, on-disk metadata round-trip with rejected_fields healing.
* fix(config-sync): four review-driven correctness fixes
LWW bogus-future check now uses APL_APPLY_INCOMING_SERVER_TIME from the response so a fast local clock cannot self-mask future-stamped on-disk metadata. Atomic position-group LWW pre-check in config.sh stops a partial server response from mixing local and server axes. _config_sync_load_meta validates RFC 3339 and edited_by enum per entry. read_secret_file failure is captured cleanly so a corrupt secret exits 64 instead of 1.1 parent 56d6787 commit bd0da35
11 files changed
Lines changed: 1707 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
0 commit comments