Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge branch 'gbra284-f9-defer-direct-writes' into contract-v3-with-own
garrytanfab1d5ee274e
diff --cc CHANGELOG.mdindex 024b06345e,58de53da35..3be021437e--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,18 -10,335 +10,345 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+ ## [0.60.620.0] - 2026-11-09++ **A diverged managed checkout now publishes its local commits on refresh by default when Git durability is on, after a secret scan of those commits.** Commits a script made with plain `git commit` in a managed checkout used to strand there whenever the remote moved: every `gbrain sources refresh` refused `refresh_diverged` and asked the user, unless `sources.refresh_publish_diverged` was set to `true`. With the setting unset, a worktree whose Git durability is on (`gbrain sources writer git-durability <source> --enable`, or the legacy hook) now publishes them itself: the local commits merged with the upstream in memory, never a rebase or force-push, then the fast-forward. The publish child scans, under its publish lock and for the exact commits it pushes, what they add: commit messages, added lines (including a value a later commit removed) and merge-commit conflict resolutions. A value that looks like a secret, added text too large to scan, or a commit that changes `.gbrain-scan-allow` or a `.gitattributes` refuses the new `publish_secret_found` naming the file, line, rule and commit, never the value, with nothing pushed; commits the scan cannot read in full refuse `publish_scan_unreadable` instead. The rewritten-upstream refusal and the `--expect-remote` bound are unchanged. `false` turns it off; `true` still publishes with durability off.++ ### Itemized changes++ - `src/core/git/range-secret-scan.ts` (new): reads the range with plumbing only (`rev-list`, `git cat-file commit` per message, one `git diff-tree --stdin -p --root --cc` streamed to a private temporary file and read in chunks), so no log, diff or encoding setting, no replace ref and no system attributes file changes what is scanned, and memory stays bounded however large the binaries in the range are. It scans each commit's message (also as raw bytes when it declares an encoding other than UTF-8), each file's added lines and each merge's lines no parent has with `scanText` and the workspace allowlist (`.gbrain-scan-allow`). Binary is git's own rule (a NUL in the first 8000 bytes) with attributes read from the empty tree; a file git still calls binary is checked by its own bytes when its old side was not empty or an attribute could apply, and scanned whole when it is text. Added text over the scan cap is reported unscanned, and output it does not recognise, a git failure or its 300 s budget make the result unreadable.+ - `src/core/persistence/worktree-refresh.ts`: an unset `sources.refresh_publish_diverged` publishes only when `gitDurabilityPolicy` says durable (otherwise `refresh_diverged` names the durability and the `--enable` command); the publish child runs with `--scan-secrets`.+ - `src/core/git/commit-push.ts`, `src/commands/git.ts`: `scanSecrets` / `--scan-secrets` (push-only) scans `trackingRef..target` inside the publish lock, right before the push, and refuses `publish_secret_found` (new error code) on a finding or an over-cap file, and `publish_scan_unreadable` (new error code: no secret was reported, check the checkout with `git fsck`) when the scan could not read the range in full; the secret refusal's fix lists the commits and asks the user to remove the value or allowlist a false positive, never to push anyway.+ - Docs: `docs/guides/shared-checkout-git.md` (`publish_secret_found` row), `docs/guides/write-refusals.md` (`refresh_diverged`), `docs/guides/live-sync.md`, `docs/guides/shared-checkout-git.md`, `docs/guides/troubleshooting.md`, `docs/architecture/canonical-writers.md`.+ - Tests: `test/guarded-publish.test.ts` (a secret added then removed, one in a commit message and one in a merge resolution each refuse with nothing pushed and no value printed; an allowlisted fingerprint and a binary file are skipped; a clean range publishes; a NUL past a text file's first 8000 bytes, a repository log encoding `log.showRoot=false` with a merged root commit and a message declaring UTF-16 never hide a secret; a range the scan cannot read, or a message encoding it cannot decode, refuses `publish_scan_unreadable`; every scan git call runs with the system attributes file off); `test/refresh-publish-diverged-7686.test.ts` (unset with durability off refuses naming `--enable`, unset with durability on publishes, a secret in the local commits refuses `publish_secret_found` with nothing pushed or fenced).++ ## [0.60.619.0] - 2026-11-08++ **`gbrain git commit-push` on a managed checkout no longer reports commits the remote lacks as already pushed.** On a managed canonical worktree, commit-push commits only the named paths and leaves publishing to the persistence owner. When the commit already existed (a script's bare commit, or one an earlier call made), it printed `nothing to commit; origin/main at -`, exited 0 and logged `[push] ok-already-on-remote`, which the push-log reader behind `put_page`'s `lastPushStatus` and doctor counts as a push that landed, while the branch sat ahead of (or diverged from) its upstream. It now says nothing was pushed, reports how many commits the upstream lacks as last fetched (`unpublished` in `--json`), names the command that publishes them, and writes no push-log line. Nothing is pushed or moved; exit codes are unchanged.++ ### Itemized changes++ - `src/core/git/commit-push.ts`: `commitManagedPaths` marks its result `managed: true`, counts `unpublished` (`@{upstream}..HEAD`; `null` when no fetched upstream can be read) and names the branch's configured `upstream` (`null` when it names none); both are in `--json`.+ - `src/commands/git.ts`: a managed result reports `committed <sha>` or `nothing to commit`, then `not pushed:` with the unpublished count against the configured upstream (or "is on <upstream> as last fetched", "may not be on <upstream>" when its fetched ref can't be read, or "has no upstream"), and returns before the push log is written.+ - Docs: `docs/guides/shared-checkout-git.md` (managed worktree paragraph and the `nothing_to_commit` / `committed_local` rows).+ - Tests: `test/git-commit-push-managed-unpublished.test.ts` (the real CLI against a bare remote, a sibling clone and a managed-root registry: an existing commit with a moved remote, a fresh commit, a checkout on its upstream, a branch with no upstream, an upstream whose fetched ref is missing, an upstream with a different branch name; no push-log line in any case).++ ## [0.60.618.0] - 2026-11-08++ **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}` 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; own published commits under an upstream changed under the fence still refuse and merge nothing).++ ## [0.60.617.0] - 2026-11-08++ **Older URL sources can get the same reclone settings as new ones remote callers add.** URL sources added before gbrain recorded who added them carry no record, and nothing stored tells a remote caller's add from the local operator's, so their reclones used the clone settings of a local add. The new doctor check `url_source_origin` lists them and asks the user who added each one. `gbrain sources record-origin <id>... --remote|--local` records that answer, as a preview until `--apply`. A URL source the local operator adds from now on records that it was a local add, so doctor never asks about it. With `--remote`, every later reclone of the source clones with git-lfs downloads and hooks off, like a source a remote caller adds today. A checkout that tracks git-lfs files is refused, because changing its settings would make the next reclone fail to match its canonical content. Nothing changes on upgrade.++ **`gbrain frontmatter install-hook` reads a clone's hooks-off setting from that clone's own config only, and its skip message names only that setting.** The check that leaves a clone with `core.hooksPath=/dev/null` alone now runs with `GIT_DIR`, `GIT_WORK_TREE` and the `GIT_CONFIG*` variables scrubbed, so a variable inherited from the caller's shell cannot point the read at another repository or config file. The `skipped — …` line says the clone's own config turns hooks off, without naming a cause it did not check.++ ### Itemized changes++ - `src/commands/frontmatter-install-hook.ts`: `hooksOffInClone` runs `git config --local --get core.hooksPath` with `gitChildEnv()` minus `GIT_CONFIG_GLOBAL`, `GIT_CONFIG_SYSTEM` and `GIT_CONFIG_NOSYSTEM`. `hooksPathBlocker` returns `hooks are off in this clone's own config (core.hooksPath=/dev/null), and gbrain leaves them off`. Other git reads in the file keep the caller's environment.+ - `src/core/url-source-origin.ts`, `src/commands/sources-record-origin.ts`, `src/commands/doctor/checks/url-source-origin.ts`, `src/commands/doctor/wave-checks.ts`: doctor `url_source_origin` (host-only, read-only) lists active URL sources in the default clone directory with no `added_by_remote_caller` record, including a clone there from before the ownership marker; a clone in another directory is a local add and is not listed. Only an explicit `true` reads as a remote caller's add. `gbrain sources record-origin` is trusted local CLI only (`trusted_local_only` for any other caller) and writes the record in one transaction that re-reads the row. `--remote` refuses `lfs_tracked` (a tracked path with `filter=lfs`, or a committed `.gitattributes` naming `filter=lfs`, so clone-local attributes cannot hide git-lfs files) and inspects the checkout again under the row lock before it writes, and refuses `lfs_unknown` (a checkout that is missing or Git cannot list); `--local` never replaces a remote record. Without git-lfs files the tracked bytes of a reclone are unchanged, so the stored writer manifest is not rewritten.+ - `src/core/sources-ops.ts`, `src/core/persistence/managed-sources.ts`: a URL add records `added_by_remote_caller: false` when the local operator adds it, as both add paths already recorded `true` for a remote caller.+ - Tests: `test/frontmatter-install-hook.test.ts`; `test/sources-remote-lfs.test.ts`; `test/url-source-origin.test.ts` on PGLite and Postgres; the doctor goldens gain the `url_source_origin` row.++ ## [0.60.616.0] - 2026-11-08++ **Opt-in local-edit adoption (`persistence.adopt_local_edits`, off by default) no longer leaves an adoption commit unrecorded when the write it was made for ends early, names that commit on a failed adoption's receipt, and refuses during a bisect or an uncommitted squash merge.** An adoption whose `gbrain: adopt local edit` commit landed before its publication failed used to end `write_claim_lost` (or be cancelled) once its caller's claim ended, so the commit was never recorded and later writes to the page refused `file_database_drift` until a sync. It is now published on its replay with its receipt naming the landed commit. An adoption that ends without committing after its commit landed names that commit too (`outcome.persistence.git_commit`, `landed_before_row: true`), so `gbrain write-request` and `gbrain sources writer failures` tie the commit to the adoption. Adoption now also keeps its refusal while a `git bisect` or an uncommitted `git merge --squash` is in progress, and when Git names the checkout's git dir with anything but one absolute, existing directory in valid UTF-8.++ ### Itemized changes++ - `src/core/persistence/local-edit-adoption.ts`, `file-repair.ts`: `landedAdoptionCommit` finds this adoption's commit at HEAD (subject, `gbrain-adopted:` trailer, commit-ledger line, the pre-adoption blob in its parent and the adopted blob at HEAD). The ledger's commit line is written after `git commit` and can be missing (a busy ledger lock, or a crash in between), so the intent line written before the commit also proves it when its `head_before` is the commit's parent and its message digest is the commit's. Preparation and the publication's recheck run the caller check only until that commit lands, and `settleAdoption` leaves a requeued adoption whose commit landed to the consumer instead of cancelling it. Fixes #8824.+ - `src/core/persistence/coordinator.ts`: `recoverPublication` stamps a landed adoption commit as `outcome.persistence = {git_state: committed, git_commit, landed_before_row: true}` on the requeued or failed receipt, the shape a strict source's landed door commit already uses; `completeWrite` keeps it on any later end without committing. Fixes #8767.+ - `src/core/persistence/pending-import.ts`: `operationMarkerPaths` adds `BISECT_LOG` and `SQUASH_MSG`, reads `git rev-parse --absolute-git-dir` as bytes and answers null on invalid UTF-8, or unless the one line (only its trailing newline stripped) is an absolute path that exists as a directory. `GIT_OPERATION_MARKERS` and `assertNoOperationInProgress` (`src/core/git/commit-push.ts`) are unchanged. A `git cherry-pick -n` leaves no marker; the adoption and its caller commit only their own path (`git commit --only`), so the picked path stays staged. Fixes #8826.+ - Tests: `test/adopt-local-edit.test.ts` on PGLite and Postgres (a replay after the caller was cancelled before recovery requeued it; a terminal failure right after the adoption commit; a replay whose commit line never reached the ledger, and intent lines that prove nothing without their commit, on another parent or with another message; a real `cherry-pick -n` of another path; a real bisect and a squash merge stopped on a conflict in another path), and `test/operation-marker-paths.test.ts` (a non-UTF-8 git dir reached through a clean symlink mid-cherry-pick, real squash merge and bisect, and a shim git answering with CRLF, a trailing space, a relative path, a missing directory, a file or no newline).++ ## [0.60.615.0] - 2026-11-08++ **A refresh killed after git refused its fast-forward no longer leaves the checkout fenced until a person acts.** When another agent commits on the start commit with plain git right before a refresh merges, git refuses the fast-forward and the refresh aborts, keeping that commit. If the refresh process died between the refused merge and that abort, recovery used to mark the refresh `recovery_required`, so writes to the checkout stayed fenced (or deferred, with the refresh write barrier on) until someone reset the checkout. Recovery (the owner's scan or `gbrain sources refresh --resume`) now aborts it the same way, with the fence lifted and the commit kept, and the next refresh completes. It tells this case from a merge that ran and was then reset by reading the reflog of HEAD and its branch since the merge started; without a reflog, or for a refresh an earlier version started, it still marks `recovery_required`.++ ### Itemized changes++ - `src/core/persistence/worktree-refresh.ts`: the update that marks `outcome.merge_started` also records `merge_started_at` (epoch ms, the refresher's clock). `recoverOne` aborts a `fenced` row `refresh_interrupted` when its merge started, HEAD descends from the start commit without the target, no member synced off HEAD, and the reflogs of HEAD and its branch (`reachedTargetSince`) show no move to the target since `merge_started_at` less 5 s. It reads at most the last 1 MiB of each reflog file and needs an unbroken old-to-new chain back past that time or to the log's first entry; a missing, empty or unreadable reflog, a gap in the chain or a tail that ends inside the window keeps `recovery_required`, and a reflog read git cannot finish leaves the row `fenced` for the next scan. Refresh git calls no longer inherit `GIT_COMMITTER_DATE`. `--abandon` lifts such a row the same way instead of marking it `recovery_required`.+ - `spec/tla/refresh-barrier`: `RefusedAbortable` models the new recovery rule, `FfMerge` aborts a refused merge as the code has since #8765, and `RecoveryOnlyByPolicy` now allows `recovery_required` only for a merge that ran. The guard mutant `resume-marks-refused-merge-recovery` reverts the rule.+ - Tests: `test/persistence-worktree-refresh-restart.test.ts` SIGKILLs a real refresh process right after git refused its merge, on PGLite and Postgres: recovery aborts it, a write deferred behind it commits and the next refresh completes; with the reflog deleted, with no `merge_started_at`, after a merge that reached the target and was reset (also with those reflog entries expired), or with a reflog tail that holds nothing from before the merge, it stays `recovery_required`; a 32 MiB reflog still aborts, and a reflog read git cannot finish leaves the row `fenced`.++ ## [0.60.614.0] - 2026-11-08++ **With the refresh write barrier on, a write held behind a refresh that ends without completing is now decided in the run that ends it, instead of waiting for a later refresh.** A refresh's fence keeps managed sync from importing another writer's commit while it runs, and only the refresh's own sync imports in its place. When the refresh was aborted, abandoned or rolled back after its process died, nothing imported that commit, so a write to that file stayed pending until some later refresh or sync, indefinitely while the checkout stayed diverged (up to the 15-minute wait limit). Now, while a checkout's last refresh ended aborted, every `gbrain sources refresh` run on the owner host ends by running the managed `--no-pull` sync of each source behind the checkout HEAD, including a run that refuses `refresh_diverged`. The waiting write is then prepared again against the checkout as it is. 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. The barrier is still off by default (`persistence.refresh_barrier`); with it off, the only change is that such a run also syncs sources behind HEAD.++ ### Itemized changes++ - `src/core/persistence/worktree-refresh.ts`: `refreshWorktree` ends every run (returned or refused, not `--dry-run`) with `syncAfterUnfinishedRefresh`. When the worktree's newest refresh row is `aborted`, it runs the bounded member sync for each member whose `last_commit` is not HEAD and that the run did not already sync, after the run's locks are released. The run's `synced` lists those syncs once each; a member left behind HEAD is named with its `gbrain sync --source <id> --no-pull` command in `next` (and `sync_blocked` when blocked) or in a refusal's message. A refusal of the run's own arguments, `refresh_in_progress` and an unexpected failure skip it.+ - `spec/tla/refresh-barrier`: new `RefreshBarrierAbortLiveness.cfg` checks liveness with no scheduled sync and no forced expiry (`OutsideHelp = FALSE`). `OwedSyncBegin` models the new sync, and the guard mutant `abort-skips-owed-sync` removes it (`DeferredLeaves` fails; the code edit fails the new tests). `scripts/spec/mutants.ts` names the temporal property that fails by checking each one on its own.+ - Tests: `test/refresh-barrier-held-after-abort.test.ts` (PGLite, and Postgres when `DATABASE_URL` is set). It covers a refresh aborted by another writer's commit followed by a diverged retry, a refresh killed at fenced and then abandoned by `--resume`, and an owner-scan abort followed by a diverged tick, plus a run that already synced the members (no second sync, each member listed once), a member left behind HEAD named with its resume command, and an argument refusal that runs no owed sync.++ ## [0.60.613.0] - 2026-11-08++ **A `POST /ingest` capture that runs again after its write landed no longer reverts a newer edit to the page.** A worker that died or lost its lock after the write committed, but before the job was marked complete, handed the job to another attempt, which wrote the captured body over any edit made in between. A client replaying the same POST after `gbrain jobs prune` removed the finished job got a fresh job that did the same. Each capture is now recorded under its job's idempotency key in the same transaction as the page write, and any later run of that key writes nothing and returns the first run's result. The record lasts 90 days, even after the job row is pruned. The upgrade records the captures whose completed jobs are still in the queue, so replaying one of those after its job row is pruned writes nothing either. Separate captures to one page still land in order, because each has its own key.++ ### Itemized changes++ - `src/core/minions/handlers/ingest-capture.ts` + `src/core/ingestion/applied-captures.ts`: a keyed capture checks `ingest_applied_captures` (new migration v296, which also records the completed `ingest_capture` jobs already in `minion_jobs`) before writing. On an unmanaged brain the row is inserted inside the page write's transaction, and a run that finds the row already there rolls its write back. On a managed brain each run sends the door a new `request_id` under a prefix derived from the key, the row is inserted once the door reports the write committed, and a committed request the handler sent as the local writer, found without its row, counts as applied and fills the row in; a remote writer's request under the same prefix never counts. Because the id is new on every run, a stalled run or a `gbrain jobs retry` (which resets the attempt count) never replays an earlier write of the capture that failed. Tombstones and jobs queued without a key behave as before.+ - `src/core/minions/types.ts`: handlers see the job's `idempotency_key` on their context; jobs already waiting when you upgrade carry it from their row.+ - `src/core/cycle.ts`: the dream cycle's purge phase drops applied-capture records older than 90 days.+ - Tests: `test/ingest-capture-applied-once.test.ts` (PGLite) and `test/e2e/ingest-capture-applied-once-postgres.test.ts` (Postgres): a re-run after a newer edit, a replay after the job row is pruned (through the real route), two ordered captures to one slug, a replay of a capture completed before the upgrade, the re-run on a managed brain, a retried managed capture whose attempt id already names a refused or failed write, and a remote writer's request forged under the capture's prefix.++ ## [0.60.612.0] - 2026-11-08++ **A page write or a managed `extract_facts` run no longer retires facts that the page's `## Facts` fence never held, and `gbrain repair unwithdrawn-facts` restores the ones earlier releases retired.** A fact a `put_page` writer attached to a page with a row number, but that was never in the page's fence, used to be expired by any later write that projected the fence. That included a write that changed nothing in the fence, often the page's first facts-fence generation, which `gbrain repair generations` cannot undo because it has no earlier generation. Now a row retires only when a fence held it (a facts-fence generation recorded it, the page as the writer read it carried it, or a stored version of the page did) or when the incoming fence states its claim. Every other row stays active with its id. Removing a row from the fence still retires it, as before. Doctor `unwithdrawn_facts` counts the facts that were already retired and points to the new repair, which previews first and restores the original fact ids and lifecycle from the generation ledger.++ The repair restores only what a later write would keep. It leaves a fact retired when you forgot it, including on your own memory page, and when the page's fence states the same claim. For copies of one claim it restores one per speaker. It picks the narrowest visibility first, and a copy that is still valid before one whose validity had lapsed. On a brain without managed persistence the `extract_facts` reconcile still retires rows its fence lacks, so the repair lists those facts as `excluded:unmanaged_reconcile` and restores none of them.++ ### Itemized changes++ - `src/core/generations/fence-evidence.ts` (new): `factsFenceHeld` decides whether a fence ever held a fact row, from the facts-fence ledger, the replaced body and the page's stored versions. `moveKeptRows` moves a kept row whose number an incoming fence row claims above the page's rows.+ - `src/core/generations/adapters/fact-rows.ts`, `src/core/persistence/canonical-projections.ts`, `src/core/trust/fence-guard.ts`: the page projection's fact generation retires only held rows and rows whose claim the incoming fence restates. Conversation-extractor rows still give up a number a fence row claims. Its expire statement and the trust guard leave kept rows alone.+ - `src/core/cycle/extract-facts.ts`: on a managed brain the reconcile keeps stale rows no fence held, unless the fence restates their claim, and moves one whose number a new fence row needs. An unmanaged brain's reconcile is unchanged.+ - `src/core/repair/unwithdrawn-facts.ts` and `src/commands/doctor/checks/unwithdrawn-facts.ts` (new): `gbrain repair unwithdrawn-facts [--include-ambiguous] [--apply --expect <hash>]`, bound to each page's revision at preview. A managed brain applies it through a database-only `managed_maintenance_restore_unwithdrawn_facts` request. Each fact is listed with its class: evidenced, ambiguous, or excluded with a reason (`fence_held`, `withdrawn`, `fence_states_claim`, `active_duplicate`, `duplicate_candidate`, `unmanaged_reconcile` and others). A page written since the preview restores nothing. Doctor check `unwithdrawn_facts`.+ - Tests: `test/fence-first-generation-8819.test.ts` and `test/repair-unwithdrawn-facts-8819.test.ts`, on PGLite and Postgres.++ ## [0.60.611.0] - 2026-11-08++ **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 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. 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. 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).++ ## [0.60.610.0] - 2026-11-08++ **A client that retries a `POST /ingest` capture accepted before v0.60.609.0 no longer queues a second job that writes the old body over the page's newer edit.** v0.60.609.0 added the target slug to the capture's queue key, and nothing looked up the old key form, so a retry of a capture that had already landed was taken as a new one. The route now also looks up a capture's pre-v0.60.609.0 key and answers 202 with that job when it was queued for the same target slug, so the retry is the same request again and nothing is queued.++ ### Itemized changes++ - `src/commands/serve-http-webhooks.ts` (`POST /ingest`): before queueing, the route looks up the capture's legacy key (client, write source and content hash, no slug part). A row queued for the same normalized target slug (or with no slug, for a slug-less capture) answers the request; a row for another slug never does, so one body sent to two slugs still queues two captures. A dead or cancelled legacy row frees its key, as under the current key. A legacy row still waiting or running with no recorded submitter (left by an upgrade across v0.50) answers 409 `legacy_job_authority` with its recovery hint instead of queueing a second job. The 429 at the waiting cap, the 400 for slugs over 1024 bytes and the webhook HMAC are unchanged.+ - Tests: `test/serve-http-ingest-legacy-key-retry.test.ts` (PGLite) and `test/e2e/serve-http-ingest-legacy-key-retry-postgres.test.ts` (Postgres) drive the real route: a retry of a completed legacy capture gets its job back, queues nothing and leaves the newer edit in place, and a legacy row with no recorded submitter gets its job back when completed or a 409 while still waiting.++ ## [0.60.609.0] - 2026-11-07++ **`POST /ingest` no longer answers 202 for a capture it drops, and an unsigned GitHub webhook can no longer tell from response time which repositories a brain syncs.** The same body sent to two slugs now queues two captures, where the second caller used to get the first job back and nothing written to its slug. A capture over the 50-capture waiting cap now gets 429 `ingest_backlog_full` with `Retry-After: 30` and nothing queued, where it used to get another capture's job id. A slug over 1024 bytes gets 400 `invalid_slug` before anything is queued, well short of the roughly 2.7 KB where no page can be stored under it. Every webhook request now computes the HMAC over its body, whether the repository is unknown, has no secret or is covered by a source, so a 401 takes the same work either way.++ ### Itemized changes++ - `src/commands/serve-http-webhooks.ts` (`POST /ingest`): the queue idempotency key carries the normalized target slug as its sha256 (empty when the job picks the slug), so retries to the same slug in any letter case still collapse onto one job. When the waiting cap hands back another job, the route answers 429 instead of 202. An `X-Gbrain-Slug` over 1024 UTF-8 bytes is refused with 400 `invalid_slug`.+ - `src/commands/serve-http-webhooks.ts` (`POST /webhooks/github`): push and item events compute the HMAC with a throwaway key when there is no source or no secret. For item events, every github-kind source with a secret is checked, and legacy `github_repo` sources share exactly one check, given to the lowest-id one with a secret, so the work does not depend on how many sources name the repository. A second legacy source on the same repository with a different secret is not tried.+ - Tests: `test/serve-http-ingest-write-loss.test.ts` (slug-keyed dedup, the 429 at the cap, the 1024-byte slug limit at both edges), and HMAC-count checks in `test/serve-http-github-webhook.test.ts` and `test/serve-http-github-push-webhook.test.ts`.++ ## [0.60.608.0] - 2026-11-07++ **With the refresh write barrier on, a write that waited behind a refresh or an import can no longer land on top of a later write to the same page, and most of the barrier's remaining review follow-ups (GST-1623) are closed.** The barrier is still off by default (`persistence.refresh_barrier`); with it off, only the receipt health, the recovery-time replay order, the refresh merge check, the drain sleep and the new index change. A consumer from an older release that claims a later write first now makes the waiting write end `revision_conflict` instead of overwriting it. A write held again and again behind imports now expires at a ceiling counted from its admission. Waiting writes count toward their source's fair share of the local CLI cap. A refresh whose record recovery moved before the merge merges nothing. With the barrier on or off, a plain-git commit that lands on the upstream commit right after a refresh's merge no longer leaves the checkout `recovery_required` with writes refused until someone runs `--resume`: the refresh records the merge and syncs the new HEAD. One that lands on the start commit right before the merge no longer does either. Git refuses the fast-forward, and the refresh ends `refresh_source_changed` with the fence lifted, nothing merged and the commit kept, so the next refresh can run.++ ### Itemized changes++ - `src/core/persistence/refresh-barrier.ts`: a deferred or import-held write ends `revision_conflict` when a later non-sync write to its page has already committed (appends excepted), and refreshed paths compare case-folded when `core.ignorecase` is true. A held write's limit is the wait limit since its hold, or four wait limits (at least four hours) since its admission. An expired `remember` says that only a fact naming its entity gets the automatic replay, and that `gbrain repair failed-writes` lists the rest.+ - `src/core/persistence/import-deferral.ts`: a write deferred behind a refresh that meets `pending_import` takes the refresh-change check on that file first (a refresh that changed it ends the write `revision_conflict`), and its hold clears the released `deferred_refresh_id`, so a pre-v294 consumer never claims it (#8759 included: a capture whose captured bytes are the imported file names no `supersedes`).+ - `src/core/persistence/page-prepare.ts`: an earlier held write refuses only a journaled request admitted after it, never a Git or withdrawal-mirror effect, lint or a drift check reading the file.+ - `src/core/persistence/journal.ts`: the local CLI fair share counts `deferred` rows; managed sync's capacity discount counts only writes still held for its own source (#8759); receipt health treats a released deferred write as an earlier write and reports `recovery_required` for every write on a worktree whose refresh awaits recovery; a replay of an accepted request id reconciles before any deferral.+ - `src/core/persistence/worktree-refresh.ts`: the ff-only merge runs only when recording `merge_started` matched the `fenced` row; otherwise the refresh ends `refresh_source_changed` with nothing merged. When the merge succeeded but HEAD already descends from the upstream commit (a plain-git commit landed in between) and no member synced a commit HEAD lacks, the refresh records the merge and continues to `syncing`. When git refuses the fast-forward because HEAD gained commits on the start commit only (a plain-git commit landed after the HEAD check), the refresh aborts with `refresh_source_changed` and retries once in the run (GST-1674). A reset to the start commit plus an unrelated commit still ends `recovery_required`.+ - `src/core/persistence/sync-drain.ts`: a `worktree_refreshing` retry hint never sleeps past the drain's refresh budget.+ - Migration v295 adds `persistence_worktree_refreshes_completed` on `(worktree_id, completed_at DESC) WHERE state='completed'` for the retry-hint history read.+ - `gbrain upgrade --check-downgrade` and the guide say a released deferred write publishes only when a process runs the write consumer on the owner host; polling `gbrain write-request` only reads the receipt.+ - Tests on PGLite and Postgres: `test/refresh-barrier-gst1623.test.ts` (GST-1623 items 1, 2, 3, 5, 13–22, #8759, and a commit landing right after or right before the refresh merge with the barrier off and on).++ ## [0.60.607.0] - 2026-11-07++ **A long `gbrain sync` no longer prints a stall right after the writer was busy finishing a claimed request.**++ While a sync drains its write queue, gbrain prints a live line such as `stalled 45s on queued` when the request at the head of the queue stops moving. If the head was claimed for a while (for example while the process published the writes a killed server left behind) and a new queued request then reached the head, that line counted the new request's wait from before the claimed stretch. It reported a stall of a minute or more right after the writer had been working the whole time. Now every read of the head counts as progress, claimed or not, so the next queued head's age starts at the read before it. A claimed head still prints its own step age.++ ### What you'd see++ | Head reads, ten seconds apart | Before | Now |+ |---|---|---|+ | a queued request, then a claimed one for 60 seconds, then a new queued request | `stalled 70s on queued` | `stalled 10s on queued` |+ | a claimed request that is publishing | the claim's step age | the claim's step age (unchanged) |++ ### Things to watch++ Only the printed age changes. When a sync stops, escalates or reports blocked is unchanged, and nothing stored is touched.++ ### Itemized changes++ #### Fixed++ - The in-pass stall line (`inPassHeadAge` in `src/core/persistence/sync-drain.ts`) records claimed head reads, so a queued head that follows a claimed one counts its age from the read before it.++ #### For contributors++ - `test/sync-drain-claims.test.ts` covers a claimed head between two queued heads. The convergence nightly's 70 s owner-kill stall bound now measures real stalls, not time the writer spent publishing a killed server's writes.++ ## [0.60.606.0] - 2026-11-07++ **Updates follow a stable channel by default; every release is one setting away on alpha.**++ gbrain publishes a release for nearly every merged change, more than a hundred a week. Every install followed all of them, so an always-on brain upgraded several times a week onto releases no one had run on a production-shaped brain. Installs now follow the stable channel, which gets about one release a week, each promoted by a maintainer after the soak passed on that release's exact tree. The alpha channel (the old `latest`, which still works as an alias) keeps every release.++ ### What changed++ | Situation | Before | Now |+ |---|---|---|+ | A new or existing install with no channel set | offered every published release | offered the newest stable release; one notice on stderr says so, once per brain home |+ | Following every release | the default | `gbrain config set self_upgrade.channel alpha` (or `--channel alpha`, `GBRAIN_RELEASE_CHANNEL=alpha`) |+ | Which stable release is offered | `VERSION` at the `stable` tag | the published evidence record (`stable.json` on `stable-record`): version, commit, tree, soak run, withdrawn versions; a record without the evidence is never trusted |+ | Stable has no usable answer | `stable_channel_unresolved` on upgrade | `stable_missing`, `stable_invalid` or `stable_unreadable`; the background check only reports it, an explicit upgrade exits non-zero, neither falls back to alpha |+ | An install ahead of stable (it ran alpha) | — | offered nothing until stable passes it; never downgraded unless its version was withdrawn |+ | Update cache and snooze | one file for every channel; a snooze ended when a newer release shipped | one per channel, tagged with the evidence policy; a snooze holds its whole window (24 h, 48 h, 7 days); a stable rollback below it clears it |+ | `gbrain upgrade --dry-run` | refused without `--restart-only` | reports channel, its source, current and target version and the action, installing nothing |+ | doctor `self_upgrade_health` | — | names the channel and its source, warns on an invalid channel or a failed stable check |+ | `Promote stable` workflow | moved the `stable` tag | also commits the evidence record in the same atomic push; new `withdraw` input adds versions to `known_bad`; promoting the current stable again writes its record from the stable tag's message, moving no tag (the one-time backfill for releases promoted before the record existed; the daily stable check does it on its first scheduled run) |++ Install commands now name `stable` (`bun install -g github:garrytan/gbrain#stable`), so a new install starts on the channel it follows. Every install surface goes through one constant (`src/core/install-ref.ts`), checked by `bun run check:install-ref`; `latest-stable` still installs the newest release for anyone who pins it.++ ## [0.60.605.0] - 2026-11-07++ **Stable now moves forward by itself: a daily check promotes an important fix within a day and anything else within a week, and only after the soak passed on that exact release.** `.github/workflows/stable-daily.yml` runs at 05:17 and 13:17 UTC. It acts only when a merged PR labelled `stable:important` is released but not yet in stable, or stable is more than 7 days old. It promotes the newest release whose exact tree passed the production soak with every integrity gate clean, and otherwise dispatches one soak so a later run can promote. It never moves stable backward, pauses while stable is a rollback, and stops entirely with the repository variable `STABLE_AUTO_PROMOTE=off`.++ ### Itemized changes++ - New `scripts/stable-daily.ts` and `.github/workflows/stable-daily.yml`: the reason (a released `stable:important` fix stable lacks, or the 7-day weekly floor), the candidate (newest release on master newer than stable with a successful full soak of its exact tree, both default cells for at least 2 hours on the requested 600,000-page fixture with privacy probes run and none erroring, and `privacy_leaks`, `read_errors`, `version_skew`, `residents_alive` and `session_refusals` passing in every cell; on the important-only path it must contain the fix), one soak dispatch when nothing qualifies (never while a soak runs, never after a soak on a newer release failed to qualify, with a warning once stable is past the weekly floor), the rollback pause and the kill switch. A manual dispatch defaults to a dry run, and `dry_run=false` needs an admin or maintainer before it writes anything.+ - `scripts/promote-stable.ts`: `scheduleAuthorized()` lets only a schedule event of `stable-daily.yml` on the default branch promote without the admin or maintain role; every other check is unchanged, and the record's `promoted_by` names the schedule. Manual dispatches keep the maintainer check.+ - `docs/RELEASING.md#daily-stable-check` documents the label, the schedule, the kill switch and the rollback.+ - `test/scripts/stable-daily.test.ts` covers the authorization, the integrity gates, each reason and no-op path, the soak dispatch rules, the dry run and the workflow shape.++ ## [0.60.604.0] - 2026-11-07++ **New installs now start on the stable channel: the soaked release, not every release.** The documented install (`bun install -g github:garrytan/gbrain#stable`) and the clone fallback (`git clone --branch stable`) follow the `stable` tag, which moves only to a published release whose exact tree passed the production soak, at least weekly. A fresh `gbrain init` (and so `gbrain setup claude-code` or `codex`) writes `self_upgrade.channel: stable`, so the update check and `gbrain upgrade` offer only stable releases. `#latest-stable` keeps working as the alpha line with every release. An existing brain is not changed, because a re-init never sets or alters its channel.++ ### Itemized changes++ - Install pins move from `#latest-stable` to `#stable` in README, AGENTS.md, INSTALL_FOR_AGENTS.md, BOOTSTRAP_FOR_AGENTS.md, docs/INSTALL.md, the MCP, headless, in-agent and tutorial guides, the setup skills, the Codex plugin manifests and launcher, doctor's npm-squat fix, the bootstrap hints and the agent-workspace template. The bootstrap runbook fetch and the in-agent setup helper read the `stable` ref, and the in-agent helper pins the commit `refs/tags/stable` peels to. Until a release containing this change is promoted to `stable`, the runbook and helper served from that ref are the previous stable release's copies.+ - `scripts/check-bootstrap-tag.sh` sanctions `stable` as the one distribution ref and now refuses `#latest-stable` in the entry docs.+ - `src/commands/init.ts`: a fresh install (new content database, no prior config file) persists `self_upgrade.channel: stable` on PGLite and Postgres. A re-init keeps whatever the config says, including no channel. `test/init-stable-channel.test.ts` covers the fresh, re-init and explicit-channel cases, and `test/e2e/init-stable-channel-postgres.test.ts` the fresh and re-init cases on Postgres.+ - `docs/guides/upgrades-auto-update.md#stable-channel` describes stable as the default for new installs and `latest` as the alpha line.++ ## [0.60.603.0] - 2026-11-07++ **A source that a remote caller adds by URL keeps its clone settings on a managed brain, both when it is first cloned and when it is recloned, and `gbrain frontmatter install-hook` leaves that clone's hooks off.** v0.60.601.0 wrote git-lfs downloads off and hooks off into such a clone's own git config, but on a managed brain the add path did not record the source as remote-added and `gbrain sources reclone` cloned it again without the settings. `install-hook` read the clone's hooks-off setting as a hooks directory someone else chose, wrote a hook it would never run, and told the operator how to turn hooks back on.++ ### Itemized changes++ - `src/core/persistence/managed-sources.ts`, `src/core/persistence/topology-filesystem.ts`, `src/core/persistence/topology-clone.ts`: a managed add by a remote caller records `added_by_remote_caller` on the source, and the managed clone of such a source, on add and on reclone, uses the same `git clone --config` settings as `cloneRepo`'s `skipLfs` (shared as `LFS_OFF_CLONE_CONFIG` in `src/core/git-remote.ts`).+ - `src/commands/frontmatter-install-hook.ts`: a checkout whose own (`--local`) `core.hooksPath` is `/dev/null` is skipped (`skipped_hooks_off`) with nothing written and no wiring advice, `--force` included, and doctor's `frontmatter_hook` check no longer asks to refresh a hook there. A machine-wide `core.hooksPath=/dev/null` keeps the earlier behaviour, so the hook is written unwired with the usual advice.+ - Tests: `test/persistence-source-lifecycle.test.ts` (PGLite and Postgres), `test/sources-remote-lfs.test.ts`, `test/frontmatter-install-hook.test.ts`.++ ## [0.60.602.0] - 2026-11-07++ **A TLA+ model of the refresh write barrier and its deferred-write queue now runs in CI. It checks that a refresh killed at any phase recovers without stranding the writes deferred behind it, that held writes commit in admission order, and that no lock order deadlocks.** Nothing changes at run time: this release adds a model, its CI job and tests.++ ### Itemized changes++ - `spec/tla/refresh-barrier/`: `RefreshBarrier.tla` models write admission and deferral, the drain, the fence and the merge, a crash at each phase followed by recovery, ledger commits that move HEAD during the drain, writes held for an import, deferral behind `recovery_required`, and local-edit adoption. Four configs check every safety property and one checks liveness; two larger configs run nightly. The model reproduces the fenced-orphan recovery bug fixed in 0.60.596.0 and passes on the fix.+ - `spec/tla/refresh-barrier/mutants.json`: 19 mutants. Each removes one guard from the model, and TLC must report the named property. 15 make the same edit to the code, and a named PGLite or Postgres test must then fail on an assertion. Run them with `bun scripts/spec/mutants.ts refresh-barrier`.+ - `.github/workflows/tla-spec.yml`: TLC and the mutants run for both TLA+ specs, nightly and on pull requests and pushes that touch a spec, its runner, the code it models or a test a mutant names. Each spec uploads its own log artifact, `tla-spec-logs-<spec>`.+ - Tests: `test/spec-refresh-barrier.test.ts` keeps the configs, the workflow's path filter and the README's mutant table in step with the catalogue. New tests cover an import expiry overlapping a fence (Postgres), a claimed write that holds the drain, a token revoked after its write was claimed, and the owner scan aborting a refresh killed at the fence after an outside commit. The two Postgres race tests now fail if the operation they start never waits on the lock.++ ## [0.60.601.0] - 2026-11-07++ **Security wave from a /cso audit: four remote-surface holes closed on `gbrain serve --http` and `gbrain mcp expose`.** A write-scoped token could replace, through `POST /ingest`, pages that every MCP write refuses it: another member's `readable_by` page, an owner `visibility: private` page, another member's fact page. A read-scoped caller could make `search_by_image` read a file on the brain host by passing a `file://` URI or an absolute path as `image_url`, which echoed the file's first bytes, sent server images to the embedding provider, or hung or exhausted the server. And an unsigned GitHub push webhook answered whether a repository was wired to the brain, its tracked branch and its source id before checking the signature. A remote caller adding a source by URL could also make the brain host contact an address the cloned repository names for itself, which the URL check never sees. A default keyless install (stdio MCP, no HTTP surface) was not exposed to any of them.++ ### Itemized changes++ - `src/commands/serve-http-webhooks.ts`, `src/core/minions/handlers/ingest-capture.ts`: `POST /ingest` stores the caller's token or OAuth client on the job. The route answers `404 page_not_found` for an `X-Gbrain-Slug` the caller cannot read and `403 permission_denied` for a member fact page or the scope page, and queues nothing. An `X-Gbrain-Slug` that is not a valid slug gets `400 invalid_slug` instead of a queued job that fails later (#8763). The job checks the same writer again right before it writes, so a page restricted after the 202 is still refused, and a queued webhook job with no stored writer is checked as a guest. Fresh slugs and pages the caller can read import as before.+ - `src/core/ops/image.ts`, `src/core/search/image-loader.ts`: `search_by_image` accepts only an http(s) `image_url` from any caller that is not the trusted local CLI, and refuses `image_path` unless the context says the caller is local. The loader reads local paths only when its caller opts in, and checks for a regular file and the size cap before it reads.+ - `src/commands/serve-http-webhooks.ts`: a push event is verified against the source's secret before anything about the repository is answered. An unknown repository, a source with no secret and a bad signature all get the same `401 signature_mismatch`; the missing-secret case is logged on the server with the command that sets it.+ - `src/core/git-remote.ts`, `src/core/sources-ops.ts`, `src/core/ops/sources.ts`: a URL source a remote caller adds is cloned with git-lfs downloads off, written into the clone's own git config (`lfs.fetchexclude=*`, which outranks the repository's `.lfsconfig`, with hooks off so git-lfs's pre-push hook never runs), so every later pull, managed refresh and commit-push in that checkout keeps large files as pointer files and contacts no LFS endpoint. The source records `added_by_remote_caller: true` so a re-clone keeps it off. A URL source a remote caller added before this release carries no such record, so remove it and add it again (from the remote caller or with `gbrain sources add --url`, which keeps git-lfs) to choose its setting. A remote caller whose clone fails gets a fixed message; git's own error goes to the brain host's log. Sources added from the local CLI keep git-lfs.+ - Tests: `test/serve-http-ingest-member-access.test.ts` (real token verifier and Express route, two members), `test/search-by-image-op.test.ts`, `test/cross-modal-phase2.test.ts`, `test/serve-http-github-push-webhook.test.ts` and `test/sources-remote-lfs.test.ts` (real git-lfs against a local LFS endpoint).++ ## [0.60.600.0] - 2026-11-07++ **With the refresh write barrier on, writes waiting behind an import no longer use up the capacity the import itself needs, so a full cap no longer stalls managed sync until the waits expire.** The barrier is still off by default (`persistence.refresh_barrier`), and with it off nothing changes. Before, every held write kept its outstanding-request slot and intent bytes, so enough of them could leave a managed sync job, or a bulk import group, refused `queue_capacity`, and the writes it would have released waited out the limit and expired. A held `capture` that replaces an imported page now names what it replaced, as a blind `put_page` does, and the expiry pass no longer expires a hold that an import and a new deferral replaced while it ran.++ ### Itemized changes++ - `src/core/persistence/journal.ts`: a managed sync job, and a bulk sync group in `admitWriteGroupInTransaction` whose writes are all managed sync jobs, is admitted as if the writes held for an import or a refresh took no outstanding-request slot and no intent bytes. The held writes are counted only when the plain check would refuse, so an admission that fits reads nothing more. The importer can pass a cap by at most what the held writes hold. Other writes still count them.+ - `src/core/persistence/import-deferral.ts`: a held `capture` that lands over imported content records `supersedes` on its receipt, the `gbrain-supersedes:` commit trailer and the commit-ledger line, as a blind `put_page` does.+ - `src/core/persistence/refresh-barrier.ts`: `expireDeferredWrites` rechecks, under the lock, that the hold it scanned is still waiting on the same import and is still older than the wait limit, so a hold that an import and a new deferral replaced between the scan and the lock is left alone.+ - Tests on PGLite and Postgres: `test/import-write-barrier.test.ts` (a held capture's `supersedes`, the capacity a single import and a bulk import group need, the expiry racing a new hold) and `test/refresh-write-barrier.test.ts` (the capacity a refresh's own sync needs). Follow-ups are in #8759.++ ## [0.60.599.0] - 2026-11-07++ **A page write refused `source_changed` now says why in its receipt, and a source can opt in to having a `remember`, `capture` or `add_timeline_entry` adopt an uncommitted local edit instead of being refused.** Before, only `pending_import`, `sync_held` and `canonical_file_missing` refusals carried a cause, so a write lost to a hand edit, an occupied path or a file that moved mid-write looked the same in `gbrain write-request` and doctor. Every `source_changed` refusal now records `error_detail.origin`. With `persistence.adopt_local_edits.source.<id>` on (off by default), a one-sided local edit (Git `HEAD` still holds the database's copy, or any edit on a repo-less brain) is committed as its own write first, then the caller's write lands on top. Keep the flag off until the follow-ups in #8755 are done.++ ### Itemized changes++ - `src/core/persistence/publication-failure.ts`, `coordinator.ts`, `page-prepare.ts`, `git-door.ts`: a `source_changed` refusal's `error_detail` is `{ origin }`, one of `file_database_drift`, `canonical_path_occupied`, `raw_file_changed`, `pinned_git_worktree_conflict`, `unsafe_file_target`, `source_binding_changed` or `unbound_source`. Classification, retries and replay are unchanged. `gbrain sources writer status` leaves these routine refusals out of its recent database refusals.+ - `src/core/persistence/local-edit-adoption.ts` (new), `file-repair.ts`, `effect-git.ts`, `commit-ledger.ts`: the adoption is a `managed_file_repair` admitted under the installation's CLI writer with a request id derived from the caller's, so a write adopts at most once. It waits until the file has been unchanged for `persistence.adopt_quiet_ms` (default 5000, at most three windows), imports the exact bytes, keeps the replaced revision with change reason `adopted_local_edit` and, on a Git-durable checkout, commits only that file (`gbrain: adopt local edit to <path>`, trailers `gbrain-adopted:` and `gbrain-author: unknown`, a commit-ledger `adopted` line). The caller's receipt names `adopted: { path, blob, replaced_revision }`.+ - The adoption keeps the refusal for an edit to the title, type or a protected frontmatter key, a file that does not import, an edit on both sides, bytes that are not valid UTF-8, a `HEAD` that moved before publication or that Git cannot read, a cancelled caller, `put_page`, batches and every other verb. A file changed again during the adoption ends `raw_file_changed` with nothing written. An adoption still waiting on the worktree lock when the caller gives up is cancelled.+ - `src/commands/doctor/checks/local-edit-adoptions.ts` (new): doctor `local_edit_adoptions` lists the last 24 hours of adoptions per source.+ - Tests on PGLite and Postgres: `test/adopt-local-edit.test.ts` (each verb, every kept refusal, the quiet window, the lock and cancel races, a moved or unreadable `HEAD`, the doctor check, a repo-less brain) and `test/remember-pending-import.test.ts`.++ ## [0.60.598.0] - 2026-11-07++ **A segmented page that sync replaces on Postgres now publishes on the first try instead of being refused `body_staging_expired` ("does not cover its N-byte body") and blocking its source until the next sync.** The import ran its version write, which for a segmented page prunes old versions and sweeps their segment rows, at the same time as the flip that publishes the new body. On Postgres the two overlap on one connection, so the sweep could delete the freshly published tail row between the flip clearing its staging and bumping the page's generation. PGLite runs them in order, so only Postgres was affected. The refusal now records which staging was short, a retry inside the run really prepares the page again, and `gbrain sources writer failures` answers within its bound on a source full of large sync writes.++ ### Itemized changes++ - `src/core/import-file.ts` (#8729): a segmented import writes its version before the page write, as unpinned and demoting imports already did, so the version prune and segment sweep never run beside the flip.+ - `src/core/persistence/sync-prepare.ts`: a waiver screen aborts the segmented staging its import opened as soon as the import hands it over, on the unbounded engine so a screen past its deadline still aborts it. Before, every screened replace left a second staging live until the idle sweep.+ - `src/core/persistence/sync-pass-batch.ts`, `sync-run.ts`: an in-place re-freeze in a pass takes `passRequestId(…, failedRequestId)` instead of the failed request's own id, so the retry prepares the entry again instead of reading the failed receipt back. The first freeze keeps the v1 id; `STOPS_PER_ENTRY` still bounds retries. A chain restarted in the same pass can still re-derive an earlier chain's ids (#8750).+ - `src/core/persistence/publication-failure.ts`, `coordinator.ts`: a `body_staging_expired` refusal's `error_detail` is `{ origin: 'body_staging', staging: { staging_id, state, reason, rows, segment_count, covered_bytes, body_bytes } }`, read field by field from the engine's detail. Remote callers still see only `origin`.+ - `src/core/persistence/terminal-classify.ts`, `terminal-failures.ts`: the supersession probe tests the failed row's intent kind before it reads any later request's intent, and `readTerminalFailures` selects its page of rows before the lateral join, so the drill-down and the summary no longer detoast every later sync write's frozen file per failed row. On 200 failed and 2,000 committed large-intent writes the drill-down went from `unknown` at the 5 s bound to about 2 s.+ - Tests on PGLite and Postgres: `test/large-pages/segmented-sync-replace-8729.test.ts` and `test/e2e/segmented-sync-replace-8729-postgres.test.ts` (tail-only replaces while every version prunes, no staging left live, a forced refusal recorded and prepared again), `test/e2e/terminal-failures-large-intents-8729-postgres.test.ts`, `test/publication-failure-staging-8729.test.ts`, `test/terminal-supersession-kind-8729.test.ts`, `test/sync-pass-retry-id-8729.test.ts`.++ ## [0.60.597.0] - 2026-11-06++ **`gbrain upgrade` now restarts a jobs supervisor started from a source checkout as `bun run src/cli.ts jobs supervisor` instead of refusing the upgrade with `restart_refused`.** The restart planner recognised a gbrain process only when its command line held a path containing "gbrain", so a supervisor launched with a relative `src/cli.ts` was invisible, its worker looked unsupervised, and the upgrade stopped. Four smaller fixes ride along with it, covering a flaky spend-guard SIGTERM test, the PGLite snapshot cache keys, the stress gate's pooled-owner match, and the ownership stamp on a checkout that became a Git repository after it was stamped.++ ### Itemized changes++ - `src/core/upgrade-restart.ts`: `gbrainEntry` resolves a relative entry point against the process's working directory (`/proc/<pid>/cwd` on Linux), skips interpreter flags that take a value (`--preload x`, `--cwd x`, `-r x`; after the value of any other flag, such as `--dns-result-order ipv4first`, the entry is the next path) and treats `src/cli.ts` as gbrain when the package two levels up is named gbrain; an unreadable package falls back to the old path match. `bun run <file>` runs the file in its own process and is classified; `bunx`, `bun x` and `bun run <bin>` are wrappers whose child is the gbrain process, so they are no longer counted twice. A worker whose parent is not recognised as gbrain is refused with that parent's pid and executable name; its command line, which can carry credentials, is never printed or put in `--json` output. On macOS, where the working directory is not read, a relative entry still matches a gbrain path; otherwise its worker is refused with the parent's pid and executable name (`ps -p <pid> -o command=` shows the rest).+ - `scripts/eval-spend-guard.sh` (#8717): the lease's start time is read before the signal traps are armed, so no command substitution is parsed between arming them and `wait`. A TERM that landed there ran its trap while bash 5.2 still expected the lease line's `)`, the trap failed with "unexpected EOF while looking for matching `)'", the signal was lost and the guard waited out its command and exited 0. Under CPU load the original guard did that in 3 of 3000 forced TERMs and the fixed guard in 0 of 3000, interleaved. `test/eval-spend-guard.test.ts` pins that no command substitution sits in that window; the exit-143 assertion is unchanged.+ - `.github/workflows/test.yml`, `e2e.yml`, `stress.yml` (#8700): the 15 `pglite-snapshot` cache keys hash `src/core/**/*.ts` (plus the snapshot builder and its test helper) instead of `src/core/*.ts` and a hand list of subdirectory files, so a schema input in a new `src/core` folder needs no workflow edit. A change anywhere under `src/core` now rebuilds the snapshot cache.+ - `scripts/stress/run.ts` (#8702): a pooler-gated test is exempt from the stress gate only when the workflow job that names it, or the script lines beside it, set `GBRAIN_CI_REQUIRE_PGBOUNCER`; a flag elsewhere in the same file no longer counts. `test/e2e/graduation-cli-topologies.test.ts` is no longer exempt, and a script owner is reported as an "owning pooled runner".+ - `src/core/persistence/physical-root-record.ts` (#8713): verifying a physical root inside a Git checkout writes the ownership-marker exclude once per process, so a repo-less brain that later ran `git init` stops offering its `.gbrain-owner.json` to `git add -A`. The conversion refusal for a root with no Git history now says to add the exclude before the first `git add -A`. Doctor's existing `tracked_ownership_marker` check (#5186) still names a stamp already in the index with the `git rm --cached` fix, which keeps the file and history.++ ## [0.60.596.0] - 2026-11-06++ **With the refresh write barrier on, a page write no longer bounces because a sync is running, and a `gbrain sources refresh` killed at any point recovers on its own or stops for an operator, never losing work.** The barrier is still off by default (`persistence.refresh_barrier`), and with it off writes behave as before. With it on, a `put_page`, `capture`, `remember` or `add_timeline_entry` whose page file holds a committed change managed sync has not imported yet is answered pending instead of refused `pending_import`, then prepared again once the import lands. A write during a refresh stuck in `recovery_required` waits too, and the per-refresh deferral cap is gone. Wherever `worktree_refreshing` still refuses, `retry_after_ms` is estimated from the refresh instead of a fixed second.++ ### What changed++ | Situation (barrier on) | Before | Now |+ |---|---|---|+ | A page write onto a file with a committed change sync has not imported | refused `pending_import` | pending; lands after the import (a `put_page` with `expected_revision` ends `revision_conflict` when the import moved the page) |+ | A blind `put_page` that replaces imported content | n/a | lands and names the revision and commit it replaced in `supersedes`, a `gbrain-supersedes:` commit trailer and the commit ledger |+ | The import never lands within the wait limit of the hold | n/a | `pending_import_expired`, nothing applied; a `remember` ends as its `pending_import` refusal did and is replayed after the import |+ | A write during a refresh in `recovery_required` | refused `refresh_recovery_required` | waits behind the refresh and lands once it is resumed or abandoned |+ | Writes past `persistence.refresh_barrier_max_deferred` | refused | deferred; the setting is no longer read |+ | `retry_after_ms` on `worktree_refreshing` | always 1000 | the refresh's typical remaining time, at least 15 s while syncing and 2 s otherwise |++ ### Itemized changes++ - Import holds (`src/core/persistence/import-deferral.ts`, journal claim, `refresh-barrier.ts`): the consumer moves its own claim back to `deferred` naming the last imported commit, and the row is claimable again once `sources.last_commit` moves. A later write to the same page never passes a held one, and expiry rechecks under the source lock that the import still has not landed. An idle owner counts an overdue hold as work, so expiry runs with nothing else queued. A hold happens only when every live consumer on the owner host advertises `refresh_barrier_import_1`; otherwise the write keeps the refusal. Schema migration v294 adds `persistence_requests.deferred_import_from` and widens the deferred-row guard.+ - Refresh crash recovery (`src/core/persistence/worktree-refresh.ts`): a refresh records `merge_started` in a committed transaction before `git merge --ff-only`. A refresh killed at `fenced` before its merge, whose HEAD then moved on its own line (gbrain commits from its drain, or anyone else's), aborts as `refresh_interrupted` instead of being recorded as merged. One whose HEAD reached the target records the merge. A started merge followed by a reset and an unrelated commit still stops at `recovery_required` for an operator.+ - Retry hint (`src/core/persistence/refresh-retry-hint.ts`): the median duration of the worktree's last completed refreshes minus how long this one has run, leaving out refreshes that waited in `recovery_required`. The message says the write was not saved and when to retry, and the CLI's human output ends with one line saying the same.+ - Tests on PGLite and Postgres: `test/import-write-barrier.test.ts` (every held operation, supersedes, expiry, the remember replay, the hold clock, the capability gate, the idle-owner expiry, recovery_required and same-page ordering), `test/refresh-retry-hint-gst1582.test.ts`, and the crash-recovery cases in `test/refresh-write-barrier.test.ts`. Design note: docs/designs/REFRESH_WRITE_BARRIER.md, "Writes that wait for an import" and "Crash recovery".+## [0.60.595.0] - 2026-11-06+**An attested call to the tools QM's agent uses in a person's own DM now answers in `structuredContent`, and those tools are in a new contract, `v3.json`, with frozen result shapes.** `query`, `get_page`, `get_timeline`, `get_backlinks`, `find_experts`, `whois`, `entity`, `context_pack`, `volunteer_context`, `get_write_request` and `forget_fact` called with `x-qm-actor` put their result in `structuredContent` and their refusals in `structuredContent.error`, so QM decodes every answer from one place. `docs/contracts/qm-memory-provider/v3.json` keeps all of v2 and adds each of those tools with its served input schema and the fields every success carries; other fields may appear and are ignored. `get_write_request` freezes the seven write-request states, and a state outside them means unknown, not published. Each `memory_recall` fact now says which read found it (`arm`: `own` or `ranked`). Nothing became attestable by default: the operator still lists each tool in `--attest-ops`. `v1.json` and `v2.json` are unchanged.++| Situation | Before | Now |+|---|---|---|+| Attested call to a v3 personal tool | JSON text in `content` only; a refusal had no `structuredContent.error` | the same JSON in `content` plus the result in `structuredContent` (a list as `structuredContent.results`); refusals carry `structuredContent.error` |+| Attested `context_pack` | JSON in `content` | `content` is the rendered pack text; the rest of the result is in `structuredContent` |+| Attested personal read over the result cap once `structuredContent` is counted | sent | refused whole with `result_too_large` |+| `memory_recall` fact rows | `{id, text, date, kind}` | add `arm`: `own` or `ranked`; no score |+| The same tools without `x-qm-actor` | as above | unchanged |+**An attested call can no longer write pages directly: `add_timeline_entry`, `add_link`, `put_page` and `edit_page` are not attestable.** They write to pages that everyone who reads the page sees, so a trusted system acting as one person could put that person's words in front of a whole audience with no one approving them. They now wait for owner-approved proposals, the way `capture` and take writes already do. An operator whose `--attest-ops` list names one of them sees `gbrain auth rescope` refuse the list, and each attested call to it is refused (`actor_not_attested`, reason `op_not_attested`); a queued attested write of one fails when it publishes. Unattested calls, and credentials bound to a member, are unchanged. `v2.json` lists the new deferred operations; `v1.json` is unchanged.**A `memory_recall` that names sources reads as that scope, never as the attested person, so a shared turn can no longer recall one member's private facts into a shared channel.** `memory_recall` gains `source_id` and `source_ids`. Named, the read drops the person's own recent facts and every member-page fact, keeps restricted pages hidden and never relaxes `visibility: private`. The contract for it is the new `docs/contracts/qm-memory-provider/v2.json`; `v1.json` stays byte-identical and a test holds it there. Three smaller provider fixes ride along.diff --cc scripts/module-size-limits.tsvindex 92a6a0a13a,1284da50c1..33caf0b91b--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@@ -47,4 -47,4 +47,4 @@@ src/commands/doctor/checks/extraction-ssrc/core/search/evidence-delivery.ts 1759 ratchet +5 W5: EvidencePlan.rankCut resolved with the plan (logic in search/page-rank-cut.ts); +20 W5 whole_pages: wholeCost prices a block as delivery would emit it whole (needs the private Block/enrichBlock internals) and the cut is wired before allocate (cutWholePages lives in search/page-rank-cut.ts); new row: crossed the 1500 unlisted cap at the #6367 merge (master 1479, its explicit-budget cap) by the C1 date header threaded through every block path, cap included; pagePlanHits (search/page-plan-hits.ts) and the header loader (evidence-date.ts blockDateHeaders) were peeled first; peel candidate: allocateCapped; +8 at the #6396 merge: page evidence text cut through the fence-chunk trust overlay and the caller minTrust floor (re-summed: our 1504 + master +8); +119 Cat 40 next wave F2: the search.long_page_unit policy (withLongPagePolicy, selectLongPages size preflight with page/byte/deadline limits) and the long-page fetch and fallback in deliverEvidence, kept in the shared seam the plan names (gbrain-evals docs/plans/2026-10-11-cat40-next-wave, F2); +17 F2 rework to the frozen-comparison policy: search.long_page_min_chars (rendered-body characters, default 20,000) read in withLongPagePolicy, a character count in the preflight, the rendered-body confirmation in deliverEvidence, and the long-page row exemption in capDeliveredSnippets (re-summed at the 0.60.225.0 merge: master 1537 + F2 136); +39 Wave B PR 2 lane 2b: planSegmentedBlock joins the windows search/segmented-evidence.ts reads around a segmented page's hits into one run-marked document (needs the private Doc/Piece/buildDoc/locateAnchor internals), planBlock's unit cut split into blockFromDoc for both, sections bounded by their run, selectionCost counts a gap between runs, and the fetch skips the whole-body fence overlay for a segmented page; +4 segmented pages read at once before planning (segmentedReads; the read is search/segmented-evidence.ts, the statements page-body/read-range.ts); +17 GBRA-156: tail trim plan flag, DeliverOptions.query, DeliveryMeta.tail_trim, the trim call and the frozen-hit score/query library fields (logic in search/evidence-tail-trim.ts; interface fields cannot move); +7 GBRA-205: EvidencePlan.titleHeader and DeliveryMeta.title_header (interface fields cannot move) and the titles option on the header loader (logic in search/evidence-date.ts; the query budget key lives in search/evidence-packing.ts); +11 #7600: assemble_evidence quotes conversation rows and capEvidenceToBudget counts the quote fence (logic in search/transcript-quote.ts); +2 GBRA-156 /ship review: the cut-path admission and title room count the quote fence; +2 GBRA-156 /ship review pass 2: capEvidenceToBudget counts the fence only for the paths that fence (quote flag; recall counts the text as returned); +4 GST-687: page evidence and the extractive fallback quote below-owner-tier text for untrusted readers (untrusted flag; logic in search/transcript-quote.ts)src/commands/config.ts 1526 ratchet +1 GBRA-216: recall.* config set value refusal (facts/recall-config.ts); +1 GBRA-216: config set refuses a dream.claim_conflicts.mode other than propose|off (refusal in facts/claim-conflicts.ts); new row: crossed the 1500 unlisted cap in wave 15 P7.4 #5461: set-time validation of think.pages_budget_chars / think.excerpt_ceiling_chars (range + parser live in core/think/pages-budget.ts), mirroring the cycle.consolidate.cluster_threshold hook; +1 wave 16 G5.1 (#6495): set-time refusal hook for search.keyword_statement_timeout_ms (check lives in commands/config/keyword-timeout-value.ts); +1 wave 18b lane 5 (#5012 item 6): search.contextual_retrieval prints the existing-pages hint after the write (text lives in commands/config/contextual-mode-hint.ts); +1 #6712 PR 2: retired/rollback sync key dispatch line (logic in core/sync-config-keys.ts handleSyncKeyConfig); +1 #6865: sync.slug_conflicts.auto_remove boolean validation at set time (refusal text in repair/slug-autoheal.ts); +1 #6948: sync.origin_twins.auto_resolve boolean validation at set time (refusal text in repair/origin-twins-heal.ts); +2 #6795: config set chat_model/expansion_model help line and the model-pin import (shadow report and file-pin unset live in commands/config/model-pin-shadow.ts); +1 #6712 PR 4b: sync.admission set-time hook (value logic in commands/config/sync-admission-value.ts); +4 #7130: set-time refusal hook for sync.max_deletes / sync.max_delete_ratio (and .source.<id>) / purge.retention_hours (check lives in core/sync-reconcile.ts deleteSafetyConfigRefusal); +1 GBRA-150: sync.metafile_pages set-time route (body in config/sync-metafile-pages-value.ts); re-summed at the v0.60.330.0 merge (1520 measured); +2 #7242 minions.terminal_hook file-plane key and its set branch (logic in minions/terminal-hook.ts); +1 GBRA-161: generations.* set-time route (refusal in commands/config/generations-values.ts); +1 GBRA-207 #7630: sync.repo_path set-time refusal hook (refusal in core/sync-config-keys.ts syncRepoPathRefusal)src/commands/mcp-expose.ts 1519 ratchet hosted_option: Session carries the gbrain.io coaching notice on the first-receipt run and Tailscale/service friction exits (copy, refs and gating live in core/onboard/hosted-option.ts); +7 GBRA-199: --surface help lines, surfaceChosen option field and the advertise pass-through (registrationAdvertise in core/mcp-registration.ts)- src/core/behavior-change-notice.ts 1669 ratchet +4 train R: #7491/#7492 keyword_identifier_probe and keyword_slug_handles rows and their comment, #7175 keyword phrase row; the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +1 GBRA-156 #7593: private_pages_granted_sources row (re-summed at the 0.60.527.0 merge: 1574 + 1); +3 GBRA-200 comment, write-grant refusal and degraded-stamp rows (re-summed at the 0.60.562.0 merge: 1615 + 3); +2 GBRA-280 get_page selector-precedence row and comment (re-summed at the 0.60.569.0 merge: 1619 + 2); the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +2 GBRA-205 saved_facts_stems row and its comment (re-summed at the #7901 0.60.492.0 merge: 1541 + 2); +2 GBRA-205 search.query_facts_block default-on row and its approval comment (re-summed at the #7610 0.60.490.0 merge: 1539 + 2); +2 the #7900 content checkpoint host-move row (since TBD until the merge slot), +2 the #7897 private-hold sweep row (since TBD until the merge slot), +2 the #7880 ingest_capture and company-brain private-hold row (since TBD until the merge slot), +5 the frozen-source wave comment and four rows (#7868, #7850, #7869/#7870, #7871), +2 the #7848 visibility_noncanonical hold row (since TBD until the merge slot), +2 the #7846 extract_atoms session-source row (re-summed at the 0.60.481.0 merge: master 1524 + 2), +2 the #7805 synthesize session-source and #7841 visibility_not_applied rows (re-summed at the 0.60.480.0 merge: master 1522 + 2), +2 strict door planned-state row (#7705, re-summed at the 0.60.470.0 merge: master 1514 + 2), +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, +1 G5 lane C trust_release row, +1 #7619 cli_flag_equals, +3 GBRA-207 #7630 relative-anchor and stalled-write rows, +2 the #7632 function search_path disclosure row and +2 the #7679 orphaned worktree refresh row (re-summed at the 0.60.471.0 merge: master 1516 + 2), +2 the #7814 retired v0.13.1 grandfather row, +2 the #7618 conversion withhold/progress/push row (master 1520 + 2); the behavior-change table split (#7607) retires this row; +4 GBRA-188 #7489: the wave comment and three rows (brain-first instructions, starter surface default, per-turn rule); +1 GBRA-188 plugin_turn_hook_gbra188 row; +1 GBRA-242 provider_key_rules_7959 row (#7959), +2 the GBRA-199 registration_lists_verbs row (since TBD until the merge slot); +2 GBRA-133 #7652: the #7611 pass_abandoned reader row and the lean read-only serve socket row (re-summed at the 0.60.503.0 merge: master 1555 + 2); +1 GBRA-243: the per-turn hook disclosure row (rows are data and cannot move); +4 GBRA-156 #7598 harness wave comment and rows (remote page cap, sources_not_readable refusal, sources add next step); +4 GBRA-156 #7601 search_quotes_transcript_rows comment and row; +1 GBRA-175 #7475 autopilot_restarts_serve_7475 row (re-summed at the #8012 merge: 1566 + 1); +3 #7997/#8014/#8015 rows (redaction markers, company db_only keep, ignored supabase_only scope); +2 #7199 (re-port of #7228) classic_drift_rescreen_7199 comment and row; +2 #7931 file_drift_agrees_7931 comment and row; +1 #7950 file_drift_slug_release_7950 row; +1 #7974 file_drift_followups_7974 row; +1 #8059 quoted_fence_marker_8059 row; +2 GBRA-247 #8009 provenance_repair_held_8009 and #7982 pass_transient_streak_7982 rows; +4 GBRA-247 #7973 plain_directory_sync_7973, #7988 managed_marker_own_directory_7988, #7985 former_binding_parked_group_7985 and settle_effects_retire_7985 rows Train S merge: 1570 base + 5 (master since the #8077 base) + 13 (#8077) = 1588.; +2 GST-687 remote_quotes_unverified_text_gst687 row and its comment (re-summed at the gate-ahead on train S 0.60.534.0: 1588 + 2); +2 #8377: the quote fence follow-ups row and its comment; +2 #8384: the quote fence follow-ups 2 row and its comment; +2 #8384 wave 3: the quote fence follow-ups 3 row and its comment; +5 GBRA-218 train M rows (A1 member_read_access_gbra218 and member_access_hatch_scope_gbra218, B shared_agent_audience_gbra231, A2 folder_access_rules_gbra218, folder_access_scoped_role_gbra218), re-summed at the train M merge of master v0.60.541.0: 1596 + 5 = 1601 measured; +3 GST-359 train C rows (C1 qm_attested_actor_gst359, C2 member_facts_gst359, D qm_memory_provider_gst359), re-summed at the train C merge of master v0.60.543.0: 1601 + 3 = 1604 measured; +2 #8424: hook_launcher_8424 row and its comment (rows are data and cannot move), re-summed at the #8418 v0.60.546.0 merge: 1604 + 2 = 1606 measured; +2 #8426: mcp_lane_launcher_8426 row and its comment (rows are data and cannot move); +2 GST-927: empty_nonstring_args_gst927 row and its comment, re-summed at the gate-ahead on master v0.60.550.0 plus #8420: 1610 measured; +2 GBRA-283 Wave A (#8460): engine_keyed_caches_gbra283 row and its comment (rows are data and cannot move); +2 GBRA-287: segmented_freeze_hold_gbra287 and segmented_reexport_gbra287 rows (rows are data and cannot move); +1 GST-1209: segmented_tiling_gst1209 row (rows are data and cannot move); +1 GST-1251: skillopt_loop_deprecated_gst1251 row (rows are data and cannot move); +1 GST-1209 follow-up: untiled_hold_repair_gst1209 row (rows are data and cannot move); +1 GBRA-283 B3a: embedded_scope_required_gbra283 row (rows are data and cannot move); re-summed at the train R merge with v0.60.574.0: 1623 + 4; +2 GST-1387: refresh_fence_refusal_gst1387 row and its comment (rows are data and cannot move); re-summed at the memory train #8481 merge with v0.60.578.0 (1643 measured); +3 GBRA-253 #8109 rows (frontmatter_drift_write_8109, contacts_activity_advance_8109, contact_rows_dedupe_8109; rows are data and cannot move), re-summed at the master v0.60.581.0 merge: 1643 + 3 = 1646 measured; +3 #8123 part C rows: sync_write_through_off_writeback_7084, managed_sync_dry_run_counts_7087, frontmatter_missing_source_dir_7889 (since TBD until the merge slot; re-summed at the 0.60.583.0 merge: 1646 + 3); +4 PR B commit_ledger_prb, doctor_foreign_writers_prb and sources_guard_prb rows and their comment (rows are data and cannot move; since TBD until the merge slot); +1 PR B #8615: file_drift_held_needs_prefer_8615 row; +1 PR B #8617: refresh_source_changed_retry_8617 row; +1 PR B #8662: commit_push_checkout_not_a_source_8662 row (since TBD until the merge slot; rows are data and cannot move); +2 PR B refresh_barrier_prb and commit_push_base_prb rows (re-summed: 1658 measured); +3 convergence PR A: the wave comment and two rows (conversion_content_evidence_pr_a, git_gap_live_pages_pr_a; since TBD until the merge slot; rows are data and cannot move); re-summed at the gate-ahead on master v0.60.592.0 plus #8711: 1658 + 3 = 1661 measured; +4 GST-1094/GST-900 rows (memory_recall scope-read, member-bound acting_user, recall max_chars, unknown_param _meta-only) and +1 qm_scope_writes_gst1113 and +1 recall_question_terms_gst1304 rows (rows are data and cannot move), re-summed at the 0.60.595.0 slot merge: 1661 + 6; +1 GST-1158 F9: the attest_direct_page_writes_deferred_gst1158 row (since TBD until the merge slot); +1 GST-1158 v3: the qm_personal_structured_gst1158 row (since TBD until the merge slot)-src/core/behavior-change-notice.ts 1688 ratchet +4 train R: #7491/#7492 keyword_identifier_probe and keyword_slug_handles rows and their comment, #7175 keyword phrase row; the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +1 GBRA-156 #7593: private_pages_granted_sources row (re-summed at the 0.60.527.0 merge: 1574 + 1); +3 GBRA-200 comment, write-grant refusal and degraded-stamp rows (re-summed at the 0.60.562.0 merge: 1615 + 3); +2 GBRA-280 get_page selector-precedence row and comment (re-summed at the 0.60.569.0 merge: 1619 + 2); the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +2 GBRA-205 saved_facts_stems row and its comment (re-summed at the #7901 0.60.492.0 merge: 1541 + 2); +2 GBRA-205 search.query_facts_block default-on row and its approval comment (re-summed at the #7610 0.60.490.0 merge: 1539 + 2); +2 the #7900 content checkpoint host-move row (since TBD until the merge slot), +2 the #7897 private-hold sweep row (since TBD until the merge slot), +2 the #7880 ingest_capture and company-brain private-hold row (since TBD until the merge slot), +5 the frozen-source wave comment and four rows (#7868, #7850, #7869/#7870, #7871), +2 the #7848 visibility_noncanonical hold row (since TBD until the merge slot), +2 the #7846 extract_atoms session-source row (re-summed at the 0.60.481.0 merge: master 1524 + 2), +2 the #7805 synthesize session-source and #7841 visibility_not_applied rows (re-summed at the 0.60.480.0 merge: master 1522 + 2), +2 strict door planned-state row (#7705, re-summed at the 0.60.470.0 merge: master 1514 + 2), +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, +1 G5 lane C trust_release row, +1 #7619 cli_flag_equals, +3 GBRA-207 #7630 relative-anchor and stalled-write rows, +2 the #7632 function search_path disclosure row and +2 the #7679 orphaned worktree refresh row (re-summed at the 0.60.471.0 merge: master 1516 + 2), +2 the #7814 retired v0.13.1 grandfather row, +2 the #7618 conversion withhold/progress/push row (master 1520 + 2); the behavior-change table split (#7607) retires this row; +4 GBRA-188 #7489: the wave comment and three rows (brain-first instructions, starter surface default, per-turn rule); +1 GBRA-188 plugin_turn_hook_gbra188 row; +1 GBRA-242 provider_key_rules_7959 row (#7959), +2 the GBRA-199 registration_lists_verbs row (since TBD until the merge slot); +2 GBRA-133 #7652: the #7611 pass_abandoned reader row and the lean read-only serve socket row (re-summed at the 0.60.503.0 merge: master 1555 + 2); +1 GBRA-243: the per-turn hook disclosure row (rows are data and cannot move); +4 GBRA-156 #7598 harness wave comment and rows (remote page cap, sources_not_readable refusal, sources add next step); +4 GBRA-156 #7601 search_quotes_transcript_rows comment and row; +1 GBRA-175 #7475 autopilot_restarts_serve_7475 row (re-summed at the #8012 merge: 1566 + 1); +3 #7997/#8014/#8015 rows (redaction markers, company db_only keep, ignored supabase_only scope); +2 #7199 (re-port of #7228) classic_drift_rescreen_7199 comment and row; +2 #7931 file_drift_agrees_7931 comment and row; +1 #7950 file_drift_slug_release_7950 row; +1 #7974 file_drift_followups_7974 row; +1 #8059 quoted_fence_marker_8059 row; +2 GBRA-247 #8009 provenance_repair_held_8009 and #7982 pass_transient_streak_7982 rows; +4 GBRA-247 #7973 plain_directory_sync_7973, #7988 managed_marker_own_directory_7988, #7985 former_binding_parked_group_7985 and settle_effects_retire_7985 rows Train S merge: 1570 base + 5 (master since the #8077 base) + 13 (#8077) = 1588.; +2 GST-687 remote_quotes_unverified_text_gst687 row and its comment (re-summed at the gate-ahead on train S 0.60.534.0: 1588 + 2); +2 #8377: the quote fence follow-ups row and its comment; +2 #8384: the quote fence follow-ups 2 row and its comment; +2 #8384 wave 3: the quote fence follow-ups 3 row and its comment; +5 GBRA-218 train M rows (A1 member_read_access_gbra218 and member_access_hatch_scope_gbra218, B shared_agent_audience_gbra231, A2 folder_access_rules_gbra218, folder_access_scoped_role_gbra218), re-summed at the train M merge of master v0.60.541.0: 1596 + 5 = 1601 measured; +3 GST-359 train C rows (C1 qm_attested_actor_gst359, C2 member_facts_gst359, D qm_memory_provider_gst359), re-summed at the train C merge of master v0.60.543.0: 1601 + 3 = 1604 measured; +2 #8424: hook_launcher_8424 row and its comment (rows are data and cannot move), re-summed at the #8418 v0.60.546.0 merge: 1604 + 2 = 1606 measured; +2 #8426: mcp_lane_launcher_8426 row and its comment (rows are data and cannot move); +2 GST-927: empty_nonstring_args_gst927 row and its comment, re-summed at the gate-ahead on master v0.60.550.0 plus #8420: 1610 measured; +2 GBRA-283 Wave A (#8460): engine_keyed_caches_gbra283 row and its comment (rows are data and cannot move); +2 GBRA-287: segmented_freeze_hold_gbra287 and segmented_reexport_gbra287 rows (rows are data and cannot move); +1 GST-1209: segmented_tiling_gst1209 row (rows are data and cannot move); +1 GST-1251: skillopt_loop_deprecated_gst1251 row (rows are data and cannot move); +1 GST-1209 follow-up: untiled_hold_repair_gst1209 row (rows are data and cannot move); +1 GBRA-283 B3a: embedded_scope_required_gbra283 row (rows are data and cannot move); re-summed at the train R merge with v0.60.574.0: 1623 + 4; +2 GST-1387: refresh_fence_refusal_gst1387 row and its comment (rows are data and cannot move); re-summed at the memory train #8481 merge with v0.60.578.0 (1643 measured); +3 GBRA-253 #8109 rows (frontmatter_drift_write_8109, contacts_activity_advance_8109, contact_rows_dedupe_8109; rows are data and cannot move), re-summed at the master v0.60.581.0 merge: 1643 + 3 = 1646 measured; +3 #8123 part C rows: sync_write_through_off_writeback_7084, managed_sync_dry_run_counts_7087, frontmatter_missing_source_dir_7889 (since TBD until the merge slot; re-summed at the 0.60.583.0 merge: 1646 + 3); +4 PR B commit_ledger_prb, doctor_foreign_writers_prb and sources_guard_prb rows and their comment (rows are data and cannot move; since TBD until the merge slot); +1 PR B #8615: file_drift_held_needs_prefer_8615 row; +1 PR B #8617: refresh_source_changed_retry_8617 row; +1 PR B #8662: commit_push_checkout_not_a_source_8662 row (since TBD until the merge slot; rows are data and cannot move); +2 PR B refresh_barrier_prb and commit_push_base_prb rows (re-summed: 1658 measured); +3 convergence PR A: the wave comment and two rows (conversion_content_evidence_pr_a, git_gap_live_pages_pr_a; since TBD until the merge slot; rows are data and cannot move); re-summed at the gate-ahead on master v0.60.592.0 plus #8711: 1658 + 3 = 1661 measured; +4 GST-1094/GST-900 rows (memory_recall scope-read, member-bound acting_user, recall max_chars, unknown_param _meta-only) and +1 qm_scope_writes_gst1113 and +1 recall_question_terms_gst1304 rows (rows are data and cannot move), re-summed at the 0.60.595.0 slot merge: 1661 + 6; +1 GST-1582 refresh_barrier_import_gst1582 row (since TBD until the merge slot; rows are data and cannot move); +2 GST-1601 source_changed_origin_gst1601 and adopt_local_edits_gst1601 rows (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.596.0 merge: 1668 + 2; +1 GST-1623 refresh_barrier_capacity_gst1623 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.599.0 merge: 1670 + 1; +2 GBRA-224 W1 release_channel_stable_default row and its comment; +1 GST-1623 refresh_barrier_later_write_gst1623 row (#8765; rows are data and cannot move); +5 #8766 GST-1623 items 4/6-9 and #8755: the wave comment and four rows (doctor_foreign_writers_partial_gst1623, commit_push_enclosing_repo_gst1623, owner_guard_fail_closed_gst1623, adopt_local_edits_hardening_8755) and +1 managed_sync_kind_reserved_8765 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the gate-ahead on master v0.60.608.0 plus #8798: 1674 + 6; +1 GST-1853 refresh_barrier_aborted_refresh_sync_gst1853 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.613.0 merge: 1680 + 1; +1 GST-1674 refresh_refused_merge_recovery_gst1674 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.614.0 merge: 1681 + 1; +1 #8824/#8826/#8767: adopt_local_edits_replay_markers_8824 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the gate-ahead on #8837: 1682 + 1; +1 url_source_origin row (since TBD until the merge slot; rows are data and cannot move), re-summed at the gate-ahead on #8834: 1683 + 1; +1 #8828: the refresh_replan_own_commits_8828 row (1684 + 1 at the 0.60.618.0 slot); +1 the managed commit-push unpublished-count row; +1 the refresh publish-diverged default row; +1 GST-1158 F9: the attest_direct_page_writes_deferred_gst1158 row (since TBD until the merge slot)++src/core/behavior-change-notice.ts 1689 ratchet +4 train R: #7491/#7492 keyword_identifier_probe and keyword_slug_handles rows and their comment, #7175 keyword phrase row; the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +1 GBRA-156 #7593: private_pages_granted_sources row (re-summed at the 0.60.527.0 merge: 1574 + 1); +3 GBRA-200 comment, write-grant refusal and degraded-stamp rows (re-summed at the 0.60.562.0 merge: 1615 + 3); +2 GBRA-280 get_page selector-precedence row and comment (re-summed at the 0.60.569.0 merge: 1619 + 2); the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +2 GBRA-205 saved_facts_stems row and its comment (re-summed at the #7901 0.60.492.0 merge: 1541 + 2); +2 GBRA-205 search.query_facts_block default-on row and its approval comment (re-summed at the #7610 0.60.490.0 merge: 1539 + 2); +2 the #7900 content checkpoint host-move row (since TBD until the merge slot), +2 the #7897 private-hold sweep row (since TBD until the merge slot), +2 the #7880 ingest_capture and company-brain private-hold row (since TBD until the merge slot), +5 the frozen-source wave comment and four rows (#7868, #7850, #7869/#7870, #7871), +2 the #7848 visibility_noncanonical hold row (since TBD until the merge slot), +2 the #7846 extract_atoms session-source row (re-summed at the 0.60.481.0 merge: master 1524 + 2), +2 the #7805 synthesize session-source and #7841 visibility_not_applied rows (re-summed at the 0.60.480.0 merge: master 1522 + 2), +2 strict door planned-state row (#7705, re-summed at the 0.60.470.0 merge: master 1514 + 2), +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, +1 G5 lane C trust_release row, +1 #7619 cli_flag_equals, +3 GBRA-207 #7630 relative-anchor and stalled-write rows, +2 the #7632 function search_path disclosure row and +2 the #7679 orphaned worktree refresh row (re-summed at the 0.60.471.0 merge: master 1516 + 2), +2 the #7814 retired v0.13.1 grandfather row, +2 the #7618 conversion withhold/progress/push row (master 1520 + 2); the behavior-change table split (#7607) retires this row; +4 GBRA-188 #7489: the wave comment and three rows (brain-first instructions, starter surface default, per-turn rule); +1 GBRA-188 plugin_turn_hook_gbra188 row; +1 GBRA-242 provider_key_rules_7959 row (#7959), +2 the GBRA-199 registration_lists_verbs row (since TBD until the merge slot); +2 GBRA-133 #7652: the #7611 pass_abandoned reader row and the lean read-only serve socket row (re-summed at the 0.60.503.0 merge: master 1555 + 2); +1 GBRA-243: the per-turn hook disclosure row (rows are data and cannot move); +4 GBRA-156 #7598 harness wave comment and rows (remote page cap, sources_not_readable refusal, sources add next step); +4 GBRA-156 #7601 search_quotes_transcript_rows comment and row; +1 GBRA-175 #7475 autopilot_restarts_serve_7475 row (re-summed at the #8012 merge: 1566 + 1); +3 #7997/#8014/#8015 rows (redaction markers, company db_only keep, ignored supabase_only scope); +2 #7199 (re-port of #7228) classic_drift_rescreen_7199 comment and row; +2 #7931 file_drift_agrees_7931 comment and row; +1 #7950 file_drift_slug_release_7950 row; +1 #7974 file_drift_followups_7974 row; +1 #8059 quoted_fence_marker_8059 row; +2 GBRA-247 #8009 provenance_repair_held_8009 and #7982 pass_transient_streak_7982 rows; +4 GBRA-247 #7973 plain_directory_sync_7973, #7988 managed_marker_own_directory_7988, #7985 former_binding_parked_group_7985 and settle_effects_retire_7985 rows Train S merge: 1570 base + 5 (master since the #8077 base) + 13 (#8077) = 1588.; +2 GST-687 remote_quotes_unverified_text_gst687 row and its comment (re-summed at the gate-ahead on train S 0.60.534.0: 1588 + 2); +2 #8377: the quote fence follow-ups row and its comment; +2 #8384: the quote fence follow-ups 2 row and its comment; +2 #8384 wave 3: the quote fence follow-ups 3 row and its comment; +5 GBRA-218 train M rows (A1 member_read_access_gbra218 and member_access_hatch_scope_gbra218, B shared_agent_audience_gbra231, A2 folder_access_rules_gbra218, folder_access_scoped_role_gbra218), re-summed at the train M merge of master v0.60.541.0: 1596 + 5 = 1601 measured; +3 GST-359 train C rows (C1 qm_attested_actor_gst359, C2 member_facts_gst359, D qm_memory_provider_gst359), re-summed at the train C merge of master v0.60.543.0: 1601 + 3 = 1604 measured; +2 #8424: hook_launcher_8424 row and its comment (rows are data and cannot move), re-summed at the #8418 v0.60.546.0 merge: 1604 + 2 = 1606 measured; +2 #8426: mcp_lane_launcher_8426 row and its comment (rows are data and cannot move); +2 GST-927: empty_nonstring_args_gst927 row and its comment, re-summed at the gate-ahead on master v0.60.550.0 plus #8420: 1610 measured; +2 GBRA-283 Wave A (#8460): engine_keyed_caches_gbra283 row and its comment (rows are data and cannot move); +2 GBRA-287: segmented_freeze_hold_gbra287 and segmented_reexport_gbra287 rows (rows are data and cannot move); +1 GST-1209: segmented_tiling_gst1209 row (rows are data and cannot move); +1 GST-1251: skillopt_loop_deprecated_gst1251 row (rows are data and cannot move); +1 GST-1209 follow-up: untiled_hold_repair_gst1209 row (rows are data and cannot move); +1 GBRA-283 B3a: embedded_scope_required_gbra283 row (rows are data and cannot move); re-summed at the train R merge with v0.60.574.0: 1623 + 4; +2 GST-1387: refresh_fence_refusal_gst1387 row and its comment (rows are data and cannot move); re-summed at the memory train #8481 merge with v0.60.578.0 (1643 measured); +3 GBRA-253 #8109 rows (frontmatter_drift_write_8109, contacts_activity_advance_8109, contact_rows_dedupe_8109; rows are data and cannot move), re-summed at the master v0.60.581.0 merge: 1643 + 3 = 1646 measured; +3 #8123 part C rows: sync_write_through_off_writeback_7084, managed_sync_dry_run_counts_7087, frontmatter_missing_source_dir_7889 (since TBD until the merge slot; re-summed at the 0.60.583.0 merge: 1646 + 3); +4 PR B commit_ledger_prb, doctor_foreign_writers_prb and sources_guard_prb rows and their comment (rows are data and cannot move; since TBD until the merge slot); +1 PR B #8615: file_drift_held_needs_prefer_8615 row; +1 PR B #8617: refresh_source_changed_retry_8617 row; +1 PR B #8662: commit_push_checkout_not_a_source_8662 row (since TBD until the merge slot; rows are data and cannot move); +2 PR B refresh_barrier_prb and commit_push_base_prb rows (re-summed: 1658 measured); +3 convergence PR A: the wave comment and two rows (conversion_content_evidence_pr_a, git_gap_live_pages_pr_a; since TBD until the merge slot; rows are data and cannot move); re-summed at the gate-ahead on master v0.60.592.0 plus #8711: 1658 + 3 = 1661 measured; +4 GST-1094/GST-900 rows (memory_recall scope-read, member-bound acting_user, recall max_chars, unknown_param _meta-only) and +1 qm_scope_writes_gst1113 and +1 recall_question_terms_gst1304 rows (rows are data and cannot move), re-summed at the 0.60.595.0 slot merge: 1661 + 6; +1 GST-1582 refresh_barrier_import_gst1582 row (since TBD until the merge slot; rows are data and cannot move); +2 GST-1601 source_changed_origin_gst1601 and adopt_local_edits_gst1601 rows (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.596.0 merge: 1668 + 2; +1 GST-1623 refresh_barrier_capacity_gst1623 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.599.0 merge: 1670 + 1; +2 GBRA-224 W1 release_channel_stable_default row and its comment; +1 GST-1623 refresh_barrier_later_write_gst1623 row (#8765; rows are data and cannot move); +5 #8766 GST-1623 items 4/6-9 and #8755: the wave comment and four rows (doctor_foreign_writers_partial_gst1623, commit_push_enclosing_repo_gst1623, owner_guard_fail_closed_gst1623, adopt_local_edits_hardening_8755) and +1 managed_sync_kind_reserved_8765 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the gate-ahead on master v0.60.608.0 plus #8798: 1674 + 6; +1 GST-1853 refresh_barrier_aborted_refresh_sync_gst1853 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.613.0 merge: 1680 + 1; +1 GST-1674 refresh_refused_merge_recovery_gst1674 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the master v0.60.614.0 merge: 1681 + 1; +1 #8824/#8826/#8767: adopt_local_edits_replay_markers_8824 row (since TBD until the merge slot; rows are data and cannot move), re-summed at the gate-ahead on #8837: 1682 + 1; +1 url_source_origin row (since TBD until the merge slot; rows are data and cannot move), re-summed at the gate-ahead on #8834: 1683 + 1; +1 #8828: the refresh_replan_own_commits_8828 row (1684 + 1 at the 0.60.618.0 slot); +1 the managed commit-push unpublished-count row; +1 the refresh publish-diverged default row; +1 GST-1158 F9: the attest_direct_page_writes_deferred_gst1158 row (since TBD until the merge slot); +1 GST-1158 v3: the qm_personal_structured_gst1158 row (since TBD until the merge slot)diff --cc src/core/behavior-change-notice.tsindex cdfc0a4eb5,e093a93753..193c5557f7--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -1469,8 -1475,21 +1475,22 @@@ export const BEHAVIOR_CHANGES: Readonly{ since: '0.60.594.0', id: 'file_drift_held_needs_prefer_8615', text: '`gbrain repair file-drift` with `--held`, `--side`, `--state`, `--cursor` or `--provenance` and no `--prefer` now refuses with the usage line (`invalid_params`, and `file_drift_state_required` for a deleted side without `--state`) instead of silently running the all-drifted survey, which counted a different set of pages (#8615).' },{ since: '0.60.594.0', id: 'refresh_source_changed_retry_8617', text: 'A `gbrain sources refresh` run refused `refresh_source_changed` because the checkout HEAD moved (a writer committing) or work reached the checkout after the drain check now retries once from a fresh precheck in the same run, so the tick is not lost (#8617). When the retry is refused too, the run returns the first `refresh_source_changed` refusal with the retry\'s cause appended; ownership or source-membership changes are not retried.' },{ since: '0.60.594.0', id: 'commit_push_checkout_not_a_source_8662', text: '`gbrain git commit-push` now refuses `checkout_not_a_source` before staging anything when this brain home records its source checkouts (a managed brain) and the checkout it resolved from the working directory (no `--path`) is none of them and has no `gbrain.sourceRoot`, for example a wrapper that changed into another repository (#8662). The refusal names the resolved path and the brain\'s checkouts; pass `--path` with the absolute brain checkout. Hosts whose brain records no source checkout behave as before.' },+ // GST-1623 items 4 and 6-9, #8755. release:restamp stamps since at the merge slot.+ { since: '0.60.611.0', id: 'doctor_foreign_writers_partial_gst1623', text: 'Doctor `foreign_writers` no longer reads what it could not scan as clean. A source root inside a Git checkout whose `git rev-parse` fails or times out, roots past the 50-root scan cap, a commit ledger that exists but cannot be read, and a `git status` that failed or timed out now mark the scan partial, each listed in the new `partial_reasons` and named in the message. A scan that read no repository but skipped one warns instead of reporting not_applicable. `git status` now gets up to 30 s within doctor\'s budget instead of the fixed git timeout. A foreign commit whose trailers include a `gbrain-` trailer still fails the check, and the message names it as possibly an older gbrain without the commit ledger (`gbrain_trailer: true`).' },+ { since: '0.60.611.0', id: 'commit_push_enclosing_repo_gst1623', text: 'On a brain home that records its source checkouts, `gbrain git commit-push` without `--path` now also refuses `checkout_not_a_source` in a repository that only encloses a registered checkout (a clone above it): a registered checkout must contain the resolved one, or be a directory of it that its HEAD tracks. A checkout registry that cannot be listed now refuses `writer_coordinator_required` instead of an internal error.' },+ { since: '0.60.615.0', id: 'refresh_refused_merge_recovery_gst1674', text: 'A `gbrain sources refresh` whose process died after git refused its fast-forward (a plain-git commit landed on the start commit right before the merge) and before the refresh aborted is now aborted by recovery (the owner\'s scan or `--resume`, and `--abandon` abandons it) with the fence lifted and that commit kept, instead of being marked `recovery_required` and holding the fence, and every write deferred behind it, until a person acted. Recovery reads the reflog of HEAD and its branch to tell this from a merge that ran and was then reset; without a reflog (`core.logAllRefUpdates` off) or for a refresh an earlier version started, it still marks `recovery_required`.' },+ { since: '0.60.611.0', id: 'owner_guard_fail_closed_gst1623', text: 'The owner-path commit guard of `gbrain sources guard` now refuses the commit (exit 1, with a message) when `git rev-parse --absolute-git-dir` fails, instead of letting it through; a hook that belongs to another git dir still passes. A guard installed by an earlier version keeps its old script until `gbrain sources guard <source> --install` runs again.' },+ { since: '0.60.616.0', id: 'adopt_local_edits_replay_markers_8824', text: 'With `persistence.adopt_local_edits` on for a source (off by default), an adoption whose `gbrain: adopt local edit` commit already landed in Git is now published, and its receipt names that commit (`outcome.persistence.git_commit`, `landed_before_row: true`), even when the write it was made for was cancelled or its claim ended before the replay; before, it ended `failed` / `write_claim_lost` (or was cancelled) and left the commit unrecorded, so later writes to the page refused `file_database_drift` until a sync. An adoption that ends without committing after that commit landed now names the commit on its receipt too, so `gbrain write-request` and `gbrain sources writer failures` tie it to the adoption. Adoption also keeps the `file_database_drift` refusal while a `git bisect` (`BISECT_LOG`) or an uncommitted `git merge --squash` (`SQUASH_MSG`) is in progress, and when `git rev-parse --absolute-git-dir` answers with anything but one absolute, existing directory in valid UTF-8.' },+ { since: '0.60.611.0', id: 'adopt_local_edits_hardening_8755', text: 'With `persistence.adopt_local_edits` on for a source (off by default), a local edit is no longer adopted, and the write keeps its `file_database_drift` refusal, when its path has merge conflicts, while a merge, cherry-pick, revert or rebase is in progress, when the file equals one of the page\'s last 50 revisions or drops rows the current revision added (a stale editor save), when the page is segmented, or when the write\'s claim ended meanwhile. The quiet wait is capped at 30 s (it was up to three `persistence.adopt_quiet_ms` windows, 180 s at that key\'s cap), and an empty `persistence.adopt_quiet_ms` reads as the 5000 default instead of no wait. Doctor `local_edit_adoptions` still counts an adoption after its receipt is compacted.' },+ { since: '0.60.611.0', id: 'managed_sync_kind_reserved_8765', text: 'A page write that passes a `kind` starting with `managed_sync_` (for example `capture` with `kind: managed_sync_import`) is now refused `invalid_params` and writes nothing: that prefix is reserved for managed sync, and with `persistence.refresh_barrier` on a waiting write now tells sync\'s own imports apart from later writes by the operation that wrote them, not by the kind. Use another kind, or drop `kind`.' },+ { 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: '0.60.618.0', 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: '0.60.619.0', id: 'managed_commit_push_unpublished_gst1923', text: 'On a managed checkout, `gbrain git commit-push -m <msg> -- <paths>` now reports how many commits the upstream lacks as last fetched (`unpublished` in `--json`, `null` when there is no upstream) and says nothing was pushed, instead of answering `nothing to commit; <remote>/<branch> at -` and logging `[push] ok-already-on-remote` for a commit that already existed. It writes no push-log line on a managed checkout. It still never pushes there; `gbrain git commit-push --push-only --keep-checkout --path <checkout>` publishes.' },+ { since: '0.60.620.0', id: 'refresh_publish_diverged_default_gbra386', text: 'A diverged managed checkout now publishes its local commits on `gbrain sources refresh` by default when the worktree\'s Git durability is on: `sources.refresh_publish_diverged` unset now means on there (it used to mean off), merged with the upstream in memory, never rebased or forced. The refresh publish first scans what the local commits add (messages, added lines, merge resolutions) and refuses the new `publish_secret_found` naming the file, line and rule, never the value, when one looks like a secret; `gbrain git commit-push --push-only --scan-secrets` runs the same gate. Unset with durability not on still refuses, naming `gbrain sources writer git-durability <source> --enable`; `false` turns it off.' },{ since: 'TBD', id: 'attest_direct_page_writes_deferred_gst1158', text: 'An attested call (`x-qm-actor`) may no longer run `add_timeline_entry`, `add_link`, `put_page` or `edit_page`: they write pages every reader of the page sees, so they wait for owner-approved proposals. `gbrain auth rescope --attest-ops` refuses a list that names one, a credential whose list already names one is refused for it on every attested call (`actor_not_attested`, reason `op_not_attested`), and a queued attested write of one fails when it publishes. Unattested calls and member-bound credentials are unchanged.' },+ { since: 'TBD', id: 'qm_personal_structured_gst1158', text: 'An attested call (`x-qm-actor`) to `query`, `get_page`, `get_timeline`, `get_backlinks`, `find_experts`, `whois`, `entity`, `context_pack`, `volunteer_context`, `get_write_request` or `forget_fact` now also answers with its result in `structuredContent` (a list as `structuredContent.results`) and its refusals with `structuredContent.error`; `content` keeps the JSON, except `context_pack`, whose `content` is now its rendered text alone. A personal read whose answer, counted with `structuredContent`, is over the result cap is refused whole (`result_too_large`). Each `memory_recall` fact in `structuredContent.facts` gains `arm` (`own` or `ranked`). The same tools without `x-qm-actor` are unchanged, and none of them joined the default attested operations.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */