Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(changelog): #8828 entry and behavior row name the recorded-upstream check
garrytan84417b3449bd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2cd39e5226..dc50cb0763 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,14 +12,14 @@ identifiers and attribution are available in the pre-removal Git revision## [Unreleased]-**A refresh no longer loses its tick when gbrain's own writes land while it drains.** `gbrain sources refresh` waits for writes admitted before its fence, and finishing them commits on the checkout and pushes, so HEAD moved past the commit the refresh started from and the run refused `refresh_source_changed`, twice when its same-run retry met the next writes. When every commit since that start is in gbrain's commit ledger and the upstream branch holds them, the refresh now takes HEAD as its start under the fence and fast-forwards to the upstream; any other HEAD move, one commit another agent made among them included, still refuses as before.+**A refresh no longer loses its tick when gbrain's own writes land while it drains.** `gbrain sources refresh` waits for writes admitted before its fence, and finishing them commits on the checkout and pushes, so HEAD moved past the commit the refresh started from and the run refused `refresh_source_changed`, twice when its same-run retry met the next writes. When every commit since that start is in gbrain's commit ledger and the upstream branch the refresh started with holds them, the refresh now takes HEAD as its start under the fence and fast-forwards to that upstream; any other HEAD move, one commit another agent made among them or an upstream changed under the fence included, still refuses as before.### Itemized changes-- `src/core/persistence/worktree-refresh.ts`: `replanOnOwnCommits`, under the commit lock in `fenceAndMerge`: HEAD descends from `old_head`, every sha in `old_head..HEAD` is in the commit ledger (`ownCommits`), and `@{upstream}` holds HEAD and the precheck's target; one UPDATE of the fenced row with no merge started sets `old_head` to HEAD and `target_head` to the upstream. Nothing is fetched under the lock.+- `src/core/persistence/worktree-refresh.ts`: `replanOnOwnCommits`, under the commit lock in `fenceAndMerge`: HEAD descends from `old_head`, every sha in `old_head..HEAD` is in the commit ledger (`ownCommits`), and `@{upstream}` is still the `upstream_ref` the precheck recorded and holds HEAD and the precheck's target; one UPDATE of the fenced row with no merge started sets `old_head` to HEAD and `target_head` to the upstream. Nothing is fetched under the lock.- `spec/tla/refresh-barrier/RefreshBarrier.tla`: `RefMerge` models the re-plan (`OwnSince` for the ledger check, foreign commits as a set `fgn`), new invariant `ReplanOnlyOwnCommits` in every safety config, guard mutant `replan-over-foreign-commit` (spec and code arms).- Docs: `docs/designs/REFRESH_WRITE_BARRIER.md`, the `refresh_source_changed` row in `docs/guides/write-refusals.md`, `spec/tla/README.md`.-- Tests: `test/refresh-own-commits-replan-8828.test.ts` on PGLite and Postgres (own published commits fast-forward; a ledgered commit not pushed yet still refuses; one foreign commit among gbrain's own still refuses and merges nothing).+- Tests: `test/refresh-own-commits-replan-8828.test.ts` on PGLite and Postgres (own published commits fast-forward; a ledgered commit not pushed yet still refuses; one foreign commit among gbrain's own still refuses and merges nothing; own published commits under an upstream changed under the fence still refuse and merge nothing).## [0.60.617.0] - 2026-11-08diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex cb52255d7d..771a684cef 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -1486,7 +1486,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;{ since: '0.60.614.0', id: 'refresh_barrier_aborted_refresh_sync_gst1853', text: 'While a checkout\'s last `gbrain sources refresh` ended without completing (aborted, abandoned, or rolled back after its process died), every refresh run on the owner host, including one refused `refresh_diverged`, now ends by running the managed `--no-pull` sync of each source behind the checkout HEAD, listed in its `synced` (a refusal\'s message names them). With `persistence.refresh_barrier` on, a write held behind that refresh for a commit sync had not imported is therefore decided in that run instead of waiting for a later refresh: a `put_page` with `expected_revision` ends `revision_conflict`, a blind one lands and names what it replaced in `supersedes`, and a `remember` or `add_timeline_entry` applies on top.' },{ since: '0.60.608.0', id: 'refresh_barrier_later_write_gst1623', text: 'With `persistence.refresh_barrier` on, a write that waited behind a refresh or an import (other than a `remember` or `add_timeline_entry`, which still applies on top) now ends `revision_conflict` instead of applying when a later write to the same page committed first, which a consumer from an older release can cause; read the page again and resubmit with a new `request_id`. A write held again and again behind imports now expires once it has waited four wait limits (at least 4 hours) since its admission, even when each hold is shorter than one wait limit. With the barrier on or off, a plain-git commit that lands on the start commit right before a refresh merges makes git refuse the fast-forward, and the refresh now ends `refresh_source_changed` with the fence lifted and the commit kept, instead of leaving the checkout `recovery_required`; one that lands right after the merge is recorded and synced.' },{ since: '0.60.617.0', id: 'url_source_origin', text: 'New doctor check `url_source_origin` (warn) lists URL sources in the default clone directory with no record of who added them, which is every URL source added before that record existed: gbrain cannot tell whether a remote caller or the local operator added each one, so their reclones use the clone settings of a local add. `gbrain sources record-origin <id>... --remote|--local` records the answer the user gives, as a preview until `--apply`, on the brain host only. `--remote` gives the source the clone settings a remote add gets (git-lfs downloads and hooks off on every later reclone) and refuses a checkout that tracks git-lfs files or cannot be inspected. Nothing changes on upgrade.' },- { since: 'TBD', id: 'refresh_replan_own_commits_8828', text: 'A `gbrain sources refresh` whose checkout HEAD moved while it waited for writes admitted before its fence no longer refuses `refresh_source_changed` when every commit since its start is one of gbrain\'s own (in the commit ledger) and the upstream branch holds them: it takes HEAD as its start and fast-forwards to the upstream. A HEAD move that includes a commit gbrain did not make, or gbrain\'s commits the upstream does not hold yet, still refuses as before.' },+ { since: 'TBD', id: 'refresh_replan_own_commits_8828', text: 'A `gbrain sources refresh` whose checkout HEAD moved while it waited for writes admitted before its fence no longer refuses `refresh_source_changed` when every commit since its start is one of gbrain\'s own (in the commit ledger) and the upstream branch the refresh started with holds them: it takes HEAD as its start and fast-forwards to that upstream. A HEAD move that includes a commit gbrain did not make, gbrain\'s commits the upstream does not hold yet, or an upstream changed while the refresh waited still refuses as before.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */