Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/master' into gbra133-effect-claim-release
garrytan333e9f193da5
diff --cc src/core/behavior-change-notice.tsindex d49f870c2c,3b005962f7..cc08929a45--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -1190,11 -1190,8 +1190,13 @@@ export const BEHAVIOR_CHANGES: Readonly{ since: '0.60.411.0', text: '`gbrain doctor` no longer counts a check that did not finish within the run\'s budget as a warning in `health_score` or the category scores. The report counts those checks in `unknown_count`, a category with no finished check is listed in `unknown_scores` instead of scoring 100, and the status stays at warnings, never healthy. `derived_visibility` now runs as its own check right after the cheap incident checks, so it no longer waits on the wave checks\' budget.' },// #7236 (GBRA-151). `since` is stamped at the merge slot.{ since: '0.60.414.0', text: 'An autopilot tick reads the brain health aggregate once (it used to read it twice), and on Postgres the read is bounded at 120 s. A read that runs out reports `health_degraded` (an NDJSON event under `--json`) and the tick runs with an unknown score: no healthy sleep, no score-forced full cycle before the hourly floor, the base interval, and `brain_score: null`. The timeout is not counted as a failed cycle.' },+ // Held deletions and legacy unknown-side holds (GBRA-133 wave 4b).+ { since: '0.60.415.0', id: 'held_deletion_hold_release', text: '`gbrain repair file-drift --prefer file` on a held `file_gone` page now clears its `file_drift` hold when it soft-deletes the page (`hold_cleared` in the receipt), and the next managed sync pass that stamps releases any deleted-side `file_drift` hold whose page is no longer live and whose file is gone. Unknown-side `file_drift` holds written before #7340 are screened once more and import a Git edit when the page still holds its file at the baseline commit.' },+ // Dead-owner effect-claim release (GBRA-133).+ { since: 'TBD', id: 'dead_owner_effect_claims', text: 'On Linux with Postgres, when a gbrain process is killed while it runs a Git, embedding, links, facts or withdrawal-mirror effect, another consumer on the same machine now takes that effect over within about 5 s, instead of after the effect\'s 2-minute claim lease (the same rule #6650 gave write claims). An owner on another machine or container, an owner whose process this one cannot inspect, and an effect holding a recovery record wait as before. A takeover cannot apply an effect twice: the old claim\'s outcome writes are refused, and Git and mirror effects still wait for the worktree lock while the old owner holds it.' },+ // Side-unknown file_drift holds and the pending-import fix (GBRA-133). `since` is stamped at the merge slot.- { since: 'TBD', id: 'legacy_validate_stamp_drift', text: 'A page an older gbrain imported, whose database copy carries the v0.13.1 grandfather stamp `validate: false` that its file lacks, is no longer held `file_drift` when its file is committed again: sync compares and imports such a file the way a page write already did (#6429), so the first sync records the page and a later commit imports, and the page keeps the stamp. A `file_drift` hold that has no import record now says it cannot tell whether the file or the database changed, instead of saying the page changed in the database. Holds already open are re-screened as before (`gbrain sources retry-held <source>`).' },++ { since: 'TBD', id: 'legacy_validate_stamp_drift', text: 'A page an older gbrain imported, whose database copy carries the v0.13.1 grandfather stamp `validate: false` that its file lacks, is no longer held `file_drift` when its file is committed again: sync compares and imports such a file the way a page write already did (#6429), so the first sync records the page and a later commit imports, and the page keeps the stamp. A `file_drift` hold that has no import record now says it cannot tell whether the file or the database changed, instead of saying the page changed in the database. A hold already open stays held, because its baseline commit has moved past the edit: preview it with `gbrain repair file-drift --source <source> --held --side unknown --prefer file` (writes nothing) and apply the set the user approves.' },+ { since: 'TBD', id: 'pending_import_owner_safe_fix', text: 'A write refused because its page\'s file holds a committed Git change sync has not imported yet (`pending_import`) no longer tells the caller to run `gbrain sync --source <source> --no-pull`. A running sync owner (`gbrain serve`, autopilot or a sync job) imports the commit on its own, and a second sync beside it competes with that owner. The fix of every such refusal, `put_page` included, is now the read-only `gbrain sync status --source <source> --json`, and the frozen `remember` refusal carries that fix too.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */diff --cc src/core/persistence/sync-page-fault.tsindex 6fbd5ecd14,a38be8f21a..9f07b49a87--- a/src/core/persistence/sync-page-fault.ts+++ b/src/core/persistence/sync-page-fault.ts@@@ -147,14 -147,11 +147,14 @@@ function base(entry: HoldEntry, slug: sexport function fileDriftHold(entry: HoldEntry, slug: string, pageId: number | null, intent: Pick<SyncIntent, 'content' | 'blobOid'>,observed: { sides: 'database' | 'both' | 'unknown'; revision: string | null; proof: PageChangeProof | null; sharedOrigin: boolean }): HeldEntry {const by = observed.proof ? `${observed.proof.operation} request ${observed.proof.request_id} wrote page ${slug} straight to the database` : `page ${slug} changed in the database`;- const file = observed.sides === 'database' ? 'its file did not change in Git' : observed.sides === 'both' ? 'its file changed too'- : 'there is no import record to tell which side changed';+ const file = observed.sides === 'database' ? 'its file did not change in Git' : 'its file changed too';+ // GBRA-133: with no import record and no database write on record, nothing shows the database side changed.+ const held = observed.sides === 'unknown' && !observed.proof+ ? `page ${slug} differs from its file and has no import record to tell whether the file or the database changed`+ : `${by} since the file was last imported and ${observed.sides === 'unknown' ? 'there is no import record to tell whether the file changed too' : file}`;return base(entry, slug, pageId, 'file_drift',- `${entry.path}: ${by} since the file was last imported and ${file}, so sync held the import instead of overwriting the database version; the rest of the source synced.`,+ `${entry.path}: ${held}, so sync held the import instead of overwriting the database version; the rest of the source synced.`,- intent.content ?? null, intent.blobOid, { sides: observed.sides, ...(observed.sides !== 'database' ? { side: observed.sides } : {}), ...(observed.revision ? { page_revision: observed.revision } : {}),+ intent.content ?? null, intent.blobOid, { sides: observed.sides, drift_version: FILE_DRIFT_VERSION, ...(observed.sides !== 'database' ? { side: observed.sides } : {}), ...(observed.revision ? { page_revision: observed.revision } : {}),...(observed.proof ? { competing_request_id: observed.proof.request_id, competing_operation: observed.proof.operation } : {}),...(observed.sharedOrigin ? { shared_origin: true as const } : {}) });}