Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Name the real command in the not-cloned reconcile message and fix two CHANGELOG sentences
garrytan3d2ec1867c3b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d785848a90..3ba4b18b6a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -23,12 +23,12 @@ identifiers and attribution are available in the pre-removal Git revision- 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).-**Held pages that only changed in Git import on the next sync.** A Git edit to a page with no import record is held `file_drift` unless sync can show only the file moved. An earlier release could show that only by comparing the page with its file at the last synced commit; a later one also compares the path's earlier committed versions, but did not screen the holds the first rule had already written. Those holds are now screened once more: a page that still holds an earlier committed version of its file imports the Git edit and its hold clears; a page the database also changed stays held, and is not screened again.+**Held pages that only changed in Git import on the next sync.** A Git edit to a page with no import record is held `file_drift` unless sync can show only the file moved. An earlier release could show that only by comparing the page with its file at the last synced commit; a later one also compares the path's earlier committed versions, but did not screen the holds the first rule had already written. Those holds are now screened once more. A page that still holds an earlier committed version of its file imports the Git edit and its hold clears; a page the database also changed stays held, and is not screened again.- `src/core/persistence/sync-holds.ts`: `FILE_DRIFT_VERSION` 2, so an unknown-side `file_drift` hold stamped 1 is re-screened once with the earlier committed versions.- Tests: `test/sync-unknown-drift-history-rescreen.test.ts` (a hold stamped 1 whose page holds an older committed version imports the Git edit; one whose page the database changed stays held at 2 and is not screened again); the existing rescreen and #7931 tests name the current screen version instead of the literal 1.-**`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.+**`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`, and the second names `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`, 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`.diff --git a/src/commands/sources-git-reconcile.ts b/src/commands/sources-git-reconcile.tsindex 09cd46dec2..2415815c84 100644--- a/src/commands/sources-git-reconcile.ts+++ b/src/commands/sources-git-reconcile.ts@@ -101,7 +101,7 @@ export async function reconcileSources(engine: BrainEngine, opts: ReconcileOptioconst result = group.managed? await withReconcileLock(group.root, opts.waitMs ?? 300_000, () => reconcileManaged(engine, group.sources[0], group.root, publish, opts)): await reconcileCheckout(group.root, { dryRun: opts.dryRun, publish, ...(opts.waitMs !== undefined ? { waitMs: opts.waitMs } : {}), ...(opts.childTimeoutMs ? { childTimeoutMs: opts.childTimeoutMs } : {}),- ...(publishSetting === null && !cloned ? { unpublishedReason: `gbrain did not clone this checkout for the source (it was not added with gbrain sources add --url, or the source folder is not the repository root); publish it with gbrain git commit-push --push-only --scan-secrets --path ${group.root}, or set ${REFRESH_PUBLISH_DIVERGED_KEY} true to publish such checkouts automatically` } : {}) });+ ...(publishSetting === null && !cloned ? { unpublishedReason: `gbrain sources add --url did not clone this checkout for the source, or the source folder is not the repository root; publish it with gbrain git commit-push --push-only --scan-secrets --path ${group.root}, or set ${REFRESH_PUBLISH_DIVERGED_KEY} true to publish such checkouts automatically` } : {}) });out.push({ ...entry, ...result });} catch (error) {const failure = classifyItemFailure(error);