Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(changelog): describe the adoption rechecks at commit time and the commit-push marker fix

garrytan0f34b9294f71
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42ad9ff7e9..30bc58b818 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,16 +12,16 @@ identifiers and attribution are available in the pre-removal Git revision
## [0.60.610.0] - 2026-11-07
-**Doctor `foreign_writers` no longer reads an unreadable ledger or a skipped repository as clean, the owner-path commit guard fails closed, and the opt-in local-edit adoption (`persistence.adopt_local_edits`, off by default) gets the hardening it needed before any source turns it on.** `foreign_writers` now marks a scan partial when a root's Git probe fails, when roots pass the 50-root cap, or when the commit ledger exists but cannot be read. It names a foreign commit that carries a `gbrain-` trailer as possibly an older gbrain without the ledger, and still fails it. `gbrain git commit-push` refuses a repository that only encloses a registered checkout. Adoption keeps its refusal for a conflicted path or a merge in progress, a stale editor save, a segmented or oversized page, and a caller whose claim is gone. Its quiet wait is capped at the foreground budget, and an adoption whose publication failed after its commit is retried instead of left orphaned.
+**Doctor `foreign_writers` no longer reads an unreadable ledger or a skipped repository as clean, the owner-path commit guard fails closed, and the opt-in local-edit adoption (`persistence.adopt_local_edits`, off by default) gets the hardening it needed before any source turns it on.** `foreign_writers` now marks a scan partial when a root's Git probe fails, when roots pass the 50-root cap, or when the commit ledger exists but cannot be read. It names a foreign commit that carries a `gbrain-` trailer as possibly an older gbrain without the ledger, and still fails it. `gbrain git commit-push` refuses a repository that only encloses a registered checkout, even when an older gbrain left a stale marker in it. Adoption keeps its refusal for a conflicted path or a merge in progress, a stale editor save, a segmented or oversized page, and a caller whose claim is gone, and checks the claim, the conflict and the merge again in the transaction that publishes its commit. Its quiet wait is capped at the foreground budget, and an adoption whose publication failed after its commit is retried instead of left orphaned.
### Itemized changes
- `src/commands/doctor/checks/foreign-writers.ts`, `src/core/git/commit-ledger.ts`: `partial_reasons` lists skipped roots. A probe that fails inside a checkout, or roots past `MAX_ROOTS`, mark the scan partial, and a scan that read no repository but skipped one warns instead of reporting not_applicable. `readLedger` treats only ENOENT as empty. A failed or timed-out `git status` names its checkout, and its timeout follows doctor's per-entry deadline (5 to 30 s). Commits with a `gbrain-` trailer carry `gbrain_trailer`.
-- `src/commands/git.ts`, `src/core/persistence/root-registry.ts`: `checkout_not_a_source` requires a registered root to contain the checkout, or to be a directory of it that its HEAD tracks. A registry directory that cannot be listed refuses with a typed error.
+- `src/commands/git.ts`, `src/core/persistence/root-registry.ts`: `checkout_not_a_source` requires a registered root to contain the checkout, or to be a directory of it that its HEAD tracks. A stale `gbrain-managed.json` in an enclosing repository's git dir no longer admits it. A registry directory that cannot be listed refuses with a typed error.
- `src/core/git/commit-guard.ts`: the owner-path hook exits 1 when `git rev-parse --absolute-git-dir` fails.
-- `src/core/persistence/local-edit-adoption.ts`, `file-repair.ts`, `coordinator.ts`, `pending-import.ts`: adoption refuses unmerged paths and in-progress merges, cherry-picks and rebases. It also refuses a file whose body equals one of the last 50 revisions or that drops rows the current revision added, and it stats the file before reading it. It caps the quiet wait at 30 s and records the caller's claim, so an orphaned adoption publishes nothing. It waits on an adoption another task is already publishing, retries a requeued publication against a HEAD that already holds the adopted blob, and never reports `released` for a lost claim. An empty `persistence.adopt_quiet_ms` reads as the 5000 default, and an admission failure logs a `phase=adoption` line.
+- `src/core/persistence/local-edit-adoption.ts`, `file-repair.ts`, `coordinator.ts`, `pending-import.ts`: adoption refuses unmerged paths and in-progress merges, cherry-picks and rebases. It also refuses a file whose body equals one of the last 50 revisions or that drops rows the current revision added, and it stats the file before reading it. It caps the quiet wait at 30 s and records the caller's claim, so an orphaned adoption publishes nothing. It waits on an adoption another task is already publishing, retries a requeued publication against a HEAD that already holds the adopted blob, and never reports `released` for a lost claim. The publication transaction locks the caller's row and checks again that its claim holds, that the path has no unmerged stages and that no merge, cherry-pick, revert or rebase is in progress, so a cancel or a conflict that arrives after admission stops the commit. A caller that names no claim token ends `write_claim_lost` instead of a database error, and the stale editor save check strips the same edge whitespace in SQL as in JavaScript, so a body ending in a non-breaking space still matches its earlier revision. An empty `persistence.adopt_quiet_ms` reads as the 5000 default, and an admission failure logs a `phase=adoption` line.
- `src/commands/doctor/checks/local-edit-adoptions.ts`: counts adoptions from `outcome.adopted_local_edit`, which receipt compaction keeps.
-- `src/core/persistence/refresh-barrier.ts`: with `persistence.refresh_barrier` on, a write waiting behind a refresh or an import now counts a later write to its page as a conflict unless managed sync's own import wrote it. Before, a caller could hide its write by passing a `managed_sync_` kind, and a compacted sync receipt counted as a later write.
+- `src/core/persistence/refresh-barrier.ts`: with `persistence.refresh_barrier` on, a write waiting behind a refresh or an import now counts a later write to its page as a conflict unless managed sync's own import wrote it. Before, a caller could hide its write by passing a `managed_sync_` kind, and a compacted sync receipt counted as a later write. A connector import still counts as a later write after its receipt is compacted.
- `src/core/persistence/page-mutations.ts`: a page write that passes a `kind` starting with `managed_sync_` is refused with `invalid_params`.
- Tests: `test/doctor-foreign-writers.test.ts`, `test/commit-ledger.test.ts`, `test/sources-guard.test.ts`, `test/git-commit-push-not-a-source-8662.test.ts`, `test/adopt-local-edit.test.ts`, `test/refresh-barrier-gst1623.test.ts` and `test/refresh-write-barrier.test.ts` on PGLite and Postgres (#8755).