Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge origin/master (v0.60.152.0 #6439); restamp wave 11 to v0.60.153.0
time-attacke52e30135680
diff --cc .claude-plugin/plugin.jsonindex b98700cf76,b98700cf76..883369811b--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@@ -1,6 -1,6 +1,6 @@@{"name": "gbrain",-- "version": "0.60.152.0",++ "version": "0.60.153.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.jsonindex c908e5cfb3,c908e5cfb3..ae624d357e--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@@ -1,6 -1,6 +1,6 @@@{"name": "gbrain",-- "version": "0.60.152.0",++ "version": "0.60.153.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.mdindex a56187b931,a56187b931..2a57be8872--- a/BOOTSTRAP_FOR_AGENTS.md+++ b/BOOTSTRAP_FOR_AGENTS.md@@@ -1,4 -1,4 +1,4 @@@--<!-- gbrain-runbook-stamp: 0.60.152.0 -->++<!-- gbrain-runbook-stamp: 0.60.153.0 --><!-- This stamp must equal the VERSION file at every release; CI enforces it(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it tothe installed binary and warns on skew. -->diff --cc CHANGELOG.mdindex 766c96dc4a,385039505b..a6b34fd988--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,33 -10,21 +10,48 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).- ## [0.60.152.0] - 2026-10-10++## [0.60.153.0] - 2026-10-10++**A repeated query in a long-running `gbrain serve` no longer waits on the embedding provider: about 110–150 ms faster per repeat, and 75 of 100 provider embed calls avoided on a realistic mix. Cold `search`, `query` and `stats` start 100–175 ms faster on both engines. Doctor's `eval_drift` stops paying 0.2–0.4 s per run on a freshly cloned or just-pulled source checkout. Rankings and output are unchanged.**++Efficiency wave 11 (GBRA-75). Base is master at wave 10 (c8d513eeb). Measured on 4-vCPU / 16 GiB cloud machines with synthetic brains, base and branch interleaved in one session, p50 / p95.++| Path | Engine, brain, N | Before | After |+|---|---|---|---|+| MCP `query`, repeat of an earlier query (live Voyage embed + rerank) | Postgres 5k, N=25 | 483 / 530 ms | 370 / 427 ms |+| same | Postgres 50k, N=25 | 504 / 557 ms | 359 / 441 ms |+| same | PGLite 5k, N=25 | 462 / 531 ms | 312 / 399 ms |+| provider embed calls, 100-query Zipf mix of 40 queries | all three brains | 100 | 25 |+| cold `gbrain search` | PGLite 5k / 50k, N=20 | 704 / 754, 739 / 769 ms | 604 / 642, 622 / 655 ms |+| same | Postgres 5k / 50k, N=20 | 477 / 550, 515 / 579 ms | 355 / 429, 392 / 442 ms |+| cold `gbrain stats` | PGLite 50k / Postgres 50k, N=20 | 987 / 1061, 584 / 633 ms | 855 / 902, 437 / 499 ms |+| modules loaded before connect, `search` | PGLite 5k | 1021 | 667 |+| `eval_drift` probe, racy index (fresh 10.5k-file clone) | 3 clones × 6 runs | 224–457 ms every run | one 400–1045 ms run, then 18–35 ms |+| same, settled index | 6 runs | 22–32 ms | 17–28 ms |++PGLite cold start stays about 170–200 ms above Postgres: `PGlite.create` boots the WASM backend and its vector and pg_trgm extensions on the main thread, and the catalog needs those extensions at boot.++### Itemized changes++- **Query-embedding cache** (`ai/query-embed-cache.ts`, `gateway.ts` `embedQuery`). Identical query embeds within one process reuse the vector: a 512-entry LRU with a 10-minute TTL, keyed by recipe, resolved model id, `base_urls` override, effective dimensions and the exact string sent (query prefix + text). Only resolved vectors are stored, as copies; aborts and failures are never cached. Every gateway reconfigure clears it, and a caller under an AI invocation guard (minion spend authorization, delegated spend) always goes through its guard. Document-side embeds are uncached. A deterministic-provider fixture shows byte-identical ranked lists with and without the cache on both engines. Expansion variants never repeat within one call (deduped already); across calls the expansion LLM output is not cached, so a variant embed is reused only when the LLM returns the same string.+- **Cold start** (`operation-load.ts`, `operation-loaders.generated.ts`, `remote-mcp-error.ts`, `embedding-disabled.ts`, `ai/gateway.ts`, `ops/admin.ts`). The CLI loads only the module that defines the op it runs, finalized by the same area-and-redaction step the registry uses; the MCP client, evidence delivery, the `ai` SDK and `page-mutations` load on first use. Trust proposal decisions load their handlers at the reader, and a test classifies every load-time registry and diffs it per op against the full registry.+- **`eval_drift`** (`eval/drift-watch.ts`). A working-tree diff that takes 75 ms or more means racily-clean index entries, which git re-hashes on every diff until the index is rewritten; the probe then runs `git update-index -q --refresh` once. A settled checkout skips it. The answer is unchanged, and a held `index.lock` is ignored.++ ## [0.60.152.0] - 2026-10-10++ **Remote fact writes apply the same visibility filter as reads.**++ `forget` and `remember` called by a remote agent now apply the same visibility filter as remote fact reads. The trusted local CLI is unchanged, and nothing needs doing after you upgrade.++ ### Itemized changes++ - Remote `forget` applies the same visibility filter as reads, through its trust guard, the withdrawal it records and the similar facts it lists.+ - Remote `remember` applies the same visibility filter in its duplicate checks and in `replaces`.++ ### For contributors++ - `test/remote-fact-write-private-provenance.test.ts` covers the fix on PGLite, and on Postgres through `test/e2e/remote-fact-write-private-provenance-postgres.test.ts`.+## [0.60.151.0] - 2026-10-10**A visibility filter fix for remote fact reads.**diff --cc VERSIONindex 3912113ff4,3912113ff4..1ced212a83--- a/VERSION+++ b/VERSION@@@ -1,1 -1,1 +1,1 @@@--0.60.152.0++0.60.153.0diff --cc openclaw.plugin.jsonindex d80a39910e,d80a39910e..f31a19a605--- a/openclaw.plugin.json+++ b/openclaw.plugin.json@@@ -1,7 -1,7 +1,7 @@@{"id": "gbrain-context-engine","name": "gbrain",-- "version": "0.60.152.0",++ "version": "0.60.153.0","description": "Personal knowledge brain with Postgres + pgvector hybrid search","family": "bundle-plugin","kind": "context-engine",diff --cc package.jsonindex 8a32791553,ca7527b33f..271ac3ec1d--- a/package.json+++ b/package.json@@@ -231,7 -230,7 +231,7 @@@"bun": ">=1.4.0"},"license": "MIT",-- "version": "0.60.152.0",++ "version": "0.60.153.0","overrides": {"@ai-sdk/provider-utils": "4.0.56","@hono/node-server": "^2.0.5",diff --cc plugin-variants/gbrain-coding/.claude-plugin/plugin.jsonindex 046607f23c,046607f23c..c568010078--- 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.152.0",++ "version": "0.60.153.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.jsonindex 9220e07b5c,9220e07b5c..cbe870f5ec--- 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.152.0",++ "version": "0.60.153.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.mdindex 9dc4ece04b,9dc4ece04b..a32eca76c6--- 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.152.0 -->++<!-- gbrain-plugin-tree-stamp: 0.60.153.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.jsonindex 028a69566d,028a69566d..972172d035--- 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.152.0",++ "version": "0.60.153.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.jsonindex 6bd3b1ef04,6bd3b1ef04..1d99ee7940--- 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.152.0",++ "version": "0.60.153.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.mdindex b62230d353,b62230d353..7c73953a55--- 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.152.0 -->++<!-- gbrain-plugin-tree-stamp: 0.60.153.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.mdindex a25be9a24d,a25be9a24d..657576e03c--- a/plugin/README.md+++ b/plugin/README.md@@@ -1,4 -1,4 +1,4 @@@--<!-- gbrain-plugin-tree-stamp: 0.60.152.0 -->++<!-- gbrain-plugin-tree-stamp: 0.60.153.0 --># gbrain plugin skill tree (generated — do not hand-edit)This tree is the curated skill set for the gbrain Codex and Claude Codediff --cc templates/bootstrap/template-repo/README.mdindex b129f8a882,b129f8a882..f15decfbb4--- 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.152.0 -->++<!-- gbrain-template-stamp: 0.60.153.0 -->This repository is the **"Use this template"** distribution artifact for a[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same