Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge origin/master into capy/gbra177-maintenance-wave
garrytan428188b46261
diff --cc src/core/behavior-change-notice.tsindex 0d105c7d18,801dd58800..888576ac1e--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -1097,23 -1097,8 +1097,25 @@@ export const BEHAVIOR_CHANGES: Readonly{ since: '0.60.359.0', text: 'A `gbrain repair <kind> --apply` that the database refuses mid-run (deadlock 40P01, serialization failure 40001, a lost connection) now stops with a result (`stopped.reason` `database_contention` or `connection_lost`, the SQLSTATE in its message, what it applied, and the command that resumes from the refused item) instead of ending with an error and, under `--json`, no record of what it applied. A SIGTERM or SIGHUP (an outer timeout, a closed terminal) stops the apply before its next item with `stopped.reason: interrupted` and the same result; a second signal exits at once.' },// #7190 (GBRA-150): per-source applied-through watermark. `since` is stamped at the merge slot.{ since: '0.60.361.0', id: 'applied_watermark_7190', text: '`get_write_request` with `applied: true` (`gbrain write-request <id> --applied`) now returns `applied`, read live: whether the write is searchable yet (`searchable_yet`, `searchable`, `state`), the gap (`requests_ahead`, `unembedded_chunks`), the request `sequence` and the source\'s write watermark (`indexed_through`, `committed_through_request`, `requests_pending`), and a pending write\'s hint names that read; a write\'s own reply is otherwise unchanged. `gbrain sources status --json`, MCP `sources_status` and `gbrain sync --json` add a `watermark` per source: `indexed_through` (the last commit a finished sync pass reached; a deadline-stopped or partial pass never moves it), `embedded_through` (held pages count as not embedded), `committed_through_request`, `pending` (requests, commits and files behind HEAD, held files, withheld deletes) and `writer_heartbeat` (the drain-lease holder and its last progress).' },+ // #7292 (GBRA-133: brain-added fences on unmanaged connector pages). `since` is stamped at the merge slot.+ { since: '0.60.363.0', text: 'On a brain without managed persistence, a Google connector re-render now carries the page\'s `## Facts` and `## Takes` fences (added by loop extraction or `remember`) into the file and the database, as the managed connector already did; before, the re-render dropped them and the next `extract_facts` expired those facts. A contact or email page whose database copy holds a facts fence its checkout file lacks is no longer held `file_database_drift`: the file holds no edit the database lacks, so the re-render replaces it and writes the fence back. A page already held that way imports on its next attempt (a new upstream change, or `gbrain sources retry-held <id>`). A file with a real edit is still held, and a stored fence the render cannot carry verbatim refuses `connector_fence_below_timeline` (preview the fix with `gbrain repair connector-fences --source <id>`).' },+ // #7306 / #7305 (GBRA-177): pinned-question output cap; hyphen-run slugs at write time. `since` is stamped at the merge slot.+ { since: 'TBD', text: 'A pinned-question refresh whose answer does not fit the output cap no longer fails as `refresh_failed:provider_error` (or `model_output_not_json` after a second metered call): it fails `refresh_failed:answer_too_long:<cap>` after one call, the receipt\'s `blocked_reason` is `answer_too_long` with a fix naming the new key `cycle.standing_questions.max_output_tokens` (default 2000, the old fixed cap), and the `standing_questions` cycle phase skips that pin (reported `blocked:answer_too_long`) until the cap is raised instead of spending on it every cooldown. `gbrain questions refresh <id>` still runs when asked.' },+ { since: 'TBD', text: 'A put_page or capture of a new slug with a hyphen run or a segment-final hyphen (three hyphens between `notes/x-1900` and `2000-ab`, or `notes/x-`) is refused with `invalid_params` (detail `slug_hyphen_run`) naming the folded slug (`notes/x-1900-2000-ab`), the slug import and sync derive from its file. A page that already exists under such a slug still updates, and its response carries `slug_advisory`. New doctor check `slug_path_mismatch` counts live pages whose slug their recorded file path does not derive and warns when the file lacks the `slug:` line that keeps the page, naming the read-only `gbrain repair frontmatter --source <id>` preview.' },+ // #7311 / #7305 (GBRA-177): retention purge of a shared-origin tombstone. `since` is stamped at the merge slot.+ { since: 'TBD', text: 'The 72 h retention purge (the autopilot purge phase, `gbrain pages purge-deleted`) now removes a soft-deleted page whose canonical file another live page of its source records (a duplicate deleted with receipt `write_through.skipped: shared_origin`) database-only: its row, chunks, links and facts go; the file and the surviving page stay, and no content or fact tombstone is written. It used to refuse every run as a shared origin, so the purge phase failed each pass (`managed_purge_failed`), `global_maintenance_stalled` never cleared and the tombstone parked after 5 failures. A tombstone parked by that refusal is retried once by the first purge run after the upgrade and purged then. An owner `gbrain delete <slug> --purge` of such a page still refuses (it would tombstone the survivor\'s content), and on a soft-deleted page it now names the retention purge instead of a soft delete. Nothing changes on upgrade.' },+ { since: 'TBD', text: 'A purge park (a soft-deleted page the purge stopped retrying after 5 failed purges) now records the gbrain version that wrote it. The first purge run of another version (the autopilot purge phase, the purge job, `gbrain pages purge-deleted`) tries such a park once more, so a park whose cause the upgrade fixed clears by itself instead of waiting for `--retry-parked`; a failure parks it again under the new version, so each version tries it at most once. A park written before parks recorded a version counts as another version\'s. Doctor `purge_parked_pages` counts only parks the running version wrote. `--retry-parked` is unchanged.' },+ // #7307 (GBRA-177). `since` is stamped at the merge slot.+ { since: 'TBD', text: 'With System One triage (the decide `triage` slot) acting, the Dream synthesize phase and `gbrain dream retriage` no longer send a transcript to the decide provider when the verdict cache already holds a verdict for that exact content from today\'s LLM triage (the current triage model and triage version), so transcripts the LLM triage judged after a borderline decide answer are not re-judged and paid for every pass. A borderline (margin hold) decide answer is now cached for 24 hours: the transcript goes to today\'s LLM triage, and decide is not asked again for it in that time even when the LLM step ran out of its `dream.triage.max_ms` window. A transcript in unreliable-verdict backoff is not sent to decide either until its backoff ends. `gbrain dream retriage --force` still re-judges everything.' },+ { since: 'TBD', text: 'Brain-wide maintenance stamps `autopilot.last_global_at` past a synthesize triage deferral that has stopped making progress: when the number of transcripts triage leaves for the next pass did not shrink across three passes in a row, the fourth pass stamps (the job result lists it under `pass_completed_with_failing_phase`), as it already did for a phase failing the same way. While the deferred count keeps shrinking, the stamp is still withheld. Doctor `global_maintenance_stalled` names `gbrain dream retriage` (preview with `--dry-run`; it asks before paid spend) for a deferral streak instead of rerunning the phase, which stops at the same time window.' },+ { since: 'TBD', text: '`gbrain dream retriage` triages the same transcript list as the synthesize phase: on a brain with `dream.synthesize.conversation_pages true` and no `session_corpus_dir` it no longer refuses with config_error, and on a brain with a corpus dir and conversation pages left on by default it now also re-scores and reconciles those conversation pages (from source `default`, or the source named by `--source`). Judging stays behind the existing spend estimate and consent gate.' },+ { since: 'TBD', text: 'Brain-wide maintenance no longer stops every job at a phase that fails with a run-scoped error such as a missing table, `permission_denied`, `write_quota_exhausted` or `recovery_required` (before, each later job resumed at that phase and stopped again, so later phases never ran and `autopilot.last_global_at` was never stamped): the failure is that phase\'s `fail:<code>` streak and the job goes on to the next phase, so it backs off and is stamped past after three passes like any other failing phase. A lost connection or database contention still stops the job and the next job retries that phase first, at most three jobs in a row before it counts as the streak. A phase skipped for `insufficient_cycle_budget` after another phase ran in the same job now moves to the next job, where it runs first with the whole budget, instead of counting as a `budget` blocker on every pass; its skip no longer replaces its measured duration.' },+ { since: 'TBD', text: 'The Dream synthesize phase skips a transcript whose estimated synthesis cost alone exceeds `dream.synthesize.budget_usd` (reported as `over_budget_alone` in its skips), instead of deferring it and every transcript after it on every pass, which kept the synthesize cooldown and brain-wide maintenance from completing. Raise the cap or use a cheaper synthesis model to synthesize it. A cap of 0 still defers everything.' },+ { since: 'TBD', text: 'With the System One triage slot in shadow mode (or on without a calibration), Dream now asks the decide provider only about transcripts the LLM triage judged in that pass, not about every transcript whose verdict was already cached, so a shadow brain stops paying the provider for its whole backlog on every pass.' },+ { since: 'TBD', id: 'repair_provider_refusal_memo', text: 'Fence and content repair now treat a provider error that refuses the request\'s own input (a content-policy block, a prompt block, a context-length overflow) as `llm_refused`: the attempt memo records it and the same bytes are not sent again until the page, the model or the prompt changes. Timeouts, rate limits and server errors stay `llm_unavailable` and are retried on the next run.' },+ { since: 'TBD', id: 'concepts_hold_before_spend', text: '`synthesize_concepts` now checks an existing concept page before the model call: a page whose fences it cannot republish losslessly (`concept_preservation_hold`) or whose body is stored in segments (`page_body_segmented`) is listed under `publication_held` with no model spend, every cycle, and a segmented concept no longer stops the phase. A concept\'s failed-attempt count is cleared only after its narrative is published.' },+ { since: 'TBD', id: 'calibration_profile_unchanged_skip', text: '`calibration_profile` makes no model call and writes no new profile row when the holder\'s resolved count, Brier score, accuracy, partial rate and model all equal the latest stored profile (`skipped: unchanged_scorecard`); a new profile prompt takes effect at the next scorecard change.' },+ { since: 'TBD', id: 'grade_takes_window', text: '`grade_takes` now reads unresolved takes oldest-first, leaves takes too recent to grade (or with no date) out of its 50-take window, and puts takes with no verdict for the current prompt and judge ahead of graded ones, so with auto-resolve off older takes beyond the first 50 are graded on later passes. Its `too_recent` count now covers only takes whose date it could not read in SQL.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */diff --cc test/postgres-unit-arms.txtindex 566a246ae6,330083a6a4..98d02d7865--- a/test/postgres-unit-arms.txt+++ b/test/postgres-unit-arms.txt@@@ -72,7 -72,7 +72,8 @@@ test/fence-repair-receipts.test.ttest/forecast-journal.test.tstest/frontmatter-reserved-keys-6454.test.tstest/get-chunks-paging.test.ts+ test/google-connector-facts-fence-7292.test.ts+test/grade-takes-window.test.tstest/graduation-copy.test.tstest/graduation-digest.test.tstest/graduation-drain.test.ts