Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/master' into gbra133-pr2a
garrytan555e5485c90d
diff --cc src/core/behavior-change-notice.tsindex dd09e85d37,60a47a2a6e..1dad7f7551--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -960,13 -960,13 +960,20 @@@ export const BEHAVIOR_CHANGES: Readonly// Fix wave 20 integration: one mention rescan for #6843 and #6958.{ since: '0.60.312.0', text: '`MENTION_EXTRACTOR_VERSION` is now 7, so the next `gbrain extract --stale` (or maintenance cycle) rescans every inline-body page\'s mentions once: a Katakana name no longer matches inside a longer Katakana word (#6843), and a page of any type whose whole title is one generic word no longer collects mention links (#6958). Stale plain mention rows are removed by that rescan; `typed_ner` edges are untouched. Entity cards and `get_backlinks` show a mention coverage notice (state `pending`) until it finishes.' },{ since: '0.60.311.0', text: 'The dream `consolidate` phase no longer promotes a cluster in which two typed facts state the same metric, unit and period for the same effective time (an original amount and its correction recorded on one day, or the same statement twice). It used to keep the higher-confidence one as the take and close the other at its own instant, a zero-length validity that silently marked a real fact superseded. Such a cluster is now left unchanged: the phase reports `warn` with `details.clusters_held_same_instant` and `details.same_instant_clusters`, each with the fact ids and a next step (ask which statement is current, then `gbrain forget` the other). Facts an earlier run closed this way are listed by `gbrain repair consolidate-ties`, which reopens exactly the previewed ones on `--apply --expect <hash>`; nothing changes on upgrade.' },+ { since: '0.60.315.0', text: 'New `gbrain repair segmented-mirror [--source <id>]` for brains that ran a gbrain older than v0.60.299.0 with `pages.segmented_storage` on: on those versions a withdrawal (`forget`, `forget_fact`, `purge_fact`) of a row in a page stored in segments struck it in the database but left the page\'s canonical file holding it (the mirror skipped the page with `page_body_segmented`). Upgrading does not rewrite those files. Run the preview on the source\'s owner host: it lists each file-backed segmented page whose file still holds a withdrawn or purged row and otherwise matches the database, with the file\'s SHA-256 and size and those of the page\'s canonical render (`gbrain export`\'s bytes), and prints a hash; a file that also differs from the database for another reason is listed held (`file_database_drift`) and never rewritten. `--apply --expect <hash> --yes` rewrites each listed file to that render through the withdrawal mirror (one receipted write request per page, `operation: repair_segmented_mirror`) and its Git effect commits it; a file or page that changed since the preview refuses the apply with `preview_changed`, and so does a file (even a formatting-only edit) or render that changes after the apply but before the mirror rewrites it: the mirror leaves it as it is and the Git effect commits nothing for it. Doctor does not scan for these files (that needs every segmented file read), so run the preview once if this brain ever ran such a version.' },+ { since: '0.60.315.0', text: 'A publication or withdrawal-mirror recovery record of a version this gbrain does not know (one a newer gbrain wrote) is now refused with `recovery_version_unsupported` before anything reads it: the record, its staged files and the canonical file are left exactly as they are, the effect keeps retrying instead of parking, and `gbrain sources writer status` and a stalled sync name it as a blocker whose fix is `gbrain upgrade` on the owner host. Before, recovery could read a newer record as an older one: a withdrawal-mirror recovery published the bytes the record embedded, removed its staging file and cleared the record, and a request recovery tried to rewrite the record\'s staging (the database refused it with an untyped `unsupported_mutation_protocol`). v0.60.290.0 and older still read a version 2 withdrawal-mirror record as version 1 and fail every attempt with an untyped `effect_unavailable` while the record holds every write and effect on the worktree; they never delete the record or its staging file, and an upgraded owner finishes it.' },+ { since: '0.60.315.0', text: 'While a gbrain older than the segmented writer floor (v0.60.290.0 included) that doctor `segmented_storage` still warns about wrote to the brain in the last 7 days (another host, an older `serve` or worker still running on this host, or an older write this build has not matched; doctor names the host), a withdrawal (`forget`, `forget_fact`, `purge_fact`) on a page stored in segments still commits, but its withdrawal mirror no longer writes a version 2 recovery record, which that older gbrain cannot read and would wedge the worktree on. The mirror refuses `segmented_mirror_writer_gate` (its fix names the hosts to upgrade), retries, and parks after five attempts like any failed mirror, so writes on the worktree are not held; the page\'s canonical file keeps the withdrawn row and the withdrawal\'s Git effect waits meanwhile. Once the older writer is upgraded and out of the 7-day window, the parked mirror runs again by itself (checked at most once a minute), rewrites the file and the Git effect commits it. `gbrain sources writer retry-effects` retries it at any time. A hold left only by this host\'s own writes from before it upgraded, which the upgraded gbrain has since superseded with the same kind of write (doctor reports it as information), still keeps new pages inline but does not hold the mirror: an upgraded single-host brain mirrors withdrawals at once.' },+ { since: '0.60.315.0', text: 'A withdrawal (`forget`, `forget_fact`, `purge_fact`) of a claim in a facts fence that crosses a forced segment cut, when that one fence holds more than 16,384 rows (or more than 8 MiB of rows to check), is still refused `withdrawal_capacity` (the bound is unchanged), but the refusal now says why: it carries reason `split_fence_rows`, names the page, the fence\'s row count and the limit, and its fix asks you to split that fence into fences of at most 16,384 rows and write the page again. It used to say discovery "could not prove a bounded complete target set" and told you not to split the source.' },+ { since: '0.60.315.0', text: '`delete_page purge: true` (`gbrain delete --purge`) of a page stored in segments now also deletes, in the purge, the segment texts the page stopped referencing within the last hour, which used to stay in `page_segment_texts` until the hourly segment sweep removed them. A withdrawal (`forget`, `forget_fact`) followed by another write to the page (a delete and `restore_page` included) left the text that held the withdrawn row, with the page text around it, in that state, and the purge reported success. The purge also deletes every unreferenced segment text of the source that holds one of the page\'s claims (its facts, withdrawn ones included, and its takes), plain or as a facts-fence cell stores it, which covers a text another page\'s write reused after the page\'s own write record of it expired. `removed.page_segment_texts` in the purge receipt counts these texts too, and the receipt\'s `page_segment_texts` store checks for them. A text that an unpublished write of another page staged is still kept, as before for the texts the page referenced.' },+ { since: '0.60.315.0', text: '`purge_fact` (`gbrain forget <id> --purge`) of a claim containing `|` now also deletes the unreferenced segment texts that hold the claim as its facts-fence cell stores it (`|` escaped as `\\|`, a line break as `<br>`), in the purge. It matched only the claim\'s exact bytes, so after a withdrawal and another write to a page stored in segments (a delete and `restore_page` included) the text holding the old fence row stayed until the hourly segment sweep, and the receipt\'s `page_segment_texts` store did not report it. The receipt now probes both forms.' },+ { since: '0.60.315.0', text: 'A managed write the database interrupts under load is now retried with backoff instead of failing at the second interruption. A statement the database ends with a statement timeout or cancel (SQLSTATE 57014) and, new, a publication the owner cancels past `persistence.publication_ceiling_ms` (until now released and published again without limit, or on Postgres sometimes failed `storage_error` at once) count against their own budget, `persistence.max_transient_retries` (default 5, 0 to 20), instead of `persistence.max_preparation_attempts`: each one schedules the request\'s next claim after 1 s, 2 s, 4 s, 8 s, then 15 s (stored on the request, so nothing is held while it waits; `gbrain sources writer status` names the waiting head `transient_backoff`), and the interruption after the last retry ends it `failed` with `write_interrupted` as before. Its receipt names the interruptions (`attempts`), the retry limit (`limit`, `limit_key`), the cause (`statement_cancel` or `publication_ceiling`) and the SQLSTATE. An interruption of a grouped publication (a `put_pages` batch, a managed import batch or a sync lane group) counts against every member of the group, and a member already charged an interruption is claimed and published on its own from then on, so a batch that overruns only as a whole still commits page by page. Preparations cut off at their deadline still count against `persistence.max_preparation_attempts` alone, and lock timeouts, serialization failures, deadlocks and lost connections are still never counted. `persistence.preparation_deadlines false` turns this counting and the backoff off with the deadlines. Upgrading adds two columns to `persistence_requests` (migration v261, no rewrite of existing rows).' },+ // GBRA-133 PR 2a (commit triggers that never drop a commit). `since` is restamped at the merge slot.+ { since: '0.60.315.0', text: 'With `sync.on_commit` on, the commit watcher now runs in every resident (gbrain serve, serve --http, gbrain jobs work and the autopilot daemon; one owns it per host), watches classic sources last synced on this host as well as managed ones, starts a sync as soon as a quiet HEAD moves (the fixed 3 s debounce is now a 400 ms trailing window, `GBRAIN_NOTIFIER_QUIET_MS`), and keeps a source due across failed or refused starts with retries at 5 s, 15 s, 1 min and 5 min (`notifier_stalled` after that). `GBRAIN_NOTIFIER=0` turns it off per process; `sync.on_commit.sources` excludes sources.' },+ { since: '0.60.315.0', text: 'A sync request is now recorded before it runs and is never dropped: `gbrain sync trigger` answers queued, coalesced or nudged (with `--json`; still `job_id=N` on stdout when a job is queued, exit 0) and adds the notice `no_resident` with the fix when nothing watches the source, a second GitHub push while the first job waits joins it instead of being ignored for 30 s, and requests are drained by residents even with `sync.on_commit` off. A push for a managed source answers 409 `refresh_required` with the `gbrain sources refresh` fix instead of queueing a sync that cannot import it.' },+ { since: '0.60.315.0', text: 'Search and query responses carry a `freshness` entry per source (current, behind, syncing, unknown or not_monitored, the observed HEAD and time, the detection mode and the held-file count), read from the notifier\'s record without a git call, once `sync.on_commit` is on or a resident has observed a source (otherwise search output is unchanged).' },+ { since: '0.60.315.0', text: 'The autopilot daemon dispatches a freshness sync when a checkout\'s HEAD differs from the commit its source last synced, at the next tick instead of after the 5-minute wall-clock interval (which stays as the backstop), once per HEAD and never in the middle of a rebase or merge; classic and managed sources alike. With `sync.on_commit` on, the daemon also reads every checkout\'s HEAD between ticks (every 3 s, git only; `GBRAIN_AUTOPILOT_HEAD_PROBE_MS`) and queues the sync within seconds.' },+ { since: '0.60.315.0', text: 'On Postgres, `gbrain jobs work` starts a persistence consumer at boot (#7002), so queued persistence effects drain after a `serve` stops even while the worker is idle. It joins the existing election: with `persistence.single_consumer` on it waits beside a live owner and takes over when that owner stops; with the switch off (the default) a worker beside a `serve` runs its own full consumer, as every resident process already does, and doctor `two_consumers_on_host` lists it. A queued sync job now wakes an idle worker at once: LISTEN on a direct session (one extra connection), a 1 s sync-queue read behind a transaction pooler; `GBRAIN_WORKER_SYNC_WAKE=0` turns it off.' },+ { since: '0.60.315.0', text: '`gbrain autopilot --status` grades a running daemon from its own schedule (#7003): the daemon writes `autopilot.heartbeat.json` beside its lock with its next tick, so a healthy daemon on a long adaptive sleep no longer reads `stale` (exit 1); a missing or outdated sidecar falls back to the interval-flag rule. `--status --json` adds `stale_after_source` (`daemon` or `flag`) and `next_tick_at`.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */