Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge origin/master (3001fd9a5, #6473) into wave 14 PR4 rebuilt from c18d92a35 without #6447; migration stays v236; stamp 0.60.167.0 (GBRA-40 reorder)

garrytancbdaf053a3e9
diff --cc .claude-plugin/plugin.json
index a29d71675e,a29d71675e..6382e20a1b
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
-- "version": "0.60.166.0",
++ "version": "0.60.167.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.json
index 84f9b95790,84f9b95790..d6fbe051ea
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "gbrain",
-- "version": "0.60.166.0",
++ "version": "0.60.167.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.md
index dd9d0d157b,dd9d0d157b..4d986d4141
--- a/BOOTSTRAP_FOR_AGENTS.md
+++ b/BOOTSTRAP_FOR_AGENTS.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-runbook-stamp: 0.60.166.0 -->
++<!-- gbrain-runbook-stamp: 0.60.167.0 -->
<!-- This stamp must equal the VERSION file at every release; CI enforces it
(scripts/check-bootstrap-tag.sh). `gbrain bootstrap status` compares it to
the installed binary and warns on skew. -->
diff --cc CHANGELOG.md
index 1beeec6f48,500d276d44..3b8f56ed04
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,45 -10,14 +10,54 @@@ credits are retained; no result has bee
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
- ## [0.60.166.0] - 2026-10-11
++## [0.60.167.0] - 2026-10-11
+
+**Wave 14 PR4: the Google connector, open loops, contacts, calendar, Windows and polish.** Gmail loops now find the person page wherever it lives in the brain, extraction runs under a daily spend cap and your own label exclusions, contacts land next to your people pages, and three Windows reports (parked tests, console windows, backups) get native coverage on CI.
+
+### Google connector and open loops
+
+- **Loops find the person across sources (#5504).** A Gmail source's loop names someone whose page lives in `default:people/<slug>`; resolution now runs in the mail's own source first and then across sources by identity only (the exact email as a page alias, or an `entity_identities` canonical member; names never cross, ties stay unresolved). The loop row records the page's source (`open_loops.counterparty_source_id`, migration `open_loops_counterparty_source`, v236), the `owes_to` / `awaiting_reply_from` edge points there, and the entity card, `gbrain waiting` and `open_loops` read the loop from that page and never from a namesake in another source. The commitment fact stays in the connector source.
+- **Daily spend cap on loop extraction.** `loops.extraction_max_usd_per_day` (default $2.00, per UTC day, brain-wide): every `loops_extract` job a sweep or the managed catch-up queues shares the day's spend group through the job spend envelope; an attempt the cap cannot admit is refused before the provider call and a sweep at the cap queues nothing (`daily_spend_cap`; `spend_cap_zero` when the user set 0).
+- **Your own label exclusions (#5445).** Per-source `g_loops_exclude_labels` (`gbrain sources add … --loops-exclude-labels`) with the brain-wide `loops.extraction_exclude_labels` as the fallback; label names are resolved once per sweep and gate all three eligibility sites, the execution-time check and grace-hold publication, plus the deterministic detector. A name that does not resolve fails closed for new paid extraction (`excluded_label_unresolved`, visible in the sweep counters and retried every sweep). Contributed by @furuchanchan. Supersedes #5524.
+- **Contacts next to your own people (#4845, #6158).** `g_contacts_dir` (default `people`, `--contacts-dir`) decides where a Google contact page renders; an existing page is renamed in place (import the new path, then retire the old one). A connector stub yields to its canonical twin in another source under `link_resolution.cross_source`, and doctor `junk_entity_hubs` names the twin and the exact remedy instead of an open policy question.
+- **Calendar window reconciles on `--full` (#5442).** `g_future_days` (`--future-days`) bounds the forward window and a `--full` sync reconciles events that moved out of it through the mass-delete guard.
+- **Progress ticks per contact and event (#5349)**, and the sweep's shared Gmail category gate (#5103) applies the same bulk-mail rule to Gemini notes and the deterministic detector.
+- `loops_extraction_skipped` in the error registry explains every sweep skip reason (`gbrain errors loops_extraction_skipped`).
+
+### Windows
+
+- **Lease identity is the token (#6028).** `apply-migrations` and every other `gbrain_cycle_locks` lease refresh/release by `(id, holder_pid, acquisition_token)`; the `acquired_at` epoch text, whose session-fragile form made a runner refuse its own lease as `migrations_running` naming its own pid, is diagnostics only.
+- **Two files no longer park `bun test` (#5332).** `endPoolBounded`'s guard timer stays ref'd while the race is pending (an unref'd timer was dropped before the await came back), and the spawned-CLI persistence test races every child against one wall-clock timer that fails with the argv instead of waiting on a pipe. Both files run on the `windows-latest` row.
+- **Backups (#5312).** The archive write → read → cluster-extract round trip runs natively on the `windows-latest` row; the backup guide tells a hand copier to copy the tree, not just the files. The PGLite `dumpDataDir` ENOENT on Windows stays open.
+- **No console windows from detached processes (#4992).** `src/core/spawn.ts` launches subprocesses with `windowsHide: true` by default (an explicit `false` is kept; only `openBrowser` uses it), and the minions supervisor, worker, child runner, readiness probe, isolation, registry and shell handler, the Stop-hook push, `cli/main.ts`, the hook heartbeat, the backup check, `cli-force-exit`, `cli-preflight`, the autopilot lock and commands and `bounded-child-exec` go through it now. `scripts/check-windows-hide.ts` (in `verify`) is a ratchet: a new direct launch fails unless its file is in `NOT_YET_MIGRATED` (89 files today), and a listed file that moves onto the seam must drop its entry. `test/windows-hidden-console.test.ts` proves it natively on the `windows-latest` row (the unhidden control launch must show a window first, or the run fails as `windows_console_gate_unsupported`). Contributed by @rokas-tarasevicius (PR #6105). The remaining sites keep their windows until they migrate.
+
+### Polish
+
+- **`lint` stops inventing `created:` (#5433).** `missing-created` fires only when none of `created`, `event_date`, `date`, `published`, `captured_at`, `ingested_at` parses, is never fixable, and `--fix` (the cycle's lint phase included) no longer copies ingest time into `created`; pages that got one that way keep it.
+- **`add_tag` / `remove_tag` defer embedding (#5251).** Tags are not chunk text, so the prepared import reuses stored vectors; the ~1.5 s republication cost in the issue is not addressed and the issue stays open.
+- **`bootstrap verify` always removes its probe pages (#6001)**, early exits included; the guide says `bootstrap_last_verify` is silent when no snapshot exists.
+- **agent-voice defaults to `sonic-3.6` (#5905)**; `CARTESIA_MODEL_ID` overrides.
+- **Admin Dashboard pauses its 30 s poll while the tab is hidden (#5061)** and refreshes once on return (`admin/src/lib/visibility-poll.ts`; `admin/dist` and `src/admin-embedded.ts` rebuilt).
+- **Superseded push records (#5799 residual).** `isSupersededPushStatus` / `livePushStatuses` in `workspace-push.ts` drop a `writer_coordinator_required` record and any record whose root is a managed worktree now; the `gbrain hook user-prompt` FAILING banner and the SessionStart push note read only the live records, so a managed root's stale refusal no longer announces a failing push.
+
+### Things to watch
+
+- `test/db-lock-fencing.test.ts` and `test/cycle-lock-steal.serial.test.ts` simulate a steal by rotating the acquisition token (what a real successor does) instead of only moving `acquired_at`; a rewrite of `acquired_at` under a live holder is now, deliberately, not a steal.
+- `test/junk-entity-guards.test.ts`'s #6158 pin changed from "open policy question" (`operator_judgement`) to a concrete remedy; `test/google-source-reconcile.test.ts`'s calendar reconcile pin flipped from "events outside the window stay" to "they reconcile on `--full`".
+- `test/lint-3958.test.ts`, `test/managed-lint.test.ts`, `test/managed-phase-matrix.test.ts` and `test/cycle-lint-durability.test.ts` relied on the `created:` promotion as their one fixable issue and were updated deliberately (#5433).
+
+### For contributors
+
+- New tests: `test/loops-counterparty-null-entity.test.ts` (+ Postgres arm), `test/loops-exclusion.test.ts`, `test/loops-extract-spend-cap.test.ts`, `test/db-lock-token-predicate.test.ts` (+ Postgres arm, in the PgBouncer matrix), `test/backup-archive-roundtrip-5312.test.ts`, `test/spawn-windows-hide.test.ts`, `test/scripts/windows-hide-guard.test.ts`, `test/windows-hidden-console.test.ts`. The `add_link` per-endpoint source parameters were deferred (the composite-key path is not cleanly scoped yet).
++
+ ## [0.60.166.0] - 2026-10-11
+
+ **Fixes a flaky managed-sync governor test that turned master red after v0.60.165.0.**
+
+ ### Itemized changes
+
+ - `test/sync-drain-no-admission.test.ts` "a pass that commits keeps the governor quiet" failed when the event loop stalled 60 ms or more at pass start (or one 25 ms timer fired late), so the governor's 10 ms interval woke first and stopped the pass before the first commit. The drain now takes an injected clock (`DrainInput.clock`, test seam, default `Date.now`), and the test advances it 25 ms per committed page while the governor keeps ticking on real timers. The assertion is unchanged. Two forced probes are now part of the test: an 80 ms synchronous loop stall at pass start (failed the old test 5/5) and an 85 ms real delay before the first page (failed it 3/3). A new control test shows the same governor still stops `no_admission` once the clock passes the window before a commit. The file's two hung-pass tests only wait for a stop, so a late timer cannot fail them.
+
## [0.60.165.0] - 2026-10-11
**Managed sync stops instead of hanging, a database publish that never finishes is cancelled and retried, and managed brains write meeting timelines and extracted entities through the coordinator.**
diff --cc VERSION
index 56a9d40d77,56a9d40d77..3fb9c41e0a
--- a/VERSION
+++ b/VERSION
@@@ -1,1 -1,1 +1,1 @@@
--0.60.166.0
++0.60.167.0
diff --cc openclaw.plugin.json
index 067b030a44,067b030a44..14d819da36
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@@ -1,7 -1,7 +1,7 @@@
{
"id": "gbrain-context-engine",
"name": "gbrain",
-- "version": "0.60.166.0",
++ "version": "0.60.167.0",
"description": "Personal knowledge brain with Postgres + pgvector hybrid search",
"family": "bundle-plugin",
"kind": "context-engine",
diff --cc package.json
index 25b9653651,3d85824290..da7b88625b
--- a/package.json
+++ b/package.json
@@@ -232,7 -231,7 +232,7 @@@
"bun": ">=1.4.0"
},
"license": "MIT",
-- "version": "0.60.166.0",
++ "version": "0.60.167.0",
"overrides": {
"@ai-sdk/provider-utils": "4.0.56",
"@hono/node-server": "^2.0.5",
diff --cc plugin-variants/gbrain-coding/.claude-plugin/plugin.json
index a5f0f2b23e,a5f0f2b23e..3a01d547d0
--- 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.166.0",
++ "version": "0.60.167.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.json
index dcd53da1c1,dcd53da1c1..8038e89d3a
--- 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.166.0",
++ "version": "0.60.167.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.md
index 146bf1d0be,146bf1d0be..85df832419
--- 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.166.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.167.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.json
index 9a750b14c1,9a750b14c1..67e357439d
--- 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.166.0",
++ "version": "0.60.167.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.json
index 033e19486c,033e19486c..547f6a8a01
--- 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.166.0",
++ "version": "0.60.167.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.md
index 3a6ad07675,3a6ad07675..ac8a5ec64f
--- 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.166.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.167.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.md
index ffb40830e0,ffb40830e0..73ea726746
--- a/plugin/README.md
+++ b/plugin/README.md
@@@ -1,4 -1,4 +1,4 @@@
--<!-- gbrain-plugin-tree-stamp: 0.60.166.0 -->
++<!-- gbrain-plugin-tree-stamp: 0.60.167.0 -->
# gbrain plugin skill tree (generated — do not hand-edit)
This tree is the curated skill set for the gbrain Codex and Claude Code
diff --cc src/core/behavior-change-notice.ts
index 989bb31847,6f593e4d28..165ac22c35
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -373,10 -373,6 +373,10 @@@ export const BEHAVIOR_CHANGES: Readonly
{ since: '0.60.147.0', text: 'In a brain folder with the Git durability hook, a write that arrives while the effect worker commits a backlog of Git effects now publishes after the group in flight, inside its 5 s wait, instead of returning pending after the whole backlog; Git effects still commit in order. A write waiting on a busy worktree is reported as `writer_busy` without a stale preparing phase.' },
// `since` is a placeholder equal to the branch's VERSION until the merge-slot stamp.
{ since: '0.60.151.0', text: '`delta` and `context_pack` called without `include_private`, and the per-turn context block that harness hooks inject, now apply to their facts the same page-visibility rule they already apply to their pages. With `include_private` from the local CLI, `delta` and `context_pack` output is unchanged.' },
- { since: '0.60.166.0', text: 'Open-loop extraction from Gmail threads (`loops_extract` jobs) now runs under a $2.00 per UTC day cap, brain-wide: every job a sweep or the managed catch-up queues shares the day\'s spend group, an attempt the cap cannot admit is refused before the provider call and the thread is queued again on a later day, and a sweep that finds the day at its cap queues nothing (`daily_spend_cap`). `gbrain config set loops.extraction_max_usd_per_day <usd>` changes the cap (0 queues no paid extraction).' },
- { since: '0.60.166.0', text: 'A Gmail thread\'s open loop now attaches to the counterparty\'s page even when that page lives in another source (`default:people/<slug>` on a federated brain), by identity only: the exact email as that page\'s alias or an `entity_identities` canonical member; a display name alone never crosses a source and a tie leaves the loop with no counterparty page. The loop row records the page\'s source (`counterparty_source_id`), the `owes_to` / `awaiting_reply_from` edge points there, and the entity card, `gbrain waiting` and `open_loops` read the loop from that page rather than from a namesake in another source. Rows written before this change keep reading as their own source.' },
- { since: '0.60.166.0', text: '`gbrain lint` no longer reports `missing-created` on a page that carries any parseable date under `created`, `event_date`, `date`, `published`, `captured_at` or `ingested_at`, and `--fix` (the cycle\'s lint phase included) no longer copies `captured_at` / `ingested_at` into `created`: ingest time is not creation time, and the copy rewrote every page gbrain itself exported. Pages that got a `created:` that way keep it; nothing is removed.' },
- { since: '0.60.166.0', text: 'Gmail labels named in a source\'s `g_loops_exclude_labels` (or the brain-wide `loops.extraction_exclude_labels`) keep their threads out of paid loop extraction and the deterministic detector. A name that does not resolve against the account\'s labels fails closed: no NEW paid extraction for that source until it resolves (`excluded_label_unresolved` in the sweep counters, retried every sweep); existing loops, closes and the email pages themselves are unaffected.' },
++ { since: '0.60.167.0', text: 'Open-loop extraction from Gmail threads (`loops_extract` jobs) now runs under a $2.00 per UTC day cap, brain-wide: every job a sweep or the managed catch-up queues shares the day\'s spend group, an attempt the cap cannot admit is refused before the provider call and the thread is queued again on a later day, and a sweep that finds the day at its cap queues nothing (`daily_spend_cap`). `gbrain config set loops.extraction_max_usd_per_day <usd>` changes the cap (0 queues no paid extraction).' },
++ { since: '0.60.167.0', text: 'A Gmail thread\'s open loop now attaches to the counterparty\'s page even when that page lives in another source (`default:people/<slug>` on a federated brain), by identity only: the exact email as that page\'s alias or an `entity_identities` canonical member; a display name alone never crosses a source and a tie leaves the loop with no counterparty page. The loop row records the page\'s source (`counterparty_source_id`), the `owes_to` / `awaiting_reply_from` edge points there, and the entity card, `gbrain waiting` and `open_loops` read the loop from that page rather than from a namesake in another source. Rows written before this change keep reading as their own source.' },
++ { since: '0.60.167.0', text: '`gbrain lint` no longer reports `missing-created` on a page that carries any parseable date under `created`, `event_date`, `date`, `published`, `captured_at` or `ingested_at`, and `--fix` (the cycle\'s lint phase included) no longer copies `captured_at` / `ingested_at` into `created`: ingest time is not creation time, and the copy rewrote every page gbrain itself exported. Pages that got a `created:` that way keep it; nothing is removed.' },
++ { since: '0.60.167.0', text: 'Gmail labels named in a source\'s `g_loops_exclude_labels` (or the brain-wide `loops.extraction_exclude_labels`) keep their threads out of paid loop extraction and the deterministic detector. A name that does not resolve against the account\'s labels fails closed: no NEW paid extraction for that source until it resolves (`excluded_label_unresolved` in the sweep counters, retried every sweep); existing loops, closes and the email pages themselves are unaffected.' },
// Fix wave 14 PR2 (GBRA-79). `since` is a placeholder equal to the branch's VERSION; the integrator sets it to the merge-slot stamp.
{ since: '0.60.163.0', text: 'On a managed brain, whether the persistence owner commits and pushes page writes is now a recorded setting: `gbrain sources writer git-durability <source> --enable|--disable` (with `--pat-file <path>` for the push credential) records it on the host binding, and a binding with nothing recorded keeps consulting the post-commit hook as before. `gbrain sources push` on a managed worktree, `bootstrap verify`\'s push probe and the skill-pack writer guard now refuse by naming that verb and `writer status`. `writer activate` on an already-managed brain answers `already_enabled`; doctor adds `foreign_ownership_marker`; `gbrain repair managed-sync-orphans --source <id>` (explicit, preview-bound) retires sync bookkeeping nothing current can resume; a stale transcript part is deleted through the coordinator on re-ingest.' },
{ since: '0.60.163.0', text: '`gbrain sources set-strategy <id> <strategy>` persists a code source\'s sync strategy and refuses `sync_run_unfinished` while a managed sync run of that source is unfinished. `gbrain bootstrap status` reports a project-scoped Codex MCP server in `<workspace>/.codex/config.toml` as `partial` (detected) instead of `pending`, and `gbrain bootstrap hooks --adopt --harness codex` records it as the wire evidence after a passing verify; nothing is written to the Codex config.' },
diff --cc templates/bootstrap/template-repo/README.md
index 1ec23e5112,1ec23e5112..325d9ac27a
--- 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.166.0 -->
++<!-- gbrain-template-stamp: 0.60.167.0 -->
This repository is the **"Use this template"** distribution artifact for a
[gbrain](https://github.com/garrytan/gbrain) personal-agent workspace — the same