Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs: CHANGELOG entry and TBD behavior rows for #7381

garrytana2f59cff910d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d65f14573c..e55b2e2f20 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,38 @@ 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.383.0] - 2026-10-22
+
+**A brain checkout that several agents, crons and hooks commit into no longer loses or brings back work.** A change the remote already took and then reverted is no longer put back by the next push. gbrain's own page commits never commit without the checkout's lock, and a refused commit leaves nothing staged for another writer to sweep up. Reported in #7381.
+
+### What changed
+
+| Situation | Before | Now |
+|---|---|---|
+| A local commit whose patch the remote already has (cherry-picked or rebased there), and the remote reverted it | the next `commit-push` or `--pull` silently put the change back | the commit is left out of the merge, the revert stands, and the merge message names it |
+| The same, but the remote edited those lines since | `integrate_conflict` on every push from then on | publishes cleanly with the remote's lines |
+| A page write (`put_page`, facts fences, takes, timeline, `lint --fix`) while another writer holds the commit lock past 2 s | committed without the lock | the file is written and noted in a pending ledger; the next locked page write or `gbrain git commit-push --pending` commits it |
+| git refuses a commit (hook, missing identity) | the paths stayed staged, and the next commit without paths by any writer published them | the exact earlier staging is restored |
+| `commit-push -- <dir>` while another writer has files staged under `<dir>` | they were committed too | refused (`commit_prestaged_paths`); name a file to claim it |
+| A brain folder inside a larger repository | commits and pushes could carry files outside it | `gbrain sources harden` records `gbrain.sourceRoot`; commit-push refuses to commit or publish files outside it (`commit_outside_source_root`) until the user agrees |
+| `scripts/brain-commit-push.sh` on a machine without gbrain | held the commit lock through the push | releases it first and pushes under `brain-publish.lock` |
+
+New and opt-in: `gbrain git guard --install` adds a `prepare-commit-msg` hook that refuses commits made around gbrain in that checkout, `--no-verify` included. `git config gbrain.quarantine true` turns a content conflict into a published merge that takes the remote's version and keeps this machine's under `refs/gbrain/quarantine/`. `gbrain doctor` adds `checkout_lagging`, `dirty_age`, `commits_outside_source_root` and `quarantined_changes`.
+
+### What to watch for after you upgrade
+
+- Rerun `gbrain sources harden <source>` on a brain checkout to record its source root and refresh the committed helper script.
+- A doctor `dirty_age` warning means page writes are waiting for a commit; its fix is `gbrain git commit-push --pending`.
+- Nothing is rewritten on upgrade, and there is no schema migration. The guard and quarantine stay off until you turn them on.
+
+### Itemized changes
+
+- `src/core/git/commit-push.ts`: patch-equivalent replay in `integrate`, locked-only write-through with the pending ledger, index restore, staged-sweep and source-root refusals, `--pending`, opt-in quarantine (`test/git-writer-safety-7381.serial.test.ts`).
+- `src/core/git/commit-guard.ts`, `src/commands/git.ts`: `gbrain git guard`.
+- `src/core/brain-repo-durability.ts`: helper fallback lock release, `recordSourceRoot`.
+- `src/commands/doctor/checks/git-writer.ts`: the four doctor checks (`test/doctor-git-writer-7381.test.ts`).
+- `docs/guides/shared-checkout-git.md`: source roots, pending page writes, quarantine, guard.
+
## [0.60.379.0] - 2026-10-22
**Release binaries are built on Bun 1.4.4, which fixes the Brotli decoder flaw CVE-2026-111497, and `gbrain doctor` warns when gbrain runs on an older Bun.** A standalone gbrain binary embeds the Bun it was built with, so upgrading a separately installed `bun` does not fix it; install the new binary. Reported in #7373.
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index c1913bdec8..6b322f5ae5 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -1131,12 +1131,12 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
{ since: '0.60.372.0', text: '`gbrain sources status --json` no longer prints every held file of a source by default: `git_holds` now carries `count`, `by_code` (each hold code with its count and one example item, whose `fix` applies to the rest), and the first 10 items with `items_complete: false` and an `items_command`. `--holds` lists every held file read, as before, and `--limit <n> [--cursor <c>]` pages them by path (the cursor needs the source id). The text output is unchanged.' },
// #7355: a level read reports progress; pass_abandoned; racy floor
{ since: '0.60.377.0', text: 'A managed `gbrain sync` pass no longer stops `drain_stalled` / `no_progress` on a large source while it is still reading and classifying the level before its first commit: the level read reports progress to the drain as it works (its loops and the history walk for the origin evidence of files a page lost), writes the open pass row every 30 s so a follower and `gbrain sync status` see it working, and a pass that asks for a history walk already running joins it. A hung read still stops after 5 minutes. When two passes in a row never end (abandoned by the drain or killed; the newest open one counts after 5 quiet minutes), `gbrain sync status` reads `blocked` with the new reason `pass_abandoned` and `next` is `gbrain doctor --json` and a report, instead of the plain sync. The stat caches of the dirtiness probe and the working level now take the racy window from the earlier of the process clock and the filesystem clock (a file written in the Git directory), so a mount whose clock lags the process no longer keeps a stale `clean` verdict.' },
- // #7381 (GBRA-180): shared-checkout writer safety. `since` is provisional (current VERSION); restamped at the merge slot.
- { since: '0.60.379.0', text: 'When a brain checkout publishes local commits whose patch the remote already has (a cherry-picked or rebased copy), `gbrain git commit-push` and `--pull` now leave those commits out of the merge: the other local commits are replayed onto the remote tip in memory. A copy the remote edited since no longer reports `integrate_conflict` forever, and a copy the remote reverted is no longer silently put back. The merge commit message lists the commits it left out.' },
- { since: '0.60.379.0', text: 'gbrain\'s own page commits (write-through, facts fences, takes, timeline, `lint --fix`) no longer commit without the checkout\'s commit lock after their 2-second wait: the file is written, noted in a pending ledger, and committed by the next page write that gets the lock or by the new `gbrain git commit-push --pending`. A commit git refuses now unstages its paths again, so nothing is left staged for another writer\'s commit to sweep up.' },
- { since: '0.60.379.0', text: '`gbrain git commit-push` refuses to commit a file another writer already staged under a directory you named (`commit_prestaged_paths`; name the file to claim it). `gbrain sources harden` records a source folder below the checkout top in git config `gbrain.sourceRoot`; with it set, commit-push refuses to commit or publish changes outside that folder (`commit_outside_source_root`) until the user reruns with `--allow-outside-source-root`.' },
- { since: '0.60.379.0', text: 'New opt-in `gbrain git guard --install`: a local prepare-commit-msg hook that refuses commits not made through gbrain in that checkout, `--no-verify` included (bypass once with `GBRAIN_COMMIT_GUARD=off`). The committed `scripts/brain-commit-push.sh` fallback (no gbrain on the machine) now releases the commit lock before it pushes and pushes under `brain-publish.lock`; rerun `gbrain sources harden` to refresh it.' },
- { since: '0.60.379.0', text: 'Three new doctor checks on source checkouts: `checkout_lagging` (behind the last fetched upstream for over an hour), `dirty_age` (pending write-through files or staged files waiting over 30 minutes) and `commits_outside_source_root` (unpushed commits that change files outside the brain\'s folder). Each names its fix.' },
+ // #7381 (GBRA-180): shared-checkout writer safety.
+ { since: 'TBD', text: 'When a brain checkout publishes local commits whose patch the remote already has (a cherry-picked or rebased copy), `gbrain git commit-push` and `--pull` now leave those commits out of the merge: the other local commits are replayed onto the remote tip in memory. A copy the remote edited since no longer reports `integrate_conflict` forever, and a copy the remote reverted is no longer silently put back. The merge commit message lists the commits it left out.' },
+ { since: 'TBD', text: 'gbrain\'s own page commits (write-through, facts fences, takes, timeline, `lint --fix`) no longer commit without the checkout\'s commit lock after their 2-second wait: the file is written, noted in a pending ledger, and committed by the next page write that gets the lock or by the new `gbrain git commit-push --pending`. A commit git refuses now unstages its paths again, so nothing is left staged for another writer\'s commit to sweep up.' },
+ { since: 'TBD', text: '`gbrain git commit-push` refuses to commit a file another writer already staged under a directory you named (`commit_prestaged_paths`; name the file to claim it). `gbrain sources harden` records a source folder below the checkout top in git config `gbrain.sourceRoot`; with it set, commit-push refuses to commit or publish changes outside that folder (`commit_outside_source_root`) until the user reruns with `--allow-outside-source-root`.' },
+ { since: 'TBD', text: 'New opt-in `gbrain git guard --install`: a local prepare-commit-msg hook that refuses commits not made through gbrain in that checkout, `--no-verify` included (bypass once with `GBRAIN_COMMIT_GUARD=off`). The committed `scripts/brain-commit-push.sh` fallback (no gbrain on the machine) now releases the commit lock before it pushes and pushes under `brain-publish.lock`; rerun `gbrain sources harden` to refresh it.' },
+ { since: 'TBD', text: 'Four new doctor checks on source checkouts: `checkout_lagging` (behind the last fetched upstream for over an hour), `dirty_age` (pending write-through files or staged files waiting over 30 minutes), `commits_outside_source_root` (unpushed commits that change files outside the brain\'s folder) and `quarantined_changes` (local versions the opt-in quarantine parked). Each names its fix. Quarantine is off unless you set git config `gbrain.quarantine true` in a checkout: a content conflict then publishes the remote\'s version of the file and keeps this machine\'s version under `refs/gbrain/quarantine/`.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */