Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge commit 'cf90970a3d6abb94da40d821500d29eebb5e8c8c' into capy/nightly-reds-gst2457

garrytan2a2a4a1dfd07
diff --cc CHANGELOG.md
index b779794f11,a7c4c31e89..975fd6cf9c
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,20 -10,373 +10,387 @@@ credits are retained; no result has bee
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
+## [Unreleased]
+
+### Nightly checks stop failing on their own fixtures and sampling
+
+**Three nightly checks were failing because of how they measure, not because of gbrain. All three now test what users get.** The Codex plugin check expected gated tools to be listed even when their publish gate was off. The pre-v0.18 upgrade fixture couldn't build its legacy database because a newer trigger depends on the column it removes.
+
+- `test/e2e/codex-plugin-install-real.serial.test.ts`: the expected tool list now resolves publish gates the way `gbrain serve` does for the seeded brain over stdio. Wakeshift's `watch_job`, `list_watches` and `unwatch` (#8670) and `set_memory_writeback` (#8481) are listed only when their gate is on. Before this change the check failed every night from 2026-11-06 on; it now passes against codex 0.147.0, the version the workflow pins.
+- `tests/heavy/fixtures/down-mutate-pre-v0.18.sql`: before dropping `pages.source_id`, the fixture drops every trigger that depends on that column. The first such trigger was the per-folder access stamp from #8134. The walk forward re-creates those triggers. `tests/heavy/pg_upgrade_matrix.sh` failed on the pre-v0.18 shape before this change and passes on both shapes after it.
+- `scripts/bench/sync-freshness-gate.ts`: the Postgres managed serve-watch cell is now measured 3 times, and the gate uses the median of the three p50s, as the PGLite managed cell already did. The baseline and the 25% limit are unchanged. The cell's nightly p50 moves in steps of the 50 ms probe. Single runs at 656.5, 659.2 and 706.8 ms failed the 627 ms limit on 3 of 19 nightlies, and each passed when rerun on the same commit. A regression that slows every run still fails.
+- `scripts/ci-census-tests.sh`: the pull-request census job now also runs `test/scripts/run-unit-shard.test.ts` (1.5 s, no database). It reads every test file's per-test timeouts, so a bad timeout now fails the pull request instead of a later full run.
+- `scripts/sharding.ts`, `.github/workflows/test.yml`, `.github/workflows/e2e.yml`: the unit suite now splits into 30 shards instead of 28, run two per job (15 jobs), and the shard weights are refreshed from the median of five Test nightlies and the latest full E2E nightly. On the new weights 28 shards came to about 601 s each, over the 600 s per-shard budget; 30 shards come to about 561 s. Both coverage merges now expect shards 29 and 30.
+- `scripts/ci-typecheck.sh`, `.github/workflows/test.yml`: when the typecheck job's tsc aborts without a type error (exit 134 or a signal, as when V8 hits the heap limit), the job deletes the restored `tsbuildinfo` and runs tsc once more from cold. A run seeded with a distant head's state could go past the heap cap where a cold run of the same tree fits, and because the aborted run saved that same state under its own head's key, every rerun failed the same way. A type error (exit 1 or 2) still fails at once with no retry, and a run whose tsc aborted or timed out no longer saves its state. `test/scripts/ci-typecheck.test.ts` pins the retry to aborts only.
+- `scripts/postgres-unit-arms.ts`, `.github/workflows/persistence-validation.yml`: the PostgreSQL arms of unit-lane suites now run in 21 shards instead of 19. On current weights the largest shard planned at 554.6 s against its 570 s budget, so the next few arm files would have failed the budget test; at 21 it plans at 502.3 s. The budget and its assertion are unchanged.
+
+ ## [0.60.689.0] - 2026-11-12
+
+ **Three opt-in ways to share what is derived from member-restricted pages: raw-only folder rules, audience members the owner reads, and member lineage reads.** A folder rule kept the summaries, atoms, chronicle events and facts made from its pages as tightly as the pages themselves, so a transcript folder kept to one member hid every summary of those calls from everyone else; a group chat's own memory page was closed to the brain owner; and only the owner could read the derived pages and facts of pages it already reads. Each now has an operator setting, off by default, and nothing changes on upgrade: `gbrain access rule add --raw-only` keeps a folder's pages to its readers but lets whoever reads a derived page read it (use it for transcripts, never for a folder whose content is itself the secret: summaries of a raw-only page, and the facts extracted from it, are readable like any other derived page, so the facts pulled out of a fenced transcript are not fenced); `gbrain access member kind <id> audience` lets the owner read that member's own member page, versions, derived pages and facts; and `gbrain access members-read-lineage on` lets every member read the derived pages and facts of pages it reads, as the owner does. All three work the same on a repo-less brain and with rules in `access.yml`, only the operator on the brain host sets them, and no write widens.
+
+ ### Itemized changes
+
+ #### Access lineage designs (GBRA-108 designs 2, 3 and 4)
+
+ - Migration v305 (`src/core/schema-migrations/v305-access-lineage-designs.ts`): `access_rules.covers_derived` (default true), `access_members.kind` (`person` | `audience`, default `person`), the SQL function `gbrain_access_lineage_rules()`, and new versions of `gbrain_access_origin_restricted()`, `gbrain_access_origin_closed_for()` (10 arguments) and `gbrain_access_origin_hidden_for()` (9 arguments); the v304 signatures stay as wrappers. Nothing is rewritten, and every existing rule keeps its digest.
+ - Raw-only rules: `src/core/access/folder-rules.ts` (`covers_derived: false` in `access.yml`, the held widening `derived_released` and the narrowing `derived_covered`), `src/core/access/policy.ts` (stored, compared and previewed with `lineage` in `gbrain access apply`), `src/commands/access-rules.ts` (`rule add --raw-only`).
+ - Audience members: `src/core/access/members.ts` (`setMemberKind`, `member add --kind`, refused for remote callers with `permission_denied`), `src/core/search/private-visibility.ts` (the owner's read of an audience member page, its versions, derived pages and facts), `gbrain access member kind <id> person|audience`; `member list` marks audience members.
+ - Member lineage: config `access.members_read_lineage` (`src/core/access/lineage.ts`, `gbrain access members-read-lineage [on|off]`, refused for remote callers); `src/core/access/caller.ts` and `src/cli/as-preview.ts` give it to a member speaking for itself, never to an audience of several or an unbound credential (an unbound `granted_sources` token included), while a member-bound `granted_sources` token gets its member's lineage; `whoami` adds `members_read_lineage` while it is on.
+ - `src/cli/enforced-member.ts`: the enforced member CLI's output guard judges slugs under the record the read ran under, so with member lineage on it no longer withholds output naming a derived page the member reads.
+ - The semantic cache key (`src/core/search/mode.ts`) and the per-caller key (`src/core/access/member-facts.ts`) carry the member lineage and the owner's audience members.
+ - `gbrain access check` and `who-can-read` explain all three; doctor `access_raw_only_rules`, `access_audience_members` and `access_members_read_lineage` (`src/commands/doctor/checks/access-lineage.ts`).
+ - Docs: `docs/guides/access-designations.md` (raw-only rules, audience members, members read lineage), key-files entry.
+ - Tests: `test/access-raw-only-rules.test.ts`, `test/access-audience-members.test.ts`, `test/access-members-read-lineage.test.ts` (every read path for every caller, off and on, the held widening, remote refusals, cache keys and the write gate; PGLite and Postgres, rules in the database and in `access.yml`); shared fixture `test/helpers/access-lineage-fixture.ts`; migration, catalog and doctor goldens.
+
+ ## [0.60.688.0] - 2026-11-12
+
+ **Sync no longer wedges on a source with thousands of old file-drift holds, and `sync status` stops calling a source synced while new commits wait**
+
+ Since v0.60.677.0, every unknown-side `file_drift` hold written under the earlier drift screen is screened once more, and that screen reads each held path's earlier committed versions. It read them with one Git process per path and reported nothing while it ran. On a source with thousands of such holds, the pass stayed silent past the sync's 300-second no-progress check and was stopped (`drain_stalled`) before it stamped any hold, so every later pass repeated the same reads and the source never synced again.
+
+ - The re-screen now reads every held path's history through one `git cat-file --batch-check` per 2,000 paths, with no file bodies, and reports progress as each path's history arrives. A Git read that hangs still reports nothing, so the no-progress check still stops it. On a generated repository with 80,000 files and 3,000 commits, 10,000 holds took 6.2 s instead of 141 s, and 80,000 holds took 66 s instead of 17 minutes. The longest silence was 36 ms instead of the whole read.
+ - A pass stopped partway keeps the holds it re-screened, and the next pass reads only the rest.
+ - `gbrain sync status` reads `resumable` / `commits_waiting` when nothing else is pending (or only holds that need no person) but the checkout's HEAD is past the last synced commit, with a `next` that runs the sync. It used to read `synced` until the next sync happened to run. A hold that needs a person keeps its own reason, and a company-brain source, which syncs to its approved revision, never reads it.
+ - With `sync.on_commit` off, the notifier's fix now says so, instead of saying that no resident runs.
+
+ ## [0.60.687.0] - 2026-11-12
+
+ **An upgrade can no longer run the same schema step twice at once.** When two gbrain processes started on one brain together (a cron job and an agent, or two hosts after an upgrade), both could apply the same schema migration. On Postgres reached through a transaction-mode pooler such as PgBouncer or Supabase's pooler, the lock meant to keep them apart did not hold. The pooler hands each statement to whichever server connection is free, so the lock could be taken on one connection and left behind on another. The second process then ran the step too, which showed up as a failed migration (for example a duplicate key on `pg_proc` while a function was being created) or as a step applied twice, and a lock left behind could keep later upgrades waiting until they timed out. Every path that changes the schema now takes one lock that holds for the whole run, through a pooler or a direct connection, and on PGLite. There is nothing to do beyond upgrading.
+
+ ### Itemized changes
+
+ - The schema setup a gbrain process runs when it opens the brain (which `gbrain init` and `gbrain upgrade` go through) and `gbrain apply-migrations` take the same schema-migration lock, and each migration step checks that the lock is still held before it runs.
+ - On Postgres the lock is a transaction-scoped advisory lock held on one reserved server connection for the whole run, so a transaction-mode pooler cannot move it, and it is released when the run ends or the connection drops. A connection pool with only one connection keeps the previous session lock.
+ - While one process holds the lock, another waits for it and then finds the steps already applied. If the wait times out, the message names the process holding the lock and, when that process is a running migration, says to let it finish rather than terminate it.
+ - The idle-connection check that runs before a migration no longer counts the lock's own connection as a blocker.
+ - Tests: `test/e2e/schema-migration-lock-postgres.test.ts` (direct Postgres and PgBouncer), `test/e2e/schema-migration-lock-direct-pool-postgres.test.ts` and `test/schema-migration-lock-pglite.test.ts` start two runners at once and check that each step runs once and that no lock is left behind.
+ - For contributors: `bun run typecheck` raises its Node heap ceiling from 6,144 MB to 8,192 MB, because a cold tsc run now peaks at about 6.5 GB and one CI typecheck job aborted at the old ceiling.
+
+ ## [0.60.686.0] - 2026-11-12
+
+ **The brain host can now set who reads a page without lowering its trust.** `gbrain repair visibility --slug <page> --readers alice-example,group:team-a` (or `--slugs-file <file>` for a long list, `--readers none` to remove the field) sets a page's `readable_by` through the same label-only door: the page keeps its tier and provenance, no `lower_page` proposal is filed, and its file changes only on the `readable_by` line. Before, the only way was a `put_page`, which lowered the page to "written by an agent". Readers are checked first. An unknown or disabled member or an unknown group refuses with nothing written, and a list that leaves out the brain owner refuses unless `--allow-without-owner` is passed, because `readable_by` binds the owner too. A list of thousands holds no run-wide lock. On a managed brain each admission window of pages is admitted together (Postgres publishes them in groups of up to 8), the Git effect commits the ready files together (up to 100 per commit), and `--json` counts them by effect state in `details.git`. A managed page with no file outside a declared `storage.db_only` path is now held `canonical_file_missing` with nothing written (it was refused as a failed `source_changed`), for every `repair visibility` write.
+
+ **A visibility repair now closes a fenced fact instead of leaving a world copy beside it.** When `gbrain repair visibility --class facts` made a `## Facts` row private and the stored row was more trusted than the repair, the fence guard kept the original world row live and filed a contested private copy, so remote callers could still read the fact while the page and its file read as fixed. A write that only makes a fence row private now makes the stored row private in place, keeping its id and trust tier, and files no proposal. On a brain without managed persistence the repair makes the fenced row private itself, because that import does not re-project the fence. A write that makes a more trusted private row world is still held for the owner.
+
+ ### Itemized changes
+
+ #### Set who reads a page, label-only (GST-2476, #9184)
+
+ - `src/core/persistence/label-edit.ts`: the label edit also takes `readable_by`, written as a one-line list (`readable_by: [a, b]`); block lists and duplicate keys are declined. `LABEL_KEYS` is unchanged, so `gbrain trust backfill --label-lowerings` reads as before.
+ - `src/core/repair/readers.ts` (new), `src/core/repair/visibility.ts`, `src/commands/repair.ts`: `gbrain repair visibility (--slug <slug>... | --slugs-file <file>) --readers <ids|none> [--allow-without-owner]`, preview-bound (`--apply --expect <hash>`), up to 10,000 pages per run; reader validation (`access_member_invalid`, owner rule); `details.git` effect counts on apply; a managed run admits each window of pages together (`applyBatch`, `publishMaintenancePages` under the run's batch id); a managed page with no canonical file outside `storage.db_only` held `canonical_file_missing`.
+ - `src/core/repair/label-write.ts`: a readers run publishes its pages under one maintenance batch.
+ - Tests: `test/readers-label-setter.test.ts` (managed Git source with tracked files, a `storage.db_only` page and a page with no file; repo-less brain with remote reads by member, a 150-page slugs file, refusals and `preview_changed`).
+
+ #### A visibility repair closes a fenced fact (GST-2487, #9188)
+
+ - `src/core/trust/fence-guard.ts`: a guarded row whose claim the writer kept and whose visibility it only narrowed (world to private) moves to the new row's position and turns private in place, instead of being detached and contested.
+ - `src/core/repair/visibility.ts`: on a brain without managed persistence, a fenced fact row the label write made private in the fence is made private in the database too; `fact_left_readable` and `fact_left_world` stay for the rows that still cannot be closed.
+ - Tests: `test/label-only-repairs.test.ts` (managed and repo-less, PGLite and Postgres) and `test/trust-guarded-supersession.test.ts` (narrowing applies in place; widening stays guarded).
+
+ ## [0.60.685.0] - 2026-11-12
+
+ **`remember` now tells the truth about a fact saved for something that has no page yet, a source that lives in Git keeps that fact in Git, and the brain owner's own agents save facts shared by default.** Three changes to how agents save and withdraw facts land together.
+
+ A fact saved for an entity whose page does not exist yet (`remember` never creates a page) used to get a reply that named the missing page, so an agent would report the fact as saved to a file. The reply now says the fact is stored in the database only and names the `put_page` call that creates the page. On a source whose pages are canonical in Git (`canonical: git`), such a fact no longer lives in the database alone, where a rebuild from Git would lose it: it is committed to Git as a row of `memory/unattributed` that names the entity, and maintenance moves it into the entity's page once that page exists. Other sources and brains with no Git repository store it as before.
+
+ A credential bound to the brain owner (`gbrain access owner set`) reads the whole brain, but its `remember` kept every fact private on the owner's member page unless the call passed `share: true`, its `visibility: "world"` was refused, and its `forget` refused a fact it had just shared. Those private facts also stayed out of hot memory, turn context and context packs, which carry shared facts only. Now, speaking for itself, the owner's credential saves a fact with no `visibility` on its subject's page for every reader of the source, keeps it private on its member page when the call passes `visibility: "private"`, when the page or `facts.default_visibility` keeps facts private, or when it replaces a fact on that page, and withdraws a shared fact it reads. The trade-off: an owner agent that follows a planted instruction can now share a fact without passing a flag, so pass `visibility: "private"` for a fact that must stay with the owner. Member credentials, attested QM calls (`x-qm-actor`), audiences, subagent jobs and slug-fenced clients keep what they had.
+
+ The changes meet on a strict source. The owner's save for an entity with no page is held, shared, on `memory/unattributed` like any other shared save, the owner's `forget` strikes it there, and the brain host's purge removes it from the file.
+
+ Upgrade every gbrain host of a strict source together, because an older gbrain holds a `memory/unattributed` file that carries the new `entity` column as a malformed fence, with no data loss.
+
+ Reported by @andreineacsu (#9101). First fixed by @Masashi-Ono0611 in #9103.
+
+ ### Itemized changes
+
+ #### The reply for a fact on no page (GST-2446, #9165)
+
+ - The reply names a `page` only when the fact is on one. For an entity with no page it used to carry `page: "<the entity slug>"`, a page that does not exist; now the field is absent. A pending reply's `target.slug` follows the same rule, and so does a fact with no entity on a source that cannot hold the `memory/unattributed` page.
+ - Each `items` entry of a batch carries `persistence` and `write_through`, the same fields the single form returns. Before, a batch item gave no sign of whether it landed in a page file or in the database alone.
+ - When the source has a checkout, the reason no file was written is `write_through.skipped: "entity_page_missing"`, in the reply and in the write receipt. It used to read `no_repo_configured`, which is false for such a source. A source with no checkout still reads `no_repo_configured`.
+ - Where the brain's pages are in a Git repository, the reply adds one `entity_page_missing` notice per entity per session with the `put_page` call that creates the page. Once the page exists, the next maintenance cycle can move the facts saved for that entity into the page's Facts table and its file. A brain with no Git repository gets no notice, because there the database is the record.
+ - `gbrain remember` prints `note: the entity has no page, so this fact is stored in the database only`, and a batch line ends `(no page: database only)`.
+ - Docs: `docs/guides/entity-scoped-facts.md`, the `remember` section of `docs/mcp/TOOL_REFERENCE.md` and `docs/protocol/MEMORY_VERBS_v1.md` describe the reply. One behavior-change row discloses the reply change after an upgrade.
+ - Tests: `test/remember-pageless-entity-gst2446.test.ts` runs on PGLite and Postgres against a Git checkout, a content folder with no Git and a source with no checkout, single and batch, through the operation handler and through MCP dispatch. It also pins that the fact reaches the page's Facts table and its committed file once the page is created.
+
+ #### A strict source keeps a pageless fact in Git (GST-2492, #9179)
+
+ - The reply, each batch item and the write receipt say where the fact is: `page: "memory/unattributed"`, `persistence: {mode: "filesystem"}`, `write_through: {written: true, held_for: "<entity>"}`, and the `entity_page_missing` notice says the fact is saved and committed and when it moves.
+ - The `extract_facts` maintenance phase moves held facts into a new entity page in one commit. The fact keeps its id, provenance and embedding, and the held row is struck (`moved to <entity>`); when the page is restricted the held row is removed instead, so the world-readable holding page keeps nothing of it. A page kept out of Git does not take the fact; the run warns `HELD_FACT_UNMOVABLE` and the fact stays held.
+ - `forget` strikes a held fact's own row, and `purge_fact` removes it from `memory/unattributed` as it removes a fact with no entity, so a rebuild does not bring it back (a purge of a held fact also drops every copy of the same claim text on `memory/unattributed`, held for another entity or with no entity); `remember … replaces` supersedes a held fact from `memory/unattributed` or from the entity's page.
+ - A client bound to slug prefixes may save a held fact for an entity inside its prefixes; a fact with no entity is still refused for it. An entity under a folder access rule is never held on the world-readable page, so its fact stays in the database, as before.
+ - Only `memory/unattributed` reads the `entity` column, and an invalid entity cell makes its fence malformed. Every other page parses exactly as before. An older gbrain holds a `memory/unattributed` file that carries the column as a malformed fence, so upgrade every host of a strict source together.
+ - Tests: `test/remember-strict-held-gst2492.test.ts` on PGLite and Postgres: the commit before the reply (handler, batch, MCP), rebuilds from a clone of HEAD, the move (one commit, interrupted after its commit and replayed), restricted and database-only pages, forget, purge, both supersede paths, a prefix-bound client, duplicates and the fence column.
+
+ #### The owner's own facts are shared by default (GST-2346 D1, #9178)
+
+ - An explicit `visibility: "world"` onto a page whose facts are kept private is refused (`share_target_restricted`), as `share: true` is, and the reply still names the `page` and `visibility` the fact got. Works the same on a brain with no Git repository and on a managed one.
+ - `src/core/access/member-facts.ts`: `ownerSpeaksForItself` (`CallerAccess.owner`, no attested actor, no audience, not a subagent, no slug fence).
+ - `src/core/persistence/memory-mutations.ts`: `remember` takes the ordinary route for the owner and moves a default save the page or brain default keeps private to the owner's member page; `forget` takes the ordinary remote path for the owner when that path reads the fact. `src/core/verbs.ts`: no `member_share_required` for the owner.
+ - `src/core/facts/writeback-config.ts`, `src/core/ops/memory-settings.ts`, `src/mcp/http-transport.ts`, `src/commands/serve-http-mcp.ts`: with writeback on, the owner's credential gets the instructions of a credential bound to no member.
+ - Docs: access designations, the company-brain tutorial, `TOOL_REFERENCE.md`, `MEMORY_VERBS_v1.md`, the access key-files entry, `skills/brain-ops/SKILL.md`; behaviour-change row `owner_facts_shared_gst2346`.
+ - Tests: `test/owner-facts-d1-gst2346.test.ts` (every caller shape, repo-less and managed, PGLite and Postgres); `test/member-forget-refusal-9101.test.ts` now expects the owner to withdraw a fact it shared.
+
+ #### Where the changes meet
+
+ - `test/remember-strict-held-gst2492.test.ts` adds an owner-bound OAuth credential on a strict source, on PGLite and Postgres. Its save for an entity with no page is held, shared, on `memory/unattributed` with #9179's reply, its `forget` strikes the held row, `purge_fact` over MCP is refused `trusted_local_only`, and the host's purge removes the claim so a rebuild from Git does not bring it back.
+ - `docs/guides/memory-boundaries.md`: the purge section says a purge of a held fact drops every copy of the same claim text on `memory/unattributed`.
+
+ ## [0.60.684.0] - 2026-11-12
+
+ **An agent that runs gbrain for one member can now be held to that member's view of the brain.** Set `GBRAIN_ENFORCED_MEMBER=<member>` in the launcher that starts the agent's gbrain calls, and every command it runs reads exactly what a remote credential bound to that member would read: pages kept to other members, private pages, folders the member is outside of and other members' personal sources leave no slug, title, body, fact or count behind. Writes still land where they land today, as trusted local writes, but the mode refuses a write to a page the member cannot read and every change to a page's readers or visibility. `remember` saves a fact only with `--entity` naming a page the member reads, and its refusal says so with the exact retry command. `gbrain write-request <id>` reads the member's own receipts, and any other id answers exactly like an unknown one. sync, `sources refresh` and `git commit-push` keep working with their output replaced by one line (sync and refresh take only `--source <id>`, `--no-pull`, `--no-embed`, `--json` and `--dry-run`, on a source the member reads), `doctor` prints only check names, statuses and counts, and `hook` succeeds silently so group turns never fail. Every other command is refused with one exact line, exit 3 and the code `enforced_member_refused`, `--help` included, and so is everything when the value is empty, names an unknown member or names the owner. Unset, nothing changes. The mode binds only a caller whose launcher pins the variable; a process that can unset it, or read the brain's files or database directly, is outside it. Guide: [docs/guides/enforced-member.md](docs/guides/enforced-member.md).
+
+ ### Itemized changes
+
+ - `src/cli/enforced-member.ts`, `src/cli/enforced-member-classes.ts`, `src/cli/enforced-commit-push.ts`: the gate, the allow-list (every CLI command and operation classified once) and the read, write and commit-push checks; `src/cli/main.ts` calls the gate before any dispatch.
+ - `src/core/cli-force-exit.ts`: `setStdoutCapture`, so the mode also withholds what a command writes through the fd-1 chain (`--json` documents).
+ - `src/mcp/dispatch.ts`: `DispatchOpts.enforcedMember` forces hidden privacy and no owner access on a dispatched read.
+ - `src/commands/recall.ts`: recall reads through the member filter under the mode; `src/cli/cli-socket-client.ts`, `src/cli.ts`: the warm socket and the skill-resolver fast path are skipped under the mode.
+ - `src/core/error-registry.ts`: new code `enforced_member_refused` (regenerated `docs/guides/error-codes.md`).
+ - Known limits: a PGLite brain with a running `gbrain serve` refuses every enforced-mode read; a thin-client install refuses; creating a page at a slug the member cannot read refuses where a free slug would be created.
+ - Tests: `test/enforced-member.serial.test.ts` (CLI subprocesses on PGLite and Postgres, repo-less and git), `test/enforced-member-classes.test.ts`.
+
+ ## [0.60.683.0] - 2026-11-11
+
+ **Making a page private through an operator repair no longer lowers its trust or rewrites its file.** On a managed brain, an operator who added `visibility: private` to one page through a local `put_page`, or ran `gbrain repair visibility`, saw the page drop from "your notes" (operator_curated) to "written by an agent", a pending `lower_page` proposal only a typed token could settle, and a re-rendered file: a `slug` key removed, a `source_kind` value overwritten with `put_page`, keys reordered, and provenance stamps and a `trust_tier` marker added. Both repairs and `gbrain repair private-labels` now write through one label-only door. The page keeps its tier, no proposal is filed, and its file changes only on the label lines, with every other key, its order and the body kept byte for byte. A new slug-bound form, `gbrain repair visibility --slug <page>`, is the operator's single-page way to make a page private (preview first, then `--apply --expect <hash>`). A plain `put_page`, local or remote, is still an agent edit and lowers the page as before. `gbrain trust backfill --label-lowerings` lists every `lower_page` proposal as label-only or content, counted by proposer, so an operator can see which lowerings came from label-only writes; it changes nothing, and raising a page back stays a trust decision.
+
+ ### Itemized changes
+
+ - `src/core/persistence/label-edit.ts` (new): the `label_edit` intent (`set` and `remove` over `visibility`, `access`, `confidentiality`) and the line editor that applies it to a file's frontmatter, or declines a label line it cannot edit as one line.
+ - `src/core/persistence/page-prepare.ts`: a `managed_maintenance_page` write that carries `label_edit` publishes the canonical file's own bytes with only its label lines edited (`labelEditFile`), keeping its body when it reads as the write's body, and refuses instead of re-rendering when no line edit reads back as the write.
+ - `src/core/persistence/prepared-maintenance.ts`: maintenance page publications carry `labelEdit`.
+ - `src/core/repair/label-write.ts` (new): the label-only write door both repairs use (the maintenance door with `keep_trust` on a managed brain; the import under the page lock and `withTrustKeep` otherwise); `filesInCheckout` and `importAtRevision` moved here from `private-labels.ts`.
+ - `src/core/repair/visibility.ts`: page and fenced-fact items write through the label door instead of `put_page`; on a brain without managed persistence a page whose file sits in a checkout gets the same label-line edit in that file, imported with its tier kept, and a file it cannot write (`sync.write_through` off, a pulled clone, a write error) is held `file_backed` with nothing written; a segmented page is held (`segmented_page`); a page that changed after it was read is skipped (`revision_conflict`) instead of counted; new `--slug` selection (class `pages`), preview-bound, tighten-only; a fenced fact row it could not make private is reported `fact_left_readable` when remote callers can still read it, or `fact_left_world` when only its page's privacy hides it (`NOT CLOSED` in the text output for both), instead of a plain skip.
+ - `src/core/repair/private-labels.ts`: clears and restores carry their label edit, so the file loses or regains only those lines.
+ - `src/core/trust/label-lowerings.ts` (new), `src/cli/commands/trust.ts`: `gbrain trust backfill --label-lowerings [--source ID] [--json]`, read-only.
+ - Tests: `test/label-only-repairs.test.ts` (managed Git source and repo-less brain, PGLite and Postgres); `test/owner-member-boundary.test.ts` pins that the owner reads its private pages and pages that list it, and never another member's restricted page, on every read path.
+
+ ## [0.60.682.0] - 2026-11-11
+
+ **The brain owner reads the derived pages and facts of pages it can already read, and the operator can let the owner read pages kept to other members.** An atom, a synthesized concept, a Life Chronicle event, a page with `derived_from` or a fact made from a page under a folder rule, or from a page that names readers, was hidden from every remote caller, the owner included, even when the rule or the readers named the owner. Credentials bound to the owner now read them whenever they read every origin, with no setting. A new opt-in, `gbrain access owner reads-restricted on`, off by default and settable only by the operator on the brain host, lets the owner also read pages that readers lists, folder rules and page rules keep to other members, with their derived pages and facts, but never another member's own member page. Nothing changes for any other caller or for writes, and nothing changes on upgrade.
+
+ ### Itemized changes
+
+ #### Owner reads and the owner opt-in (GST-2490)
+
+ - Migration v304 (`src/core/schema-migrations/v304-access-owner-origin.ts`): `gbrain_access_origin_closed_for()` and `gbrain_access_origin_hidden_for()`, the lineage arms of `gbrain_access_origin_restricted()` asked per origin for one caller. Only owner reads call them; `gbrain_access_origin_restricted()` is unchanged. Nothing is rewritten.
+ - `src/core/search/private-visibility.ts`: `ownerAccessSql` for owner reads (read-only operations only: `remoteCallerAccess` in `src/core/access/caller.ts`, `src/mcp/dispatch.ts`, `src/core/minions/tools/brain-allowlist.ts`, and `--as <owner>` in `src/cli/as-preview.ts`), fact provenance and the readers checks for single rows; the search cache key and the hot-memory key carry the owner mode.
+ - `src/core/access/owner.ts`, `src/commands/access.ts`: `gbrain access owner reads-restricted on|off` (refused for remote callers), shown by `gbrain access owner`, `access check` (`owner_reads_restricted`) and `who-can-read`; `whoami` adds `owner_reads_restricted` for every remote caller while it is on; doctor `access_owner_reads_restricted` (`src/commands/doctor/checks/owner-reads-restricted.ts`).
+ - Unchanged on purpose: what every other caller reads, every write and publication check, member private facts, personal sources, shared-room audiences and attested calls.
+ - Docs: `docs/guides/access-designations.md` (derived pages, member access, the owner opt-in), key-files entry.
+ - Tests: `test/owner-reads-restricted.test.ts` (opt-in off and on, owner, other members and unbound keys, `--as`, writes, the remote refusal; PGLite and Postgres, rules in the database and in `access.yml`); doctor goldens.
+
+ ## [0.60.681.0] - 2026-11-11
+
+ **The low-capacity warning now says it is not a refusal, and a quota refusal no longer reads a whole week of admissions while it holds the write counters.** v0.60.686.0 made the `write_capacity_low` notice open with "This write was saved", but the notice also rides sync status, dry runs and failed batches, where nothing was saved. It now opens with "This notice is not a refusal: writes still work, and this call's own result says what it did", and over MCP its fix is the read-only `get_brain_health` call instead of a CLI command the agent would relay to its user. A `write_quota_exhausted`, `write_quota_insufficient` or background-pause refusal runs under the counter locks, and v0.60.686.0 had it walk the scope's whole week (up to 200,000 admissions) to match doctor's value. It now takes the 7-day mean rates the last forecast recorded, lifecycle changes included, and without a forecast from the last minute it samples the latest 1,000 admissions as before. Both apply only under a cap the operator set: since v0.60.686.0 the caps are off by default.
+
+ ### Itemized changes
+
+ - `src/core/persistence/capacity-snapshot.ts`: `write_capacity_low` opens with "This notice is not a refusal" and never claims the call saved anything; its fix carries `mcp` (`get_brain_health`), and its why says nothing needs to change for this call.
+ - `src/core/persistence/capacity-forecast.ts`, `src/core/persistence/limits.ts`: `readCapacityForecast` records each scope's 7-day mean gross and net rates for a minute (`recordForecastRates`, `FORECAST_RATES_TTL_MS`), and `oneYearCapacity` uses them, so the refusal names doctor's value, lifecycle changes included; without a recorded forecast it samples the latest 1,000 admissions and never walks the week. The sample's compacted size uses the forecast's SQL (`receipt-bytes.ts`).
+ - `src/core/behavior-change-notice.ts`: one row for the new wording and the refusal's rate source.
+ - Docs: `docs/guides/write-refusals.md` (`write_capacity_low` row), `docs/guides/concurrent-writes.md`, `docs/architecture/key-files/core-persistence-capacity.md`.
+ - Tests: `test/persistence-capacity-notices.test.ts` (the notice rendered over HTTP and stdio runs `get_brain_health`; a week of lifecycle changes moves the brain's value to doctor's; a refusal reads at most the latest 1,000 admissions, and none after a forecast; a refusal after a forecast names doctor's value, on PGLite and Postgres).
+
+ ## [0.60.680.0] - 2026-11-11
+
+ **gbrain now tells you when a privacy label it doesn't recognize leaves a page readable.** A page with no `visibility` counts as private only when `access` is private, restricted or confidential, or `confidentiality` is confidential, secret, private or restricted. Any other value, such as `access: personal` or a confidentiality value naming a health record, was ignored without a word, so the page read as world to every remote caller and could be committed to the brain's git remote. Writes and doctor now say so. Who can read a page does not change.
+
+ **You can now keep one page to some members, even when gbrain can't write the page.** A page at the root of a source (one named after a folder, say) could not be covered by a folder rule, and a page whose file was removed from git outside gbrain refused a `visibility: private` edit with `source_changed`, whose receipt only offered the ghost-page repair, which deletes the page. `gbrain access rule add --slug <page> --readers <list>` now restricts exactly that page without writing it, and the refusal names that route. Removing the rule is the undo.
+
+ ### Itemized changes
+
+ #### Ignored privacy labels: a write-time notice and a doctor check (GST-2462)
+
+ - `src/core/search/ignored-privacy-labels.ts`: one rule, in TypeScript and SQL, for a page whose `access` or `confidentiality` value gbrain ignores (no `visibility`, no recognized value, no other default-private rule), and the `privacy_label_ignored` safety notice. The notice names the key and the value, says remote callers read the page like an unlabelled one and, on a source with a git checkout, that the label does not keep it out of git (a repo-less source gets no git sentence), and its fix asks the user before adding `visibility: private`. It never quotes page content.
+ - `src/core/ops/pages.ts`: `put_page` carries the notice for the page it stored. `src/commands/import.ts`, `src/cli/commands/import.ts` and `src/commands/sync/` (`perform.ts`, `full.ts`, `plain-directory.ts`, `run.ts`): `gbrain import` and `gbrain sync` carry one notice per run that counts pages by value and names no page (`--json` under `notices`, otherwise on stderr); a managed sync reads the source's pages updated during the run.
+ - `src/commands/doctor/checks/privacy-label-ignored.ts`, `src/commands/doctor/wave-checks.ts`: doctor `privacy_label_ignored` counts such pages by key and value. A value containing private, confidential, secret, restricted, personal, health or therapy warns, any other value is information, and the fix is the read-only `gbrain list --where <key>=<value> --json`. Bounded for large brains. The frontmatter GIN index serves the scan, which stops after 100,000 labelled pages, returns at most 50 values and runs under a 15 s statement timeout (an overrun reports the health as unknown).
+ - Unchanged on purpose: the recognized values, `visibility.honor_aliases`, and every read and git placement decision. No repair rewrites labels.
+ - Docs: `docs/guides/access-designations.md` (unrecognized label values), `docs/guides/troubleshooting.md`, `skills/conventions/page-privacy.md`, key-files entries.
+ - Tests: `test/privacy-label-ignored.test.ts` (put_page, import, sync and a managed git source, doctor, and a pin that reads stay the same; PGLite and Postgres), `test/ignored-privacy-labels.test.ts` (the TypeScript and SQL rules agree on both engines).
+
+ #### Page rules: restrict one exact page (GST-2462)
+
+ - `src/core/access/folder-rules.ts`: a rule can name one page with `slug:` instead of `prefix:` (`gbrain access rule add --slug <page>`, `src/commands/access-rules.ts`). It is stored in the same rulebook without the trailing `/` and covers only that slug, never a folder of the same name or a longer slug. A `prefix:` without `/` is still refused and now names the slug form.
+ - Migration v303 (provisional number, `access_page_rules`): both prefix checks accept the page form, and `gbrain_access_folder_rules` / `gbrain_access_pending_covers` match a slash-less prefix only when it equals the slug; `src/core/search/private-visibility.ts` and the rule preview use the same matcher. Folder prefixes match exactly as before, so no page is restamped on upgrade. Upgrade every gbrain host that shares the brain before adding a page rule. Reads are decided in the database, so an older host still keeps the page restricted, but it refuses its own `gbrain access rule` commands and, on a git-backed source, stops syncing that source with `stored rulebook holds a malformed rule` until it is upgraded.
+ - `src/core/persistence/service.ts`, `terminal-classify.ts`, `verb-errors.ts`, `page-prepare.ts`: a write refused because the page's canonical file is missing names the page rule as the way to narrow who reads the page, beside the ghost-page repair.
+ - Docs: `docs/guides/access-designations.md`, `docs/tutorials/company-brain.md`, `docs/guides/write-refusals.md#canonical_file_missing`.
+ - Tests: `test/access-page-rule-fileless.test.ts` (a root page named after its folder and a page whose file left git on a managed git source, and a repo-less brain, on PGLite and Postgres: put refuses and names the route, the rule hides each page from unbound callers while the owner reads it, nothing else is covered, no page file is written, and removing the rule restores the reads after approval).
+
+ ## [0.60.679.0] - 2026-11-11
+
+ **Doctor, dream, enrich and `maintain --safe` fixes, landed together.** `gbrain maintain --safe` no longer deletes pages or calls a paid provider, several doctor checks now report what they find accurately, dream phases stop and report correctly, and enrich, model-call errors, atom provenance, transcript dates and the stale link sweep get community-reported fixes. Each fix has a test that fails without it.
+
+ **The `unindexed_files` maintenance phase no longer reports a complete scan when a source could not be scanned.** A source whose Git checkout failed to read was counted as an error and the phase warned, but its `details.complete` still said `true`, so anything reading the phase result took the run as a full scan of every managed source. `complete` is now `true` only when no source stopped at its time budget and none errored. Reported by @Masashi-Ono0611 (#8887).
+
+ **A source with automatic sync off now walks forward through its pages on a database whose DateStyle is not ISO.** The per-source maintenance window saved its cursor in the session's date style. Under a day-first style such as `German, DMY` or `SQL, DMY`, a cursor dated after the 12th of a month was not a date the cycle handler could read, so it dropped the cursor and the next cycle started again from the source's oldest pages; a source over 2,000 pages never got past its first window. The cursor is now always written as a UTC ISO timestamp with microseconds. A source holding a cursor in the old form may start from its oldest pages one last time; from then on it advances. Reported by @javieraldape (#8771).
+
+ **`gbrain dream --drain` stops as no progress when its batches only skip items the backlog keeps counting.** The drain checked for no progress only after a batch that extracted nothing and skipped nothing. A page the phase skips on every batch while the backlog still counts it kept that check from ever running, so the drain ran all 1,000 batches, held the cycle lock for minutes and ended `max_batches` with exit 11, which tells the caller to rerun a stop a rerun cannot clear. A batch that extracts nothing now always rechecks the backlog, and when it did not shrink, the drain stops `no_progress` (`atom_drain_no_progress`, exit 1), and skips that do shrink it keep draining. Reported by @h6y3 (#8445).
+
+ **`gbrain dream --help --json` prints its help as one JSON document.** Under `--json`, stdout carries only a JSON document, and dream printed its help as plain text, which went to stderr. So stdout was empty, the run exited 0 and logged a missing-document event that `gbrain doctor` counts under its agent-contract check. It now prints `{"command": "dream", "help": "<the help text>", "contract_version": 1}`, and `dream retriage --help --json` and `dream reset-key --help --json` do the same. `gbrain dream --help` without `--json` prints exactly the same text as before. Reported by @Kkkkkuro (#8510).
+
+ **Concept synthesis stops when its maintenance job times out or is cancelled.** The `synthesize_concepts` dream phase never looked at the cycle's abort signal, so with a slow model it kept calling the model and publishing concept pages after its job had timed out, and an aborted model call could be written as a template fallback page. The phase now passes the signal to the model call and checks it before each concept and again right before each page is written, so nothing is published once the job is cancelled. The spend of the model calls that finished and the failed-attempt counts are still saved, so the recorded spend and the retry limit keep counting them. On a managed brain, concepts synthesized but not yet published when the job stops are synthesized again on the next run. No setting changed. Reported by @Nazim22 (#7986).
+
+ **Doctor checks that misreported their findings now report them accurately.** A community bug wave: each fix below was reported by a contributor, reproduced on master with a failing test first, and rewritten here.
+
+ **`gbrain maintain --safe` no longer deletes pages or calls a paid provider.** It used to run the whole dream cycle on the default source, so pages soft-deleted more than 72 hours earlier were purged for good, and the embedding, synthesis and other model phases ran too. The source cycle now runs only free phases that never purge: lint, backlinks, sync, the fence and content repair lanes, unindexed files, extract, extract_facts, symbol edges, emotional weight, consolidate, orphans and schema suggestions. It also holds back `extract_facts` when an embedding provider is set up or the decide conflict slot is on (its conflict sweep calls the decision provider), and the fence and content repair lanes when an embedding provider is set up (their publications embed) or `fences.repair.llm` has a repair model. The JSON report lists the phases that ran and the ones held back. Old soft-deleted pages are still purged by `gbrain pages purge-deleted` (preview it with `--dry-run`), `gbrain dream` and an installed autopilot, and the paid phases still run from `gbrain dream`.
+
+ **Enrich write-ups from thinking models are no longer cut off.** Enrich capped every write-up at 2048 output tokens, which thinking-by-default models such as Claude 5 spend on reasoning, so write-ups came back truncated or failed. Thinking models now get the gateway's thinking headroom; other models keep 2048.
+
+ **An OpenAI account with no credits left is reported as a billing problem instead of being retried.** OpenAI answers with HTTP 429 when an organisation has no credits, and gbrain read that as a rate limit and retried. A provider body whose error type or code is a billing code now decides billing wherever the error is wrapped.
+
+ **Atom quotes keep their provenance when the model drops Markdown or punctuation, and a failed fence step no longer books a healthy facts round.** Quote matching skips line-leading `#` and `>` markers, quotation marks and a spaced dash, never words or number signs; ambiguous or reworded quotes still fail closed. A fence write that fails with an I/O or database error now counts as failed and stops the `facts.fence` round, so doctor's `extract_health` warns.
+
+ **A write-up that has its own dated timeline section round-trips.** A page with no timeline whose body had a `## Timeline highlights` section re-parsed that section as the page timeline, so enrich refused its own paid write-up with `CONCEPT_REPUBLICATION_LOSSY`.
+
+ **Transcripts without a date in the filename take the date in their frontmatter, and the atoms extracted from a transcript take the transcript's date.** Both used to fall back to the date of the run.
+
+ **The admin dashboard's live feed keeps reconnecting after a dropped connection,** and four smaller fixes land with it: the load throttle still applies its concurrency and memory limits when the machine reports no load data (Windows), a `remember` TTL past the representable date range is refused as `invalid_params` instead of throwing, a worker pool whose error callback throws now stops every worker before rejecting, and claude-cli tool loops read the previous turn's prompt cache instead of rewriting the whole transcript to it.
+
+ **The stale link sweep no longer re-extracts one page forever when a bare-name frontmatter link matches a top-level page.** A person page with `founded: ["acme-toolkit"]` resolves that name under `companies/`, so a top-level page named `acme-toolkit` does not satisfy it and the link stays wanted. The wanted-link row was still stamped as if its target existed, which marks its page stale on every pass, so the sweep queued the same page again and again (thousands of extract jobs an hour) and starved lower-priority jobs. Only a slug reference to an existing page is stamped that way now, and a row an earlier release stamped settles the next time its page is extracted, which the sweep does on its own. Editing the top-level page still re-checks the link once. One narrow case is left for a follow-up release. If the top-level page is created for the first time while that link is being extracted, the link can stay missing until either page is written again. Reported by @akinduroifedayo (#9140) and first fixed by @Masashi-Ono0611 (#9144); @akinduroifedayo's own fix (#9149) also found that narrow case.
+
+ ### Itemized changes
+
+ - `src/core/cycle/unindexed-files.ts`: `details.complete` also requires `errors.length === 0`. Test: `test/unindexed-files.test.ts` (a source whose `.git/HEAD` is unreadable: phase `warn`, one error, `complete: false`).
+ - `src/core/cycle/source-window.ts`: the listing instant and the last page's `updated_at` are formatted with `to_char(... AT TIME ZONE 'UTC', 'YYYY-MM-DD"T"HH24:MI:SS.US"Z"')`. Test: `test/sync-disabled-cycle-window.test.ts` (the real queued handler under `German, DMY` advances window by window; `German`, `SQL` and `Postgres` styles under a +05:45 time zone give ISO UTC cursors with microseconds and the same windows), now also run on Postgres by `test/e2e/sync-disabled-cycle-window-postgres.test.ts`.
+ - `src/core/cycle/extract-atoms-drain.ts`: the no-progress recount runs after every batch with `extracted === 0`, not only when `skipped` is also 0. Test: `test/extract-atoms-drain.test.ts` (a skip-only batch over a flat backlog stops `no_progress` after one batch; skip-only batches that shrink the backlog drain).
+ - `src/cli/help/render.ts`: new `printHelpText(command, text, args)`, the `--help --json` document for a handler that prints its own help text; `src/commands/dream.ts`, `dream-retriage.ts` and `dream-reset-key.ts` print their help through it. Test: `test/dream-help-json-8510.test.ts` (the real CLI: one document per help, no `json_document_missing` event, plain `--help` stdout equal to the document text).
+ - `src/core/cycle/synthesize-concepts.ts`, `src/core/cycle.ts`: `signal` option, passed from the cycle like extract_atoms', handed to the narrative `chat` call and checked before each concept, right before each publication and before the final managed flush; an abort saves the retry counters and the finished spend to the rollup, then throws `AbortError`. Test: `test/cycle/synthesize-concepts-abort-7986.test.ts` (`runCycle` under the creator pack: a job aborted during the second model call publishes only the first concept and makes no third call; an aborted call is not published; an abort during the page read before the first publication publishes nothing; an aborted run still writes its spend and failed attempts).
+ - `timeline_history`: on a brain with more than 10,000 pages carrying database-only timeline rows, a pass keeps only the first 10,000 for its final recount. It used to report that recount as exact, and a pass whose kept pages had been repaired was recorded as clean while the rest still held database-only rows. Such a pass now reports its counts as a lower bound ("at least"), keeps warning, and is never trusted as clean. A pass saved by an earlier release, which did not record whether it dropped pages, is treated the same way when its kept list is full. Reported by @Masashi-Ono0611 (#8511).
+ - `conversation_format_coverage`: the sample now includes pages stored under the granular conversation types the extractor already reads (`slack-thread`, `slack-dm-day`, `email-digest`), so unparseable transcripts on a brain that never ran the type-consolidation pack are reported instead of silently skipped. Reported by @Masashi-Ono0611 (#8519).
+ - `minions_migration` under `gbrain doctor --fast`: a migration the brain's config can decline (v0.53.0, `shared_skills.migration.enabled`) is no longer listed as not run. Without a database connection the check cannot read that setting, and `gbrain apply-migrations --yes` skips a declined migration, so the warning could never clear. The full `gbrain doctor` still reports it when it is not declined. Reported by @Masashi-Ono0611 (#8721).
+ - `stale_mentions`: each stale example now carries its own `gbrain unlink` command with the link type the row is stored under, shell-quoted so a slug or link type with quotes or `$(...)` pastes as plain words, with the options first and `--` before the two slugs, so a slug that starts with `--` is never read as a flag. The hint used to say `--link-type mentions` for every row, which removes nothing for a typed link stored under a verb such as `founded`. Reported by @Masashi-Ono0611 (#8817).
+ - `schema_pack_consistency`: pages gbrain itself wrote (extract receipts under `extracts/`, and pages from the code importer) no longer count as undeclared on a custom schema pack copied before the base pack declared their types. The exemption follows how the page was written, not its type name. A page of yours that uses one of those types, such as a Markdown note with `type: code`, still warns, as do your own undeclared types. Reported by @Masashi-Ono0611 (#8818).
+ - `embedding_state` and `gbrain embed --stale`: a page whose body holds only a protected takes fence (which never reaches search chunks) is now counted `empty` instead of `chunkless_healable`. Doctor no longer warns about it, and `embed --stale` no longer plans a heal that can never produce a chunk. A page is treated this way only when the writer already chunked its current revision to nothing; a chunkless page that was never chunked, a page whose chunks were deleted after it was chunked, or an `embed_skip` page an older release stored without chunks, is still healed. Deleting a page's chunks clears that seal, in `deleteChunks`, an empty chunk replacement and `purge_fact`'s chunk delete (which also empties pages whose body held no purged row), so such a page stays healable. Reported by @akinduroifedayo (#8502).
+ - `managed_sync_backlog`: removing a source in the middle of a managed sync now removes its sync cursor too, whether the brain is managed or not. The cursor used to stay behind, and doctor warned about a stalled backlog forever with a resume command that failed `unknown_source`. A cursor an earlier removal already left behind is no longer reported, including after the source is added back under the same id. Reported by @omni-nordaware (#8741).
+ - `src/commands/maintain.ts`: `MAINTAIN_SAFE_PHASES` is the allowlist of free, non-purging phases; `maintainSafePhases` intersects it with the source's own phase list and holds back provider-gated phases (`extract_facts` on an embedding provider or an enabled decide conflict slot, `fence_repair` and `content_repair` on an embedding provider or a resolved repair model); the dry-run and applied actions report `phases` and `held_phases`; the help text names `gbrain pages purge-deleted` and `gbrain dream`.
+ - `src/core/behavior-change-notice.ts`: one row for the changed `maintain --safe` behavior.
+ - `scripts/module-size-limits.tsv`: the notice file's ceiling grows by one for that row.
+ - Docs: the `maintain.ts` row in `docs/architecture/key-files/commands-4.md`.
+ - Tests: `test/maintain.test.ts`: the allowlist holds no purge or paid phase; each provider holds its phase; a non-default source keeps its subset; on PGLite a page soft-deleted 100 hours ago survives `--safe` and no unsafe phase runs; a keyless brain with the decide conflict slot on holds `extract_facts`.
+ - `src/commands/enrich.ts` (`defaultSynthesize`): thinking models get the gateway's thinking output headroom; other models keep the 2048-token cap. A thinking-model write-up can reserve up to 32000 output tokens against `--max-usd` per in-flight call. Test: `test/enrich/thinking-cap-7564.test.ts`. Reported by @mattverlaque (#7564).
+ - `serializeMarkdown`, `edit_page`'s view and the timeline file splice: a body with no timeline sentinel whose own dated section would split under the bare-section fallback ends with an empty `<!-- timeline -->`; every other body keeps its bytes. Test: `test/markdown-own-timeline-section-7738.test.ts`. Reported by @mattverlaque (#7738).
+ - `src/core/ai/errors.ts`: "no credits remaining" is a billing phrase, and a billing `error.type`/`error.code` decides billing through every wrapper layer. Test: `test/ai/classify-billing-credits-8400.test.ts`. Reported by @Masashi-Ono0611 (#8699, #8400).
+ - `src/core/ai/providers/claude-cli-language-model.ts`: one content block per message over `--input-format stream-json` (rendered text unchanged, lone surrogates still become U+FFFD), so each turn reads the previous turn's cache. The subscription-only env scrub is unchanged. Test: `test/claude-cli-prompt-cache-7352.test.ts`. Reported by @spiky02plateau (#7352).
+ - `src/core/cycle/extract-atoms.ts` (`locateQuote`): folds with the shared grounding core's markup option. Test: `test/cycle/extract-atoms-quote-markup-8373.test.ts`. Reported by @Masashi-Ono0611 (#8373).
+ - Legacy fence step of `extract_facts`: an untyped fence write error counts in `pagesFailed` and halts the round with `item_error`; typed refusals, a busy source lock, segmented pages and files on another host stay holds. Test: `test/extract-facts-fence-failure-health-8758.test.ts` (PGLite and Postgres, managed and unmanaged). Reported by @javieraldape (#8758).
+ - Transcript discovery and `--input`: an undated basename falls back to the frontmatter `date`; impossible calendar days are rejected and the date window filters on the resolved date. Test: `test/transcript-discovery-frontmatter-date.test.ts`. Reported by @spiky02plateau (#7267).
+ - `src/core/cycle/atom-source-date.ts`: new `transcriptAtomSourceDate` (frontmatter date, else the path date that names the `atoms/<date>/` folder); an undated transcript still gets none. Test: `test/extract-atoms-source-date.test.ts`. Reported by @spiky02plateau (#7268).
+ - Admin dashboard: the EventSource `onerror` only sets the status from `readyState` and no longer closes the stream; `admin/dist` and `src/admin-embedded.ts` are rebuilt. Test: `test/admin-dashboard-stream-reconnect.test.ts`. Reported by @ramybarsoum (#8913).
+ - Load throttle (`shouldProceed`), `remember` TTL parsing and the worker pool: see the paragraph above. Tests: `test/backoff.test.ts`, `test/writeback-config.test.ts`, `test/worker-pool.test.ts`. Reported by @ramybarsoum (#8913).
+ - `src/core/wanted-links-store.ts` (`replaceWantedLinks`): `checked_at` is `-infinity` only for a `slug` row whose exact page exists; a `name` row gets `now()`, and the existing `ON CONFLICT` update re-stamps old rows on their origin's next extraction. Test: `test/wanted-links.test.ts` and `test/e2e/wanted-links-postgres.test.ts` (`topLevelSlugNameReferenceSettles`: the origin is not stale after one sweep, and a row forced to `-infinity` settles after one more; `topLevelSlugNamePageEditWakesOnce`: an edit of the top-level page lists the origin stale once and one sweep settles it). Reported by @akinduroifedayo (#9140); first fixed by @Masashi-Ono0611 (#9144) and also by @akinduroifedayo (#9149).
+
+ ## [0.60.678.0] - 2026-11-11
+
+ **Pushes from an unmanaged checkout now scan every commit they publish for secrets, not only the files they just wrote.** Four gbrain pushes from a checkout that is not a managed worktree carried earlier local commits to the remote unscanned: the access-policy commit, the durability-scaffolding commit, `gbrain sources push` (which scanned only its own staged files, then pushed the whole branch tip, even with nothing new to commit) and the first push of `gbrain bootstrap repo` after the remote branch was gone (which scanned only the current tree). A credential a script committed with plain `git commit`, including one a later commit removed or one in a commit message, went out with them. Each now runs the range scan managed publishes use over what the remote lacks (the whole history when the remote has no such branch) and refuses `publish_secret_found` or `publish_scan_unreadable`, with nothing pushed and the local commits kept. `gbrain sources push` pushes the exact commit it scanned, leased on the remote tip it read, so a remote rewound in between is scanned again. An allowlist edit that `gbrain sources push` or `gbrain bootstrap repo` commits itself, after scanning it, still publishes; one a script committed is left to the user. Remoteless checkouts, managed worktrees and repo-less brains are unchanged, and the policy command's retry hint keeps `--scan-secrets`.
+
+ Reported and first fixed by @javieraldape (#9159).
+
+ ### Itemized changes
+
+ - `src/core/access/policy-git.ts`, `src/core/brain-repo-durability.ts`: the policy and scaffolding commits publish with `scanSecrets`; a scaffolding refusal names its code in the harden step.
+ - `src/core/workspace-push.ts`: before the push, `stagedScanPublishRefusal` over `origin/<branch>..HEAD`, then `git push --force-with-lease=refs/heads/<branch>:<scanned tip> origin <sha>:refs/heads/<branch>`; a local branch that does not contain the remote tip is not pushed.
+ - `src/core/bootstrap/repo.ts`: both first pushes scan the branch they push, with its whole history, and refuse if it moved during the scan (`scanHistory` option, a seam for runner fakes); `src/commands/bootstrap.ts` prints a refusal's code and next step.
+ - `src/core/git/commit-push.ts`: a scanned publish whose remote has no such branch yet (no tracking ref) scans the whole history and leases the push on the branch being absent, where it used to refuse `publish_scan_unreadable`.
+ - `src/core/git/range-secret-scan.ts`: `stagedScanPublishRefusal`, the range refusal with gate changes in `workspace_push` and `bootstrap` ledger commits exempt, and files over the range scan's cap exempt in `workspace_push` commits (its staged scan streams them up to 512 MiB).
+ - Tests: `test/unmanaged-push-history-scan-8902.serial.test.ts` (each path against a local bare remote: a removed credential, a credential in a commit message, clean history, a remoteless policy commit, allowlist edits, a rewound remote).
+
+ ## [0.60.677.0] - 2026-11-11
+
+ **You can now leave one source out of automatic publishing without turning off its sync.** Set `gbrain config set sources.auto_reconcile.source.<id> false`, and neither `gbrain sources git-reconcile` (which autopilot runs each tick) nor `gbrain sources refresh` pushes that checkout's local commits. The source still syncs and fast-forwards. Before this, the only per-source switch was `gbrain sources set-sync <id> off`, which also stopped its sync. Nothing changes until the key is set.
+
+ - `src/core/persistence/worktree-refresh.ts`: `publishOptedOut` reads the key for a worktree's members. A diverged refresh with any member off refuses `refresh_diverged`, naming the key, with nothing pushed.
+ - `src/commands/sources-git-reconcile.ts`: a checkout with a source off reports `unpublished` with the reason and lists the sources under `publish_off`, in `--dry-run` too. A checkout only behind still fast-forwards.
+ - `src/commands/sources.ts`: `gbrain sources status` prints the opt-out and adds `auto_reconcile: false` to `--json`.
+ - `src/core/bounded-child-exec.ts`: with `killTree`, a child stopped at its time limit has its descendants stopped with it. The commit-push children of git-reconcile and refresh use it, so a timed-out publish leaves no git or ssh process running into the next reconcile.
+ - `src/core/config.ts`: the key is registered, so `gbrain config set` accepts it.
+ - Docs: `docs/guides/live-sync.md`, `docs/guides/shared-checkout-git.md`.
+ - Tests: `test/reconcile-publish-opt-out-gst2250.test.ts` (PGLite and Postgres): an opted-out source stays unpublished, syncs and fast-forwards while another source publishes; a managed member opted out blocks refresh's publish and sync still imports; the global key, `set-sync off` and a key set to `true` behave as before; a hung child's grandchild is gone after the timeout.
+
+ ## [0.60.676.0] - 2026-11-11
+
+ **Persistence, sync and job fixes, most from community bug reports and each reproduced on master: sync timeouts stop cleanly, held and deleted files release, Postgres pools and deadline reads stop leaking or hanging, derived effects stop reporting false recoveries, and fix commands print what a retry needs.** `gbrain sync --timeout N` now stops as a partial run with exit 0 instead of being killed by its own watchdog, a held deleted file whose page was soft-deleted no longer stays `needs_human`, and `gbrain git commit-push` publishes a staged deletion under a wildcard-ignored folder. A Postgres pool that finishes opening after a reconnect is closed instead of leaking, a managed-sync preparation read gives up at its deadline instead of waiting on a saturated pool, and the sync cost check no longer scans every chunk when nothing has drifted. A `links` or `facts-backstop` effect that meets another write's publication in flight waits as `writer_busy` and retries within a second, instead of reporting `recovery_required` and waiting 30 s. A refused edit's fix command now prints the revision the retry needs, keyless init suggests an import that runs, cancelling a finished job changes nothing, and particle-1 on OpenRouter stops truncating. gbrain's own receipt bookkeeping no longer caps writes by default (the cumulative id and receipt-byte caps become opt-in, and housekeeping keeps receipt storage in check), `gbrain repair file-drift` no longer offers to copy an untracked or gitignored file into an origin-twin page, and a `revision_backfill_pending` refusal names `gbrain apply-migrations --force-schema`, the command that resumes the backfill.
+
+ ### Itemized changes
+
+ #### Sync timeout partials, deletion holds, ignored-dir deletions, git effect parking, snapshot generations (#8976)
+
+ - `src/core/sync-reconcile.ts`, `src/commands/sync-delegate.ts`, `src/commands/sync/plain-directory.ts`: the `--timeout N` hard-deadline backstop arms one grace window after N, so the in-band stop always lands first; a delegated job keeps its own bound at N; a plain-directory source stopped by the timeout reports `Sync PARTIAL` (`reason=timeout`) with exit 0 instead of `internal_error: import aborted`. Reported and first fixed by @zkiihne (supersedes #7819).
+ - `src/core/persistence/sync-pass.ts`: a `concurrent_write` hold whose file is gone joins the deletion candidates, so the existing no-live-page check (by id and slug) releases it; a hold whose page is still live stays held. Reported and first fixed by @Masashi-Ono0611 (#8751, supersedes #8753).
+ - `src/core/git/commit-push.ts`: named paths that cover index entries stage with `add -u`, visible untracked paths with `add -A`, and a path already staged as deleted counts as staged; only the named paths are committed, a mistyped or ignored-only path still refuses, and a refusal restores the index. Reported and first fixed by @Masashi-Ono0611 (#7984, supersedes #7987).
+ - `src/core/persistence/effects.ts`: a grouped Git completion failure is recorded against its effect's target, so per-target failures accumulate to the parking threshold instead of resetting to 1. Reported and first fixed by @Masashi-Ono0611 (#8606, supersedes #8631).
+ - `src/core/page-body/ingest.ts`, `src/core/persistence/segmented-apply.ts`: `materializedSnapshot` reads the snapshot's own body generation; when that generation's rows are gone it refuses `page_body_rows_unreadable` instead of returning a newer body. Reported and first fixed by @javieraldape (#8492, supersedes #8501).
+ - `src/core/persistence/types.ts`, `src/core/persistence/verb-errors.ts`: `page_body_rows_unreadable` is a write error code with its own non-retryable diagnostic instead of `storage_error`. Reported and first fixed by @babyspectrum (#8522, supersedes #8551).
+ - Docs: `docs/guides/shared-checkout-git.md`, `docs/guides/write-refusals.md`, key-files entries.
+ - Tests: `test/sync-timeout-watchdog-order.test.ts`, `test/sync-concurrent-write-deleted-hold-8751.test.ts` (PGLite and Postgres), `test/commit-push-ignored-deletion-7984.test.ts`, `test/persistence-effect-git-group-failure-8606.test.ts`, `test/large-pages/snapshot-body-generation-8492.test.ts`, `test/memory-write-rows-unreadable-8522.test.ts`; pinned deadline expectations in `test/sync-hard-deadline.test.ts` and `test/sync-timeout-cli-dispatch.test.ts` move by the grace window.
+
+ #### Late pool leak, preparation deadlines, type cache churn, stale-chunk scan, adoption recovery, timeline batches, export and init retries (#8980)
+
+ - `src/core/connection-manager.ts`: `disconnect()` and `retire()` bump an epoch; a direct or session-fallback pool that finishes initializing after either is ended (bounded) and its waiters get `CONNECTION_ENDED`, and a late failure starts no retry. Reported and first fixed by @javieraldape (#8478, supersedes #8569).
+ - `src/core/postgres-engine/bounded-statement.ts`, `src/core/read-deadline.ts`, `src/core/persistence/bounded-reads.ts`: a deadline read refuses once expired, reserves with an abort signal at the deadline, and discards a connection whose COMMIT is still pending; the refusal surfaces as `preparation_deadline`. Reported and first fixed by @javieraldape (#8651, supersedes #8698).
+ - `src/core/pg-type-cache.ts`: re-describing a statement with the same parameter types no longer marks the cache dirty. Reported and first fixed by @Masashi-Ono0611 (#8647, supersedes #8657).
+ - `src/core/engine-sql/chunks.ts`: with a signature, `sumStaleChunkChars` sums disjoint unembedded and drifted arms through UNION ALL, so the partial stale index serves the common case (measured 100 ms to 12 ms on a 200k-chunk fixture with no drift); totals are unchanged. Reported and first fixed by @Masashi-Ono0611 (#8811, supersedes #8813).
+ - `src/core/persistence/coordinator.ts`, `src/core/persistence/local-edit-adoption.ts`: adoption recovery gathers its landed-commit proof before the recovery transaction and rechecks HEAD and the request's pin under the row lock, staying `recovery_required` on any change. Reported and first fixed by @javieraldape (#8869, supersedes #8914).
+ - `src/commands/extract.ts`: sync's inline timeline extraction writes each page's rows through one batch projection (same trust gate and dedup), falls back to row-by-row only when the batch fails, and counts rows actually inserted. A missing or soft-deleted page still fails its slug with `PageMissingError`, checked under a page lock inside the batch transaction. Reported and first fixed by @troyhoffman-oss (supersedes #6805).
+ - `src/core/shared-skills/migration-export.ts`: an exported or inventory-stage checkpoint with no bound source and no started topology claim can move to a new root, restarting at inventory with a fresh request; a bound or claimed checkpoint still refuses. A root refused for sitting inside a Git worktree is now checked before anything is staged, so no copy of the export is left in the repository; an earlier staging directory is removed only when it holds exactly the export's own files, and an earlier filled root is listed in the receipt (`earlier_roots`) and the printed next steps. Reported and first fixed by @Masashi-Ono0611 (#8528, supersedes #8628).
+ - `src/core/shared-skills/setup.ts`: `installPackagedSharedSkills` resumes the caller's open or committed default-pack publication in the same source incarnation instead of submitting a second one. Reported and first fixed by @javieraldape (#8453, supersedes #8493).
+ - Docs: key-files entries. `scripts/structural-suites.tsv` regenerated.
+ - Tests: `test/connection-manager.serial.test.ts`, `test/e2e/engine-open-postgres.test.ts`, `test/postgres-deadline-read.test.ts`, `test/e2e/persistence-preparation-pool-wait-postgres.test.ts`, `test/pg-type-cache.test.ts`, `test/sum-stale-chunk-chars-8811.test.ts` (PGLite and Postgres), `test/adopt-local-edit.test.ts`, `test/extract-timeline-for-slugs-batch.test.ts`, `test/shared-skills-export.serial.test.ts`, `test/shared-skills-packaged-key-7734.test.ts`.
+
+ #### Derived effects wait as `writer_busy` behind a publication in flight (#8754)
+
+ - `src/core/persistence/effects.ts`: the effect guard tells a publication in flight (its request `running` with a live claim, or already terminal with its record not yet cleared) from one that needs recovery. An effect that does not hold the worktree lock and meets only publications in flight is requeued `writer_busy` with the existing busy backoff (250 ms doubling, at most 60 s, never parked). A record whose publisher's claim lapsed, or a request in `recovering`, still requeues it `recovery_required`, and an effect that holds the lock (Git, withdrawal mirror) is unchanged. An `embedding` effect in the same wait records `writer_busy` too, on its unchanged retry schedule. Nothing was lost before (the next effect pass after the 30 s delay derived the links), but the receipt said a recovery was needed when none was.
+ - `test/persistence-derived-effect-publication-race.test.ts` (PGLite, and PostgreSQL through `test/e2e/persistence-derived-effect-publication-race-postgres.test.ts`): drives a real put_page publication to its `prepared` and `after_commit` boundaries between a links effect's claim and its guard, and checks the effect waits as `writer_busy` with a delay under 5 s, then commits its link on the next pass; with the publisher's claim lapsed it stays `recovery_required` and still links once the record settles.
+
+ #### Fix commands print the revision a retry needs, keyless init hint, finished job trees, particle-1 headroom (#8909)
+
+ - `src/core/error-registry.ts`, `src/cli/page-render.ts`: the fix for `revision_required`, `revision_conflict` and `page_identity_changed` is now `gbrain get --include-content ...`, and that read prints `[gbrain] revision <rev>: put or delete this page with --expected-revision <rev>.` on stderr; before, the suggested `gbrain get -- <slug>` printed only frontmatter and body. `docs/guides/error-codes.md` follows.
+ - `src/commands/init.ts`: `gbrain init --pglite --no-embedding` now suggests `gbrain import <dir> --no-embed`, which runs on that brain, instead of an import that refuses because embeddings are off.
+ - `src/core/minions/worker.ts`: a quiet-hours skip no longer rewrites an already-cancelled job's reason to `skipped_quiet_hours`.
+ - `src/core/minions/queue.ts`: cancelling a job that already finished refuses and changes nothing (it used to cancel the job's still-live children while reporting that it could not cancel); submitting a child under a parent that already completed, failed, died or was cancelled refuses; both `fail_parent` updates clear the parent's lock. A behavior-notice row discloses the cancel and submit changes.
+ - `src/core/pglite-engine/code-edges.ts`: `getEdgesByChunk` on PGLite binds the edge-type filter on every arm with one `LIMIT` per table, matching Postgres.
+ - `src/core/ai/recipes/openrouter.ts`: `particle-ai/` models get thinking headroom on OpenRouter, so `thinking: 'off'` calls no longer truncate at 2,048 tokens. No default model changes.
+ - `src/core/behavior-change-notice.ts`, `docs/guides/write-refusals.md`: the `refresh_replan_own_commits_8828` notice and the `refresh_source_changed` row now match the code (text only; the row's `since` is unchanged).
+ - Tests: `test/revision-fix-command-shows-revision.test.ts`, `test/init-keyless-import-hint.test.ts`, `test/worker-quiet-hours-skip-keeps-cancelled.test.ts`, `test/code-edges.test.ts`, `test/ai/recipe-openrouter.test.ts`, `test/minion-cancel-failed-parent.test.ts`, `test/minion-child-of-finished-parent.test.ts`, `test/minion-fail-parent-clears-lock.test.ts`, `test/write-receipt-remediation.test.ts`.
+
+ #### Receipt bookkeeping no longer caps writes (#9021)
+
+ **gbrain's own write bookkeeping no longer caps your writes.** Every accepted write leaves a receipt, and gbrain used to cap how many request ids and how many receipt bytes one writer and one brain could hold (2,000,000 / 8,000,000 ids, 16 GiB / 64 GiB). Near those caps, background writers paused at 80% and every write receipt carried a low-capacity warning; at the cap, `remember`, `put_page` and sync refused with `write_quota_exhausted` until someone on the brain host raised a number. Nothing about your data needed that, because a cap only stopped writes. Both caps are now off unless the operator sets one. Receipt storage is kept in check by housekeeping instead. While receipts not yet compacted reserve more than `persistence.housekeeping.receipt_target_bytes` (default 8 GiB; the few KiB a compacted receipt keeps so its request id stays replayable never count, since nothing can shrink them), the compaction pass also compacts committed and cancelled receipts older than 7 days (except a subagent's own page writes, which a deferred synthesis postprocess still compares with the page), plus refusals that gbrain's own producers will write again from current content, and doctor `persistence_capacity` tells the brain host's operator. A refused write you made that `gbrain repair failed-writes` could still replay now keeps its intent at any age, until a later write resolves it or you drop it with `gbrain repair receipt-compaction --include-failures`; the retention pass used to drop it after 30 days. An explicit `persistence.receipt_retention_days` is left as set. On a brain that several hosts write to, these defaults hold once every one of them runs this version. An older gbrain still enforces its old caps and its 30-day retention, and the `gbrain config set persistence.limits.*` that its `write_quota_exhausted` refusal suggests would turn a cap on for every host, so upgrade the other hosts instead of raising it.
+
+ - `src/core/persistence/model.ts`, `limits.ts`: `principal_lifetime_ids`, `brain_lifetime_ids`, `principal_terminal_bytes` and `brain_terminal_bytes` default to no cap; a value set with `gbrain config set` is enforced as before (refusal at the cap, background pause at its line). New key `persistence.housekeeping.receipt_target_bytes` (0 turns housekeeping and its warning off), measured by `readCompactableReceiptBytes`: terminal receipts not yet compacted that no recovery holds.
+ - `src/core/persistence/compaction-pass.ts`: `housekeepReceipts` compacts up to 100 receipts older than 7 days per pass: settled page writes, and refused maintenance pages and managed sync, file import, reconcile and file repair page writes. Job receipts, a subagent's own page writes (`restrictedNamespace` authority), connector writes and every other refusal (a caller's write, conversation facts, atom members, connector items) keep their intent until the retention window while the brain is over the target and the retention is the default, with every exclusion of the retention pass; the pass record counts them as `early`. A housekeeping error is counted as `housekeeping_error` in the pass record and never skips the reservation sweep or the record.
+ - `src/commands/doctor/checks/persistence-capacity.ts`: with no cap set, `ok` says so and `warn` fires above the target with the read-only `gbrain repair receipt-compaction --json` preview (actor `host_admin`); `details.housekeeping` reports target, stored bytes, the not-yet-compacted bytes the target counts and an explicit retention. The forecast, capacity notices, repair capacity rows and `persistence_request_growth` cover only caps that are set, so the `/metrics` `gbrain_write_capacity_*` gauges are exported only for a cap you set; an alert on them needs a cap.
+ - `src/core/persistence/journal.ts`, `terminal-classify.ts`: the retention pass skips `UNRESOLVED_CALLER_REFUSAL_SQL` receipts (a writer-guard or `source_changed` refusal of a caller's `put_page`, `add_timeline_entry` or `remember` that no later request wrote, removed or repeated); `gbrain repair failed-writes` reads the same refusal predicates from there. A refusal with no recorded error code is not one of them and compacts at the retention as before.
+ - `src/core/persistence/diagnostics.ts`: `gbrain sources writer status --json` lists only the limits that are set; an unset cap is left out instead of printing as `null`.
+ - `src/core/persistence/reconcile-backup.ts`: the `--backups` listing leaves out `max_retained_count` while the brain id cap is unset (it serialized as `null`); the retained-backup bound is `brain_recovery_bytes`.
+ - Docs: `docs/guides/repair.md` (refused writes keep their intent until resolved; no retention raise needed for a recovery), `docs/guides/concurrent-writes.md` (limits table, receipt housekeeping, growth model as sizing for a cap you set), `docs/guides/write-refusals.md`.
+ - Tests: `test/persistence-opt-in-caps.test.ts` (counters at the old default caps admit background and interactive writes with no notice and no raise; a set cap still refuses; housekeeping above the target takes week-old settled page writes and refused maintenance and sync writes, and keeps a caller's refused write, a refused conversation-facts job, a committed job and young receipts; the retention pass keeps a 40-day-old replayable drift or guard refusal and compacts a resolved one and a non-replayable failure (red before: the drift refusal was compacted); a 40-day synthetic run never holds more than a week of uncompacted committed receipts; doctor's operator warning; compacted receipts alone above the target leave housekeeping idle and doctor ok, red before; the backup listing names no count bound while the id cap is unset, red before; a subagent's page write is kept from early compaction, a refusal with no error code still compacts at the retention, a housekeeping error still records the pass, and writer status prints no unset cap, each red before), `test/managed-synthesis-postprocess.test.ts` (an interrupted synthesis child output ten days old, with storage above the target and a maintenance drift on the page, is still verified and stamped by the next pass; red before: `revision_conflict`), `test/persistence-capacity.test.ts` (key count); the capacity forecast, notice and read-wave tests set the cap they exercise; the doctor goldens show the uncapped default and `details.housekeeping`.
+
+ **A write that saved now says so when it carries a low-capacity warning, and the warning no longer asks the user to raise a write cap by tens of gigabytes.** When a cumulative write cap (receipt bytes or request ids) was at 80% or forecast to run out within 30 days, every write receipt's `write_capacity_low` notice ended with `actor: host_admin` and `next: tell_user_to_run: gbrain config set persistence.limits.principal_terminal_bytes <value>`. An agent that read only the end of a successful `remember` took that for a refusal and told its user the memory was not saved. The value was also oversized, because it projected the last 24 hours for a whole year, so one bulk sync day could recommend several times the current cap. The notice now opens with "This write was saved and writes still work", its fix is the read-only `gbrain doctor --only persistence_capacity --json`, and the one-more-year value uses the 7-day mean rate. Days-to-exhaustion warnings still react to a bulk day. Doctor's finding keeps the `gbrain config set` command for the brain host's operator.
+
+ - `src/core/persistence/capacity-snapshot.ts`: `write_capacity_low` says the write was saved and names doctor's read-only check (actor `agent`) as its fix, with no cap raise in the notice.
+ - `src/core/persistence/capacity-forecast.ts`: `recommended_limit` (doctor `persistence_capacity`, the notice snapshot, `gbrain sync status` and `/metrics`) covers one more year at the 7-day mean gross and net rates instead of the larger of the mean and the last 24 hours.
+ - `src/core/persistence/limits.ts`: `oneYearCapacity` (every `write_quota_exhausted`, `write_quota_insufficient` and background-pause refusal, and doctor's fallback) uses the scope's 7-day window over the forecast's window length while the scope admitted anything that week, and keeps the latest-1,000 sample for a scope idle all week; the compacted-size SQL moves to `receipt-bytes.ts` so both reads count the same net bytes.
+ - Docs: `docs/guides/write-refusals.md` (`write_capacity_low` row), `docs/guides/concurrent-writes.md` (the notice, the mean-rate value, and returning a raised `persistence.receipt_retention_days` to the default before raising a cap), `docs/guides/repair.md` (unset the 90-day retention once a failed-writes recovery is done), `docs/architecture/key-files/core-persistence-capacity.md`.
+ - Tests: `test/persistence-capacity-notices.test.ts` (the notice's fix and wording; a burst of 28 admissions in the last day over a 10-a-day week recommends the mean-rate value, ids exactly and receipt bytes under the mean-rate ceiling; after 1,000 admissions in one hour on a 100-a-week principal, a real `write_quota_exhausted` refusal names exactly the value doctor recommends, ids and receipt bytes, on PGLite and Postgres).
+
+ #### Repair file-drift leaves an untracked or gitignored twin file alone (#9054)
+
+ **`gbrain repair file-drift` no longer offers to adopt an untracked or gitignored file into an origin-twin page.** v0.60.629.0 taught the drift preview to read an origin twin with no recorded file against the file at its slug path, but only where sync admits that path. It didn't check that sync reads the file at all. Sync imports from the HEAD commit (and the working tree only with `sync.include_working_tree` or a detached HEAD, never an ignored file), so a slug-path file that Git doesn't track, or that `.gitignore` lists, is never imported or held. The preview still reported it as drift. It offered `--prefer file` to copy a possibly private, ignored file into the database, maintenance writes to the page were refused as drift, and doctor `maintenance_write_drift` counted it. Such a twin now stays `database_only`. An untracked file that sync does read from the working tree is still read as drift.
+
+ - `src/core/persistence/drift-conflicts.ts`: `twinReading` reads `adopt` only when sync reads the slug-path file: committed at HEAD, or, when sync reads the working tree, not ignored by Git.
+ - Tests: `test/repair-file-drift-origin-twin-gbra108.test.ts` (PGLite, managed source, real git): an untracked slug-path file and a gitignored one under `sync.include_working_tree` stay `database_only` with no sync hold, and an untracked file sync reads from the working tree still reads drift while sync holds it.
+
+ #### The revision-backfill refusal names the command that resumes it (#9053)
+
+ **A `revision_backfill_pending` refusal now names the command that actually resumes the backfill, and the write-refusal guide says what a webhook capture of such a page gets (follow-up to GST-2112).** The refusal's message, which is also the body of the 409 `POST /ingest` answers for a page the revision backfill has not reached and the error a dead `ingest_capture` job keeps, said `gbrain apply-migrations --yes`, which does not resume the backfill once the schema is current, and linked a section that does not cover it. It now says `gbrain apply-migrations --force-schema` on the brain host and links `docs/guides/write-refusals.md#revision-backfill`. Since #8940 that 409 stores and queues nothing, so the capture exists only with its sender, and an `ingest_capture` job already queued for such a page goes straight to `dead`; neither was written down. The guide's `revision_backfill_pending` row and a new upgrade notice row now say both, with the recovery, which is to resume the backfill, send a capture that got the 409 again, and re-run a dead job with `gbrain jobs retry <id>`. The E2E runner also gives `test/e2e/source-retire-batched-postgres.test.ts` (60,000 pages) the 4x per-file budget, because on a loaded CI runner it ran past the 180 s cap and was killed with a test in flight and no failed assertion.
+
+ - `src/core/page-state/types.ts`: `RevisionBackfillPendingError`'s message names `gbrain apply-migrations --force-schema` and the `#revision-backfill` anchor, matching the error registry's fix.
+ - `docs/guides/write-refusals.md`: the `revision_backfill_pending` row covers the 409 at `POST /ingest`, the `ingest_capture` job that goes straight to `dead`, and the resend and `gbrain jobs retry <job id>` recovery.
+ - `src/core/behavior-change-notice.ts`: one row for the changed message and the recovery.
+ - `scripts/run-e2e.sh`: `source-retire-batched-postgres.test.ts` joins the 4x per-file budget list. No assertion in that file changed.
+ - Tests: `test/ingest-capture-keeps-readers.test.ts` checks that the 409 body and the job's refusal name `--force-schema` and the anchor.
+
## [0.60.675.0] - 2026-11-11
**Tool calls through native OpenAI models no longer fill every optional argument with a placeholder.** gbrain's tool loop (subagent jobs and SkillOpt rollouts) sends OpenAI models through the Responses API, and that API treats a tool definition with no `strict` field as strict: it marks every property required, so the model has to invent a value for each optional argument. A `get_page` call came back with a zero-line window and an empty byte range, which gbrain's own argument checks then refused. Native OpenAI tool definitions now say `strict: false`, so the schema's own `required` list holds and the model sends only the arguments it means. Anthropic, Google and the OpenAI-compatible providers (chat completions) send the same request as before. Reported and first fixed by @akinduroifedayo.