Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(#6530): CHANGELOG entry and BEHAVIOR_CHANGES since

garrytanb35065982d41
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e34757e38e..d6da2a2361 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,19 @@ credits are retained; no result has been reassigned to another provider. Origina
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
+## [0.60.185.0] - 2026-10-12
+
+**Agents that share one brain checkout no longer stash, revert or ship each other's half-written files when they commit and push (#6530).** Skills and the committed `scripts/brain-commit-push.sh` used to run `git pull --rebase --autostash` and repo-wide adds in the shared working tree. A rebase that crashed or conflicted left `.git/rebase-merge` holding another agent's edits in its autostash, and a later "repair" could silently revert them. New `gbrain git commit-push` commits only the paths you name, merges a rejected push with the remote in memory, and moves the checkout fast-forward only. Run `gbrain sources harden <id>` once per hardened brain to switch its helper and post-commit hook to it. Brain history now gets merge commits instead of rebased linear history. Guide: `docs/guides/shared-checkout-git.md`.
+
+### Itemized changes
+
+- **`gbrain git commit-push`** (`src/core/git/commit-push.ts`, `src/commands/git.ts`): `-m <msg> -- <paths>`, `--push-only`, `--pull [--require-clean]`, `--dry-run`, `--json`. It commits with `add -A -- <paths>` plus `commit --only` and literal pathspecs; a staged `git mv` commits both sides. A short commit lock (`brain-commit.lock`, plus the legacy `gbrain-push.lock`) covers local index/HEAD changes only. A separate publish lock (`brain-publish.lock`) covers the network push, so a slow remote never blocks commits or page write-through. A rejected push is merged with `merge-tree --write-tree -z` (a 3-way `read-tree` into a temporary index on git older than 2.38) and `commit-tree` over immutable SHAs, with up to 8 attempts and backoff while the remote moves; acceptance is confirmed at every push URL (#5138). The checkout advances with `-c merge.autoStash=false merge --ff-only` as a compare-and-swap; a dirty file the merge must change leaves it `pushed_checkout_lagging` (exit 0), and the next `--push-only` or `--pull` catches it up. Exit 4 is `push_unconfirmed`.
+- **Conflicts:** `integrate_conflict` changes nothing and asks the user. `--push-only --expect-remote <sha> --resolve <path>=ours|theirs|file:<copy>` publishes the choice. A remote that moved since the choice is reported again, file/directory and rename conflicts are refused, and raw NUL-delimited paths make non-ASCII names resolvable. The unresolved conflict is recorded in the checkout's git dir, and `put_page`'s push status reports it.
+- **The post-commit hook** runs the CLI captured at harden with `--push-only --require-clean`, never pulls, and never waits for another push. When one is running it reports `push_deferred` and leaves a request the running push honors after it releases. `BRAIN_COMMIT_LOCK_HELD` is honored only when it names the lock file's path.
+- **Callers:** the helper (`# gbrain-protocol: 2`; harden never downgrades a newer one) delegates to the CLI; without a capable CLI it does a locked, path-scoped commit plus a plain push and fails loudly. Page, facts, takes, timeline and `lint --fix` write-through and harden's scaffolding commit go through the primitive. `divergenceSafePull` (sources pull, the pull cron, harden, workspace push) and `gbrain sync`'s pull fetch, then fast-forward or merge in memory under the commit lock, for both pull strategies. Harden sets `rebase.autoStash=false`, `merge.autoStash=false` and `pull.ff=only` locally.
+- **Docs and lint:** new guide `docs/guides/shared-checkout-git.md` covers outcomes, conflicts, recovering a stuck rebase and the lock contract for host daemons. Skills, recipes and docs that taught in-tree rebase, stash or a bare push are rewritten, and one Multi-agent rules block lives in AGENTS.md, BOOTSTRAP_FOR_AGENTS.md and INSTALL_FOR_AGENTS.md. New `scripts/check-shared-tree-git.sh` (in `verify`) fails on unsafe shared-tree git in agent-facing code.
+- Tests: `test/git-commit-push-6530.serial.test.ts` has 25 real-git cases, including a forced probe (the old rebase rewrites an in-flight edit, the new protocol leaves it byte-identical) and 12 concurrent CLI writers over two clones. Hook, pull and git-remote tests are updated for the new protocol, and the CLI and export goldens are regenerated for `gbrain git`.
+
## [0.60.184.0] - 2026-10-12
**Unit and serial CI shards are packed from clean timings again.** CI splits each test lane across several machines using the recorded run time of every test file. The unit timings recorded before v0.60.183.0 carried a cold-boot penalty: three test files cleared the PGLite snapshot for every file after them in the same shard, so those files looked several minutes slower than they are. This release re-measures the unit and serial lanes from the first green master run after that fix. No product behaviour changes.
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 1acc33ff93..46f823c45a 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -473,12 +473,12 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }
// #6529 (GBRA-79). `since` is provisional: stamped at the current VERSION because a `since` past VERSION discloses on every fresh brain (goldens, notice tests); the integrator restamps both rows to the release (0.60.182.0 placeholder) at the merge slot.
{ since: '0.60.182.0', text: 'With `GBRAIN_EMBEDDING_MULTIMODAL=true`, managed sync now imports image files through the coordinated image importer (OCR text, image vector and `source_path` at import) instead of holding them as `managed_image_sync_unsupported`; existing image holds are re-screened and imported on the next `gbrain sync --source <id> --no-pull`. With it off, images stay held as before.' },
{ since: '0.60.182.0', text: 'On a multimodal install, plain `gbrain embed --stale` now runs the image sweep (`--images`) before its text pass and reports it as `images` in `--json`; `gbrain embed --stale --images` works on managed brains, finds an image page with no recorded `source_path` by its slug, and exits non-zero naming the path it tried when no candidate has a file (it used to exit 0); the folded sweep only reports fileless pages. Doctor gains `image_embedding_coverage`.' },
- // #6530 (GBRA-82) shared-checkout-safe git. `since` is provisional (current VERSION, so a fresh brain sees nothing); restamped at the merge slot.
- { since: '0.60.184.0', text: 'New `gbrain git commit-push` commits only the paths you name and pushes them safely in a brain checkout other agents share: `-m <msg> -- <paths>`, `--push-only`, `--pull` and `--dry-run`. After `gbrain sources harden`, the committed `scripts/brain-commit-push.sh` and the post-commit hook delegate to it and never run `git pull --rebase`, `git stash` or `git reset` in the shared tree. A rejected push is merged with the remote in memory, so brain history now gets merge commits (`gbrain: merge origin/<branch> into <branch>`) instead of rebased linear history; the checkout only fast-forwards, and a push whose fast-forward a dirty file blocks reports `pushed_checkout_lagging` (exit 0). Exit 4 (`push_unconfirmed`) means the commit is local but no push was confirmed. Guide: docs/guides/shared-checkout-git.md.' },
- { since: '0.60.184.0', text: 'Brain checkout commits and pushes now coordinate through two OS locks under the git dir: `brain-commit.lock` for staging, committing and moving the checkout (wait `GBRAIN_COMMIT_LOCK_WAIT_SECONDS`, alias `GBRAIN_PUSH_LOCK_WAIT_SECONDS`, default 60, then `commit_lock_busy`) and `brain-publish.lock` for the network push (a foreground push waits `GBRAIN_PUBLISH_LOCK_WAIT_SECONDS`, default 300, then `push_unconfirmed`). The pre-#6530 `gbrain-push.lock` is still taken with the commit lock. The post-commit hook no longer waits for another push: it reports `push_deferred` and the running push publishes its commit too. `BRAIN_COMMIT_LOCK_HELD` is honored only when it names the lock file\'s path, no longer as `1`.' },
- { since: '0.60.184.0', text: 'gbrain\'s own brain-repo commits (page write-through, facts fences, takes, timeline, `lint --fix`, and `sources harden` scaffolding) now take the checkout\'s commit lock (write-through waits 2 seconds, then commits its one path without it), commit only their own paths, and include both sides of a staged `git mv` rename. Paths passed to the helper or `gbrain git commit-push` are literal: a quoted glob no longer expands and fails `commit_paths_invalid`; name the files.' },
- { since: '0.60.184.0', text: 'The pull that `gbrain sources pull`, the pull cron, `sources harden` and the workspace push run no longer rebases: a branch whose local and remote sides diverged is merged in memory and the checkout fast-forwards to the merge, for `pull_strategy: rebase` as well as `merge` (`set-pull-strategy` is still accepted). `gbrain sync`\'s pull is now a fetch plus a fast-forward under the commit lock. `gbrain sources harden` sets `rebase.autoStash=false`, `merge.autoStash=false` and `pull.ff=only` in the checkout\'s local git config so a stray `git pull` refuses instead of autostashing. A conflict now stops with `integrate_conflict` (ask the user; resolve with `gbrain git commit-push --push-only --expect-remote <sha> --resolve <path>=ours|theirs`), and `put_page` reports an unresolved one for that checkout.' },
- { since: '0.60.184.0', text: 'The committed `scripts/brain-commit-push.sh` written by `gbrain sources harden` needs a gbrain that knows `git commit-push` to integrate remote commits. Without one it does only a locked, path-scoped commit and a plain push, and a rejected push now fails loudly (exit 4, PUSH FAILED) instead of rebasing. A helper written by a newer gbrain (a higher `# gbrain-protocol:` line) is never downgraded by an older harden.' },
+ // #6530 (GBRA-82) shared-checkout-safe git. Stamped at the merge slot.
+ { since: '0.60.185.0', text: 'New `gbrain git commit-push` commits only the paths you name and pushes them safely in a brain checkout other agents share: `-m <msg> -- <paths>`, `--push-only`, `--pull` and `--dry-run`. After `gbrain sources harden`, the committed `scripts/brain-commit-push.sh` and the post-commit hook delegate to it and never run `git pull --rebase`, `git stash` or `git reset` in the shared tree. A rejected push is merged with the remote in memory, so brain history now gets merge commits (`gbrain: merge origin/<branch> into <branch>`) instead of rebased linear history; the checkout only fast-forwards, and a push whose fast-forward a dirty file blocks reports `pushed_checkout_lagging` (exit 0). Exit 4 (`push_unconfirmed`) means the commit is local but no push was confirmed. Guide: docs/guides/shared-checkout-git.md.' },
+ { since: '0.60.185.0', text: 'Brain checkout commits and pushes now coordinate through two OS locks under the git dir: `brain-commit.lock` for staging, committing and moving the checkout (wait `GBRAIN_COMMIT_LOCK_WAIT_SECONDS`, alias `GBRAIN_PUSH_LOCK_WAIT_SECONDS`, default 60, then `commit_lock_busy`) and `brain-publish.lock` for the network push (a foreground push waits `GBRAIN_PUBLISH_LOCK_WAIT_SECONDS`, default 300, then `push_unconfirmed`). The pre-#6530 `gbrain-push.lock` is still taken with the commit lock. The post-commit hook no longer waits for another push: it reports `push_deferred` and the running push publishes its commit too. `BRAIN_COMMIT_LOCK_HELD` is honored only when it names the lock file\'s path, no longer as `1`.' },
+ { since: '0.60.185.0', text: 'gbrain\'s own brain-repo commits (page write-through, facts fences, takes, timeline, `lint --fix`, and `sources harden` scaffolding) now take the checkout\'s commit lock (write-through waits 2 seconds, then commits its one path without it), commit only their own paths, and include both sides of a staged `git mv` rename. Paths passed to the helper or `gbrain git commit-push` are literal: a quoted glob no longer expands and fails `commit_paths_invalid`; name the files.' },
+ { since: '0.60.185.0', text: 'The pull that `gbrain sources pull`, the pull cron, `sources harden` and the workspace push run no longer rebases: a branch whose local and remote sides diverged is merged in memory and the checkout fast-forwards to the merge, for `pull_strategy: rebase` as well as `merge` (`set-pull-strategy` is still accepted). `gbrain sync`\'s pull is now a fetch plus a fast-forward under the commit lock. `gbrain sources harden` sets `rebase.autoStash=false`, `merge.autoStash=false` and `pull.ff=only` in the checkout\'s local git config so a stray `git pull` refuses instead of autostashing. A conflict now stops with `integrate_conflict` (ask the user; resolve with `gbrain git commit-push --push-only --expect-remote <sha> --resolve <path>=ours|theirs`), and `put_page` reports an unresolved one for that checkout.' },
+ { since: '0.60.185.0', text: 'The committed `scripts/brain-commit-push.sh` written by `gbrain sources harden` needs a gbrain that knows `git commit-push` to integrate remote commits. Without one it does only a locked, path-scoped commit and a plain push, and a rejected push now fails loudly (exit 4, PUSH FAILED) instead of rebasing. A helper written by a newer gbrain (a higher `# gbrain-protocol:` line) is never downgraded by an older harden.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */