Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge origin/master (v0.60.284.0) into capy/6712-overwrite-detect; stamp 0.60.285.0

garrytand61ba638695b
diff --cc .claude-plugin/plugin.json
index 4855c00a80,76ea5a879d..bda4e129a9
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc .codex-plugin/plugin.json
index 615bf50439,6bb8f86922..45fbfbc826
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Personal knowledge brain for your coding agent — hybrid search, synthesis, graph traversal, and durable cross-session memory over Postgres/PGLite with pgvector, plus a curated brain-first skill set.",
"author": {
"name": "Garry Tan",
diff --cc BOOTSTRAP_FOR_AGENTS.md
index 66bf261996,aef646eb2c..38b9fe8d82
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-runbook-stamp: 0.60.279.0 -->
-<!-- gbrain-runbook-stamp: 0.60.284.0 -->
++<!-- gbrain-runbook-stamp: 0.60.285.0 -->
<!-- This stamp must equal the VERSION file at every release; CI enforces it
(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it to
the installed binary and warns on skew. -->
diff --cc CHANGELOG.md
index 87735b7cf7,8af426112c..a7d7970e36
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,6 -10,210 +10,234 @@@ credits are retained; no result has bee
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
++## [0.60.285.0] - 2026-10-17
++
++**Doctor can now find page edits that an earlier sync silently overwrote, and one repair puts them back (#6712).** Between v0.60.255.0 and v0.60.279.0, a plain incremental `gbrain sync` could publish a committed file edit over a page that had also been edited in the database (for example a `put_page` with `sync.write_through` off). v0.60.279.0 stopped new damage. This release finds the pages that were already hit, using records gbrain keeps permanently, and restores them with a preview first.
++
++### What you'd see
++
++| Situation | Before | Now |
++|---|---|---|
++| a database edit an earlier sync overwrote | survived only as an old page version; nothing pointed at it | doctor `sync_overwritten_db_edits` warns and names the page; `gbrain repair overwritten-edits` previews a diff |
++| applying the restore | no command | the page goes back to the edit through a database-only, revision-bound revert; the committed file is held `file_drift` when it differs, so sync never publishes it over the edit again |
++| applying on a host that doesn't own the checkout | no command | the page is restored and the outcome is `restored_file_unheld`, naming the file-drift command to run on the owner host |
++| a page whose history has no recorded writer, or a segmented page | not detectable | not reported, or reported `unknown`, and never restored automatically |
++
++### What to do after upgrading
++
++Nothing runs on upgrade. Run `gbrain doctor --only sync_overwritten_db_edits --json`. If it warns, preview with `gbrain repair overwritten-edits --source <id>` (narrow with `--slug <slug>`), decide with the user, then apply with `--apply --expect <hash>` on the host that owns the checkout. Then resolve the `file_drift` hold it leaves, using `gbrain repair file-drift --source <id> --slug <slug>`.
++
++### Itemized changes
++
++- `persistence/overwritten-edits.ts` scans `page_versions` for a revision whose writer was a database-only page write and whose archiver was a managed-sync import that changed the body. It reads only receipt columns that compaction keeps, and caps the scan at 500 candidates per source.
++- The doctor check `sync_overwritten_db_edits` (BRAIN) warns only on high-confidence findings and counts `unknown` separately.
++- The repair kind `overwritten-edits` is explicit-only and preview-bound. It rechecks the revision and the version digest, restores through `revert_version` with `databaseOnly: 'overwrite_restore'`, writes the `file_drift` hold on the owner host, and replays an apply that was interrupted after the restore committed.
++- Tests: `test/overwritten-edits-6712.test.ts` runs on PGLite and Postgres: detect and restore, no false flag on normal sync history, a page that moved since the preview is refused, an interrupted apply replays, and a non-owner host reports the file left unheld. The doctor goldens gain the new row.
++
+ ## [0.60.284.0] - 2026-10-17
+
+ **Your agent can now finish a rename that sync split in two, find people and companies in every source it can read, and stop chasing warnings that only describe the past (fix wave 18).** When you move a note and rewrite it in the same commit, sync sometimes cannot tell it was a move, so it keeps the old page aside and starts a new one. Until now the only way out was to bring the old page back. Now one command, run after you agree, moves the old page's history, links and facts onto the new name, or closes the pair and lets the old page go.
+
+ Asking about a person or company now looks in every source you can read, not only the one you are connected to, and a context pack brings that entity's own facts with it. Facts pulled from your meetings get attached to the right person page more often, for free, before gbrain ever offers to pay for a re-read. Several doctor warnings learned to tell history from a live problem, so an agent stops "fixing" something that already healed. A batch of reliability fixes rides along: writer locks stay out of your checkout, a guarded eval stops every process it started, a Claude Code answer that ran past its length cap is never treated as complete, and `gbrain bootstrap harness` no longer reports success while old tokens still wait to be cleaned up.
+
+ ### What you'd see
+
+ | Situation | Before | Now |
+ |---|---|---|
+ | sync kept an old page aside after a move-and-edit (doctor `rename_identity_downgrades`) | the only offered fix was restoring the old page | `gbrain repair rename-identity --source <id> --slug <new-slug>` previews carrying the old page's history, links and facts onto the new slug; `--close` releases the pair instead. On a managed source only `--close` is available this release |
+ | `entity` or `context_pack` for a name that lives in another source you can read | `found: false` | the card, with `source_id`; `source_id` pins one source |
+ | `context_pack` for a person | cards plus recent hot facts | also `entity_facts[]`: up to 5 of each packed entity's own facts |
+ | a meeting page's facts about people it links | often stored with no entity | stored on the person or company the page links; `gbrain facts relink --conversation` links old ones at no cost |
+ | a meeting page titled like a person page | `volunteer_context` could point at the meeting | it points at the person page |
+ | doctor `facts_extraction_health` after the cause was fixed | kept warning and suggested raising the threshold | reports the 24 h count as history and names only jobs still dead, each with `gbrain jobs retry <id>` |
+ | a gbrain fence marker such as `<!--- gbrain:facts -->` | linked every page to a page titled "gbrain" | ignored; one rescan removes the false links |
+ | `gbrain bootstrap harness` with old shared-skills tokens still pending cleanup | exit 0 | exit 14 (`bootstrap_cleanup_pending`) with a per-token `cleanup` list and a `fix` |
+ | a GBRAIN_HOME inside the source checkout | the writer lock landed inside the checkout | the lock goes under `GBRAIN_COORDINATION_HOME`, else `~/.gbrain/persistence` |
+ | `scripts/eval-spend-guard.sh` interrupted, or SIGKILLed | helpers and grandchildren kept running | the whole process group stops; after a SIGKILL the next run reports the stale run and how to stop it, and kills nothing itself |
+ | a managed sync backlog that cannot be read | `nothing_pending` | `movement_state: unknown`; `gbrain sources writer movement` exits 1 with `movement_unknown` |
+ | a v0.11.0 upgrade on a Postgres brain with no `sync.repo_path` | wedged after three partial runs | completes, records Phase F as skipped and prints the install command |
+
+ ## To take advantage of v0.60.284.0
+
+ `gbrain upgrade` should do this automatically. If it didn't, or if `gbrain doctor` warns about a partial migration:
+
+ 1. **Run the orchestrator manually:**
+ ```bash
+ gbrain apply-migrations --yes
+ ```
+ 2. **Your agent reads `skills/migrations/v0.60.284.0.md` the next time you interact with it.** There is no schema migration. The note covers the rename remedy, the bootstrap exit 14, the coordination lock home for container installs and the one-time mention rescan.
+ 3. **Verify the outcome:**
+ ```bash
+ gbrain doctor --only rename_identity_downgrades,unlinked_facts,coordination_lock_location,facts_extraction_health --json
+ gbrain stats
+ ```
+ 4. **If any step fails or the numbers look wrong,** please file an issue:
+ https://github.com/garrytan/gbrain/issues with:
+ - output of `gbrain doctor`
+ - contents of `~/.gbrain/upgrade-errors.jsonl` if it exists
+ - which step broke
+
+ This feedback loop is how the gbrain maintainers find fragile upgrade paths. Thank you.
+
+ ### Itemized changes
+
+ #### Finishing a split rename (#6729)
+
+ - New explicit-only, preview-bound repair kind `gbrain repair rename-identity`. Without `--slug` it lists the open pairs. `--slug <new-slug>` (and `--from <old-slug>` when two pairs share a new slug) previews one pair; `--apply --expect <hash> --yes` (destructive consent) carries the old page id onto the new slug with its versions, timeline, links, facts and aliases, imports the new file as an edit and retires the provisional page. Facts of both pages survive, or the carry refuses `fact_rows_collide` before writing. `--close` settles the pair without moving anything. Both release the purge hold. `--all`, the maintenance cycle and the remediation plan never run it. Contributed by @javieraldape (PR #6732, rewritten).
+ - On a managed source carrying identity is not available yet: the preview states `managed_remedy_unavailable` and names `--close`, and an apply refuses with that code.
+ - The sync report, `gbrain sync status --json` (`identity_downgrades[].remedy`) and doctor `rename_identity_downgrades` name each pair's preview and apply commands. Doctor's fix is the first pair's apply behind `ask_user`; `gbrain restore` stays the named alternative wherever the source admits it.
+
+ #### Entities across sources and their facts (#6723, #6724, #6725)
+
+ - `entity` and `context_pack` resolve names across every source the caller can read: the home source first, then the others by id. `source_id` pins one source (refusals match `recall`), `context_pack` takes source-qualified `entity_refs`, and every card, `names` row and suggestion carries `source_id`. A bound connection whose own source misses a name gets a `source_binding_narrowed` notice. Sources outside the grant are never read. The new parameters are on the full MCP surface; the starter tool list is unchanged.
+ - Each pack card's activation verdict, newer mentions, records, page status and pinned questions now come from its own source.
+ - `context_pack` returns `entity_facts[]` (up to 5 per card, newest first, in the card's source and visibility) and renders a `## Entity facts` section before hot memory. A remote caller still never sees a private fact, and remote entity cards and packs still carry no open loops.
+ - `volunteer_context` and the retrieval reflex point at one page per name per source: the exact slug, then the linkable entity type, then anything else. Contributed by @javieraldape.
+
+ #### Conversation facts (#6731, #6764)
+
+ - `gbrain extract-conversation-facts` hints the page's own linked entities (frontmatter attendees and linked entity pages, same source, up to 40) to the extractor, and runs free write-time subject inference on facts that come back without an entity. Contributed by @troyhoffman-oss (design from #6736, reimplemented).
+ - New `gbrain facts relink --conversation` links existing conversation facts that name exactly one entity page, with no model call. Doctor `unlinked_facts` counts conversation rows on their own and prescribes the free relink first; only for rows it could not resolve does it offer a paid re-extraction of the named pages (up to 50), capped at `--max-cost-usd <N>` with the amount the user approves. A page already re-extracted on its current content is not offered again until it changes. A re-extraction keeps a relinked fact's entity.
+
+ #### Doctor tells history from live problems (#6761, #6758, #6759, #6778)
+
+ - `facts_extraction_health` reports its 24 h count as rolling history with an ages-out time and separately names facts-absorb jobs still dead.
+ - Facts absorb waits for its write up to the job deadline (was 5 s). A write still committing is logged `write_pending_accepted`, writer contention before admission `write_deferred_unadmitted`; neither counts toward the threshold.
+ - Agent-contract events record the gbrain version that wrote them; doctor `agent_contract` splits counts by build. Contributed by @Kkkkkuro (idea from #6790).
+ - `persistence_counter_drift` names each scope's direction and splits the receipts behind it.
+
+ #### Writer locks, processes and sync movement (#6765, #6774, #6719, #6781)
+
+ - A checkout that contains GBRAIN_HOME no longer gets its writer lock inside the checkout: a claim places it under `GBRAIN_COORDINATION_HOME` (absolute, outside the checkout), else `~/.gbrain/persistence`. A recorded lock always wins, a writer transfer keeps it, and a reservation an older release wedged is repaired by the next claim on its host. `gbrain sources writer status --json` shows `coordination_lock`, and the new doctor check `coordination_lock_location` warns when `GBRAIN_COORDINATION_HOME` disagrees with a recorded lock. Contributed by @lubosxyz.
+ - A graduation marker whose boot id or PID namespace this process cannot read is unknown, never alive. Contributed by @lubosxyz.
+ - A terminal write failure with origin `owner_exception` gets its own hint pointing at `gbrain write-request <id> --json` instead of a database-trigger guess. Contributed by @Kkkkkuro (idea from #6790).
+ - An unreadable managed sync backlog is `movement_state: unknown` (`unknown.reason: backlog_read_failed`) on every surface, and `gbrain sources writer movement` exits 1 with the new code `movement_unknown`.
+
+ #### Smaller fixes
+
+ - `claude-cli` rebuilds an answer Claude Code continued past its output cap from the event stream; when it cannot prove the full text, the call returns nothing, finishes `length` and reports `continuation_unproven` (#6791).
+ - The mention scan ignores HTML comments, so gbrain's fence markers stop linking every page to a page titled "gbrain" (#6740). One rescan runs on the next extract or maintenance pass. "Discussed in" timeline bullets the bug already wrote stay until you delete them by hand; they no longer come back.
+ - `gbrain-base-v2` is 1.4.0 and declares the `question` page type, so pinning a question no longer makes doctor warn (#6742).
+ - Atoms extracted from a page carry that page's content date, not the extraction run's (#6720). Existing atoms are not backfilled yet. Contributed by @javieraldape (idea from #6737).
+ - Dream-cycle summaries record `created:`, so they pass `gbrain lint`'s temporal check (#6773). Contributed by @lubosxyz.
+ - The patterns phase sends `expected_revision` when it updates an existing pattern page (#6779).
+ - An embedding provider that reports one over-long input as a 5xx is no longer retried as transient; the chunk is isolated and split (#6772). Contributed by @lubosxyz (reimplemented with stricter matching).
+ - `gbrain bootstrap harness` exits 14 (`bootstrap_cleanup_pending`) while earlier shared-skills enrollments or carried token ids still await cleanup; each carried id is revoked on its own once nothing holds it (#6743).
+ - The first Claude Code prompt hook in a new folder records `ok` with prompt-only context instead of `degraded` (#6739).
+ - On a Postgres brain with no `sync.repo_path` the v0.11.0 migration skips the autopilot install instead of wedging, a brain already wedged that way clears on the next `apply-migrations`, and wedged-migration advice names `migrations/completed.jsonl` (#6755). Contributed by @lubosxyz (#6769, reimplemented).
+ - Managed `gbrain sources add --kind google` keeps `--contacts-dir`, `--future-days` and `--loops-exclude-labels` (#6717). A managed google source added before this fix lacks them; set them again.
+ - `gbrain config set` accepts twelve keys gbrain already read at runtime but refused as unknown (#6780).
+ - `scripts/eval-spend-guard.sh` and `gbrain claw-test` stop their whole process group on an interrupt or timeout; a guard that was SIGKILLed leaves a run lease the next run reports (#6776, #6775). Contributed by @lubosxyz.
+ - The maintain skill falls back to `get_brain_health` without admin scope (#6748).
+
+ ### For contributors
+
+ - `bun run ci:local` hydrates the admin/dist volume from the worktree and refuses only on an unreadable tracked file (#6756).
+ - The OpenCode door test surfaces provider error events (#6049).
+ - Guides for reading `extract_health` halts (#6760) and for the dream triage threshold and synthesize cooldown (#6753).
+ - New error codes: `continuation_unproven`, `bootstrap_cleanup_pending` (exit 14), `fact_rows_collide`, `managed_remedy_unavailable`, `movement_unknown`. New exit code 14 in `src/core/exit-codes.ts`.
+ - `FACTS_ABSORB_REASONS` gains `write_pending_accepted` and `write_deferred_unadmitted`; `REPAIR_KINDS` gains `rename-identity`; new doctor check `coordination_lock_location`.
+ - Migration note: `skills/migrations/v0.60.284.0.md`.
+
+ ## [0.60.283.0] - 2026-10-17
+
+ **Facts about a person now land on that person's page, not on an old copy you retired.** If you keep an old page around for its history and mark it as replaced by the real one (`canonical: false`, `superseded_by: people/<name>`, or a status like `historical-retired-alias`), gbrain could still pick that old page when it filed new facts. It happened when the real page listed the name only in slug form (`alice-example`) and the extractor wrote it as `people/alice-example` or `Alice Example`: those spellings never matched the alias, and the name-matching fallback then chose the old page because its title carried the same words. One brain saw 91 fact writes go to the retired page in a day against 3 to the real one, and because that page was very large each write took minutes and slowed every other write behind it. Now a retired page is never chosen by a guess, a direct reference to it follows `superseded_by` to the real page, and aliases match whether the words are joined by spaces, hyphens, underscores or a directory prefix. Reported by @liuwenyong1985 (#6898).
+
+ ### What you'd see
+
+ | Situation | Before | Now |
+ |---|---|---|
+ | the extractor names `people/alice-example` or `Alice Example`, and the real page has the alias `alice-example` | the alias missed; a retired page with the same name words could win | resolves to the real page through its alias |
+ | an alias written `Dana Example` or `acme_example`, referenced as `dana-example` or `Acme Example` | no alias match | matches |
+ | a reference that is exactly a retired page's slug | that retired page | the page its `superseded_by` (or `merged_into`) names, up to 5 hops, same source, readable by the caller |
+ | the same, when the retired page names no target, the target is missing or private to the caller, or the chain loops | that retired page | unresolved, like an unknown name: extracted facts are saved without an entity |
+ | `gbrain recall --entity <retired-slug>` when the retired page names a target | the retired page's facts | the target page's facts (the retired page's own facts stay under its slug) |
+ | a retired page is the only page whose name matches a guess (name match, bare-name prefix, phantom merge) | it could be chosen | it is skipped |
+ | a person page whose `status` describes the person (`retired`, `archived`) | a candidate | still a candidate |
+
+ ### What to do
+
+ Nothing. No migration, nothing is rewritten on upgrade, and stored aliases are read as they are. Facts that already landed on a retired page stay there; move them by hand for now (`gbrain forget <id>`, then `gbrain remember "<fact>" --entity <slug>`).
+
+ ### Itemized changes
+
+ - `src/core/entities/resolve.ts`: a page is retired when its frontmatter has `canonical: false`, a `superseded_by` or `merged_into` target, or a `status` naming it an alias or a redirect. The fuzzy and same-name arms of both resolvers, bare-name prefix expansion and the phantom-merge candidate queries exclude retired pages in SQL before uniqueness is counted. The exact-slug, basename and alias arms follow a retired page's `superseded_by` (else `merged_into`; `[[...]]`, `.md` and a leading `/` are stripped) within the same source, at most 5 hops, refusing on a cycle, a missing or deleted target, or (strict resolver with `excludePrivate`) a private one. An exact hit that cannot be followed is reported as `fallback_slugify` (unresolved) by `resolveEntitySlugWithSource` and as `not_entity` by `resolveStrictEntityReference`. Relational recall's exact-title fallback skips retired pages too.
+ - Alias lookup tries the literal normalized reference first, then its words rejoined with a space, `-` and `_`; a slug-shaped reference uses its last segment, and a folded hit must sit in the same parent directory (`projects/acme-example` never resolves to a `companies/` page's alias). `normalizeAlias` itself is unchanged, so stored `page_aliases` rows, search's alias hop, mentions and CJK handling behave as before.
+ - Tests: `test/entity-resolve-retired-alias-6898.test.ts` (PGLite, including the facts backstop landing both spellings on the canonical page) and `test/e2e/entity-resolve-retired-alias-6898-postgres.test.ts` share the fixture and cases in `test/helpers/retired-alias-6898.ts`; both fail on the previous resolver.
+
+ ## [0.60.282.0] - 2026-10-17
+
+ **The take grader now has an eval, and you can review what it has graded.** Wave 4b W6: a preregistered take-grading eval measures which judge models may ever auto-resolve a take, the dream cycle's take grader stops counting evidence about a look-alike company, and `gbrain takes grades` lists its cached verdicts. Auto-resolve stays off.
+
+ ### What you'd see
+
+ | Situation | Before | Now |
+ |---|---|---|
+ | The take grader's evidence mentions a different company whose name only resembles the one in the claim | the judge could grade the claim on the other company's outcome | prompt `hybrid-evidence-v2` tells it that evidence does not count, so the verdict is `unresolvable` |
+ | The judge wraps its JSON answer in prose, or repeats an answer that agrees | no verdict ("judge output parse failed"), retried next cycle | the answer parses; two answers that disagree still give no verdict |
+ | You want to see what the grader concluded | only the database table `take_grade_cache` | `gbrain takes grades [--verdict v] [--min-confidence n] [--applied\|--unapplied] [--limit n] [--json]` lists the newest verdict per take and marks judges the eval has not measured |
+
+ ### What you need to do
+
+ Nothing. Verdicts are cached per prompt version, so the next cycles grade each eligible take once more within the phase's existing budget (`cycle.grade_takes.budget_usd`). No take's resolution changes. `gbrain takes grades` runs on the brain host; thin clients refuse it.
+
+ ### For contributors
+
+ `evals/take-grading/` holds the eval (908 seeded synthetic takes, dev and counted splits, `--check` at $0) and its preregistration. On the counted split (790 takes, $9.25), `gpt-6.1-sol` qualified: 496 applied verdicts, none wrong (95% upper bound 0.6%, bar 1%), so `GRADE_TAKES_MEASURED_MODELS` (`src/core/cycle/grade-takes-measured.ts`) lists it. `claude-sonnet-5-5` (121 applied, 1 wrong) and `claude-opus-5-5` (2 applied: right verdicts, confidence below 0.95) did not. Results are mirrored in gbrain-evals.
+
+ ## [0.60.281.0] - 2026-10-17
+
+ **A PGLite brain that is draining a large effects backlog answers requests sooner, and master CI is green again.** When the write owner starts on a backlog of queued embedding effects, its first tick ran the receipt compaction pass, the reservation sweep and the queue `VACUUM` back to back next to the drain, and each drain pass held the event loop for its whole reservation true-up. PGLite statements run synchronously, so a request (or a timer) waited behind all of it: about 0.3 s on a fast machine and 2.2 s on a slow CI runner, which failed `test/persistence-drain-latency.serial.test.ts` on master. Now each of those steps returns to the event loop before the next one, and a request waits behind one step at most.
+
+ ### What you'd see
+
+ | Situation | Before | Now |
+ |---|---|---|
+ | longest wait for a tool call while 8,000 no-op embedding effects drain (local PGLite) | 290 to 380 ms | 86 to 120 ms |
+ | the same on a host about as slow as the CI runner that failed (statements slowed 4.5x) | 1.9 to 2.1 s (over the 2 s bound in 2 of 3 runs) | 1.0 to 1.2 s |
+ | time to drain that backlog (local) | about 2.8 s | about 3.5 s |
+
+ ### What to do
+
+ Nothing. Nothing is rewritten on upgrade and there is no migration. Postgres brains are unaffected apart from the smaller settle batch.
+
+ ### Itemized changes
+
+ - `src/core/persistence/journal.ts`: new `yieldToEventLoop`, which resumes from the timer queue so a timer that came due during the last statement chain runs before the next chain. The consumer's effects drain uses it between passes (it used `setImmediate`, which ran the next pass ahead of due timers). `vacuumPersistenceQueues` vacuums each grown queue table in its own statement with a yield before each.
+ - `src/core/persistence/compaction-pass.ts` and `src/core/persistence/consumer.ts`: the compaction pass yields after compacting and after the reservation sweep step, and the consumer's maintenance chains yield between the compaction pass, the segment sweep, the queue vacuum and the planner statistics refresh.
+ - `src/core/persistence/embedding-noop-settle.ts`: `NOOP_SETTLE_BATCH` is 50 (was 200), because one pass and its reservation true-up hold the event loop on PGLite.
+ - `DRAIN_ANSWER_BOUND_MS` and every assertion of the drain latency test are unchanged.
+ - New `test/persistence-maintenance-yield.test.ts`: the queue `VACUUM` runs in a later event-loop turn than the size check, the compaction pass, the sweep and the pass record each run in their own turn, and a yield resumes after a timer that came due before it. All three fail on the previous code.
+
+ ## [0.60.280.0] - 2026-10-17
+
+ **A managed brain can now make a commit searchable in seconds, and every managed source reports how long that takes.** Until now a commit reached search only when the next scheduled sync ran, which on a managed brain could be most of an hour. Turn on `sync.on_commit` and `gbrain serve` notices the commit within about 3 seconds, waits 3 more for the commit burst to settle, and runs one managed sync for that source. The setting is off by default, so nothing changes until you turn it on.
+
+ ### What you'd see
+
+ | Situation | Before | Now |
+ |---|---|---|
+ | a commit to a managed source while `gbrain serve` runs, with `sync.on_commit` on | searchable after the next scheduled sync | searchable about 5 to 15 s later (notice, 3 s debounce, the page write) |
+ | the same, with `sync.on_commit` off (the default) | the next scheduled sync | unchanged |
+ | with `sync.on_commit` on, a commit that lands while a sync is running | (no on-commit sync) | gets one more sync when the running one ends, unless that sync already took it |
+ | `gbrain sync status --source <id>` | no latency figure | a `freshness` line, and a `freshness` block in `--json`: p50 and p95 of commit→searchable and commit→embedded over the last 24 h |
+ | `gbrain status` | no latency figure | one freshness line per managed source |
+ | `gbrain doctor` | nothing about latency | a new check, `managed_sync_latency`, that reports the numbers; it warns over the target and fails over an hour only when `sync.on_commit` is on or `sync.freshness_target_seconds` is set |
+
+ ### What to do
+
+ To turn it on, run `gbrain config set sync.on_commit true` on the brain host. The serve picks it up within 30 seconds; no restart is needed. Change the latency target with `gbrain config set sync.freshness_target_seconds <seconds>` (default 300). Nothing is rewritten on upgrade and there is no migration.
+
+ ### Itemized changes
+
+ - New `src/core/serve-head-watcher.ts`, started next to the movement watch in `gbrain serve` and `gbrain serve --http`. With `sync.on_commit` on it polls `git rev-parse HEAD` in the checkout of each managed source this host owns every 3 s (`GBRAIN_SERVE_HEAD_POLL_MS`, 1 to 30 s), with an `fs.watch` on the git directory that only brings the next poll forward, debounces 3 s (`GBRAIN_SERVE_HEAD_DEBOUNCE_MS`) and starts one managed sync through the existing `startDelegatedSync` as this host's CLI writer. It never starts beside a running delegated sync or a held drain lease, skips a commit the source has already synced, resumes a resumable stop up to three times, never writes into the checkout or `.git`, and logs each distinct error once. With the setting off it makes no git call.
+ - New `src/core/persistence/sync-freshness.ts`: commit→searchable and commit→embedded p50/p95 per managed source from existing columns (the commit's committer time from git, `persistence_requests.completed_at` of committed `managed_sync_import` receipts, `content_chunks.embedded_at`). Commit→embedded counts only a receipt that is still the page's current revision, and only an embedding at or after its write, so a later revision never rewrites an earlier sample. First syncs and working-tree entries are not counted; a run that spans several commits is dated by its newest. No schema change.
+ - New guide `docs/guides/on-commit-sync.md` (linked from the `sync.*` tunables in `docs/guides/live-sync.md`; indexed in `llms.txt` but not inlined in `llms-full.txt`, which master had within 233 bytes of its 800,000-byte budget).
+ - Embedding needs no inline-embed flag: a managed sync import queues an `embedding` publication effect with the page write, and the serve runs it right after, so a small page is embedded seconds after the write (commit→embedded within about a second of commit→searchable, measured with a mock provider on PGLite and Postgres). A run with `--no-embed` or a cost-gate deferral still queues none and leaves the page for `embed-backfill`. Tests: `test/on-commit-embedding.serial.test.ts`.
+ - New config keys `sync.on_commit` and `sync.freshness_target_seconds` (tunables in `src/core/sync-config-keys.ts`).
+ - New doctor check `managed_sync_latency` (`src/commands/doctor/checks/managed-sync-latency.ts`); the doctor goldens are regenerated for it. With grading on it also warns when the synced commits are not in this host's git checkout (the latency cannot be measured), and `doctor --source` grades only that source.
+ - Tests: `test/serve-head-watcher.test.ts` (debounce, single flight, follow-up, resume cap, error handling, stop), `test/serve-head-watcher-managed.serial.test.ts` (a real managed source on PGLite and Postgres: a commit becomes searchable with no manual sync), `test/serve-http-head-watcher.serial.test.ts` (the watcher starts with `gbrain serve --http` and its poll interval is cleared on shutdown), `test/sync-freshness-6858.test.ts` (percentiles, exclusions, doctor thresholds, the additive `sync status --json` block). The two database tests are listed in `test/postgres-unit-arms.txt`.
+
## [0.60.279.0] - 2026-10-17
**An ordinary incremental sync no longer overwrites a page you edited in the database (#6712).** If an agent saved a page with `put_page` while `sync.write_through` was off, and someone later edited and committed that page's file, the next plain `gbrain sync` published the file over the database edit. It raised no hold, took no backup and reported `synced`. The database edit survived only as an old page version. Now sync holds that file as `file_drift` and the page keeps its edit until you choose which version wins. A first sync, `--full` and a failed Git delta already guarded this case. The ordinary delta sync didn't.
diff --cc VERSION
index a7546db0e8,786f12bc9d..9afc66ce22
--- a/VERSION
+++ b/VERSION
@@@ -1,1 -1,1 +1,1 @@@
- 0.60.279.0
-0.60.284.0
++0.60.285.0
diff --cc docs/guides/repair.md
index 953256ffe3,925b23c962..99ac68e2e9
--- a/docs/guides/repair.md
+++ b/docs/guides/repair.md
@@@ -147,7 -147,7 +147,8 @@@ work behind exits 0, so scripts should
| `ghost-pages` | `ghost_pages` | Explicit-only, preview-bound, destructive consent. Soft-deletes live pages whose canonical file is missing on the owner host (ghost pages: every write refuses `canonical_file_missing` and no sync can import a file that is not there), through `delete_page` bound to the previewed owner, path and revision. `--apply --expect <hash> --yes`. See [ghost pages](#ghost-pages). | Declared db_only and never-filed derived pages (never listed); a page whose file came back before the apply (`file_restored`); pages changed after the preview (`changed_since_preview`). |
| `receipt-compaction` | `persistence_capacity` (terminal bytes) | Explicit-only, preview-bound, destructive consent. Compacts terminal write receipts now instead of on the idle maintenance tick (#6696): the intent and error message are dropped, the outcome, error code and detail stay, and the unused reservation returns to the receipt-bytes counters. `--older-than <72h\|30d>` is floored at the configured retention unless `--force`; committed receipts only unless `--include-failures`. No admission, so it runs at a full cap. See [receipt compaction](#receipt-compaction). | `failures_kept`: failed, conflict and cancelled receipts left without `--include-failures`. Receipts of a run whose sync cursor is still open, and the newest sync receipt of each worktree, are never listed. |
| `aliases` | `dangling_aliases` (orphaned rows) | Explicit-only. Deletes free-text page aliases and slug redirects whose target page has no row at all (a page purged before purge removed its aliases, #6619, or a hard-deleted page), each target rechecked under its page lock; a coordinated maintenance write on a managed brain. A redirect from an old name of a page that still exists is never touched. See [aliases](#aliases). | `soft_deleted_target`: aliases of a soft-deleted page, kept for `gbrain restore` and removed when the page is purged. |
+ | `rename-identity` | `rename_identity_downgrades` | Explicit-only, preview-bound, destructive consent. For an inexact Git rename that sync split into a delete plus an add (#6729): carries the old page's identity (id, version history, timeline, links, facts, aliases) onto the new slug, imports the new file onto it as an edit and retires the provisional page; or, with `--close`, settles the pair and moves nothing. `--slug <new-slug>` (and `--from <old-slug>`) names one pair; `--apply --expect <hash> --yes`. See [rename identity](#rename-identity). | `fact_rows_collide` (a fence row of the old page the new file does not keep with the same claim); `managed_remedy_unavailable` (a carry on a managed source; `--close` is the remedy there); pages changed after the preview (`changed_since_preview`). |
+| `overwritten-edits` | `sync_overwritten_db_edits` | Explicit-only, preview-bound. Restores database edits that an incremental managed sync replaced with a committed file edit and no `file_drift` hold (#6712, fixed by #6887). It restores only what the records prove: a database-only revision (its receipt published no file) archived by a managed-sync import that wrote different content, with no later revision holding the edit again. The preview diffs the live page against the edit; `--apply --expect <hash>` reverts each page to that version through a revision-bound, database-only `revert_version` and holds the committed file `file_drift` when it differs. See [overwritten edits](#overwritten-edits). | `unknown_*` findings (no persistence outcome on the writer's receipt, the import's content no longer readable, a segmented version), listed but not restored; pages that moved after the preview (`changed_since_preview`). |
Timeline rows that an earlier version of a page produced and its current text
no longer has are removals, not history, so `timeline` neither counts nor
diff --cc openclaw.plugin.json
index eb672b7836,ee906bcbb5..4abff160e7
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@@ -1,7 -1,7 +1,7 @@@
{
"id": "gbrain-context-engine",
"name": "gbrain",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Personal knowledge brain with Postgres + pgvector hybrid search",
"family": "bundle-plugin",
"kind": "context-engine",
diff --cc package.json
index 1b30428333,385dc91b0b..1c6b8154b1
--- a/package.json
+++ b/package.json
@@@ -238,7 -238,7 +238,7 @@@
"bun": ">=1.4.0"
},
"license": "MIT",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"overrides": {
"@ai-sdk/provider-utils": "4.0.56",
"@hono/node-server": "^2.0.5",
diff --cc plugin-variants/gbrain-coding/.claude-plugin/plugin.json
index e7530db398,17fd6e0134..4b5d5b45e1
--- a/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/.codex-plugin/plugin.json
index f795dc6789,7ca46b70d3..618cb4081d
--- a/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-coding/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-coding",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant. (persona variant of the gbrain plugin — 21 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-coding/README.md
index 670e4d7e36,96163e3c03..b73dfd605b
--- a/plugin-variants/gbrain-coding/README.md
+++ b/plugin-variants/gbrain-coding/README.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-plugin-tree-stamp: 0.60.279.0 -->
-<!-- gbrain-plugin-tree-stamp: 0.60.284.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.285.0 -->
# gbrain-coding (generated persona variant — do not hand-edit)
Brain-first coding agent working inside a repo: retrieval, routing, ingest discipline, correction hygiene. Default persona for the claude-code harness bridge; also published as the gbrain-coding marketplace variant.
diff --cc plugin-variants/gbrain-daily/.claude-plugin/plugin.json
index d8f28e6f3e,87cf30da4e..5813ea39ca
--- a/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/.codex-plugin/plugin.json
index a29b6745a9,6cca0a6c3d..0fdfb2a699
--- a/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
+++ b/plugin-variants/gbrain-daily/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain-daily",
- "version": "0.60.279.0",
- "version": "0.60.284.0",
++ "version": "0.60.285.0",
"description": "Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant. (persona variant of the gbrain plugin — 20 skills)",
"author": {
"name": "Garry Tan",
diff --cc plugin-variants/gbrain-daily/README.md
index c02c6c77ce,6edbad773f..9b563526d5
--- a/plugin-variants/gbrain-daily/README.md
+++ b/plugin-variants/gbrain-daily/README.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-plugin-tree-stamp: 0.60.279.0 -->
-<!-- gbrain-plugin-tree-stamp: 0.60.284.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.285.0 -->
# gbrain-daily (generated persona variant — do not hand-edit)
Personal knowledge-brain daily use: meetings, tasks, briefings, reading, research. Published as the gbrain-daily marketplace variant.
diff --cc plugin/README.md
index b1a411f248,a8e2a0c9a3..bf1d1cb9e0
--- a/plugin/README.md
+++ b/plugin/README.md
@@@ -1,4 -1,4 +1,4 @@@
- <!-- gbrain-plugin-tree-stamp: 0.60.279.0 -->
-<!-- gbrain-plugin-tree-stamp: 0.60.284.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.285.0 -->
# gbrain plugin skill tree (generated — do not hand-edit)
This tree is the curated skill set for the gbrain Codex and Claude Code
diff --cc src/commands/doctor/registry.ts
index b4940094a2,97c383ac0a..09fe6363f9
--- a/src/commands/doctor/registry.ts
+++ b/src/commands/doctor/registry.ts
@@@ -121,8 -121,8 +121,9 @@@ import { renameIdentityDowngradesEntry
import { unindexedFilesEntry } from './checks/unindexed-files.ts';
import { purgeParkedPagesEntry } from './checks/purge-parks.ts';
import { missingRecordedFilesEntry } from './checks/missing-recorded-files.ts';
+import { overwrittenEditsEntry } from './checks/overwritten-edits.ts';
import { managedSyncMovementEntry } from './checks/managed-sync-movement.ts';
+ import { managedSyncLatencyEntry } from './checks/managed-sync-latency.ts';
import { managedSyncBlockedEntry } from './checks/managed-sync-blocked.ts';
import { atomHeldFailedEntry } from './checks/atom-holds.ts';
import { extractionInputTruncatedEntry } from './checks/extraction-input.ts';
diff --cc src/commands/repair.ts
index 1110faea73,d03e9d644c..72d02ef10d
--- a/src/commands/repair.ts
+++ b/src/commands/repair.ts
@@@ -128,14 -132,15 +132,15 @@@ With no kind, previews every kind. Run
Held files (the content lane, then the two-pass frontmatter repair): docs/guides/repair.md#held-files.
Malformed facts/takes fences (preview, apply, undo): docs/guides/repair.md#fences.
A write recovery blocked on unexpected_file_bytes: docs/guides/repair.md#stuck-recovery.
- Live pages whose canonical file is missing (ghost pages): docs/guides/repair.md#ghost-pages.`;
+ Live pages whose canonical file is missing (ghost pages): docs/guides/repair.md#ghost-pages.
+ Renames whose identity sync did not keep (rename-identity): docs/guides/live-sync.md#renaming-a-page.`;
- const BOOLEAN_FLAGS = new Set(['--apply', '--all', '--json', '--no-embed', '--include-ambiguous', '--diff', '--yes', '--no-llm', '--all-drifted', '--include-failures', '--force']);
- const VALUE_FLAGS = new Set(['--source', '--limit', '--expect', '--only', '--skip', '--slug', '--max-usd', '--prefer', '--request', '--class', '--since', '--keep', '--request-id', '--older-than']);
+ const BOOLEAN_FLAGS = new Set(['--apply', '--all', '--json', '--no-embed', '--include-ambiguous', '--diff', '--yes', '--no-llm', '--all-drifted', '--include-failures', '--force', '--close']);
+ const VALUE_FLAGS = new Set(['--source', '--limit', '--expect', '--only', '--skip', '--slug', '--max-usd', '--prefer', '--request', '--class', '--since', '--keep', '--request-id', '--older-than', '--from']);
/** Flags only some kinds accept, with the kinds that do. */
const KIND_FLAGS: Record<string, readonly string[]> = {
- '--only': ['frontmatter', 'fences', 'slug-conflicts', 'file-drift', CONTENT_LANE], '--skip': ['frontmatter', 'fences', 'slug-conflicts', 'file-drift', CONTENT_LANE], '--diff': ['frontmatter', 'fences', 'slug-conflicts', CONTENT_LANE], '--yes': ['frontmatter', 'conversation-labels', 'stuck-recovery', 'ghost-pages'],
- '--slug': ['fences', 'file-drift', 'overwritten-edits'], '--prefer': ['file-drift'], '--request': ['file-drift'], '--all-drifted': ['file-drift'], '--class': ['file-drift'], '--since': ['file-drift'],
+ '--only': ['frontmatter', 'fences', 'slug-conflicts', 'file-drift', CONTENT_LANE], '--skip': ['frontmatter', 'fences', 'slug-conflicts', 'file-drift', CONTENT_LANE], '--diff': ['frontmatter', 'fences', 'slug-conflicts', CONTENT_LANE], '--yes': ['frontmatter', 'conversation-labels', 'stuck-recovery', 'ghost-pages', 'rename-identity'],
- '--slug': ['fences', 'file-drift', 'rename-identity'], '--from': ['rename-identity'], '--close': ['rename-identity'], '--prefer': ['file-drift'], '--request': ['file-drift'], '--all-drifted': ['file-drift'], '--class': ['file-drift'], '--since': ['file-drift'],
++ '--slug': ['fences', 'file-drift', 'rename-identity', 'overwritten-edits'], '--from': ['rename-identity'], '--close': ['rename-identity'], '--prefer': ['file-drift'], '--request': ['file-drift'], '--all-drifted': ['file-drift'], '--class': ['file-drift'], '--since': ['file-drift'],
'--keep': ['stuck-recovery'], '--request-id': ['stuck-recovery'],
'--older-than': ['receipt-compaction'], '--include-failures': ['receipt-compaction'], '--force': ['receipt-compaction'],
};
diff --cc src/core/behavior-change-notice.ts
index c200d50da3,a93030b0d3..5a169d886f
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -766,8 -766,43 +766,45 @@@ export const BEHAVIOR_CHANGES: Readonly
{ since: '0.60.278.0', text: '`gbrain extract --stale --source <id>` now refuses with `invalid_params` naming `--source-id <id>` instead of running brain-wide; `--source fs` exits 2 `invalid_params` (it exited 1), and `--source db` refuses as ambiguous when a source is named `db`. Rendered extract fixes pin `--source-id`. The end-of-sync extraction nudge stays silent when doctor `links_extraction_lag` would not warn (attendance-blocked meetings no longer count), names both `gbrain extract --stale` and `gbrain extract --stale --catch-up` with estimates, and becomes a run-it-yourself step above two minutes; `extract --stale` JSON gains `actionable`, `attendance_blocked`, `mention_due` and `complete`; the per-source "still owe extraction" line counts only pages that sync imported; and an owner-delegated plain `extract --stale` keeps the 30-minute budget (`--catch-up` is carried through).' },
// #6712 #6887 (DB-only overwrite hotfix).
{ since: '0.60.279.0', text: 'On a managed brain an incremental `gbrain sync` no longer publishes a committed file edit over a page that was also edited in the database since its last import (for example a `put_page` with `sync.write_through` off). The file is held `file_drift` (side `both`) and the page keeps its edit; `gbrain repair file-drift --slug <slug>` previews both sides. A page deleted in the database is held the same way instead of being recreated from the file. A database change an import keeps (a tag, say) holds nothing: the edit imports and the tag stays. Before, only a first sync, `--full` or a failed delta guarded this case, and the plain sync overwrote the database edit with no hold.' },
- // #6712 follow-up (#6891): `since` is a placeholder equal to the branch's VERSION, restamped when the merge slot is called.
- { since: '0.60.279.0', text: 'New doctor check `sync_overwritten_db_edits` warns when an incremental managed sync published a committed file edit over a page that was also edited in the database since its last import, with no `file_drift` hold (the bug #6887 fixes): the database edit survives only in the page\'s history. It counts the pages per source from page history and write receipts (also after receipt compaction) and warns only when the records prove it; findings it cannot prove are counted as unknown. New explicit-only repair `gbrain repair overwritten-edits --source <id>` previews each page with a diff, and `--apply --expect <hash>` restores the edit as a new revision through a database-only `revert_version` bound to the previewed revision (a page that moved is `changed_since_preview`); it never rewrites the committed file. Only the host that owns the source\'s checkout compares that file and holds it `file_drift` when it differs from the restored page; on any other host the restore applies with the file left unheld (outcome `restored_file_unheld`), and the owner host runs `gbrain repair file-drift --source <id> --slug <slug> --prefer database` afterward to write the restored edit to the file (no command writes only the hold).' },
+ // Wave 4b W6 take grading. `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.
+ { since: '0.60.282.0', text: 'The dream cycle\'s take-grading phase (`grade_takes`) now asks its judge with prompt `hybrid-evidence-v2`: evidence about a different company, person or product whose name only resembles the one in the claim no longer counts toward a verdict. An answer with prose around its JSON, or a repeated answer that agrees, now parses instead of failing (two answers that disagree are still no verdict). Verdicts are cached per prompt version, so the next cycles grade each eligible take once more, within the phase\'s budget (`cycle.grade_takes.budget_usd`, default $3 a run). Auto-resolve stays off, so no take\'s resolution changes. New: `gbrain takes grades` lists the cached verdicts for review and marks judges the take-grading eval has not measured.' },
+
+ // Wave 18 lane 1 (#6778 #6761 #6791 #6773).
+ { since: '0.60.284.0', text: 'Facts absorb now waits for its write up to the job deadline instead of 5 s. A write still committing is logged `write_pending_accepted` and writer contention before admission `write_deferred_unadmitted`; neither counts toward the doctor\'s facts_extraction_health threshold, and persistent contention gets its own warning (`gbrain sources writer status --source <id> --json`).' },
+ { since: '0.60.284.0', text: 'facts_extraction_health reports its 24 h failure count as history (rolling, with an ages-out time) and separately names facts-absorb jobs still dead, with `gbrain jobs retry <id>` as the fix; it no longer suggests raising `facts.absorb_warn_threshold`, and the thresholds are unchanged.' },
+ { since: '0.60.284.0', text: 'A `claude-cli` answer that Claude Code continued after hitting its output cap is now rebuilt in full from the call\'s event stream (the CLI runs with `--verbose`) instead of returning only the text after the continuation as a complete answer. When the full text cannot be proven, the call returns no text and no tool calls, finishes `length` (callers retry or escalate as for any capped answer) and reports `providerMetadata[\'claude-cli\'].code = \'continuation_unproven\'` with reason `events_missing`, `no_assistant_events` or `segments_unmatched`, and one stderr line per reason per process naming its remedy (upgrade the claude CLI for the first two, raise the caller\'s output cap for the third).' },
+ { since: '0.60.284.0', text: 'Generated dream-cycle summaries now carry `created: <summary date>` in their frontmatter, so they pass `gbrain lint`\'s temporal check.' },
+ // Wave 18 lane 2 (#6743 #6739 #6755 #6729).
+ { since: '0.60.284.0', text: '`gbrain bootstrap harness` exits 14 (`bootstrap_cleanup_pending`, JSON `status: "cleanup_pending"`) instead of 0 when the harness is wired but earlier shared-skills enrollments or carried previous token ids are not cleaned up yet, and `--status` exits 14 instead of 1 for the same state; the JSON gains a per-id `cleanup` list and a `fix`. Each carried token id is now revoked on its own once no enrollment holds it, and an old enrollment whose token was already revoked finishes its local cleanup and counts as left (`credential_revoked`) instead of blocking every revocation. Doctor `bootstrap_harness_health` names each id as revoked (cleanup pending) or active and recommends leave before revoke.' },
+ { since: '0.60.284.0', text: 'The first Claude Code `user-prompt` hook in a new working folder now records heartbeat outcome `ok` with prompt-only context instead of `degraded` / `transcript_unreadable`: Claude Code creates `~/.claude/projects/<project>/` only after that prompt, so a transcript whose project folder does not exist yet reads as absent, the same as a not-yet-written transcript (#5465). It applies only when the missing folder is a direct child of an existing folder inside the projects root and the path has no `..` segment; any other missing path still fails closed. A missing transcript at `session-end` is still reported as degraded.' },
+ { since: '0.60.284.0', text: 'On a Postgres brain with no sync.repo_path, the v0.11.0 migration no longer runs `gbrain autopilot --install` during an upgrade. Phase F is recorded as skipped (reason no_repo_path) with the exact install command (the default source\'s path when it has one), the migration completes instead of wedging after three partial runs, and `gbrain doctor` shows a minions_migration line with that command until an autopilot is installed for the brain. A brain already wedged on v0.11.0 by partials that failed only the install phase is cleared automatically on the next apply-migrations run when its sync.repo_path is unset (a \'retry\' row with reason phase_f_no_repo_path is appended to migrations/completed.jsonl); with sync.repo_path set the --force-retry advice stands. Phase F ledger entries now carry a reason code (no_repo_path, autopilot_already_installed, install_failed). Separately, a direct `gbrain autopilot --install` with no --repo and no sync.repo_path now installs for the default source\'s local_path instead of refusing. Wedged-migration advice now names migrations/completed.jsonl (phases[].detail) instead of upgrade-errors.jsonl.' },
+ { since: '0.60.284.0', text: 'New explicit-only repair kind `gbrain repair rename-identity --source <id>` for an inexact Git rename that sync split into a delete plus an add (#6729). Without `--slug` the preview lists the open pairs with their preview commands. `--slug <new-slug>` (and `--from <old-slug>` when two pairs share it) previews one pair and binds both page ids, both revisions and the disposition into its hash; `--apply --expect <hash> --yes` (destructive consent; without `--yes` a non-interactive run exits 3 with the consent payload) carries the old page id onto the new slug with its version history, timeline, links, facts and aliases, imports the new file onto it as an edit and retires the provisional page (soft-deleted under a purged slug). Facts of both pages survive or the carry refuses `fact_rows_collide` before writing. Carrying identity is classic-only: on a managed source the preview states `managed_remedy_unavailable` and names `--close`, and an apply refuses with that code. `--close` settles the pair and moves nothing, on both kinds of source. Both settle the record (`disposition` remedied or closed), which releases the purge hold. `--all`, the maintenance cycle and the remediation plan never run it.' },
+ { since: '0.60.284.0', text: 'The #6729 sync report, `gbrain sync status --json` (`identity_downgrades[].remedy`) and doctor `rename_identity_downgrades` now name each open pair\'s remedy: the `gbrain repair rename-identity` preview argv, the apply argv bound to the plan hash, `consent: ["destructive"]` and what releases the purge hold. On a managed source the remedy is `--close` (`carry_unavailable: "managed_remedy_unavailable"`), because carrying identity is unavailable there. Doctor\'s fix is the first pair\'s apply (`ask_user`, with `preview_argv` and `plan_hash`); `gbrain restore <old-slug> --source-id <id> --force` stays the named alternative wherever the source admits a restore (`restore_available`, so not on an unbound Postgres source with a checkout); there the remedy is the only fix doctor offers, and `restore_unavailable_sources` lists those sources.' },
+ // Wave 18 lane 3 (#6740 #6742 #6720 #6731 #6764).
+ { since: '0.60.284.0', text: 'The entity mention scan no longer reads text inside HTML comments, so the `<!--- gbrain:... -->` fence markers stop producing `mentions` links to a page titled like a marker word (#6740). `MENTION_EXTRACTOR_VERSION` is now 6: the next `gbrain extract --stale` (or maintenance cycle) rescans every inline-body page once and removes the stale plain mention rows; `typed_ner` edges are untouched and segmented pages stay deferred as before. Entity cards and `get_backlinks` show a mention coverage notice (state `pending`) until that rescan finishes.' },
+ { since: '0.60.284.0', text: 'The bundled `gbrain-base-v2` schema pack (the `init` default, also inherited by `company-brain`) is now version 1.4.0 and declares the `question` page type the pinned-question writer stamps, so a pinned question no longer makes doctor `schema_pack_consistency` warn `page_type_undeclared` (#6742). Existing question pages keep their type; no data changes. The active pack identity reads `[email protected]+<hash>`.' },
+ { since: '0.60.284.0', text: 'A page-derived atom now carries its source page\'s content date as frontmatter `date` (the source\'s stored `effective_date`, else the same precedence import uses), so its `effective_date` is the date of the conversation or note it came from instead of the extraction run (#6720); `extracted_at` stays the processing stamp and transcript-derived atoms are unchanged. Atoms extracted before this release keep their run dates until re-extracted (`gbrain dream --phase extract_atoms` with `--force` re-pays the model); a preview-first backfill repair is planned.' },
+ { since: '0.60.284.0', text: '`gbrain extract-conversation-facts` (and the `conversation_facts_backfill` cycle phase) now tells the extractor which entities the conversation page itself links (its frontmatter attendees and the entity pages its body links, same source, up to 40 slugs), so facts about those people and companies are stored on their pages instead of a guess from a first name (#6731). A private entity is hinted only when the run writes private facts. The `extract_facts` operation\'s prompt and 5-hint cap are unchanged.' },
+ { since: '0.60.284.0', text: '`gbrain extract-conversation-facts` (and the `conversation_facts_backfill` cycle phase) now runs the free write-time subject inference on facts the extractor returns without an entity, so a fact naming exactly one entity page in full is stored on that entity (context note `entity inferred from mention`; off with `facts.entity_inference false`) (#6764). Doctor `unlinked_facts` counts the conversation extractor\'s unlinked rows on their own (origin `conversation`, no longer inside fence-owned) and, because `gbrain facts relink` never examines them, its fix is a bounded, source-qualified re-extraction of the pages with the most (`--slugs`, up to 50, `--force --max-cost-usd <N>` with the approved amount as the input `N`, preview `--dry-run`; paid, asks the user first). A `replaces` naming a conversation-derived fact now says to re-extract its page instead of hinting at a fence edit.' },
+ { since: '0.60.284.0', text: 'New `gbrain facts relink --conversation` links the conversation extractor\'s facts that were stored without an entity, for free: a fact naming exactly one entity page in full is linked (context note `entity relinked from mention`), one write per page (a receipted coordinator request on a managed brain), no model call (#6764). Doctor `unlinked_facts` now prescribes it first for those rows (consent none, the agent runs it, preview `--dry-run`); a fact it cannot resolve is recorded (`fact_relink_attempts` outcome `conversation_unresolved`), and only then does the doctor offer the paid re-extraction of its page, capped at the amount the user approves (`--max-cost-usd <N>`). A re-extraction of the page keeps a relinked fact\'s entity on the claim\'s new row. Rows the free pass could not resolve no longer count toward doctor\'s 25% new-fact warning. Once a page was re-extracted on its current content, doctor stops offering the paid re-extraction for it and lists the facts left for linking by hand (`--entity`); editing the page offers it again.' },
+ // Wave 18 lane 4 (#6725 #6723 #6724).
+ { since: '0.60.284.0', text: '`volunteer_context` and the retrieval reflex now point at one page per name per source: when a meeting, transcript or note page shares an entity page\'s exact title, the pointer goes to the explicit exact slug, then the linkable entity type, then anything else, as `entity` already chose (#6725). The choice runs after the privacy and activation gate, so a private or withheld entity page falls back to the readable page, and same-title pages in different sources are still both volunteered.' },
+ { since: '0.60.284.0', text: '`entity` and `context_pack` now resolve names across every source the caller can read, like `volunteer_context` (#6723): the home source first (the connection\'s source, or its GBRAIN_SOURCE / .gbrain-source binding), then the other readable sources sorted by id. A name only another readable source holds now returns a card instead of `found: false`; a name the home source holds still resolves there. `source_id` pins one source (refusals match `recall`: `scope_denied`, `not_found`, `invalid_params`), `context_pack` takes source-qualified `entity_refs`, and every card, `names` row and suggestion carries `source_id`. A bound connection\'s lookups that its own source misses get a `source_binding_narrowed` notice naming where each name resolved. Sources outside the grant are never read; a remote `__all__` still resolves nothing. Each pack card\'s activation verdict, newer mentions, records, page status and pinned questions now come from its own source: a pinned question joins the pack only when its source and `scope_entity` match a packed card, and a requested name that packs no card no longer pulls in a pin by slug.' },
+ { since: '0.60.284.0', text: '`context_pack` now returns `entity_facts[]`, the packed entities\' own facts (up to 5 per card, newest first, read in the card\'s own source and visibility), each tagged with its card\'s `source_id` and `slug` and carrying `fact_id`, confidence, `attributed_to`, provenance and trust (#6724). `facts[]` is unchanged hot memory. `text` gains a `## Entity facts` section before hot memory, and a fact in both renders once. Under `budget_tokens` entity facts pack after cards and before hot facts; a remote caller still never sees a private fact.' },
+ // Wave 18 lane 5 (#6781 #6780 #6719 #6758 #6759 #6772 #6765 #6774 #6776 #6775).
+ { since: '0.60.284.0', text: 'A managed sync backlog that cannot be read is now movement_state unknown (unknown.reason backlog_read_failed) on sources status, writer status and doctor, never nothing_pending (#6781). Doctor managed_sync_not_moving warns with details.health unknown, and gbrain sources writer movement exits 1 with the new code movement_unknown (--warn-only still exits 0) where it used to exit 0. Rerun the movement command; if the read keeps failing, run gbrain doctor --json.' },
+ { since: '0.60.284.0', text: 'gbrain config set now accepts twelve keys gbrain already reads at runtime but refused as unknown (#6780), including facts.absorb_warn_threshold, think.trajectory_enabled, embedding_image_ocr_max_usd and agent.search_snippet_chars; a source scan guard keeps every getConfig key registered.' },
+ { since: '0.60.284.0', text: 'A terminal write failure with origin owner_exception no longer gets the database-trigger hint (#6719): it says the owner hit an unexpected exception, nothing was committed and the cause is unknown, and points at gbrain write-request <id> --json (error_detail) and the consumer log; an origin that names no database refusal stays unknown instead of being read as a trigger.' },
+ { since: '0.60.284.0', text: 'Every agent-contract event now records the gbrain version that wrote it (#6758). When doctor agent_contract warns, details.builds splits the counted events into this_build, other_builds and unknown_build, details.incident is historical when none came from the running build, and the message names how many another build recorded. The warning and its 7-day window are unchanged.' },
+ { since: '0.60.284.0', text: 'Doctor persistence_counter_drift now names each drifting scope\'s direction (overcharge for a positive delta, a bounded charge with no data lost; undercount for a negative one) and splits the receipts behind it into requests and topology_changes (#6759). The check is still read-only; there is no counter reconcile repair yet.' },
+ { since: '0.60.284.0', text: 'An embedding error from a provider that reports one input over the model\'s context with a 5xx or no HTTP status (llama.cpp "larger than the max context size", Ollama 500 "input length exceeds the context length") is no longer retried as transient (#6772): the bad chunk is isolated, its siblings embed, and the over-length heal splits it. Only explicit token or context-limit wording counts; "input queue is too long", connection-limit and other 5xx errors still retry.' },
+ { since: '0.60.284.0', text: 'Writer coordination lock path fallback (#6765): when a checkout contains GBRAIN_HOME (or is it), its native writer lock no longer lands inside the checkout; a claim places it under GBRAIN_COORDINATION_HOME (absolute, outside the checkout), else ~/.gbrain/persistence, in a directory namespaced by the checkout and host, and refuses with storage_error when even that resolves inside the checkout. Ordinary layouts keep persistenceHome()/locks, and a path a reservation already records always wins. A writer transfer keeps the recorded lock (successor reservation first, then the host binding) instead of recomputing it from the accepting process\'s home. A reservation an older release wedged with its lock inside the checkout ("must live outside the canonical checkout") is repaired by the next claim on the host that reserved it. Who: brains whose source checkout contains GBRAIN_HOME, and container deployments. What to do: in a container, set GBRAIN_COORDINATION_HOME to a mounted directory outside the checkout so the lock survives recreation; re-run the claim on a wedged source; gbrain sources writer status --json shows onboarding.sources[].coordination_lock (path, rule, old_path_wedge, and coordination_home_ignored when GBRAIN_COORDINATION_HOME names another directory than the recorded lock, which wins; doctor coordination_lock_location warns about the same case).' },
+ { since: '0.60.284.0', text: 'A graduation intent marker that recorded a boot id or PID namespace this process cannot read now reads unknown, not alive, so a marker from another host or container is never taken as a live run because a local process shares its pid (#6774).' },
+ { since: '0.60.284.0', text: '`scripts/eval-spend-guard.sh` runs the guarded command in its own process group and stops the whole group (helpers and grandchildren included) on an interrupt, after the kill grace, and when the command exits leaving processes behind. A terminal stdin is now EOF (the command cannot read the terminal from its own group); pipe or redirect input if it needs any (#6776).' },
+ { since: '0.60.284.0', text: 'While its command runs, `scripts/eval-spend-guard.sh` keeps a run lease in `<ledger>.leases/<run_id>.lease` (run id, guard pid, process group id, host, boot id) and removes it once the run is reconciled. When a guard was SIGKILLed and its process group may still be running, the next guard on that host prints a STALE RUN report on stderr with the lease path, the pgid and the commands to inspect it (ps -o pid,pgid,cmd -g <pgid>) and stop it (kill -TERM -- -<pgid>), appends a cost-0 status "unknown" ledger row (stale_run_id, pgid, lease) and renames the lease to .reported; a later start retires a .reported lease once its group has exited or the host rebooted (or remove it by hand). Nothing is killed automatically, and the stale run\'s reservation stays counted at its estimate (#6776).' },
+ { since: '0.60.284.0', text: '`gbrain claw-test` runs each phase in its own process group: a phase timeout, SIGINT and SIGTERM stop everything the phase started, and SIGINT stops the running phase even when it was not sent from the terminal (a second SIGINT kills it) (#6775).' },
++ // #6712 follow-up (#6891).
++ { since: '0.60.285.0', text: 'New doctor check `sync_overwritten_db_edits` warns when an incremental managed sync published a committed file edit over a page that was also edited in the database since its last import, with no `file_drift` hold (the bug #6887 fixes): the database edit survives only in the page\'s history. It counts the pages per source from page history and write receipts (also after receipt compaction) and warns only when the records prove it; findings it cannot prove are counted as unknown. New explicit-only repair `gbrain repair overwritten-edits --source <id>` previews each page with a diff, and `--apply --expect <hash>` restores the edit as a new revision through a database-only `revert_version` bound to the previewed revision (a page that moved is `changed_since_preview`); it never rewrites the committed file. Only the host that owns the source\'s checkout compares that file and holds it `file_drift` when it differs from the restored page; on any other host the restore applies with the file left unheld (outcome `restored_file_unheld`), and the owner host runs `gbrain repair file-drift --source <id> --slug <slug> --prefer database` afterward to write the restored edit to the file (no command writes only the hold).' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --cc src/core/persistence/preview-approval.ts
index fe6c3e9669,c0934ce930..78d44c4d22
--- a/src/core/persistence/preview-approval.ts
+++ b/src/core/persistence/preview-approval.ts
@@@ -40,7 -40,7 +40,7 @@@ export const PREVIEW_APPROVAL_OP = 'rep
/** The default `purgeStaleCheckpoints` TTL; an older approved set may already be gone. */
export const APPROVAL_MAX_AGE_DAYS = 7;
- export type PreviewApprovalCommand = 'authorize-legacy' | 'jobs-cancel' | 'stale-atoms' | 'extractor-facts' | 'conversation-labels' | 'captured-facts' | 'loop-facts' | 'ontology-facts' | 'failed-writes' | 'split-facts' | 'frontmatter' | 'fences' | 'slug-conflicts' | 'managed-sync-orphans' | 'frontmatter-keys' | 'file-drift' | 'stuck-recovery' | 'ghost-pages' | 'receipt-compaction' | 'accepted-takes' | 'overwritten-edits';
-export type PreviewApprovalCommand = 'authorize-legacy' | 'jobs-cancel' | 'stale-atoms' | 'extractor-facts' | 'conversation-labels' | 'captured-facts' | 'loop-facts' | 'ontology-facts' | 'failed-writes' | 'split-facts' | 'frontmatter' | 'fences' | 'slug-conflicts' | 'managed-sync-orphans' | 'frontmatter-keys' | 'file-drift' | 'stuck-recovery' | 'ghost-pages' | 'receipt-compaction' | 'accepted-takes' | 'rename-identity';
++export type PreviewApprovalCommand = 'authorize-legacy' | 'jobs-cancel' | 'stale-atoms' | 'extractor-facts' | 'conversation-labels' | 'captured-facts' | 'loop-facts' | 'ontology-facts' | 'failed-writes' | 'split-facts' | 'frontmatter' | 'fences' | 'slug-conflicts' | 'managed-sync-orphans' | 'frontmatter-keys' | 'file-drift' | 'stuck-recovery' | 'ghost-pages' | 'receipt-compaction' | 'accepted-takes' | 'rename-identity' | 'overwritten-edits';
export interface ApprovedSetKey {
command: PreviewApprovalCommand;
diff --cc src/core/repair/core.ts
index 9308cb72a5,f964f7a3cb..fdfad3c642
--- a/src/core/repair/core.ts
+++ b/src/core/repair/core.ts
@@@ -37,7 -37,7 +37,7 @@@ import { acceptedPendingReceipt } from
import { repairAdmissionWindow, repairPublicationOwner, settleRepairReceipts, type PendingRepair } from './settle.ts';
import { RECEIPT_RESERVATION_FLOOR } from '../persistence/receipt-bytes.ts';
- export const REPAIR_KINDS = ['timeline', 'visibility', 'safe-chunks', 'contextual-mode', 'connector-checkpoints', 'request-indexes', 'connector-fences', 'take-supersession', 'accepted-takes', 'orphan-bindings', 'embedding-effects', 'attribution-backfill', 'planner-stats', 'google-file-modes', 'stale-atoms', 'extractor-facts', 'conversation-labels', 'captured-facts', 'loop-facts', 'ontology-facts', 'orphan-children', 'failed-writes', 'split-facts', 'frontmatter', 'fences', 'slug-conflicts', 'timeline-comments', 'managed-sync-orphans', 'frontmatter-keys', 'file-drift', 'stuck-recovery', 'ghost-pages', 'receipt-compaction', 'aliases', 'overwritten-edits'] as const;
-export const REPAIR_KINDS = ['timeline', 'visibility', 'safe-chunks', 'contextual-mode', 'connector-checkpoints', 'request-indexes', 'connector-fences', 'take-supersession', 'accepted-takes', 'orphan-bindings', 'embedding-effects', 'attribution-backfill', 'planner-stats', 'google-file-modes', 'stale-atoms', 'extractor-facts', 'conversation-labels', 'captured-facts', 'loop-facts', 'ontology-facts', 'orphan-children', 'failed-writes', 'split-facts', 'frontmatter', 'fences', 'slug-conflicts', 'timeline-comments', 'managed-sync-orphans', 'frontmatter-keys', 'file-drift', 'stuck-recovery', 'ghost-pages', 'receipt-compaction', 'aliases', 'rename-identity'] as const;
++export const REPAIR_KINDS = ['timeline', 'visibility', 'safe-chunks', 'contextual-mode', 'connector-checkpoints', 'request-indexes', 'connector-fences', 'take-supersession', 'accepted-takes', 'orphan-bindings', 'embedding-effects', 'attribution-backfill', 'planner-stats', 'google-file-modes', 'stale-atoms', 'extractor-facts', 'conversation-labels', 'captured-facts', 'loop-facts', 'ontology-facts', 'orphan-children', 'failed-writes', 'split-facts', 'frontmatter', 'fences', 'slug-conflicts', 'timeline-comments', 'managed-sync-orphans', 'frontmatter-keys', 'file-drift', 'stuck-recovery', 'ghost-pages', 'receipt-compaction', 'aliases', 'rename-identity', 'overwritten-edits'] as const;
export type RepairKind = typeof REPAIR_KINDS[number];
export interface RepairScope { brain_id: string; source_ids: string[] }
diff --cc src/core/repair/registry.ts
index f8770580da,64c728eb7b..11c94cba73
--- a/src/core/repair/registry.ts
+++ b/src/core/repair/registry.ts
@@@ -68,7 -68,7 +68,8 @@@ import { stuckRecoveryRepair } from './
import { ghostPagesRepair, GHOST_CONSENT_TEXT, GHOST_CONSEQUENCES, GHOST_PURGE_FUSE_HOURS } from './ghost-pages.ts';
import { receiptCompactionRepair } from './receipt-compaction.ts';
import { aliasesRepair } from './aliases.ts';
+ import { renameIdentityRepair, RENAME_IDENTITY_CONSENT_TEXT } from './rename-identity.ts';
+import { overwrittenEditsRepair } from './overwritten-edits.ts';
import { ERROR_CATALOGUE, catalogueError } from '../error-catalogue.ts';
import type { OperationError } from '../ops/contract.ts';
@@@ -355,14 -355,16 +356,24 @@@ const SPECS: Record<RepairKind, Omit<Re
+ 'of a page that still exists is never touched. Each target slug is rechecked under its page lock; coordinated maintenance write on a managed '
+ 'brain, no journal admission. Runs only when named.',
},
+ 'rename-identity': {
+ handler: renameIdentityRepair, embeds: 'none', checks: ['rename_identity_downgrades'], explicit_only: true, preview_bound: true, consent: 'destructive',
+ consentText: RENAME_IDENTITY_CONSENT_TEXT,
+ summary: 'Carry the page identity across an inexact Git rename that sync split into a delete plus an add (#6729): the operator picks the pair '
+ + '(--source <id> --slug <new-slug>, --from <old-slug> when two pairs share it); without --slug the preview lists the open pairs and their '
+ + 'preview commands. --apply --expect <hash> --yes moves the old page id to the new slug (version history, timeline, links and facts stay on it), '
+ + 'imports the new file onto it as an edit, retires the provisional page purge-style (soft-deleted, nothing hard-deleted) and records the '
+ + 'old -> new redirect; fence rows that would collide refuse fact_rows_collide before anything is written. --close releases the purge hold and '
+ + 'moves nothing. Carry is classic-only: on a managed source the preview states managed_remedy_unavailable, an apply refuses with it, and --close is the remedy. Runs only when named.',
+ },
+ 'overwritten-edits': {
+ handler: overwrittenEditsRepair, embeds: 'effect', checks: ['sync_overwritten_db_edits'], explicit_only: true, preview_bound: true,
+ summary: 'Restore database edits an incremental managed sync overwrote with a committed file edit and no file_drift hold (#6712, fixed by #6887). '
+ + 'Only what the records prove: a database-only revision (its receipt published no file) archived by a managed-sync import that wrote different '
+ + 'content, with no later revision holding the edit again. The preview shows a diff of the live page against the edit; --apply --expect <hash> '
+ + 'reverts each page to that version through a revision-bound, database-only revert_version, then holds the committed file file_drift when it '
+ + 'differs, so sync never publishes it over the edit. Narrow with --slug. Runs only when named.',
+ },
};
export const REPAIR_REGISTRY: readonly RepairKindSpec[] = REPAIR_KINDS.map(kind => ({ kind, ...SPECS[kind] }));
diff --cc templates/bootstrap/template-repo/README.md
index 13bea9c7fe,22c4ccaa2a..a8e9d7e83a
--- a/templates/bootstrap/template-repo/README.md
+++ b/templates/bootstrap/template-repo/README.md
@@@ -1,6 -1,6 +1,6 @@@
# gbrain agent workspace — template
- <!-- gbrain-template-stamp: 0.60.279.0 -->
-<!-- gbrain-template-stamp: 0.60.284.0 -->
++<!-- gbrain-template-stamp: 0.60.285.0 -->
This repository is the **"Use this template"** distribution artifact for a
[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same
diff --cc test/fix-wave-5-integration.test.ts
index db8329cd61,309ef84f4e..adad04540a
--- a/test/fix-wave-5-integration.test.ts
+++ b/test/fix-wave-5-integration.test.ts
@@@ -196,8 -196,7 +196,8 @@@ for (const backend of testBackends())
const previews = { 'accepted-takes': 'gbrain repair accepted-takes', 'google-file-modes': 'gbrain repair google-file-modes', 'stale-atoms': 'gbrain repair stale-atoms', 'extractor-facts': 'gbrain repair extractor-facts',
'conversation-labels': 'gbrain repair conversation-labels', 'captured-facts': 'gbrain repair captured-facts', 'loop-facts': 'gbrain repair loop-facts', 'ontology-facts': 'gbrain repair ontology-facts', 'orphan-children': 'gbrain repair orphan-children', 'failed-writes': 'gbrain repair failed-writes', 'split-facts': 'gbrain repair split-facts',
frontmatter: 'gbrain repair frontmatter', 'timeline-comments': 'gbrain repair timeline-comments', 'managed-sync-orphans': 'gbrain repair managed-sync-orphans', 'frontmatter-keys': 'gbrain repair frontmatter-keys', 'file-drift': 'gbrain repair file-drift',
- 'stuck-recovery': 'gbrain repair stuck-recovery', 'ghost-pages': 'gbrain repair ghost-pages', 'receipt-compaction': 'gbrain repair receipt-compaction', aliases: 'gbrain repair aliases',
- 'stuck-recovery': 'gbrain repair stuck-recovery', 'ghost-pages': 'gbrain repair ghost-pages', 'receipt-compaction': 'gbrain repair receipt-compaction', aliases: 'gbrain repair aliases', 'rename-identity': 'gbrain repair rename-identity' };
++ 'stuck-recovery': 'gbrain repair stuck-recovery', 'ghost-pages': 'gbrain repair ghost-pages', 'receipt-compaction': 'gbrain repair receipt-compaction', aliases: 'gbrain repair aliases', 'rename-identity': 'gbrain repair rename-identity',
+ 'overwritten-edits': 'gbrain repair overwritten-edits' };
// The post-upgrade banner names both findings with the kind's read-only preview.
const banner = await postUpgradeRecoveryBanner(engine, 'host');
diff --cc test/postgres-unit-arms.txt
index f5d96e68fa,67e184aa67..3edb4a0484
--- a/test/postgres-unit-arms.txt
+++ b/test/postgres-unit-arms.txt
@@@ -126,7 -126,7 +126,8 @@@ test/managed-sync-row-parity.test.t
test/managed-sync-stale-group-head.test.ts
test/migration-persistence-request-id-index.test.ts
test/migration-persistence-request-slug-index.test.ts
+ test/on-commit-embedding.serial.test.ts
+test/overwritten-edits-6712.test.ts
test/owner-refusal.test.ts
test/pack-relation-direction-engine.test.ts
test/page-embedding-budget.test.ts
diff --cc test/repair-explicit-only.test.ts
index f6d1020813,c7c3a56ce1..71bda489a9
--- a/test/repair-explicit-only.test.ts
+++ b/test/repair-explicit-only.test.ts
@@@ -24,7 -24,7 +24,7 @@@ import { REPAIR_HELP, parseRepairArgs,
import { _resetCliExitVerdictForTests, currentExitCode } from '../src/core/cli-force-exit.ts';
import { withEnv } from './helpers/with-env.ts';
- const EXPLICIT: RepairKind[] = ['accepted-takes', 'google-file-modes', 'stale-atoms', 'extractor-facts', 'conversation-labels', 'captured-facts', 'loop-facts', 'ontology-facts', 'orphan-children', 'failed-writes', 'split-facts', 'frontmatter', 'timeline-comments', 'managed-sync-orphans', 'frontmatter-keys', 'file-drift', 'stuck-recovery', 'ghost-pages', 'receipt-compaction', 'aliases', 'overwritten-edits'];
-const EXPLICIT: RepairKind[] = ['accepted-takes', 'google-file-modes', 'stale-atoms', 'extractor-facts', 'conversation-labels', 'captured-facts', 'loop-facts', 'ontology-facts', 'orphan-children', 'failed-writes', 'split-facts', 'frontmatter', 'timeline-comments', 'managed-sync-orphans', 'frontmatter-keys', 'file-drift', 'stuck-recovery', 'ghost-pages', 'receipt-compaction', 'aliases', 'rename-identity'];
++const EXPLICIT: RepairKind[] = ['accepted-takes', 'google-file-modes', 'stale-atoms', 'extractor-facts', 'conversation-labels', 'captured-facts', 'loop-facts', 'ontology-facts', 'orphan-children', 'failed-writes', 'split-facts', 'frontmatter', 'timeline-comments', 'managed-sync-orphans', 'frontmatter-keys', 'file-drift', 'stuck-recovery', 'ghost-pages', 'receipt-compaction', 'aliases', 'rename-identity', 'overwritten-edits'];
let engine: PGLiteEngine;
const home = mkdtempSync(join(tmpdir(), 'gbrain-repair-explicit-'));