Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(wave9): lane F release notes for the integrator; regenerate llms bundle

time-attackb451e32f8878
diff --git a/docs/wave9/lane-f.md b/docs/wave9/lane-f.md
new file mode 100644
index 0000000000..9cfd902d6c
--- /dev/null
+++ b/docs/wave9/lane-f.md
@@ -0,0 +1,48 @@
+# Fix wave 9, lane F: auth, CLI and config
+
+Integrator notes for the release files. Nothing here is a CHANGELOG header;
+copy the lines below into the release entry and the upgrade-note table.
+
+## Migrations (placeholder numbers, renumber after master's latest)
+
+| Placeholder | Name | Commit | What |
+|---|---|---|---|
+| v209 | `w9_f_clamp_oauth_token_ttl` | 5ef75378 | Handler: clamps `oauth_clients.token_ttl` into 60..7776000 (above → 7776000, 1..59 → 60, ≤0 → NULL), bumps `grant_revision`, writes `oauth_grant_audit` (`clamp_token_ttl`); shortens outstanding access tokens to `created_at + 7776000` (never lengthens; audit `shorten_access_tokens`). Refresh tokens and legacy bearer tokens untouched. Idempotent. |
+| v210 | `w9_f_function_search_path` | daf7426b | Re-creates the three fact fingerprint SQL functions (qualified built-ins, byte-identical outputs) and ALTERs every public `gbrain_*` / `auto_enable_rls` plpgsql function with no setting to `search_path = pg_catalog, public`. Idempotent. |
+
+Both tests find their migration by name (`MIGRATIONS.find(m => m.name.endsWith(...))`), so renumbering needs no test edit. Regenerate `registry.generated.ts` and `test/fixtures/goldens/migrations/records.json` after renumbering.
+
+## CHANGELOG lines
+
+- **OAuth access tokens never outlive 90 days.** Issuance caps every access token at 7,776,000 seconds, whatever a client's stored lifetime, `oauth.dcr_ttl_max_seconds` or `serve --http --token-ttl` says, and `serve --token-ttl` refuses values outside 60..7776000 at startup. The upgrade brings stored client lifetimes into that range and shortens already-issued access tokens to 90 days after issue; `gbrain auth clients` marks affected clients and `whoami` names the `--token-ttl` repair choice. (#5040)
+- **`--source` on `timeline-add`, `ontology-add` and `takes add|update|supersede` is provenance on every route.** A provenance URL is no longer refused as an invalid source id, a provenance value that is also a source name no longer redirects the write, and a running `gbrain serve` keeps the provenance. (#5087)
+- **Skill retention and proposal commands work while `gbrain serve` owns the brain.** `get_skill_retention`, `prune_skill_revisions`, `retain_skill_revision` and `import_skill_proposal` no longer answer `unknown_tool` to the local CLI. (#5864)
+- **Every `gbrain import` refusal says why and what to run.** A symlinked root on a managed brain and a refused source filesystem lock no longer exit 1 silently; the multi-source warning also names `GBRAIN_SOURCE` and `GBRAIN_ALLOW_DEFAULT_WRITE`. (#5268, thanks @andreineacsu, #5515)
+- **`config get/set/unset embedding_disabled` and `config get/show schema_pack` report and change the value the runtime uses.** `embedding_disabled` writes both planes, the enable path clears both, and `schema_pack` shows the tier `schema active` resolves. (#5253)
+- **`gbrain doctor` warns instead of failing on missing RLS when nothing exposes the public schema.** It still fails when PostgREST roles or a Supabase URL are present. (#4939)
+- **`extract_health` dates a high halt rate by the last halt** ("last halt 4d ago"), not the last clean run. (#5863)
+- **Doctor's migration row reads the ledger like `get_health`:** a `--force-retry` marker resets the wedge, and a host migration a newer one skipped past is reported with `gbrain apply-migrations --yes`. (C-NEW-2, C-NEW-3)
+- **Code pages that contain a facts/takes fence marker are withheld from remote reads** and left out of `repair safe-chunks` and `safe_index_pending` counts. (D-NEW-2)
+- **Remote code reads stay suspended with a clearer error** that names the follow-up (#5052) and points at `search`/`query`. (#5052)
+- **Every gbrain plpgsql function pins `search_path`;** the fingerprint functions keep identical output and stay inlinable; the `check:search-path` guard now sees every definition. (#5190, C-NEW-1)
+
+## Upgrade-note rows
+
+| What changed | Who is affected | Doctor / check | How to opt back |
+|---|---|---|---|
+| Access tokens capped at 90 days; stored client lifetimes clamped; outstanding access tokens shortened to issue + 90 days | OAuth clients whose stored lifetime or server `--token-ttl` exceeded 90 days, and their already-issued access tokens. Tokens older than 90 days stop working; refresh tokens and machine credentials get new ones; a native OAuth client with no refresh token reconnects | `gbrain auth clients` (`token_lifetime_clamped`), `whoami` `token_ttl_invalid`; docs/mcp/ADMIN.md#access-token-lifetime | None (security cap). Restart every running `gbrain serve --http` after upgrading |
+| `serve --http --token-ttl` validated | Launch scripts passing a value outside 60..7776000 or a non-number (it used to fall back to 3600 silently) | `serve` refuses at startup with the bounds message | Pass a value in range or omit the flag |
+| `--source` is provenance for ops that own a `source` param | Scripts that used `timeline-add --source <source-id>` to pick the destination source | JSON result `source_id` names the destination | Use `GBRAIN_SOURCE=<id>` or `.gbrain-source` for the destination |
+| `config set embedding_disabled` writes both planes; `set false`/`unset` actually re-enable | Keyless brains being re-enabled | `gbrain config get embedding_disabled` shows both planes | `gbrain config set embedding_disabled true` |
+| `config get/show schema_pack` print the resolved pack | Scripts reading `config get schema_pack` (now the effective value, default `gbrain-base` when nothing is set, exit 0) | `gbrain schema active` | Read `~/.gbrain/config.json` directly for the file value |
+| RLS check: plain Postgres → warn | Self-hosted Postgres with no PostgREST roles and a missing-RLS table (doctor no longer exits 1 for it) | `rls` (warn), docs/guides/rls-and-you.md | Create the PostgREST roles to get the fail verdict, or enable RLS |
+| Migration ledger row | Hosts after a `--force-retry`, or with a skipped host migration (new warn) | `minions_migration` | Run `gbrain apply-migrations --yes` |
+| Protected code pages withheld | Code files that literally contain a gbrain facts/takes fence marker (e.g. gbrain's own source) | `safe_index_pending` counts them as kept; `repair safe-chunks` residual `code_with_fence_marker` | None |
+| Function `search_path` pinned | All Postgres/PGLite brains (no behavior change; ~10-15% more time per bulk fact insert through the withdrawal trigger in a 10k-row benchmark) | Supabase linter still lists the 3 fingerprint SQL functions (expected) | None |
+
+## Numbers that change and why
+
+- `minions_migration`: hosts that were `fail` after a forced retry become `warn` (pending), and hosts with a skipped migration gain a `warn`.
+- `rls`: plain Postgres brains with a missing-RLS table move from `fail` to `warn`, which raises their doctor score.
+- `extract_health`: the age suffix now reads "last halt Nd ago" and can be older than before.
+- OAuth `expires_in` for clients with over-cap settings drops to 7776000.
diff --git a/llms-full.txt b/llms-full.txt
index 4c303208ff..f00195d56c 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -9985,7 +9985,7 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro
<a id="pglite-aborted"></a>**PGLite crashes at startup with `RuntimeError: Aborted()` (often right after a macOS upgrade)?** Not a macOS incompatibility — the OS-upgrade reboot killed gbrain mid-write and tore the data dir's WAL. gbrain repairs this automatically on the next command (data preserved, backup kept); if auto-repair is disabled or skipped, run `gbrain pglite-repair --dry-run` to diagnose and `gbrain pglite-repair --yes` to repair in place. Full recovery ladder (repair → rebuild → engine switch) in [`docs/ENGINES.md` — Troubleshooting: startup abort](../ENGINES.md#troubleshooting-startup-abort-runtimeerror-aborted) and [`docs/INSTALL.md`](../INSTALL.md#pglite-crashes-at-startup-runtimeerror-aborted).
-<a id="embedding-dimensions"></a>**`gbrain import` fails with `expected N dimensions, not M`?** Run `gbrain doctor`. It will print the exact `gbrain config set ...` or `gbrain migrate embeddings` command to repair the mismatch (`migrate embeddings` re-embeds through the provider: effect `paid`, ask the user first). You should not need to delete `~/.gbrain`. Fresh `gbrain init --pglite` auto-detects your embedding provider from API keys: set `VOYAGE_API_KEY` (or `OPENAI_API_KEY` / another provider key) in the environment — or in `~/.gbrain/config.json`, which init also reads — before running init, or pass `--embedding-model <provider>:<model>` explicitly. With multiple keys set, init fires an interactive picker (non-TTY auto-picks the Voyage default when its key is present). With no keys at all, init continues keyless (keyword-only search) with a loud notice; add a key later and re-run `gbrain init --force --embedding-model voyage:voyage-4` to enable embeddings (effects: `credentials` and `paid`, since every page is embedded through the provider; it needs the brain's writer lock, so stop a running `gbrain serve` first; pages and facts are kept), or pass `--no-embedding` up front to make keyless explicit. See [`docs/integrations/embedding-providers.md`](../integrations/embedding-providers.md) for the full provider matrix and [`docs/operations/headless-install.md`](../operations/headless-install.md) for Docker/CI sequencing.
+<a id="embedding-dimensions"></a>**`gbrain import` fails with `expected N dimensions, not M`?** Run `gbrain doctor`. It will print the exact `gbrain config set ...` or `gbrain migrate embeddings` command to repair the mismatch (`migrate embeddings` re-embeds through the provider: effect `paid`, ask the user first). You should not need to delete `~/.gbrain`. Fresh `gbrain init --pglite` auto-detects your embedding provider from API keys: set `VOYAGE_API_KEY` (or `OPENAI_API_KEY` / another provider key) in the environment — or in `~/.gbrain/config.json`, which init also reads — before running init, or pass `--embedding-model <provider>:<model>` explicitly. With multiple keys set, init fires an interactive picker (non-TTY auto-picks the Voyage default when its key is present). With no keys at all, init continues keyless (keyword-only search) with a loud notice; add a key later and re-run `gbrain init --force --embedding-model voyage:voyage-4` to enable embeddings (effects: `credentials` and `paid`, since every page is embedded through the provider; it needs the brain's writer lock, so stop a running `gbrain serve` first; pages and facts are kept), or pass `--no-embedding` up front to make keyless explicit. `gbrain config get embedding_disabled` reports whether embedding is off and which plane says so (the config file and the database setting; `true` on either turns it off); `gbrain config set embedding_disabled true|false` and `gbrain config unset embedding_disabled` change both, and the `init --force --embedding-model` enable path clears both. See [`docs/integrations/embedding-providers.md`](../integrations/embedding-providers.md) for the full provider matrix and [`docs/operations/headless-install.md`](../operations/headless-install.md) for Docker/CI sequencing.
**`gbrain doctor` warns `default_source_local_path`?** Your `default` source has no `local_path` AND that null pointer is provably breaking write-through (the repo fallback is another source's own working tree, or file-backed default pages have no resolvable root). A null `local_path` on its own is the designed fallback topology and reports ok. The repair is a pointer update, never a file move: `gbrain sources set-path default <path>` prints the prior value before changing it and refuses a path that nests inside or swallows another source's tree (exit 6; `--force` bypasses). **Say to your agent:** *"Run a brain health check and fix what you find"* — the maintain skill runs `gbrain doctor` and applies the printed repair.
@@ -10701,6 +10701,16 @@ fail:
[FAIL] minions_migration: MINIONS HALF-INSTALLED (partial migration: 0.11.0). Run: gbrain apply-migrations --yes
```
+Three or more partial records in a row read as `WEDGED MIGRATION(s)` and name
+`gbrain apply-migrations --force-retry <version>`. After that retry the version
+is pending again, and doctor warns that it has not run yet with the plain
+`gbrain apply-migrations --yes` command. Doctor also warns when the ledger shows
+a host migration that a newer one already ran past, so it never ran:
+
+```
+[WARN] minions_migration: 1 host migration(s) not run yet: 0.53.0. Run: gbrain apply-migrations --yes
+```
+
(Missing `~/.gbrain/preferences.json` on a fresh install is a valid
pre-`apply-migrations` state — doctor deliberately does NOT fail on that
alone; the partial-migration record is the canonical half-migration signal.)
@@ -10932,7 +10942,7 @@ should also check `results[].complete`.
| `orphan-bindings` | `orphan_persistence_bindings` | Deletes persistence source bindings whose source was removed, or that belong to an earlier incarnation of a source re-added under the same id. `gbrain sources remove` and `gbrain sources purge` delete the binding; one an older gbrain left behind makes the re-added source read as claimed, so every `gbrain sync --source <id>` fails with `writer_coordinator_required`. Bookkeeping only: no journal admission, no page or file changes, and it runs brain-wide (`--source` does not narrow it). See [orphan bindings](#orphan-bindings). | A binding that a queued, running or recovering write request of the same source incarnation still references. |
| `embedding-effects` | `stale_embedding_effects` | Settles stale queued and failed embedding effects of committed writes, which block receipt compaction and activation: `reconciled` when current vectors pass the effect verifier, `superseded` when the page was deleted or a newer revision owns its own effect, `retry_queued` for the owner (paid; a used-up retry allowance gets one new bounded cycle per explicit apply). See [stale queued embedding effects](#stale-queued-embedding-effects). | `blocked` effects, counted by reason (`owner_unavailable`, `embedding_disabled`, `embedding_unconfigured`, `projection_pending`, `no_replacement_obligation`). |
| `attribution-backfill` | none | Fills write attribution (who wrote it) on pages, page versions and facts written before attribution was recorded, only where exactly one committed request in the write journal proves the writer: the page write whose recorded result is the row's revision, or the `remember` that inserted the fact. Fills NULLs only, in committed batches of 1,000 that resume after an interruption; no content, revision, page file or request ID changes. See [write attribution](../mcp/ADMIN.md#write-attribution). | `unrecorded_pages`, `unrecorded_page_versions`, `unrecorded_facts`: rows the journal cannot prove. They stay `unrecorded`; nothing is inferred. |
-| `safe-chunks` | `safe_index_pending` (also `contextual_retrieval_coverage`, `details.unsealed_pages`) | Rebuilds the chunks of markdown and code pages indexed before the safe-chunk fence, which remote and MCP search withhold. It rebuilds projections only: no page write, no new page version and no request ID. Vectors whose embedding input did not change are kept; the rest are embedded unless you pass `--no-embed` or no embedding model is configured. | `code_without_source_path`: code pages with no recorded file to re-chunk. `unsupported_page_kind`: other page kinds, such as images. Their importer re-seals them. |
+| `safe-chunks` | `safe_index_pending` (also `contextual_retrieval_coverage`, `details.unsealed_pages`) | Rebuilds the chunks of markdown and code pages indexed before the safe-chunk fence, which remote and MCP search withhold. It rebuilds projections only: no page write, no new page version and no request ID. Vectors whose embedding input did not change are kept; the rest are embedded unless you pass `--no-embed` or no embedding model is configured. | `code_without_source_path`: code pages with no recorded file to re-chunk. `code_with_fence_marker`: code pages whose text contains a facts/takes fence marker; remote reads always withhold them. `unsupported_page_kind`: other page kinds, such as images. Their importer re-seals them. |
| `orphan-children` | `child_table_orphans` (also a `storage_corrupt` error) | Explicit-only. Deletes rows of page child tables (chunks, versions, tags, takes, raw data, timeline, links) whose page row no longer exists, and clears dangling `links.origin_page_id` and `files.page_id` references, each in one statement that rechecks the orphan condition. See [orphan children](#orphan-children). | `torn_pages`: page rows whose stored body cannot be read (torn TOAST). The preview names them; the repair never changes them. |
| `planner-stats` | `planner_stats_stale` | Runs `ANALYZE` on the hot tables (pages, links, facts, takes, content_chunks, timeline_entries) whose planner statistics are stale, so search and graph reads stop planning as slow nested loops. PGLite also resets each table's pending row count; Postgres runs each `ANALYZE` with a 60 s statement timeout and a 2 s lock timeout. No journal admission, no user data changes, brain-wide. | none |
| `contextual-mode` | `contextual_retrieval_coverage` (pages with no recorded mode) | Stamps the contextual retrieval mode on markdown pages imported without one (for example by a large `--no-embed` sync, or by a connector source on an older gbrain), exactly as a fresh import of the page would: the page, source and brain settings decide, and the per-chunk synopsis tier lands at the free title tier. It rebuilds projections only: no page write, no new page version and no request ID. A page whose stored vectors already match the stamped convention keeps them and queues no re-embedding; a page whose embedding input changes has only those vectors cleared and is re-embedded once, unless you pass `--no-embed`. | `unsealed_projection`: pages whose chunks lag their text; `gbrain embed --stale` or `safe-chunks` seals them first, and the next run stamps them. `embed_skip`: pages marked to skip embedding keep their stored vectors and are not stamped. |