Commit ca09007
journal-worktree-keeper: repair a missing origin from the canonical journal remote
The keeper's origin self-heal (jw_ensure_origin) re-added a vanished
remote.origin.url only from $GARDEN_ROOT's origin. Derive it instead from
journal_remote — the same canonical resolver every other consumer uses —
whose fallback order is $JOURNAL_REMOTE -> the worktree origin -> the
persisted per-host cache ($JOURNAL_REMOTE_CACHE, the companion job's
last-good value) -> $GARDEN_ROOT's origin. The prior root-only source missed
both an explicit $JOURNAL_REMOTE override and the cache, so it could not
recover in the window where the root origin was momentarily gone too but the
cache still held the last-good URL (the 2026-07-03 15:50-15:51Z "no origin"
cascade). A possible journal_remote die() is confined to the command
substitution so a genuinely unresolvable remote leaves the repair to the
caller's own gate rather than killing the keeper.
Adds test coverage for the missing-origin path (previously untested): origin
re-added from an explicit $JOURNAL_REMOTE and from the persisted cache, each
logging REPAIRED and reconciling without a maintainer page.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent aa1eb55 commit ca09007
2 files changed
Lines changed: 61 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
320 | 330 | | |
321 | | - | |
| 331 | + | |
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
330 | 340 | | |
331 | 341 | | |
332 | | - | |
333 | | - | |
334 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
335 | 345 | | |
336 | 346 | | |
337 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
129 | 165 | | |
130 | 166 | | |
131 | 167 | | |
| |||
0 commit comments