Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(git): managed Git effects publish with --keep-checkout; conflict and parked-push recovery
garrytan3eaa63dc6ff4
diff --git a/docs/guides/shared-checkout-git.md b/docs/guides/shared-checkout-git.mdindex 63c876d807..e2e19f64f5 100644--- a/docs/guides/shared-checkout-git.md+++ b/docs/guides/shared-checkout-git.md@@ -107,6 +107,19 @@ both forms with `writer_coordinator_required`: its persistence owner is the onlyGit writer there. Save pages with `put_page`, `edit_page`, `remember` or`capture`; see [files that are not pages](../architecture/topologies.md#files-that-are-not-pages).+The one form a managed worktree accepts is `--push-only --keep-checkout`. It+publishes the commits already on the branch, merging a moved remote in memory,+but never moves the checkout and skips its pre-push hook, so+`gbrain sources refresh` stays the only way remote files enter the checkout.+The owner's Git effects use it on their own when another machine pushed first;+you run it only to settle a [conflict](#conflicts) the owner reports.++**Say to your agent:** *"My brain's Git backups stopped pushing. Find out why and get them moving again."*+The agent reads `gbrain sync status --source <id> --json` (`git_push_holds`) or+`gbrain doctor --json` (`parked_effects`). Effects parked after repeated push+failures go through `gbrain sources writer retry-effects <source> --parked-pushes`+(preview with `--dry-run`); a conflict names the user's choice first.+<a id="outcomes"></a>## Outcomes@@ -204,6 +217,14 @@ To resolve:Write a merged copy outside the checkout: editing the conflicted file in placeleaves it dirty, so the checkout cannot fast-forward over it afterwards.+On a managed worktree the owner's Git effects hold with `integrate_conflict`+instead (the database already has every page write; only the Git backup+waits). The fix the owner reports adds `--keep-checkout` and the checkout's+`--path`; after the choice is pushed, run+`gbrain sources writer retry-effects <source> --parked-pushes` for the effects+that parked meanwhile, then `gbrain sources refresh <source>` to bring the+merged remote files in.+Shared append-only files (a `log.md` every workflow appends to) are the usualsource of conflicts: two appends at the end of the same file overlap. Keepboth sides by merging by hand with `file:`, or make such files derived insteaddiff --git a/src/core/persistence/effect-git.ts b/src/core/persistence/effect-git.tsindex 79f1eace08..d9b5b59582 100644--- a/src/core/persistence/effect-git.ts+++ b/src/core/persistence/effect-git.ts@@ -368,7 +368,7 @@ async function publishKeepingCheckout(root: string, signal?: AbortSignal): Promifunction heldConflict(root: string, error: OperationError): OperationError {const fix = error.fix as Action | undefined;const held = opError('integrate_conflict', `Git backups of canonical page writes are held: ${error.message}`,- `${error.suggestion ?? ''} The page writes themselves are committed in the database and in local commits; nothing is lost, and nothing is pushed from ${root} until the conflict is resolved. After the choice is pushed, gbrain sources writer retry-effects <source> --parked-pushes retries the Git effects that parked meanwhile; gbrain sources refresh <source> then brings the merged remote files into the checkout.`,+ `${error.suggestion ?? ''} The page writes themselves are committed in the database and in local commits; nothing is lost, and nothing is pushed from ${root} until the conflict is resolved. After the choice is pushed, gbrain sources writer retry-effects with --parked-pushes for the source this checkout backs (gbrain sources writer status names it) retries the Git effects that parked meanwhile, and gbrain sources refresh for that source brings the merged remote files into the checkout.`,{ ...(error.detail ? { detail: error.detail } : {}), fix: { ...(fix ?? { ask_user: true, consent: [], actor: 'user', requires_exclusive: false,why: 'Choosing which version of a file wins discards the other side; ask the user before resolving.' }),user_message: `${fix?.user_message ?? 'This machine and the remote changed the same file.'} Until you choose, Git backups of new page writes from ${root} are held (nothing is lost; the database has every write).`,