Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(#6803): keep llms-full.txt under its 800000-byte budget after merging master 0.60.273.0
garrytan6c070ace0f92
diff --git a/docs/guides/repair.md b/docs/guides/repair.mdindex 0cd7b925e8..1bd6b30766 100644--- a/docs/guides/repair.md+++ b/docs/guides/repair.md@@ -2089,6 +2089,15 @@ ran out; `2` when the score target is unreachable and there was no repair stepto run, or a resume was refused. `healthy` is true only when every recoverycheck is clean after the run; `repairs_completed` counts the repair steps that finished.+### Doctor budgets++Every doctor check runs under a budget, so a slow check reports `unknown` instead of holding the run.++- **Order:** the ops sections run first, then the cheap incident checks (`persistence_capacity`, `managed_sync_not_moving`, `managed_sync_blocked`, `text_projection_readiness`, `partial_embedding`, `links_extraction_lag`), then the full scans.+- **Per check:** `doctor.entry_budget_ms` (default 15000). A check's database statements stop at its budget: Postgres cancels the statement; PGLite refuses the next one but cannot stop one already running, so a check there can finish late. The frontmatter and fence scans report what they read by then.+- **Per run:** a non-interactive `gbrain doctor --json` (stderr not a terminal, no `--budget-ms`, `--tier`, `--fix` or remediation flag) caps its check run at `doctor.default_budget_ms` (file plane, default 90000; connect and migrations are not counted) and says so on stderr. `--budget-ms 0` turns it off for one run; `gbrain config set doctor.default_budget_ms 0` turns it off for good.+- **Past a budget:** the check reports `details.health: "unknown"` with `details.limit` (`entry` or `overall`) and prints `gbrain doctor --only <check> --budget-ms N --json`, which gives that check the whole N.+## Recover after an upgrade<a id="recover-after-upgrading-to-this-release"></a>diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.mdindex 336da4a8da..3d8f9b10cb 100644--- a/docs/guides/troubleshooting.md+++ b/docs/guides/troubleshooting.md@@ -19,7 +19,7 @@| `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.157.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok || A write (`add_timeline_entry`, `put_page`, `remember`, any `mutating` tool) refused `invalid_params` "unknown parameter … write operations always reject unknown parameters; nothing was written" | the call named a parameter the tool does not declare (for example `content` instead of `detail`); the `suggestion` names the submitted key and the declared one; resend with the declared name. Reads keep the `mcp.strict_params` warn grace period | agent | none | the resent call returns no `invalid_params` and no `unknown_param` warning || Facts extraction or embedding reports `(cause=AIConfigError model_not_found)` or `gbrain models doctor` says `model_not_found` while the key is valid | the provider refused the model, not the key (a 404, or a 403 "project does not have access to model"): the fix text names the config key that selected the model when the gateway knows it ("Selected via models.tier.reasoning. Fix: gbrain config set …"; an env var or config.json pin says what to clear); otherwise check the model id with `gbrain models`, enable the model for the project in the provider console or set another model (`gbrain config set models.facts <provider:model>`) | user (provider console); agent for the config change, after the user agrees | none | `gbrain models doctor` reports the model `ok` |-| Doctor `links_extraction_lag` or the end-of-sync line says "N page(s) have un-extracted edges" | the link-extraction backlog; preview with `gbrain extract --stale --dry-run --json`, then on the brain host run `gbrain extract --stale --catch-up [--source-id <id>]` (one interruptible run) or repeat plain `gbrain extract --stale` (30 min per run); scope with `--source-id` | user on the host above 120 s (`tell_user_to_run`); agent otherwise | none | `gbrain extract --stale --dry-run --json` shows `actionable: 0` (and `mention_due: 0` with mentions on) |+| Doctor `links_extraction_lag` or sync says "N page(s) have un-extracted edges" | `gbrain extract --stale --dry-run --json`, then on the host `gbrain extract --stale --catch-up [--source-id <id>]` | user above 120 s, else agent | none | dry run: `actionable: 0` || A gbrain call failed with a code you don't recognize | follow `fix.next` ([protocol](../protocol/AGENT_OPERATOR_v1.md)); `gbrain errors <code>` | agent | as the fix's `consent` | the fix's `verify` || A graph read omits a relationship you know existed, or says someone still works somewhere they left | the default read returns relationships true today: repeat with `status: "all"` or `as_of`; to record an end, add a dated timeline line (`Ended works_at [[companies/x]]`) or `add_link ... valid_until` ([temporal edges](temporal-edges.md)) | agent | none | `gbrain doctor --only edge_validity --json` || A command exited 3 (`confirmation_required`) | relay `user_message`; run `fix.command` only after the user agrees | agent, after the user agrees | the payload's `effects` | the fix's `verify` |@@ -63,8 +63,7 @@| `gbrain init` or `gbrain upgrade` stops with `schema_lock_blocked` naming a pid (or, before #5227, sat in `wait_event_type=Lock` with no output) | let the named session finish, or with the user's agreement end it on the database host: `SELECT pg_terminate_backend(<pid>)`; then rerun the same command ([ENGINES.md](../ENGINES.md#schema-lock-blocked)) | brain host, after the user agrees | `destructive` when it ends another session | the rerun completes; `gbrain doctor --json` shows the schema at head || [`queue_capacity`, `persistence_capacity` or `persistence_request_growth`](#write-capacity) | run the printed `gbrain config set persistence.limits.<limit> <value>` | brain host | none | `gbrain doctor --only persistence_capacity,persistence_request_growth --json` || [`dream_paid_loop`, or dream keeps skipping one transcript](#dream-paid-loop) | fix the cause, then `gbrain dream reset-key --list` and `gbrain dream reset-key '<key>'` | agent, after the user agrees | `paid` (the key is retried) | `gbrain doctor --only dream_paid_loop --json` |-| [A page exists (`gbrain get <slug>` returns it) but search never finds text from it](memory-boundaries.md#large-pages) | find the cause: `gbrain reindex --oversized --dry-run --json` lists pages stored before the upgrade with a size-based `embed_skip` marker (run it without `--dry-run` to keyword-index them, free); a page above an operator-lowered `content_sanity.bytes_block` keeps its marker until the operator raises or unsets it; a page the content-quality gate quarantined as junk shows in `gbrain quarantine list`, and `gbrain quarantine clear <slug>` re-checks it once the user agrees; a file over the 24 MiB page ceiling was never stored ([`file_too_large`](write-refusals.md#file_too_large)). Embedding the re-indexed pages is a separate paid step: `gbrain embed --held --dry-run`, then `gbrain embed --held --source <id> --max-usd <N>` per source | agent for the reindex; the user decides embedding spend, a `bytes_block` change and a quarantine clear | none for the reindex (CPU only); `paid` for `gbrain embed` | `gbrain reindex --oversized --dry-run --json` lists nothing; `gbrain doctor --json`; `gbrain search "<phrase from deep in the page>"` returns the page |-| [Large pages stay out of meaning-based search; `gbrain embed --stale` prints `large page(s) have chunks waiting for embedding approval` or doctor `partial_embedding` warns](memory-boundaries.md#large-pages) | preview with `gbrain embed --held --dry-run` (every source, free); with the user's approval `gbrain embed --held --source <id> --max-usd <N>` per source, N as printed (the run's cap) | agent, after the user agrees | `paid`, `egress` (none on a local provider that bills nothing) | `gbrain embed --held --dry-run --source <id> --json` shows `held: 0` and `capped: 0` for that source; `gbrain doctor --only partial_embedding --json` |+| [A page exists (`gbrain get <slug>` returns it) but search never finds text from it](memory-boundaries.md#large-pages) | `gbrain reindex --oversized --dry-run --json` lists pages stored before the upgrade with a size-based `embed_skip` marker (without `--dry-run` it keyword-indexes them, free); a page above an operator-lowered `content_sanity.bytes_block` keeps its marker until it is raised; a page the content-quality gate quarantined shows in `gbrain quarantine list` (`gbrain quarantine clear <slug>` re-checks it once the user agrees); a file over the 24 MiB page ceiling was never stored ([`file_too_large`](write-refusals.md#file_too_large)). Its chunks waiting for embedding approval (doctor `partial_embedding`) are a paid step: `gbrain embed --held --dry-run`, then `gbrain embed --held --source <id> --max-usd <N>` as printed | agent for the reindex; the user decides embedding spend, a `bytes_block` change and a quarantine clear | none for the reindex; `paid` for `gbrain embed` | `gbrain reindex --oversized --dry-run --json` lists nothing; `gbrain search "<phrase from deep in the page>"` returns the page || [Search answers look keyword-only on a large Postgres brain](#hybrid-search-returns-only-keyword-hits) | read doctor's `vector_plan`; run the index command it prints | brain host | none | `gbrain doctor --only vector_plan --json` || [Broad keyword queries take about 8 s and come back vector-only (`keyword_arm_failed`, or `skipped_after_timeout` for 10 minutes after a timeout) on a large Postgres brain](#keyword-search-times-out-on-a-large-postgres-brain) | read doctor's `keyword_plan`; narrow with `--source-id`, or raise `search.keyword_statement_timeout_ms` on the brain host and restart the serving process | brain host | none | `gbrain doctor --only keyword_plan --json` || A second `gbrain serve` cannot open the brain | the readiness `harness_wiring` fix: every session shares one `gbrain serve --http` | user | `persistent_install`, `credentials` | `gbrain doctor --only harness_wiring --json` |@@ -256,7 +255,7 @@ A running sync is not one of these: `gbrain repair fences` now runs during a cat<a id="write-capacity"></a>**Managed writes refused with `queue_capacity`, or doctor warns `persistence_capacity`?** A per-principal or per-brain write-journal limit (`persistence.limits.*`) is full (`queue_capacity`), or doctor sees lifetime request IDs or receipt bytes at 80% or more (`persistence_capacity`). For the cumulative limits (lifetime request IDs and receipt bytes), the warning and the refusal print a `gbrain config set persistence.limits.<limit> <value>` sized for about one more year; run it on the brain host, then retry with the same request ID. For outstanding-request or queued-byte limits, let outstanding writes finish and check `gbrain sources writer status`. Receipt compaction age is `persistence.receipt_retention_days` (default 30). Limits and defaults: [bounded admission and retention](concurrent-writes.md#bounded-admission-and-retention).-<a id="doctor-ops-tier"></a>**`gbrain doctor` is slow on a large brain, or you need to see what is wrong in seconds?** Run `gbrain doctor --tier ops --json`. It runs only the operator sections (write capacity, unresolved write failures, a managed sync cursor that stopped moving, receipt compaction freshness (`persistence_compaction`, see [receipt compaction](repair.md#receipt-compaction)), a serve running an older build, schema-pack consistency, embedding state) under a 4000 ms deadline; `--budget-ms <n>` changes it. A section the deadline cut off is reported as unknown (`details.health: "unknown"`, `reason: "budget"`, `exact: false`), never as clear, and the report says `complete: false` with the section in `unknown_sections`; rerun it alone with `gbrain doctor --only <name> --json`. On PGLite, sections that need a Postgres serve (managed sync, terminal-failure receipts, schema packs) read `not_applicable` and the report stays complete. The default doctor runs the same sections first, then the cheap incident checks (managed sync, `text_projection_readiness`, `partial_embedding`, `links_extraction_lag`), and bounds every other check by `doctor.entry_budget_ms` (default 15000): a check's database statements stop at its budget, and the frontmatter and fence scans report what they read by then. A non-interactive `gbrain doctor --json` (stderr not a terminal, no `--budget-ms`, `--tier`, `--fix` or remediation flag) caps its check run at `doctor.default_budget_ms` (file plane, default 90000; connect and migrations are not counted) and says so on stderr; `--budget-ms 0` turns that off for one run and `gbrain config set doctor.default_budget_ms 0` for good. A check past its budget names the budget (`details.limit`: `entry` or `overall`) and prints `gbrain doctor --only <check> --budget-ms N --json`, which gives that check the whole N. PGLite cannot stop a statement already running, so a check there can finish late. It also estimates `orphan_ratio` from a sample above `doctor.orphan_ratio.full_scan_max_pages` pages (default 50000); `--tier deep` scans fully. From a thin client, `gbrain doctor --tier ops` (or `--only persistence_capacity`) asks the serve: an admin token gets the ops report, a read token gets the `get_brain_health` bands (capacity and write failures as bands, no raw counts), and a serve that predates the ops tier refuses `doctor_tier_unavailable`: run `gbrain doctor --tier ops --json` on the brain host or upgrade and restart its serve. Agents without a shell call MCP `get_brain_health` (read scope) or `run_doctor` with `tier: "ops"` (admin).+<a id="doctor-ops-tier"></a>**`gbrain doctor` is slow on a large brain, or you need to see what is wrong in seconds?** Run `gbrain doctor --tier ops --json`: only the operator sections (write capacity, unresolved write failures, a managed sync cursor that stopped moving, [receipt compaction](repair.md#receipt-compaction) freshness, a serve on an older build, schema-pack consistency, embedding state) under a 4000 ms deadline (`--budget-ms <n>`). A section the deadline cut off reads unknown (`details.health: "unknown"`, `reason: "budget"`, `exact: false`), never clear; the report says `complete: false` and lists it in `unknown_sections`; rerun it with `gbrain doctor --only <name> --json`. On PGLite, serve-only sections read `not_applicable` and the report stays complete. The default doctor runs the same sections first and bounds each check and a plain `--json` run ([doctor budgets](repair.md#doctor-budgets)); above `doctor.orphan_ratio.full_scan_max_pages` pages (default 50000) it samples `orphan_ratio`, and `--tier deep` scans fully. From a thin client, `gbrain doctor --tier ops` (or `--only persistence_capacity`) asks the serve: an admin token gets the ops report, a read token the `get_brain_health` bands (no raw counts), and a serve that predates the ops tier refuses `doctor_tier_unavailable` (run it on the brain host, or upgrade and restart the serve). Agents without a shell call MCP `get_brain_health` (read) or `run_doctor` with `tier: "ops"` (admin).<a id="dream-paid-loop"></a>**Dream keeps skipping one transcript, or doctor warns `dream_paid_loop`?** A dream key died `dream.breaker.max_dead_submissions` times (default 3) in 24 hours and is refused so it stops billing you. Fix the cause, then `gbrain dream reset-key --list` and `gbrain dream reset-key '<key>'`. See [the paid-loop breaker](../operations/spend-controls.md#dream-paid-loop-breaker-dreambreakermax_dead_submissions).diff --git a/docs/protocol/AGENT_OPERATOR_v1.md b/docs/protocol/AGENT_OPERATOR_v1.mdindex 5d4357fda3..5fe55f8c70 100644--- a/docs/protocol/AGENT_OPERATOR_v1.md+++ b/docs/protocol/AGENT_OPERATOR_v1.md@@ -625,8 +625,8 @@ interface RenderedAction {`verify.argv`, `then`) names the brain and source the failing call acted on:`--brain <id>` for commands that open a brain, `--source <id>` for commands thatresolve their source through the ambient chain (shared ops, and CLI commands the-command table marks `routes_source`; `gbrain extract`, whose `--source` picks the-fs|db read mode, gets `--source-id <id>` instead). gbrain appends them when it renders the+command table marks `routes_source`; `gbrain extract`, whose `--source` is the+fs|db mode, gets `--source-id <id>`). gbrain appends them when it renders thefix, before any bare `--`, and keeps flags the fix already carries. So you canrun the fix later from another directory, or under a different `GBRAIN_BRAIN_ID`,`GBRAIN_SOURCE`, `.gbrain-mount` or `.gbrain-source`, and it still acts on the@@ -662,7 +662,7 @@ per-token price), obtain each value as `how` describes and substitute it for| `host_admin` | the operator of the brain host (a remote brain over HTTP, scope grants, server restarts). Never authorizable from MCP || `provider` | an outside service you wait on (rate limits, outages) |-A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`: its actor is `user` (`host_admin` on a remote brain), so it renders `tell_user_to_run`.+A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`; it renders `tell_user_to_run`.### The `next` decision tablediff --git a/llms-full.txt b/llms-full.txtindex 57c47a230d..2cf6428811 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -3997,8 +3997,8 @@ interface RenderedAction {`verify.argv`, `then`) names the brain and source the failing call acted on:`--brain <id>` for commands that open a brain, `--source <id>` for commands thatresolve their source through the ambient chain (shared ops, and CLI commands the-command table marks `routes_source`; `gbrain extract`, whose `--source` picks the-fs|db read mode, gets `--source-id <id>` instead). gbrain appends them when it renders the+command table marks `routes_source`; `gbrain extract`, whose `--source` is the+fs|db mode, gets `--source-id <id>`). gbrain appends them when it renders thefix, before any bare `--`, and keeps flags the fix already carries. So you canrun the fix later from another directory, or under a different `GBRAIN_BRAIN_ID`,`GBRAIN_SOURCE`, `.gbrain-mount` or `.gbrain-source`, and it still acts on the@@ -4034,7 +4034,7 @@ per-token price), obtain each value as `how` describes and substitute it for| `host_admin` | the operator of the brain host (a remote brain over HTTP, scope grants, server restarts). Never authorizable from MCP || `provider` | an outside service you wait on (rate limits, outages) |-A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`: its actor is `user` (`host_admin` on a remote brain), so it renders `tell_user_to_run`.+A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`; it renders `tell_user_to_run`.### The `next` decision table@@ -10602,7 +10602,7 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro| `remember` or `put_page` refused `source_changed` "The canonical file contains an uncoordinated local edit" on many pages nobody edited, or doctor `lost_caller_writes` warns | upgrade to v0.60.157.0 or later (a database-only v0.13.1 `validate: false` stamp was read as a file edit, #6429); then `gbrain repair failed-writes --source <id>` previews the refused writes and prints the apply command ([failed writes](repair.md#failed-writes)) | agent; the apply after the user agrees | none to preview | `gbrain doctor --only lost_caller_writes --json` is ok || A write (`add_timeline_entry`, `put_page`, `remember`, any `mutating` tool) refused `invalid_params` "unknown parameter … write operations always reject unknown parameters; nothing was written" | the call named a parameter the tool does not declare (for example `content` instead of `detail`); the `suggestion` names the submitted key and the declared one; resend with the declared name. Reads keep the `mcp.strict_params` warn grace period | agent | none | the resent call returns no `invalid_params` and no `unknown_param` warning || Facts extraction or embedding reports `(cause=AIConfigError model_not_found)` or `gbrain models doctor` says `model_not_found` while the key is valid | the provider refused the model, not the key (a 404, or a 403 "project does not have access to model"): the fix text names the config key that selected the model when the gateway knows it ("Selected via models.tier.reasoning. Fix: gbrain config set …"; an env var or config.json pin says what to clear); otherwise check the model id with `gbrain models`, enable the model for the project in the provider console or set another model (`gbrain config set models.facts <provider:model>`) | user (provider console); agent for the config change, after the user agrees | none | `gbrain models doctor` reports the model `ok` |-| Doctor `links_extraction_lag` or the end-of-sync line says "N page(s) have un-extracted edges" | the link-extraction backlog; preview with `gbrain extract --stale --dry-run --json`, then on the brain host run `gbrain extract --stale --catch-up [--source-id <id>]` (one interruptible run) or repeat plain `gbrain extract --stale` (30 min per run); scope with `--source-id` | user on the host above 120 s (`tell_user_to_run`); agent otherwise | none | `gbrain extract --stale --dry-run --json` shows `actionable: 0` (and `mention_due: 0` with mentions on) |+| Doctor `links_extraction_lag` or sync says "N page(s) have un-extracted edges" | `gbrain extract --stale --dry-run --json`, then on the host `gbrain extract --stale --catch-up [--source-id <id>]` | user above 120 s, else agent | none | dry run: `actionable: 0` || A gbrain call failed with a code you don't recognize | follow `fix.next` ([protocol](../protocol/AGENT_OPERATOR_v1.md)); `gbrain errors <code>` | agent | as the fix's `consent` | the fix's `verify` || A graph read omits a relationship you know existed, or says someone still works somewhere they left | the default read returns relationships true today: repeat with `status: "all"` or `as_of`; to record an end, add a dated timeline line (`Ended works_at [[companies/x]]`) or `add_link ... valid_until` ([temporal edges](temporal-edges.md)) | agent | none | `gbrain doctor --only edge_validity --json` || A command exited 3 (`confirmation_required`) | relay `user_message`; run `fix.command` only after the user agrees | agent, after the user agrees | the payload's `effects` | the fix's `verify` |@@ -10646,8 +10646,7 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro| `gbrain init` or `gbrain upgrade` stops with `schema_lock_blocked` naming a pid (or, before #5227, sat in `wait_event_type=Lock` with no output) | let the named session finish, or with the user's agreement end it on the database host: `SELECT pg_terminate_backend(<pid>)`; then rerun the same command ([ENGINES.md](../ENGINES.md#schema-lock-blocked)) | brain host, after the user agrees | `destructive` when it ends another session | the rerun completes; `gbrain doctor --json` shows the schema at head || [`queue_capacity`, `persistence_capacity` or `persistence_request_growth`](#write-capacity) | run the printed `gbrain config set persistence.limits.<limit> <value>` | brain host | none | `gbrain doctor --only persistence_capacity,persistence_request_growth --json` || [`dream_paid_loop`, or dream keeps skipping one transcript](#dream-paid-loop) | fix the cause, then `gbrain dream reset-key --list` and `gbrain dream reset-key '<key>'` | agent, after the user agrees | `paid` (the key is retried) | `gbrain doctor --only dream_paid_loop --json` |-| [A page exists (`gbrain get <slug>` returns it) but search never finds text from it](memory-boundaries.md#large-pages) | find the cause: `gbrain reindex --oversized --dry-run --json` lists pages stored before the upgrade with a size-based `embed_skip` marker (run it without `--dry-run` to keyword-index them, free); a page above an operator-lowered `content_sanity.bytes_block` keeps its marker until the operator raises or unsets it; a page the content-quality gate quarantined as junk shows in `gbrain quarantine list`, and `gbrain quarantine clear <slug>` re-checks it once the user agrees; a file over the 24 MiB page ceiling was never stored ([`file_too_large`](write-refusals.md#file_too_large)). Embedding the re-indexed pages is a separate paid step: `gbrain embed --held --dry-run`, then `gbrain embed --held --source <id> --max-usd <N>` per source | agent for the reindex; the user decides embedding spend, a `bytes_block` change and a quarantine clear | none for the reindex (CPU only); `paid` for `gbrain embed` | `gbrain reindex --oversized --dry-run --json` lists nothing; `gbrain doctor --json`; `gbrain search "<phrase from deep in the page>"` returns the page |-| [Large pages stay out of meaning-based search; `gbrain embed --stale` prints `large page(s) have chunks waiting for embedding approval` or doctor `partial_embedding` warns](memory-boundaries.md#large-pages) | preview with `gbrain embed --held --dry-run` (every source, free); with the user's approval `gbrain embed --held --source <id> --max-usd <N>` per source, N as printed (the run's cap) | agent, after the user agrees | `paid`, `egress` (none on a local provider that bills nothing) | `gbrain embed --held --dry-run --source <id> --json` shows `held: 0` and `capped: 0` for that source; `gbrain doctor --only partial_embedding --json` |+| [A page exists (`gbrain get <slug>` returns it) but search never finds text from it](memory-boundaries.md#large-pages) | `gbrain reindex --oversized --dry-run --json` lists pages stored before the upgrade with a size-based `embed_skip` marker (without `--dry-run` it keyword-indexes them, free); a page above an operator-lowered `content_sanity.bytes_block` keeps its marker until it is raised; a page the content-quality gate quarantined shows in `gbrain quarantine list` (`gbrain quarantine clear <slug>` re-checks it once the user agrees); a file over the 24 MiB page ceiling was never stored ([`file_too_large`](write-refusals.md#file_too_large)). Its chunks waiting for embedding approval (doctor `partial_embedding`) are a paid step: `gbrain embed --held --dry-run`, then `gbrain embed --held --source <id> --max-usd <N>` as printed | agent for the reindex; the user decides embedding spend, a `bytes_block` change and a quarantine clear | none for the reindex; `paid` for `gbrain embed` | `gbrain reindex --oversized --dry-run --json` lists nothing; `gbrain search "<phrase from deep in the page>"` returns the page || [Search answers look keyword-only on a large Postgres brain](#hybrid-search-returns-only-keyword-hits) | read doctor's `vector_plan`; run the index command it prints | brain host | none | `gbrain doctor --only vector_plan --json` || [Broad keyword queries take about 8 s and come back vector-only (`keyword_arm_failed`, or `skipped_after_timeout` for 10 minutes after a timeout) on a large Postgres brain](#keyword-search-times-out-on-a-large-postgres-brain) | read doctor's `keyword_plan`; narrow with `--source-id`, or raise `search.keyword_statement_timeout_ms` on the brain host and restart the serving process | brain host | none | `gbrain doctor --only keyword_plan --json` || A second `gbrain serve` cannot open the brain | the readiness `harness_wiring` fix: every session shares one `gbrain serve --http` | user | `persistent_install`, `credentials` | `gbrain doctor --only harness_wiring --json` |@@ -10839,7 +10838,7 @@ A running sync is not one of these: `gbrain repair fences` now runs during a cat<a id="write-capacity"></a>**Managed writes refused with `queue_capacity`, or doctor warns `persistence_capacity`?** A per-principal or per-brain write-journal limit (`persistence.limits.*`) is full (`queue_capacity`), or doctor sees lifetime request IDs or receipt bytes at 80% or more (`persistence_capacity`). For the cumulative limits (lifetime request IDs and receipt bytes), the warning and the refusal print a `gbrain config set persistence.limits.<limit> <value>` sized for about one more year; run it on the brain host, then retry with the same request ID. For outstanding-request or queued-byte limits, let outstanding writes finish and check `gbrain sources writer status`. Receipt compaction age is `persistence.receipt_retention_days` (default 30). Limits and defaults: [bounded admission and retention](concurrent-writes.md#bounded-admission-and-retention).-<a id="doctor-ops-tier"></a>**`gbrain doctor` is slow on a large brain, or you need to see what is wrong in seconds?** Run `gbrain doctor --tier ops --json`. It runs only the operator sections (write capacity, unresolved write failures, a managed sync cursor that stopped moving, receipt compaction freshness (`persistence_compaction`, see [receipt compaction](repair.md#receipt-compaction)), a serve running an older build, schema-pack consistency, embedding state) under a 4000 ms deadline; `--budget-ms <n>` changes it. A section the deadline cut off is reported as unknown (`details.health: "unknown"`, `reason: "budget"`, `exact: false`), never as clear, and the report says `complete: false` with the section in `unknown_sections`; rerun it alone with `gbrain doctor --only <name> --json`. On PGLite, sections that need a Postgres serve (managed sync, terminal-failure receipts, schema packs) read `not_applicable` and the report stays complete. The default doctor runs the same sections first, then the cheap incident checks (managed sync, `text_projection_readiness`, `partial_embedding`, `links_extraction_lag`), and bounds every other check by `doctor.entry_budget_ms` (default 15000): a check's database statements stop at its budget, and the frontmatter and fence scans report what they read by then. A non-interactive `gbrain doctor --json` (stderr not a terminal, no `--budget-ms`, `--tier`, `--fix` or remediation flag) caps its check run at `doctor.default_budget_ms` (file plane, default 90000; connect and migrations are not counted) and says so on stderr; `--budget-ms 0` turns that off for one run and `gbrain config set doctor.default_budget_ms 0` for good. A check past its budget names the budget (`details.limit`: `entry` or `overall`) and prints `gbrain doctor --only <check> --budget-ms N --json`, which gives that check the whole N. PGLite cannot stop a statement already running, so a check there can finish late. It also estimates `orphan_ratio` from a sample above `doctor.orphan_ratio.full_scan_max_pages` pages (default 50000); `--tier deep` scans fully. From a thin client, `gbrain doctor --tier ops` (or `--only persistence_capacity`) asks the serve: an admin token gets the ops report, a read token gets the `get_brain_health` bands (capacity and write failures as bands, no raw counts), and a serve that predates the ops tier refuses `doctor_tier_unavailable`: run `gbrain doctor --tier ops --json` on the brain host or upgrade and restart its serve. Agents without a shell call MCP `get_brain_health` (read scope) or `run_doctor` with `tier: "ops"` (admin).+<a id="doctor-ops-tier"></a>**`gbrain doctor` is slow on a large brain, or you need to see what is wrong in seconds?** Run `gbrain doctor --tier ops --json`: only the operator sections (write capacity, unresolved write failures, a managed sync cursor that stopped moving, [receipt compaction](repair.md#receipt-compaction) freshness, a serve on an older build, schema-pack consistency, embedding state) under a 4000 ms deadline (`--budget-ms <n>`). A section the deadline cut off reads unknown (`details.health: "unknown"`, `reason: "budget"`, `exact: false`), never clear; the report says `complete: false` and lists it in `unknown_sections`; rerun it with `gbrain doctor --only <name> --json`. On PGLite, serve-only sections read `not_applicable` and the report stays complete. The default doctor runs the same sections first and bounds each check and a plain `--json` run ([doctor budgets](repair.md#doctor-budgets)); above `doctor.orphan_ratio.full_scan_max_pages` pages (default 50000) it samples `orphan_ratio`, and `--tier deep` scans fully. From a thin client, `gbrain doctor --tier ops` (or `--only persistence_capacity`) asks the serve: an admin token gets the ops report, a read token the `get_brain_health` bands (no raw counts), and a serve that predates the ops tier refuses `doctor_tier_unavailable` (run it on the brain host, or upgrade and restart the serve). Agents without a shell call MCP `get_brain_health` (read) or `run_doctor` with `tier: "ops"` (admin).<a id="dream-paid-loop"></a>**Dream keeps skipping one transcript, or doctor warns `dream_paid_loop`?** A dream key died `dream.breaker.max_dead_submissions` times (default 3) in 24 hours and is refused so it stops billing you. Fix the cause, then `gbrain dream reset-key --list` and `gbrain dream reset-key '<key>'`. See [the paid-loop breaker](../operations/spend-controls.md#dream-paid-loop-breaker-dreambreakermax_dead_submissions).diff --git a/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md b/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.mdindex 776748e6e9..6ebdb412ad 100644--- a/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md+++ b/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md@@ -627,8 +627,8 @@ interface RenderedAction {`verify.argv`, `then`) names the brain and source the failing call acted on:`--brain <id>` for commands that open a brain, `--source <id>` for commands thatresolve their source through the ambient chain (shared ops, and CLI commands the-command table marks `routes_source`; `gbrain extract`, whose `--source` picks the-fs|db read mode, gets `--source-id <id>` instead). gbrain appends them when it renders the+command table marks `routes_source`; `gbrain extract`, whose `--source` is the+fs|db mode, gets `--source-id <id>`). gbrain appends them when it renders thefix, before any bare `--`, and keeps flags the fix already carries. So you canrun the fix later from another directory, or under a different `GBRAIN_BRAIN_ID`,`GBRAIN_SOURCE`, `.gbrain-mount` or `.gbrain-source`, and it still acts on the@@ -664,7 +664,7 @@ per-token price), obtain each value as `how` describes and substitute it for| `host_admin` | the operator of the brain host (a remote brain over HTTP, scope grants, server restarts). Never authorizable from MCP || `provider` | an outside service you wait on (rate limits, outages) |-A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`: its actor is `user` (`host_admin` on a remote brain), so it renders `tell_user_to_run`.+A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`; it renders `tell_user_to_run`.### The `next` decision tablediff --git a/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md b/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.mdindex 776748e6e9..6ebdb412ad 100644--- a/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md+++ b/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md@@ -627,8 +627,8 @@ interface RenderedAction {`verify.argv`, `then`) names the brain and source the failing call acted on:`--brain <id>` for commands that open a brain, `--source <id>` for commands thatresolve their source through the ambient chain (shared ops, and CLI commands the-command table marks `routes_source`; `gbrain extract`, whose `--source` picks the-fs|db read mode, gets `--source-id <id>` instead). gbrain appends them when it renders the+command table marks `routes_source`; `gbrain extract`, whose `--source` is the+fs|db mode, gets `--source-id <id>`). gbrain appends them when it renders thefix, before any bare `--`, and keeps flags the fix already carries. So you canrun the fix later from another directory, or under a different `GBRAIN_BRAIN_ID`,`GBRAIN_SOURCE`, `.gbrain-mount` or `.gbrain-source`, and it still acts on the@@ -664,7 +664,7 @@ per-token price), obtain each value as `how` describes and substitute it for| `host_admin` | the operator of the brain host (a remote brain over HTTP, scope grants, server restarts). Never authorizable from MCP || `provider` | an outside service you wait on (rate limits, outages) |-A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`: its actor is `user` (`host_admin` on a remote brain), so it renders `tell_user_to_run`.+A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`; it renders `tell_user_to_run`.### The `next` decision tablediff --git a/plugin/skills/conventions/agent-operator-protocol.md b/plugin/skills/conventions/agent-operator-protocol.mdindex 776748e6e9..6ebdb412ad 100644--- a/plugin/skills/conventions/agent-operator-protocol.md+++ b/plugin/skills/conventions/agent-operator-protocol.md@@ -627,8 +627,8 @@ interface RenderedAction {`verify.argv`, `then`) names the brain and source the failing call acted on:`--brain <id>` for commands that open a brain, `--source <id>` for commands thatresolve their source through the ambient chain (shared ops, and CLI commands the-command table marks `routes_source`; `gbrain extract`, whose `--source` picks the-fs|db read mode, gets `--source-id <id>` instead). gbrain appends them when it renders the+command table marks `routes_source`; `gbrain extract`, whose `--source` is the+fs|db mode, gets `--source-id <id>`). gbrain appends them when it renders thefix, before any bare `--`, and keeps flags the fix already carries. So you canrun the fix later from another directory, or under a different `GBRAIN_BRAIN_ID`,`GBRAIN_SOURCE`, `.gbrain-mount` or `.gbrain-source`, and it still acts on the@@ -664,7 +664,7 @@ per-token price), obtain each value as `how` describes and substitute it for| `host_admin` | the operator of the brain host (a remote brain over HTTP, scope grants, server restarts). Never authorizable from MCP || `provider` | an outside service you wait on (rate limits, outages) |-A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`: its actor is `user` (`host_admin` on a remote brain), so it renders `tell_user_to_run`.+A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`; it renders `tell_user_to_run`.### The `next` decision tablediff --git a/skills/conventions/agent-operator-protocol.md b/skills/conventions/agent-operator-protocol.mdindex 776748e6e9..6ebdb412ad 100644--- a/skills/conventions/agent-operator-protocol.md+++ b/skills/conventions/agent-operator-protocol.md@@ -627,8 +627,8 @@ interface RenderedAction {`verify.argv`, `then`) names the brain and source the failing call acted on:`--brain <id>` for commands that open a brain, `--source <id>` for commands thatresolve their source through the ambient chain (shared ops, and CLI commands the-command table marks `routes_source`; `gbrain extract`, whose `--source` picks the-fs|db read mode, gets `--source-id <id>` instead). gbrain appends them when it renders the+command table marks `routes_source`; `gbrain extract`, whose `--source` is the+fs|db mode, gets `--source-id <id>`). gbrain appends them when it renders thefix, before any bare `--`, and keeps flags the fix already carries. So you canrun the fix later from another directory, or under a different `GBRAIN_BRAIN_ID`,`GBRAIN_SOURCE`, `.gbrain-mount` or `.gbrain-source`, and it still acts on the@@ -664,7 +664,7 @@ per-token price), obtain each value as `how` describes and substitute it for| `host_admin` | the operator of the brain host (a remote brain over HTTP, scope grants, server restarts). Never authorizable from MCP || `provider` | an outside service you wait on (rate limits, outages) |-A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`: its actor is `user` (`host_admin` on a remote brain), so it renders `tell_user_to_run`.+A fix expected to run past 120 s (`AGENT_TOOL_LIMIT_MS`) is never `agent`; it renders `tell_user_to_run`.### The `next` decision tablediff --git a/skills/skills.lock.json b/skills/skills.lock.jsonindex c6cfeedeaa..9ffa9404ae 100644--- a/skills/skills.lock.json+++ b/skills/skills.lock.json@@ -44,7 +44,7 @@"concept-synthesis/routing-eval.jsonl": "96dbd7d9c1b606e9e06262d0c06282399741e2bccb8eeb7b9ca88c20f44cda0e","context-audit/SKILL.md": "6d786629d40544ddaab4f4e6e333569d270bcb8b581589dc16fb9f8bcb4f6207","context-audit/routing-eval.jsonl": "fb1832e24cc1b04163a74c5cde72bca53050a66246ca902e1a5f40303f52b5ab",- "conventions/agent-operator-protocol.md": "ad1744ae2e6893b72c530e1e195c52cf3867d6491ec15dbcb0f5ef2153655bcd",+ "conventions/agent-operator-protocol.md": "28b1a2e422e1886a32199c67047bfed544216852268731b0f79d3c77f2a7b0f6","conventions/brain-first.md": "987223ce443b3e8cdcd22975aafabce778016f238deddf544c346238dbde1bd9","conventions/brain-routing.md": "392998d9a109b330c9225af4ca5c8798b0ff02eba4d441c93fdb7c263687d0c6","conventions/calibration.md": "500dc26bd7c8400f50dc4c16fd83f1a588f3e7e68c59050a21fd8a0f69e4d198",