Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
#6708: CHANGELOG entry
garrytaned384e9b23f4
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5db984b093..2a1b86beab 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,33 @@ credits are retained; no result has been reassigned to another provider. Originaidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [0.60.232.0] - 2026-10-14++**MCP `list_write_conflicts` refuses a source outside the caller's grant and bounds its window to that source's own requests (#6643 follow-up).** A remote caller that named a source outside its grant used to get an empty report back. The response's `window` sequences were also brain-wide, so polling one granted source showed write activity in sources the caller cannot see. Both were found by GBRA-60's D5 agent smoke.++### Itemized changes++- **Out-of-grant `source_id`** (`src/core/ops/persistence.ts`): the op checks an explicit `source_id` with `resolveRequestedScope`, like the other source-scoped reads. A remote caller outside its grant gets `permission_denied`, whether or not the source exists.+- **Source-scoped window** (`src/core/persistence/drift-conflicts.ts`):+ - The window ends at the source's own newest request in its current incarnation, read through the `(source_incarnation, sequence)` index, and the scan reads only that incarnation.+ - A cursor naming a later sequence is clamped.+ - A source the caller may not read returns before anything is computed.+- **Tests:** `test/maintenance-file-drift-6643.test.ts` covers the refusal for a real and an unregistered source, a window that does not move when another source is written, and the clamped forged cursor. Each half fails on the previous code.++## [Unreleased]++**Writes stop failing at the cumulative quota wall (#6696).** A brain running autopilot hit `queue_capacity` on every write once its receipt bytes reached the 1.5 GiB principal cap, because every receipt held a 16 KiB reservation it never gave back and nothing warned before the wall. Receipts are now charged for what they keep, the defaults cover a year at 5,000 writes a day, background work pauses before the wall so your own writes keep working, and doctor, notices and `/metrics` say how many days are left.++### Itemized changes++- **Receipt true-up**: an admission reserves its request body plus 12 KiB (at least 16 KiB), so a 100 KB page reserves its 100 KB; once the last effect settles, `trueUpRequests` gives back what the receipt does not keep (in its own transaction after every settle path: the effect runner, embedding settle, the `embed --stale` bulk settle, effect retry and restore). Receipts compacted earlier give their excess back in one bounded pass.+- **Defaults and forecast**: principal caps 2,000,000 request ids and 16 GiB receipt bytes (brain 8,000,000 and 64 GiB), from the growth model in `docs/guides/concurrent-writes.md#growth-model`. `persistence_capacity` forecasts days to exhaustion from the full 7-day aggregate on the principal index; warn at 80% or 30 days, fail at 95% or 7 days (`persistence.capacity.warn_days`, `fail_days`).+- **Clear refusals**: a cumulative cap refuses `write_quota_exhausted` (reason `lifetime_ids` or `terminal_bytes`) with the host's `gbrain config set` raise; `queue_capacity` is only the outstanding-request cap. Background producers pause at `persistence.capacity.background_pause_pct` (80) with `write_capacity_backpressure`.+- **Warnings**: `[gbrain notice write_capacity_low]` on write and sync receipts (hourly per scope, muteable), sync status and cycle output; `write_capacity_backpressure` notice when the pause starts; admin `/metrics` gauges `gbrain_write_capacity_{used,limit,days_to_exhaustion}` with a documented alert rule.+- **Sync**: a capacity preflight refuses `write_quota_insufficient` before the first admission; a later cap refusal ends the drain `resumable` / `capacity_paused`.+- **Compaction**: `gbrain repair receipt-compaction` (explicit-only, preview-bound) compacts on demand, floored at the configured retention unless `--force`; compaction skips open sync runs and the newest sync receipt per worktree; the consumer records each pass (`persistence.maintenance.last_compaction`); doctor adds `persistence_compaction` and `persistence_counter_drift`.+- **Known-failing writes**: maintenance refuses a page whose canonical file is gone before admission (`canonical_file_missing`) and holds back a write refused three times in a day (`persistence.maintenance.refusal_breaker_threshold`); doctor `maintenance_write_drift` lists them.+## [0.60.230.0] - 2026-10-14**The entity-card latency test no longer fails on a busy CI machine while the card itself is fast (test and CI only, no product change).** The test checks that a card's p99 stays under 100 ms. On Ubicloud it failed at 107-125 ms whenever other memory-heavy tests shared its VM, or the hypervisor took CPU time from the guest, while the same calls took 36-41 ms run alone. It now measures the call's own thread CPU time, runs alone on its VM and re-times a call that hypervisor steal crossed. The 100 ms budget and every assertion are unchanged, and a 90 ms slowdown injected into the reference read still fails it.diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex 8f693db300..5e8aa3f72e 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -545,7 +545,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }// #6643 PR B (conflict pile).{ since: '0.60.217.0', text: '`synthesize_concepts` now checks each concept page against its canonical file before it calls a model or admits a write. A concept whose file differs from the database (`file_database_drift`) is skipped on every cycle, recorded in `dream.concepts.drift_skips` and released once the file and database agree, and the phase reports `warn` naming `gbrain sources reconcile <source> --brain host --audit --conflicts` and `gbrain repair file-drift`. Before, it paid for a narrative per drifted concept every cycle and left another `source_changed` conflict receipt.' },{ since: '0.60.217.0', text: 'A maintenance write (a dream-cycle page publication) to a page whose canonical file differs from the database now refuses `source_changed` with detail `file_database_drift` before admission and leaves no request row, instead of being admitted and ending as a conflict receipt. A replay of an earlier request with the same id still returns its receipt.' },- { since: '0.60.230.0', text: 'MCP `list_write_conflicts` now refuses a `source_id` outside the caller\'s grant with `permission_denied` (whether or not the source exists), like other source-scoped reads, instead of returning an empty report; its `window` sequences end at the source\'s own newest request (current incarnation) instead of the brain-wide newest, so they no longer reflect writes in other sources.' },+ { since: '0.60.232.0', text: 'MCP `list_write_conflicts` now refuses a `source_id` outside the caller\'s grant with `permission_denied` (whether or not the source exists), like other source-scoped reads, instead of returning an empty report; its `window` sequences end at the source\'s own newest request (current incarnation) instead of the brain-wide newest, so they no longer reflect writes in other sources.' },{ since: '0.60.217.0', text: 'Doctor has a new `maintenance_write_drift` check: it warns when pages behind recent `file_database_drift` conflict receipts (or recorded concept skips) still have a canonical file that differs from the database, and names the read-only `--audit --conflicts` listing and the explicit-only `gbrain repair file-drift` preview. New: `gbrain sources reconcile <source> --audit --conflicts`, MCP `list_write_conflicts` (read scope; database-derived fields only for remote callers) and `gbrain repair file-drift --prefer file|database`.' },// #6650 (fact-fence adoption exits). `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.{ since: '0.60.218.0', text: 'Fencing a legacy fact into a fence row a partial earlier run left behind now rebuilds that row from the stored fact: the published row carries the fact\'s own visibility, kind, validity, confidence and speaker attribution instead of the leftover cell\'s, a leftover private row is never reused for a world fact (the world fact gets its own row), and a newly fenced fact keeps its `attributed_to`. Before, a leftover row with a different visibility made the adoption refuse every time, a leftover row with the same visibility overwrote the fact\'s kind, dates and confidence, and every adoption cleared the fact\'s speaker attribution.' },