Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs: plain-English wave CHANGELOG entry, and name the per-checkout failure isolation

garrytana06165b48ea2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0f4150c33e..40412abae5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,7 +18,7 @@ identifiers and attribution are available in the pre-removal Git revision
- `src/core/git/reconcile.ts` (new): one checkout under its own reconcile lock (outermost; no other path takes it, so it cannot deadlock a publish); fetch with the tracking ref's move logged, then a `gbrain git commit-push --pull` child, a `--push-only --scan-secrets --expect-remote <checked upstream>` child (a remote that moved in between is fetched and checked for a rewrite again), or `upstream_rewritten`; a fetch that loses the tracking-ref race to a concurrent fetch retries.
- `src/core/git/upstream-history.ts` (new): the rewritten-upstream check, moved out of `src/core/persistence/worktree-refresh.ts` so refresh and reconcile share it.
-- `src/commands/sources-git-reconcile.ts` (new), `src/commands/sources.ts`: the command, grouping sources by checkout; a managed checkout waits out a running refresh up to `--wait`.
+- `src/commands/sources-git-reconcile.ts` (new), `src/commands/sources.ts`: the command, grouping sources by checkout; a managed checkout waits out a running refresh up to `--wait`. A checkout that fails with an unexpected error (an unwritable `.git`, say) is reported for that checkout alone and the others still reconcile; only a failure of the whole run (the database, the disk) stops it.
- `src/commands/autopilot-git-reconcile.ts` (new), `src/commands/autopilot-daemon.ts`: the per-tick reconcile in the daemon, logged.
- Docs and skills: `docs/guides/live-sync.md`, `docs/guides/shared-checkout-git.md`, `docs/guides/cron-schedule.md` (allow minutes for fetch and push calls), `skills/cron-scheduler/SKILL.md` (the managed cron line runs `sources git-reconcile`).
- Tests: `test/sources-git-reconcile.test.ts` (level, stranded, behind, diverged, conflict, secret, rewritten upstream, a force-push between the check and the push, eight concurrent callers while another clone pushes, managed with durability on and off and publishing off, no checkout, publishing off, a checkout gbrain did not clone, sync off, a missing folder), `test/autopilot-git-reconcile.test.ts` (the daemon's event loop keeps ticking during a publish child; a refusal is reported with no value printed; a hung child is killed).
@@ -30,7 +30,7 @@ identifiers and attribution are available in the pre-removal Git revision
**`gbrain sources refresh --abandon` no longer leaves the database ahead of the checkout, and every way out an interrupted refresh names now finishes it.** A refresh stopped mid-sync with the checkout reset to its start commit could still be abandoned when a member's sync had imported part of the upstream commit but stopped (on its budget) before recording it: the imported pages stayed live with no file at HEAD. Abandoning while a sync pass that read the upstream commit was still running could also let that pass record the upstream commit after the fence lifted. Both now refuse and change nothing: the first names the fast-forward and `--resume`, the second `sync_drain_lease_held` until the pass ends. The other ways out are fixed too: `--abandon` at a HEAD past the upstream commit names `--resume` (which finishes in one run) instead of a reset; members synced to diverged lines get a refusal naming each commit and a merge of them instead of a fast-forward `--resume` would refuse again; a member commit git cannot place gets its own refusal and a fetch; writer status read off the owner host says the check needs the owner host; and the refusals name the revert route for an operator who rolled back on purpose (fast-forward, `git revert` on top, `--resume`). `--abandon` is never loosened and has no override.
-- `src/core/persistence/worktree-refresh.ts`: `membersPastStart` also counts a member with a managed-sync import or delete admitted after the row's `barrier_sequence` (GST-1465 #1), and reads `git merge-base --is-ancestor` as exit 0, exit 1 or "cannot place" (GST-1472 #3). `--abandon` of a `recovery_required` row checks the members and aborts under the topology locks and every member's drain lease (`underMemberLeases`); a live holder refuses `sync_drain_lease_held` and an expired lease is taken over (GST-1465 #2). `keepPagesWayOut` replaces `keepPagesHead`: a fast-forward to the newest member commit on the target's line, a merge of diverged member lines (`ask_user`, GST-1472 #2), or a fetch when a member commit cannot be placed; `--resume` recomputes that refusal at any readable HEAD instead of repeating the stored text. `adoptsHead` is the one recovery-adopts-this-HEAD check, and `--abandon` reads it to name `--resume` at a HEAD past the target (GST-1472 #1). `refreshHolderReport` names writer status on the owner host (`actor: host_admin`) when it has no checkout for a `recovery_required` row (GST-1477 #1). The fast-forward refusal's suggestion and `user_message` name the revert route (GST-1477 #2).
+- `src/core/persistence/worktree-refresh.ts`: `membersPastStart` also counts a member with a managed-sync import or delete admitted after the row's `barrier_sequence`, and reads `git merge-base --is-ancestor` as exit 0, exit 1 or "cannot place". `--abandon` of a `recovery_required` row checks the members and aborts under the topology locks and every member's drain lease (`underMemberLeases`); a live holder refuses `sync_drain_lease_held` and an expired lease is taken over. `keepPagesWayOut` replaces `keepPagesHead`: a fast-forward to the newest member commit on the target's line, a merge of diverged member lines (`ask_user`), or a fetch when a member commit cannot be placed; `--resume` recomputes that refusal at any readable HEAD instead of repeating the stored text. `adoptsHead` is the one recovery-adopts-this-HEAD check, and `--abandon` reads it to name `--resume` at a HEAD past the target. `refreshHolderReport` names writer status on the owner host (`actor: host_admin`) when it has no checkout for a `recovery_required` row. The fast-forward refusal's suggestion and `user_message` name the revert route.
- Docs: `docs/guides/write-refusals.md` (`refresh_recovery_required`, `sync_drain_lease_held`), `docs/architecture/key-files/core-persistence-git.md`.
- Tests: `test/refresh-recovery-followups-gst1465.test.ts` (new, PGLite and Postgres through `test/e2e/worktree-refresh-postgres.test.ts`): a sliced pass's partial import refuses `--abandon` and the fast-forward then `--resume` finishes with every page at HEAD; a pass paused after its level read refuses `--abandon` `sync_drain_lease_held`; a fenced and a merged orphan past the target finish on one `--resume` and `--abandon` names it; diverged members refuse naming both commits and the named merge then `--resume` finishes; an unplaceable member commit refuses with the fetch at the start commit and at the target, and once fetched the fast-forward finishes; writer status off the owner host names the owner host; the revert route completes and the next sync removes the reverted page.