Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(regen): fix wave 12 generated docs, skills, flag registry and goldens; llms-full drops the MCP deployment runbook to stay under budget

time-attack258e2f6f386c
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.md
index 35ca5a1566..720346c22f 100644
--- a/docs/TOOL_CATALOG.md
+++ b/docs/TOOL_CATALOG.md
@@ -172,7 +172,7 @@ Every non-localOnly operation on the MCP surface: 140 tools across 23 areas. **S
| `get_write_request` | Read your write's receipt by request_id (after write_pending or a lost reply). | write | yes | |
| `list_pages` | List pages with filters. | read | yes | |
| `list_write_requests` | List your write receipts in one source, newest first. | write | yes | |
-| `put_page` | Complete content REPLACES the whole page: read get_page include_content:true, then send its revision as expected_revision and a request_id. | write | yes | |
+| `put_page` | Complete content REPLACES the whole page: read get_page include_content:true; send its revision as expected_revision. | write | yes | |
| `put_pages` | Write up to 50 complete Markdown pages (8 MB total) in one call; use instead of put_page for more than 3 pages. | write | | |
| `put_raw_data` | Store a raw provider payload (API response JSON) alongside a page, keyed by source. | write | | |
| `resolve_slugs` | Fuzzy-match a partial slug or title to page slugs. | read | yes | |
diff --git a/docs/guides/error-codes.md b/docs/guides/error-codes.md
index 52d749de6b..e224ec1878 100644
--- a/docs/guides/error-codes.md
+++ b/docs/guides/error-codes.md
@@ -728,6 +728,16 @@ More: [docs/guides/ambient-recall.md#replay-after-a-degraded-wake](../../docs/gu
|---|---|---|---|---|---|---|
| Commit or stash canonical skill edits before optimization. | The request itself was wrong or no longer matches the brain; nothing was changed. | Correct the request using the message above, then retry. | agent | `repeat the read that failed` | 1 | no |
+### dream_breaker_tripped
+
+<a id="dream_breaker_tripped"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| A dream synthesize or patterns submission died (or, for patterns, was cancelled at its timeout after paid work) the breaker limit of times within 24 hours, so it was not submitted again. | A run that keeps dying keeps paying; the breaker stops resubmitting until the cause is fixed and the key is reset. Patterns count per source (`dream:patterns:source:<id>`) whatever reflections each run read, and a completed run resets that count. | A required capability is not available on this brain. Run `gbrain doctor --json` to see what is missing. Run: gbrain doctor --only dream_paid_loop --json | agent | `gbrain doctor --json` | 1 | no |
+
+More: [docs/operations/spend-controls.md#dream-paid-loop-breaker-dreambreakermax_dead_submissions](../../docs/operations/spend-controls.md#dream-paid-loop-breaker-dreambreakermax_dead_submissions)
+
### effect_not_failed
<a id="effect_not_failed"></a>
@@ -858,7 +868,7 @@ More: [docs/guides/move-to-postgres.md#graduated-datastore](../../docs/guides/mo
| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
|---|---|---|---|---|---|---|
-| The accepted atom extraction produced malformed output. | The server failed; this is not a caller mistake. | Server-side failure, not a caller mistake. Run `gbrain doctor --json` on the brain host; if it repeats, report it to the user. | host_admin | `gbrain doctor --json` | 1 | no |
+| The accepted atom extraction failed (malformed output, or a response stopped before the end); a new attempt needs approval. | A failed managed atom batch is recorded as a failure receipt instead of being retried automatically, so the same input is not paid for every cycle. | Server-side failure, not a caller mistake. Run `gbrain doctor --json` on the brain host; if it repeats, report it to the user. | host_admin | `gbrain doctor --json` | 1 | no |
### extractor_identity_mismatch
@@ -894,6 +904,18 @@ More: [docs/guides/move-to-postgres.md#graduated-datastore](../../docs/guides/mo
More: [docs/guides/write-refusals.md#facts_absorb_write_refused](../../docs/guides/write-refusals.md#facts_absorb_write_refused)
+### facts_backstop_skipped
+
+<a id="facts_backstop_skipped"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| A page write queued no automatic fact extraction; the receipt's `facts_backstop.skipped` reason says why (a `kind:<type>` reason names a page type that is not extracted). | A capability this request needs is not configured or not reachable on this brain. | Nothing failed. `opted_out` means the page frontmatter sets `facts_backstop: false`; remove that line and save the page to extract it. Run: gbrain get --source '{source_id}' -- '{slug}' | agent | `gbrain doctor --json` | 1 | no |
+
+Reasons: `opted_out`, `body_unchanged`, `extraction_disabled`, `dream_generated`, `subagent_namespace`, `too_short`, `no_parsed_page`, `slug_bound_client`, `operation_bound_client`, `not_imported`, `backstop_error`.
+
+More: [docs/guides/concurrent-writes.md#facts-backstop](../../docs/guides/concurrent-writes.md#facts-backstop)
+
### facts_drain_deferred
<a id="facts_drain_deferred"></a>
@@ -1520,6 +1542,16 @@ More: [docs/guides/repair.md#legacy-jobs-active](../../docs/guides/repair.md#leg
|---|---|---|---|---|---|---|
| Another process holds the lock this command needs. | A temporary condition (a lock, a pending write, a rate limit); the same request can succeed later. | Wait briefly, then retry the same request (writes: reuse the same request_id). | agent | `repeat the read that failed` | 1 | yes |
+### maintenance_lock_busy
+
+<a id="maintenance_lock_busy"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| A source-scoped dream cycle skipped its brain-wide phases because another cycle (usually autopilot maintenance) holds the shared gbrain-cycle lease; its source phases still ran. | Brain-wide phases (synthesize, patterns, embed, purge and the other mixed or global phases) must not run twice at once, so a cycle that cannot take gbrain-cycle runs only the phases its own source lease covers. | Nothing is lost: the holder runs those phases itself. To run one now, wait until the lease is released, then re-run `gbrain dream --phase <phase>` (LLM-backed phases spend; ask the user first). Run: gbrain status --section locks --json | agent | `repeat the read that failed` | 1 | yes |
+
+More: [docs/guides/cron-schedule.md#dream-beside-autopilot](../../docs/guides/cron-schedule.md#dream-beside-autopilot)
+
### managed_pull_skipped
<a id="managed_pull_skipped"></a>
@@ -1530,6 +1562,14 @@ More: [docs/guides/repair.md#legacy-jobs-active](../../docs/guides/repair.md#leg
More: [docs/guides/write-refusals.md#managed_pull_skipped](../../docs/guides/write-refusals.md#managed_pull_skipped)
+### manual_only_skipped
+
+<a id="manual_only_skipped"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| An automatic remediation run (`gbrain onboard --auto`, `doctor --remediate`, MCP `run_onboard`, autopilot) did not submit a manual-only step: the schema-pack upgrade (`unify-types`) or the paid takes bootstrap (`extract-takes-from-pages`). | A pack upgrade retypes pages and switches the brain's schema pack, and the takes bootstrap pays a model per page; both are the user's one-time decision, so only the user submits them. A job of that kind an earlier run already queued is listed in `queued_jobs` and still runs unless cancelled. | Show the user the step and its `fix.command` (`gbrain jobs submit <job> --follow`, with `--params` when the step has them); the user runs it after reviewing `gbrain onboard --check`. Cancel a listed queued job with `gbrain jobs cancel <id>` if the user does not want it. Run: gbrain jobs list --status waiting | user | `repeat the read that failed` | 1 | no |
+
### membership_inactive
<a id="membership_inactive"></a>
@@ -1772,6 +1812,14 @@ More: [docs/guides/repair.md#page-projection-conflict](../../docs/guides/repair.
More: [docs/guides/google-connect.md#troubleshooting](../../docs/guides/google-connect.md#troubleshooting)
+### pattern_claims_pending
+
+<a id="pattern_claims_pending"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| An existing pattern page is waiting on the rewrite that de-duplicates its claim sources, so no patterns child was submitted this run. | The patterns child reads existing pattern pages; until their claim records reference one shared reflection list, the pages can overflow the model's window and the run pays for nothing. | Wait briefly, then retry the same request (writes: reuse the same request_id). Run: gbrain write-requests --source '{source_id}' | agent | `repeat the read that failed` | 1 | yes |
+
### payload_too_large
<a id="payload_too_large"></a>
@@ -2460,6 +2508,14 @@ More: [docs/guides/write-refusals.md#timeline_rows_would_be_removed](../../docs/
More: [docs/guides/data-ingestion.md#credential-redaction](../../docs/guides/data-ingestion.md#credential-redaction)
+### triage_unreliable_backoff
+
+<a id="triage_unreliable_backoff"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| Dream triage did not re-judge a transcript because its last judge verdict was truncated, refused or unparseable and its backoff has not ended. | An unreliable verdict is never cached, so without a backoff the same input was paid for every cycle; it waits 24h, doubling per repeat up to 7 days, and a content or triage-model change re-judges at once. | Leave it (it is retried after the backoff), or ask the user before `gbrain dream retriage --force`, which re-judges every transcript now and pays per file. Run: gbrain dream retriage --dry-run --json | agent | `repeat the read that failed` | 1 | yes |
+
### trusted_local_only
<a id="trusted_local_only"></a>
diff --git a/llms-full.txt b/llms-full.txt
index 70a76bd795..e6abb045b0 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -3097,7 +3097,7 @@ gbrain onboard --check --json
The JSON envelope (`schema_version: 1`) carries `recommendations[]` with
`apply_policy` per item: `auto_apply` (safe to run unattended),
`prompt_required` (needs explicit user consent), or `manual_only`
-(LLM-bearing, user must run themselves).
+(pack upgrade, paid takes bootstrap: the user runs it).
**After every `gbrain upgrade`:**
```bash
@@ -3111,9 +3111,10 @@ step regardless.
```bash
gbrain onboard --auto --max-usd 5
```
-Refuses without `--max-usd N`. Runs auto-eligible items only. The
-autopilot daemon also consults onboard recommendations on its tick — no
-explicit agent action needed for the autonomous path.
+Refuses without `--max-usd N`. Never runs `manual_only` items; it
+lists them in `manual_only_skipped`. The autopilot daemon also consults
+onboard recommendations on its tick — no explicit agent action needed
+for the autonomous path.
**Remote / federated brain installs (MCP):**
The `run_onboard` MCP op (admin scope) lets thin-client agents probe
@@ -6783,6 +6784,14 @@ scheduling surfaces — reach for these first:
For scheduling `sync` + `embed --stale` specifically, the home doc is
[live-sync.md](live-sync.md).
+### Dream beside autopilot
+
+A nightly `gbrain dream` beside autopilot is supported. Source phases run
+under the source's own lease; brain-wide phases (synthesize, patterns, embed,
+purge…) also need the shared `gbrain-cycle` lease, so the later run skips only
+those (`maintenance_lock_busy`) and the holder runs them.
+`gbrain status --section locks --json` shows the holder.
+
## Implementation: Setting Up Cron Jobs
```bash
@@ -6909,6 +6918,9 @@ per-transcript synthesis subagents. The dials:
judging NEW files; a big cold corpus triages across a few cycles (cached
files are free). Deferred files are labeled "not yet triaged", never
silently rejected.
+- A truncated, refused or unparseable verdict backs off (24h, doubling to
+ 7 days; `triage_unreliable_backoff`) instead of being re-paid nightly;
+ `gbrain dream retriage --force` re-judges now.
- `dream.synthesize.max_submissions_per_source_per_day` (default 0 = off) —
opt-in backstop cap on synthesis jobs per source; 200/day is a sane value
for busy deployments.
@@ -8039,860 +8051,6 @@ gbrain sources remove gh --confirm-destructive
---
-## docs/mcp/DEPLOY.md
-
-Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/mcp/DEPLOY.md
-
-# Deploy GBrain Remote MCP Server
-
-> `gbrain serve --http` ships full OAuth 2.1 (client credentials, auth code +
-> PKCE, refresh rotation, optional DCR), an embedded React admin dashboard at
-> `/admin`, scoped operations, and a live SSE activity feed. Legacy bearer
-> tokens also work: `verifyAccessToken` falls back to the `access_tokens`
-> table; tokens with no `scopes` grant carry `read+write+admin`,
-> while tokens minted with `gbrain auth create --scopes …` (or by
-> `gbrain bootstrap harness`) are honored at exactly their granted scopes.
-> Both the legacy fallback and the OAuth tables work on PGLite and Postgres
-> (both engine schemas carry `access_tokens`). See [SECURITY.md](../../SECURITY.md) for env vars and
-> tunable defaults.
-
-Access your brain from any device, any AI client. GBrain ships two transports:
-`gbrain serve` (stdio) for local agents, and `gbrain serve --http` for remote
-clients over OAuth 2.1. The recommended way to publish `serve --http` from your
-own computer is `gbrain mcp expose`, which puts it on your Tailscale tailnet
-with HTTPS and keeps it running as a user service — see
-[Use your brain from anywhere over MCP](../guides/remote-mcp.md).
-
-**Say to your agent:** *"use my brain over mcp"* — *"put my brain on
-tailscale"* — the `remote-mcp` skill runs `gbrain mcp expose` for you after
-you confirm the printed plan.
-
-For **owner login, client registration, setup instructions, permission edits,
-token invalidation, revocation, or deletion**, start with
-[MCP administration](ADMIN.md). For the connecting harness, use
-[hosted setup](../guides/hosted-harness-access.md). The owner bootstrap credential
-is separate from OAuth `admin` scope; only the former authenticates the owner
-dashboard and client-management API.
-
-Authorization-code connections require owner approval in the admin dashboard.
-Existing sessions are preserved. Before upgrading an installation with queued
-work, follow the [authorization and worker upgrade guide](../guides/authorization-upgrade.md)
-for the coordinated cutover, consent recovery, and Bun requirements.
-
-**The owner-approval step.** `/authorize` never returns an authorization code
-on its own. It records a pending request and redirects the browser to the admin
-dashboard (`/admin/?oauth_request=…`), where the brain owner signs in (bootstrap
-token or magic link), reviews the client name, redirect URI and requested
-scopes, and approves or denies. Only an approval mints the code, which is then
-delivered to the client's registered redirect URI; a denial returns
-`error=access_denied`. This applies to every authorization-code client,
-including clients that self-registered via DCR — self-registration alone never
-yields a token. Pending requests expire after ten minutes, do not survive a
-server restart, and are bounded: at most ten awaiting-decision requests per
-client and a fixed server-wide ceiling. Beyond either, `/authorize` sends the
-client back to its registered redirect URI with `error=too_many_requests`
-(and no code) until earlier requests are decided or expire; a `429` status on
-`/authorize` comes only from the MCP SDK's per-IP rate limit.
-
-**Say to the server-hosting harness:** *"Expose my existing brain over HTTPS,
-configure a protected owner credential, and help connect my native OAuth client.
-Use manual registration unless I request self-service registration. Preserve
-the OAuth request when issuing my owner login link."*
-
-## Three Paths
-
-### Local stdio (zero setup)
-
-```bash
-gbrain serve # full operation catalog (default)
-gbrain serve --surface verbs # just the 7 memory verbs (quickstart surface)
-```
-
-Works with Claude Code, Cursor, Windsurf, and any MCP client that supports stdio.
-No server, no tunnel, no token needed. Works on both PGLite and Postgres engines.
-`--surface verbs` exposes exactly the seven-verb memory protocol (`recall`,
-`remember`, `entity`, `synthesize`, `forget`, `context_pack`, `delta` —
-[MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md)) instead of the full catalog;
-`--surface starter` sits between (~27 ops: the verbs plus the daily-driver set);
-omit the flag (default `full`) for every operation.
-
-`--surface` is the callable ceiling. To keep every operation callable while
-listing fewer tools to the agent, set `mcp.advertised_surface`:
-
-```bash
-gbrain config set mcp.advertised_surface verbs # list the 7 verbs; everything else stays callable
-```
-
-Unset is the recommended default. In a held-out agent benchmark, listing only
-`starter` or `verbs` lowered task success by 8–10 points pooled across four
-frontier models, mostly on tasks that need an unlisted tool (agents rarely
-reached for `request_tools`), and saved no tokens. Narrow the list only for a
-client that cannot hold the full catalog.
-
-`tools/list` then shows the advertised surface, and the initialize
-instructions tell the agent how many more tools are callable. On stdio,
-`request_tools` with `tools: [names]` returns their schemas and adds them to
-that session's list (the server sends `tools/list_changed`). On the OAuth HTTP
-server, a client that set its own surface (`request_tools` with `surface`, or
-`gbrain auth rescope-client`) has that surface listed in full. Unset
-advertises the whole callable set.
-
-#### Stdio source binding
-
-Do not inherit `GBRAIN_SOURCE=__all__` from a trusted CLI session into a
-stdio MCP server. It does not grant all-source access: the server keeps a
-fail-closed scope, so searches can return healthy empty results even when
-the trusted CLI finds pages. Startup stderr warns about this binding before
-the MCP handshake; it does not inspect or reveal private pages.
-
-In the MCP host's server environment, set `GBRAIN_SOURCE` to the intended
-registered source id, or remove it to use normal source resolution and its
-configured federation rules. Inspect registered ids with `gbrain sources list`
-on the brain host, then restart the MCP server and check a known world-visible
-page in the intended source. Removing the variable is not unrestricted access:
-dotfiles and other source-resolution settings still apply. No memory writes or
-index repair are needed to correct this environment binding.
-
-This differs from the per-call `source_id: "__all__"` argument, which searches
-only the caller's granted sources. MCP callers also exclude private pages by
-default; a private-only miss is not evidence of a broken index. For a concrete
-source binding that still misses a known visible page, retain the version,
-engine, schema pack, effective source/grants, and retrieval metadata for a
-sanitized reproduction rather than broadening permissions.
-
-### Tailscale (recommended): `gbrain mcp expose`
-
-```bash
-gbrain mcp expose # tailnet-only HTTPS: your own devices
-gbrain mcp expose --funnel # public HTTPS on the same name: cloud agents (Grok Bot, Muse, ChatGPT, …)
-gbrain mcp expose --status # re-probe the receipt, service and health
-```
-
-One command on the brain host: installs Tailscale if needed (after a consent
-prompt), signs in, publishes `gbrain serve --http` on your MagicDNS name with
-Tailscale-terminated TLS, provisions the admin bootstrap token in a private
-file, installs a launchd / systemd user service so the server survives
-reboots, and prints the MCP URL
-(`https://your-machine.your-tailnet.ts.net/mcp`) plus separate owner-login, native OAuth, and machine-client next steps. Engine-free — it works while a PGLite brain's `serve` holds the
-write lock. Default reach is your tailnet only; `--funnel` is the explicit
-opt-in for agents that run in a vendor's cloud. Steps, flags, `--remove`,
-and the troubleshooting table: [remote MCP guide](../guides/remote-mcp.md).
-
-```
-Your AI client
- → https://your-machine.your-tailnet.ts.net/mcp (Tailscale terminates TLS)
- → gbrain serve --http on 127.0.0.1:3131 (user service)
- → Postgres or PGLite
-```
-
-Then choose the intended client's connection method. Native OAuth/PKCE uses
-[owner registration](ADMIN.md#native-oauth-with-pkce). For a private machine
-handoff, provision through the running server (the only way on PGLite while
-`serve` is live):
-
-```bash
-gbrain mcp grant agent-example --harness codex --profile memory-writer --source default \
- --url https://your-machine.your-tailnet.ts.net/mcp \
- --admin-token-file ~/.gbrain/serve/admin-token --credentials-out /private/agent-example.json
-```
-
-### Other tunnels and cloud hosts
-
-Any HTTPS front works: ngrok, Cloudflare Tunnel, or a cloud host (Fly.io,
-Railway) for a brain that must answer while your laptop is closed —
-[ALTERNATIVES.md](ALTERNATIVES.md) compares them. You run `gbrain serve --http`
-yourself and pass `--public-url` whenever the server is reachable at anything
-other than `http://localhost:<port>` so the OAuth issuer in discovery metadata
-matches what clients hit (RFC 8414 §3.3).
-
-#### Remote over OAuth 2.1
-
-```bash
-ngrok http 3131 --url your-brain.ngrok.app
-```
-
-Keep the tunnel running in its own terminal, then start the brain server once:
-
-```bash
-gbrain serve --http --port 3131 --public-url https://your-brain.ngrok.app
-```
-
-Built-in HTTP transport with OAuth 2.1, scoped operations, an admin dashboard
-at `/admin`, and a live SSE activity feed. Zero external dependencies. This is
-the only auth shape that works with ChatGPT (OAuth 2.1 + PKCE is required by
-the ChatGPT MCP connector).
-
-Supported clients:
-- **ChatGPT** — requires OAuth 2.1 + PKCE. Works natively with `--http`.
-- **Claude Desktop / Cowork** — OAuth 2.1 or legacy bearer tokens.
-- **Perplexity** — OAuth 2.1 client credentials grant.
-- **Claude Code, Cursor, Windsurf** — can use OAuth or legacy bearer.
-
-See the [OAuth 2.1 setup](#oauth-21-setup) section below.
-
-#### Remote with legacy bearer tokens (simplest)
-
-```
-Your AI client (Claude Desktop, Perplexity, etc.)
- → HTTPS front (Tailscale name, ngrok domain, or cloud host)
- → gbrain serve --http (MCP bearer access; separate owner administration)
- → Postgres or PGLite
-```
-
-This requires:
-1. A machine running `gbrain serve --http` (works on both PGLite and Postgres
- brains)
-2. An HTTPS front (Tailscale via `gbrain mcp expose`, ngrok, or a cloud host)
-3. A bearer token created via `gbrain auth create <name>`
-
-Bearer tokens created without a `scopes` grant carry `read+write+admin` on
-the HTTP server; `gbrain auth create --scopes read,write` mints narrowed
-tokens.
-
-## OAuth 2.1 Setup
-
-### 1. Start the HTTP server
-
-If `gbrain mcp expose` already started the service, keep using it and its
-configured MCP URL. Continue to owner login or client registration; do not
-start another server or repeat the publishing step.
-
-For a manually managed server, choose the HTTPS front and `--public-url` from
-[step 3](#3-expose-the-server) before starting it. This local-only example
-starts one foreground process:
-
-```bash
-gbrain serve --http --port 3131
-```
-
-On first start in an interactive terminal, the server prints an **admin
-bootstrap token** to stderr:
-
-```
-Admin bootstrap token: 3a1f9c...
-Open http://localhost:3131/admin and paste it to log in.
-```
-
-On a non-TTY start (systemd, Docker, any piped or captured logs) the generated
-token is hidden so it never lands in log storage. For headless deploys,
-set `GBRAIN_ADMIN_BOOTSTRAP_TOKEN` through the service's protected environment
-before starting. `--print-admin-token` can force printing at that process's
-startup on a trusted terminal; starting a separate process with this flag does
-not recover the existing server's token. If the existing process's generated
-credential was lost, restart that service through the normal maintenance path
-with a configured credential. See [owner credential recovery](ADMIN.md#set-up-or-recover-the-owner-credential).
-
-Save this token. Open `http://localhost:3131/admin` and paste it to access the
-dashboard. The dashboard shows live activity, registered clients, request logs,
-and per-client config export.
-
-> `mcp_request_log.params` and the live SSE activity feed default to a redacted
-> summary `{redacted, kind, declared_keys, unknown_key_count, approx_bytes}`.
-> Declared param keys are kept (intersected against the operation's spec); unknown
-> keys are counted but never named, and byte sizes round up to 1KB so size-probe
-> attacks can't binary-search secret content. Operators on a personal laptop who
-> want raw payloads back can pass `gbrain serve --http --log-full-params` (loud
-> stderr warning fires at startup). Multi-tenant deployments should leave it on
-> the redacted default.
-
-### Owner login links for AI agents
-
-**Say to the server-hosting or authorized administrator harness:** *"Give me
-the GBrain admin login link"*. The recommended command wraps the existing HTTP
-mint endpoint:
-
-```bash
-gbrain mcp admin login-link --url https://brain.example.com/mcp \
- --admin-token-file /absolute/private/admin-token --json
-```
-
-During OAuth connection, add `--oauth-request REQUEST_ID` from the pending
-browser URL. This preserves consent when the owner opens the login link in a
-fresh tab or browser. Expired/restarted requests require a new connection from
-the native client; its PKCE verifier stays in that client. Full commands and
-recovery instructions: [MCP administration](ADMIN.md).
-
-When an authenticated owner asks **"Give me the GBrain admin login link"**,
-use the existing single-use login flow. A static `/admin/` URL opens the login
-page; it does not authenticate the owner.
-
-1. Use the requesting owner's authorization and a private destination for the login link.
-2. Obtain the running server's bootstrap credential through the host's existing
- protected credential mechanism. `GBRAIN_ADMIN_BOOTSTRAP_TOKEN` is the supported
- deployment setting. Never expose its value in chat, logs, shell arguments,
- or a URL. If the credential is unavailable, report that specific setup blocker;
- do not claim the login-link capability is missing.
-3. Send `POST /admin/api/issue-magic-link` to the running server, with the
- bootstrap credential in the `Authorization: Bearer` header through that
- protected mechanism. An MCP client bearer token or client secret is not the
- server bootstrap credential.
-4. The response contains `url` and `expires_in` (300 seconds). The returned URL
- uses the server's configured `--public-url`; without it, the fallback is
- localhost. Ensure the deployment has an owner-reachable public URL rather
- than substituting a remembered tunnel address.
-5. Deliver the returned short-lived login link only to the requesting owner in
- private. In a shared channel, acknowledge private delivery without reproducing
- the link. Never put it into a public issue or commit.
-
-**Do not GET or fetch the generated login URL to verify it.** That redeems the
-single-use nonce before the owner can use it. Check the base `/admin/` page and
-non-secret response metadata separately. The link expires after five minutes,
-cannot be replayed, and is invalidated by a server restart. Successful redemption
-establishes the admin browser session and redirects to `/admin/`.
-
-This logs the owner into the dashboard; it does not create, reveal, or rotate an
-MCP client credential. Register the intended OAuth client separately on the
-[Agents page](#2-register-oauth-clients), then use its setup instructions and
-explicit private download when needed. For unattended deployments, provision the
-bootstrap credential through the operator's protected configuration before
-starting the server; generated secrets are deliberately hidden in captured logs.
-
-### 2. Register OAuth clients
-
-Register from the **`/admin` dashboard's Agents page**. Choose machine
-credentials, public PKCE (`none`), or confidential PKCE (POST/Basic) according
-to the intended harness. Native OAuth requires its actual redirect URI. Review
-permissions and connection metadata before registration, then use the setup
-instructions for that client. Public clients have no secret; confidential
-delivery is explicit and recoverable from the protected host journal while
-the live secret still matches.
-
-For a running server, use the owner HTTP CLI:
-
-```bash
-gbrain mcp admin register agent-example \
- --redirect-uri https://client.example.com/oauth/callback \
- --token-endpoint-auth-method none --scopes read,write --source default \
- --url https://brain.example.com/mcp \
- --admin-token-file /absolute/private/admin-token --dry-run --json
-```
-
-Review and repeat without `--dry-run`. Machine credentials use `gbrain mcp
-grant … --credentials-out PRIVATE_FILE` instead. See [registration and
-setup](ADMIN.md#register-and-connect-a-client) for both flows. The legacy
-`gbrain auth register-client` command remains a local database-maintenance path;
-do not open an already running PGLite brain through it.
-
-**Source-scoped clients.** Multi-source brains can scope a client's write
-authority to one source and its read scope to a curated set with the
-`--source` and `--federated-read` flags:
-
-```bash
-gbrain mcp grant dept-x-agent --harness generic --profile memory-writer \
- --source dept-x --federated-read dept-x,shared,parent-canon \
- --url https://brain.example.com/mcp \
- --admin-token-file /absolute/private/admin-token \
- --credentials-out /absolute/private/dept-x-agent.json --json
-```
-
-`--source` controls the write authority — `put_page` / `add_link` / etc only
-land in `dept-x`. `--federated-read` controls the read axis independently;
-queries return rows from any of the listed sources. New registrations that omit
-both flags use source `default`; omission does not create an unscoped
-super-client. A client with no recorded source is backfilled to
-`source_id='default'` on `gbrain upgrade`. Within a source,
-slug-level write fencing is also available: `--bound-slug-prefixes p1/,p2/`
-rejects slug-mutating writes outside the listed prefixes (update later with
-`gbrain auth rescope-client <id> --bound-slug-prefixes <p1,p2|none>`).
-
-Host-repo wrappers can register programmatically:
-
-```ts
-await oauthProvider.registerClientManual(
- 'perplexity',
- ['client_credentials'],
- 'read write',
- [], // redirect_uris, empty for CC
-);
-```
-
-### Dynamic client registration (DCR)
-
-For self-service client registration (Dynamic Client Registration, RFC 7591),
-start the server with `--enable-dcr`. DCR is off by default.
-
-**Say to your agent:** *"Start my brain's MCP server with self-service client
-registration — your agent runs `gbrain serve --http --enable-dcr`, and you
-approve each new connection in the admin UI."*
-
-A self-registered client goes through three gates:
-
-1. **Scope ceiling at registration.** Dynamic registration may request at most
- `read write`. A request naming `admin`, `sources_admin`, `users_admin`, or
- `agent` is rejected with HTTP 400 `invalid_client_metadata` (never silently
- narrowed), and the error text points at the operator path. Under
- `--enable-dcr-insecure`, a `client_credentials` registration is capped at
- `read` — a grant that skips owner approval never carries `write`. While
- DCR is enabled (either mode), OAuth discovery advertises the `read write`
- self-registration ceiling as `scopes_supported` (authorization-server and
- protected-resource metadata alike), so a client that registers with the
- advertised scopes succeeds;
- with DCR off, discovery lists every scope an operator-registered client
- may hold. `agent` is never advertised — it needs delegation bindings no
- OAuth request can carry.
-2. **Owner approval on `/authorize`.** Every authorization-code connection
- redirects to the admin dashboard, where you see the client, its redirect
- URI, and the requested scopes, and approve or deny. No code is minted
- until you approve. Consent never widens the registered scope.
-3. **Per-request clamp.** Issued codes and tokens are re-intersected with the
- client's current registered scope, so a later `rescope-client` takes effect
- on the next request.
-
-To give a self-registered client more than `read write`, use the
-[owner permission-edit path](ADMIN.md#inspect-clients-and-edit-access)
-(or the admin dashboard's Agents page), then reconnect for fresh authorization.
-Alternatively, pre-register through `gbrain mcp admin register` with the intended
-scopes. The legacy `gbrain auth rescope-client` / `register-client` commands are
-local database-maintenance paths; do not open a live PGLite database through them.
-`gbrain doctor` warns about active clients that hold a privileged scope but
-look self-registered.
-
-Native MCP clients register cleanly: `redirect_uris` may use an app custom
-scheme (RFC 8252, e.g. `myapp://callback`) or `http://` loopback alongside
-`https://`; scopes the server doesn't know are filtered rather than fatal;
-and malformed registration metadata is rejected with HTTP 400
-`invalid_client_metadata` (never a 500), so a client can correct and retry.
-
-DCR requests may include an optional `token_ttl_seconds` field (integer,
-seconds) to request a per-client access-token lifetime. The server clamps the
-request into an admin-configured window — never rejects over it — persists the
-effective value as the client's TTL override, and echoes it back as
-`token_ttl_seconds` in the registration response. Subsequent `/token` responses
-for that client carry the matching `expires_in`. Clients that omit the field
-keep the server default (`--token-ttl`). The window defaults fail-closed: min
-300 seconds, max bounded by your `--token-ttl` — a self-registering client
-cannot request a longer-lived token than the server default unless you
-explicitly widen the window:
-
-```bash
-gbrain config set oauth.dcr_ttl_min_seconds 600
-gbrain config set oauth.dcr_ttl_max_seconds 86400
-```
-
-### 3. Expose the server
-
-**Tailscale (recommended).** `gbrain mcp expose` does this whole section for
-you — Tailscale install/login, `tailscale serve` (or `funnel`), the admin
-token file, a user service, and the health checks — and keeps the server on
-its default loopback bind, because Tailscale terminates TLS on the tailnet
-and forwards to `127.0.0.1`. The manual equivalent is the
-[Tailnet / LAN-only](#tailnet--lan-only-no-public-tunnel) shape below. Full
-walkthrough: [remote MCP guide](../guides/remote-mcp.md).
-
-Choose this managed-service path before starting a manual server. If a server
-already answers at the intended HTTPS endpoint, use that deployment. Publishing
-an independently managed server with `--no-service` requires that server's own
-configured owner credential; an expose-created file does not change it.
-
-**ngrok (alternative).** ngrok also connects to loopback on the same
-machine, so the default bind is right there too:
-
-```bash
-gbrain serve --http --port 3131 --public-url https://your-brain.ngrok.app
-```
-
-**Bind explicitly only when the front is on another host.** `gbrain serve
---http` defaults to `127.0.0.1`. To accept connections from a reverse proxy
-or tunnel agent running on a different machine (or a container), restart with
-`--bind`:
-
-```bash
-gbrain serve --http --port 3131 --bind 0.0.0.0 --public-url https://brain.example.com
-```
-
-When `--public-url` is set without `--bind`, a stderr WARN fires at
-startup so a real misconfiguration ("the tunnel is up but my agent gets
-ECONNREFUSED") is loud; in the Tailscale and same-machine-ngrok shapes the
-WARN is expected and harmless. Binding `0.0.0.0` without
-`GBRAIN_HTTP_CORS_ORIGIN` warns too: browser-based clients get no CORS header
-until you set the allowlist (see [SECURITY.md — CORS](../../SECURITY.md#cors)).
-
-`--source-guard` is a stdio-lane flag: with `--http` it prints a warning and
-is ignored. HTTP writes are fenced by each token's scopes instead, so
-operators migrating from stdio mint narrowed tokens
-(`gbrain auth create <name> --scopes read`) rather than relying on the guard.
-
-For the ngrok alternative, start the tunnel after the server:
-
-```bash
-brew install ngrok
-ngrok config add-authtoken YOUR_TOKEN
-ngrok http 3131 --url your-brain.ngrok.app
-```
-
-Your OAuth issuer URL is whatever `--public-url` names
-(`https://your-machine.your-tailnet.ts.net` under Tailscale,
-`https://your-brain.ngrok.app` under ngrok). The MCP SDK's
-router exposes the spec-compliant discovery endpoint at
-`/.well-known/oauth-authorization-server`. The protected resource is the
-`/mcp` endpoint itself: its RFC 9728 metadata is served at
-`/.well-known/oauth-protected-resource/mcp` (the bare
-`/.well-known/oauth-protected-resource` root stays as an alias for older
-clients), and every 401 carries `WWW-Authenticate: Bearer
-resource_metadata="<that URL>"`, so an MCP client pointed at
-`https://your-machine.your-tailnet.ts.net/mcp` finds the token endpoint from a
-fresh connection without any pasted URLs.
-
-**Dual-mode auth on `/mcp`.** The same route verifies OAuth 2.1 access
-tokens and `gbrain auth create` bearers (OAuth first, then the
-`access_tokens` fallback). The 401 + `resource_metadata` challenge is emitted
-by the MCP SDK middleware for ANY request lacking an `Authorization` header
-(RFC 9728 / MCP auth spec §5.1 discovery) and says nothing about whether a
-configured token works. A client status probe that omits the header will
-therefore report `needsAuth` / `authentication_required` even while the
-configured bearer succeeds. Judge auth from `whoami`
-(`transport: legacy|oauth`) or `gbrain auth test <url> --token <t>`; treat a
-client's needsAuth flag as advisory unless the authenticated call itself
-returns 401 / `invalid_token`.
-
-#### Tailnet / LAN-only (no public tunnel)
-
-Two shapes work without exposing anything to the internet. In both, clients
-authenticate with `gbrain auth create` bearer tokens.
-
-**Tailscale Serve (HTTPS, tailnet-only).** This is what `gbrain mcp expose`
-automates (plus the admin token file, the user service and the health
-checks). By hand: keep the default `127.0.0.1` bind, let Tailscale terminate
-TLS on the tailnet, and point `--public-url` at your MagicDNS name:
-
-```bash
-gbrain serve --http --port 3131 --public-url https://your-machine.your-tailnet.ts.net
-tailscale serve --bg 3131
-```
-
-Clients on the tailnet use `https://your-machine.your-tailnet.ts.net/mcp`.
-The "--public-url is set but --bind is not" WARN is expected in this shape —
-Tailscale Serve forwards to loopback. `tailscale serve` stays inside your
-tailnet; `tailscale funnel` (or `gbrain mcp expose --funnel`) is public
-exposure for cloud agents (see [ALTERNATIVES.md](ALTERNATIVES.md)).
-
-**Plain HTTP, bearer-only.** Bind the tailnet/LAN interface and omit
-`--public-url` entirely:
-
-```bash
-gbrain serve --http --port 3131 --bind 100.x.y.z # or --bind 0.0.0.0
-```
-
-The OAuth issuer defaults to `http://localhost:3131`, which the MCP SDK
-accepts, and bearer-token verification never reads the issuer. Clients connect
-to `http://100.x.y.z:3131/mcp` with `Authorization: Bearer …`. OAuth discovery
-is the one thing this shape does not offer (the advertised issuer is
-loopback), so OAuth-only clients such as ChatGPT need the HTTPS shape above.
-Passing `--public-url http://100.x.y.z:3131` instead fails at startup — see
-[Troubleshooting](#troubleshooting).
-
-### 4. Scopes and localOnly
-
-Every operation is tagged `read | write | admin`. Operations flagged
-`localOnly: true` in `src/core/operations.ts` (`sync_brain` and the
-`file_*` ops among them) are rejected over HTTP regardless of scope.
-Remote agents cannot reach local filesystem surface area.
-
-| Scope | What it allows |
-|-------|---------------|
-| `read` | `search`, `query`, `get_page`, `list_pages`, graph traversal |
-| `write` | `put_page`, `delete_page`, `add_link`, `add_timeline_entry` |
-| `admin` | Eligible admin-tagged brain operations; local-only restrictions still apply. Does not grant dashboard or client-management authority. |
-
-Write ops can additionally be fenced per client with `--bound-slug-prefixes`
-(see [Register OAuth clients](#2-register-oauth-clients) above).
-
-## Legacy Bearer Token Setup
-
-Bearer tokens are the simple path when you don't need per-client scoping.
-Without a `--scopes` grant they carry `read+write+admin` on the
-HTTP server; pass `--scopes read,write` at creation to narrow one.
-
-### 1. Publish the server
-
-Tailscale (recommended): `gbrain mcp expose` (add `--funnel` for cloud
-clients) — [remote MCP guide](../guides/remote-mcp.md). ngrok alternative,
-see the [ngrok-tunnel recipe](../../recipes/ngrok-tunnel.md); quick version:
-
-```bash
-gbrain serve --http --port 8787
-brew install ngrok
-ngrok config add-authtoken YOUR_TOKEN
-ngrok http 8787 --url your-brain.ngrok.app # Hobby tier for fixed domain
-```
-
-### 2. Create access tokens
-
-These commands open the database. On PGLite, mint the token before publishing
-the service in step 1, or use the running server's owner API to provision a
-scoped machine handoff. A second database process fails with `live_serve`;
-do not remove its lock. Postgres supports concurrent local maintenance.
-
-```bash
-# Create a token for each client
-gbrain auth create "claude-desktop"
-
-# List all tokens
-gbrain auth list
-
-# Revoke a token
-gbrain auth revoke "claude-desktop"
-```
-
-Tokens are per-client. Create one for each device/app. Names are not
-unique: `gbrain auth revoke "<name>"` revokes EVERY active token carrying
-that name — use `gbrain auth list` (shows each token's id and scopes) and
-`gbrain auth revoke --id <uuid>` to revoke exactly one. Tokens are stored
-SHA-256 hashed in your database.
-
-### 3. Connect your AI client
-
-- **ChatGPT:** [setup guide](CHATGPT.md) (OAuth 2.1 + PKCE, requires `gbrain serve --http`)
-- **Claude Code:** [setup guide](CLAUDE_CODE.md)
-- **Claude Desktop:** [setup guide](CLAUDE_DESKTOP.md) (must use GUI, not JSON config)
-- **Claude Cowork:** [setup guide](CLAUDE_COWORK.md)
-- **Perplexity:** [setup guide](PERPLEXITY.md)
-
-### 4. Verify
-
-```bash
-gbrain auth test \
- https://your-machine.your-tailnet.ts.net/mcp \
- --token YOUR_TOKEN
-```
-
-(Substitute your ngrok domain or cloud host URL when you used one of those.)
-
-## Operations
-
-GBrain's operation catalog (100+ operations in `src/core/operations.ts`) is
-available subject to the selected surface, scope and operation-specific limits.
-Operations flagged `localOnly: true` are rejected over HTTP regardless of scope
-(see [Scopes and localOnly](#4-scopes-and-localonly) above). Code-inspection
-operations and stored contradiction reports also have temporary local-only
-restrictions, even when listed in the catalog. The [MCP surface runbook](../operations/mcp-surface-runbook.md)
-explains these limits and the separate chunk-rebuild requirement. Rebuild
-indexes from a local installation on the brain host; a thin client cannot
-rebuild the host's indexes.
-
-**Several brains behind one tool catalog?** Give each server an identity so a
-connected agent can tell them apart: `gbrain config set mcp.instructions
-"<identity>"` rides the initialize response of every transport (stdio, OAuth
-HTTP, legacy bearer) under a `Deployment identity:` banner, appended below the
-canonical agent contract — no transport can weaken the contract. Restart
-`gbrain serve` after setting it (the response is built once per process);
-`GBRAIN_MCP_INSTRUCTIONS` in the serve process's environment overrides the
-configured value for that process, and a blank variable falls back to it.
-**Say to your agent:** *"Tell connected agents which brain this is"* — your
-agent runs `gbrain config set mcp.instructions "<identity>"`.
-
-**Security note on file access:** the `file_*` operations being localOnly is
-the first line of defense; as defense-in-depth, `file_upload` also confines
-any caller that isn't verifiably the trusted local CLI to the working
-directory where `gbrain serve` was launched. Symlinks, `..` traversal, and
-absolute paths outside cwd are rejected, and page slugs and filenames are
-allowlist-validated (alphanumeric + hyphens; no control chars, RTL overrides,
-or backslashes). Local CLI callers (`gbrain files upload ...`) keep
-unrestricted filesystem access since the user owns the machine.
-
-## Status-only mode
-
-A `gbrain serve --http` that cannot open its brain (another serve holds the
-PGLite lock, no brain is configured yet, the brain is missing or damaged, or
-the config is unreadable) keeps its port and answers in status-only mode
-instead of exiting, so a supervisor does not crash-loop it and every client
-sees the cause:
-
-```text
-$ curl -i localhost:3131/health
-HTTP/1.1 503 Service Unavailable
-Content-Type: application/json
-Retry-After: 5
-
-{"status":"unavailable","reason":"unavailable","why":"This gbrain server cannot open its brain; its host operator can see why with `gbrain doctor`.","fix":{"argv":["gbrain","doctor","--json"],"command":"gbrain doctor --json","consent":[],"actor":"host_admin","next":"tell_user_to_run",...},"user_message":"The gbrain memory server is running but cannot open its brain, so memory is offline. ...","retry_after_s":5,"contract_version":1,"instance":"<nonce>"}
-```
-
-- `/mcp` offers only `gbrain_status`; OAuth and admin routes answer `503` with
- the `serve_status_only` envelope. Responses never name the reason, a path or
- a PID: Tailscale Funnel delivers public requests from a loopback address, so
- every request is treated as remote.
-- On the host, stderr prints the reason and its fix ("Re-checking every 5 s;
- Ctrl-C to stop; `--fail-fast` to exit instead"), the marker
- `GBRAIN_HOME/serve-http-status-<port>.json` records it, and
- `gbrain doctor --only harness_wiring` reports `serve_status_only` with the
- fix. `gbrain mcp expose` reports `verify.local` as status-only with the
- reason.
-- The server re-checks every 5 s and, once the brain opens, serves the full app
- on the same port. Clients reconnect: a client that connected during status
- mode receives `401` with `WWW-Authenticate` resource metadata and completes
- OAuth again.
-- Container health checks that probe `/health` treat the `503` as unhealthy and
- restart the container. Pass `--fail-fast` (or set `GBRAIN_SERVE_FAIL_FAST=1`)
- there so the process exits non-zero with the classified envelope on stderr.
-- A second `gbrain serve --http` on a port another server already holds exits
- with `serve_port_in_use`. A Postgres connect failure keeps the degraded-engine
- path (`GBRAIN_DB_ACCESS` marker, `gbrain db-repair`).
-
-## Deployment Options
-
-Tailscale via `gbrain mcp expose` is the recommended shape for a brain on your
-own computer ([remote MCP guide](../guides/remote-mcp.md)). See
-[ALTERNATIVES.md](ALTERNATIVES.md) for how Tailscale Serve / Funnel compare
-with ngrok and always-on cloud hosts (Fly.io, Railway).
-
-### Co-located Docker workloads (self-hosted Postgres)
-
-OAuth scopes and source scoping guard the `gbrain serve --http` path. They do
-NOT guard raw Postgres. If the brain's Postgres runs as a container on the same
-Docker host as other workloads (agent runtimes, n8n, staging fixtures), any
-container sharing Docker's default `bridge` network can open a direct DB
-session — no OAuth token required — and read every source. That silently
-recreates a privileged path underneath the isolation you configured at the MCP
-layer.
-
-Network-zone the host so untrusted containers can never reach Postgres:
-
-```
-Docker host
-├── gbrain-net ← ONLY the brain's Postgres (+ gbrain serve, if containerized)
-├── agent-<id>-net ← each untrusted agent runtime, isolated
-└── default bridge ← no secret-bearing databases
-```
-
-Operator checklist:
-
-```text
-[ ] Postgres is on a user-defined Docker network, not the default bridge
- (or nothing else runs on that bridge)
-[ ] If Postgres publishes a host port at all, it binds loopback only
- (`-p 127.0.0.1:5432:5432`, never `0.0.0.0`)
-[ ] Untrusted agent containers have no DATABASE_URL or Postgres password
-[ ] Untrusted agents reach the brain via OAuth/Bearer against serve --http only
- (host loopback via host.docker.internal / host gateway — never gbrain-net)
-[ ] OAuth clients are least-privilege: scoped --source / --federated-read,
- pre-minted short-lived tokens preferred over long-lived client secrets
-[ ] Isolation verified: a team-scoped client cannot read internal-only sources
-```
-
-Optional defense-in-depth: a dedicated Postgres role (or RLS) limited to the
-allowed `source_id`s, so even a leaked connection string can't read everything.
-
-### Run gbrain under a real init (tini / `--init`)
-
-If `gbrain serve` is your container's entrypoint, it runs as PID 1 and
-inherits every orphaned process in the container. Prefer a real init so
-orphan exits are reaped by something built for the job:
-
-```dockerfile
-# Dockerfile: wrap the entrypoint with tini
-ENTRYPOINT ["/usr/bin/tini", "--", "gbrain", "serve", "--http"]
-```
-
-or at run time:
-
-```bash
-docker run --init ... gbrain serve --http
-```
-
-Without an init, gbrain installs its own PID-1 orphan reaper (Linux only):
-a low-frequency `/proc` scan that `waitpid()`s zombies re-parented to it,
-so long-lived containers don't accumulate defunct entries in the PID table.
-It is fail-open and can be disabled with `GBRAIN_PID1_REAP=0` — but tini /
-`--init` remains the recommended setup.
-
-## Troubleshooting
-
-**"missing_auth" error**
-Include the Authorization header: `Authorization: Bearer YOUR_TOKEN`
-
-**"invalid_token" error**
-Run `gbrain auth list` to see active tokens.
-
-**Client status shows needsAuth / authentication_required but tool calls succeed**
-The client probed `/mcp` without an `Authorization` header and read the
-spec-mandated discovery 401 as a failed login. Both OAuth tokens and legacy
-bearers are accepted on `/mcp`; confirm with `whoami` (`transport: legacy`)
-or `gbrain auth test <url> --token <t>` and only re-authenticate if THAT
-call returns 401. See
-[Dual-mode auth on /mcp](#3-expose-the-server).
-
-**"service_unavailable" error**
-Database connection failed. Check your Supabase dashboard for outages.
-
-**"Issuer URL must be HTTPS" at startup**
-The MCP SDK rejects a non-HTTPS OAuth issuer unless the host is `localhost`
-or `127.0.0.1`, so `--public-url http://<lan-or-tailnet-ip>:3131` exits
-before the server listens. Either terminate TLS in front (Tailscale Serve,
-ngrok, Cloudflare Tunnel) and pass the `https://` URL, or drop `--public-url`
-for a bearer-only LAN endpoint — both shapes are in
-[Tailnet / LAN-only](#tailnet--lan-only-no-public-tunnel). Last resort, for
-plain-HTTP OAuth discovery on a private network you fully control: the SDK's
-own `MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL=1` opt-in. Bearer auth works
-either way; OAuth clients may still refuse a non-HTTPS issuer.
-
-**A connector loops back to sign-in, or the token endpoint returns `invalid_target`**
-Every OAuth authorization, token, refresh and bearer check uses one resource:
-`<origin of --public-url>/mcp`. The bare origin is accepted as an alias. A
-requested resource that is anything else, such as an old tunnel hostname,
-`http` for an `https` server or a query string, gets `invalid_target` naming
-the accepted URL. A bearer token bound to another resource gets
-`invalid_token`, and a stored grant for a resource this server no longer
-serves gets `invalid_grant` on refresh. Point the client at the accepted URL
-or fix `--public-url`, then reconnect. ChatGPT specifics
-are in [CHATGPT.md](CHATGPT.md#troubleshooting).
-
-**A claude.ai connector can search but not save**
-The `/mcp` challenge hints `read write`, and each token is capped to the
-client's registered scope. A connector approved before v0.60.5.0 received a
-`read`-only hint and keeps a read-only grant. Remove and
-re-add the connector, and approve `write` on the consent screen. If the
-client is registered with `read` only, widen it first
-([ADMIN.md](ADMIN.md#inspect-clients-and-edit-access)).
-
-<a id="stall-watchdog"></a>**`serve --http` stops answering and spins at full CPU**
-Turn on the loop-stall watchdog so a wedged process exits instead of
-spinning until the host runs out of memory:
-`export GBRAIN_SERVE_STALL_WATCHDOG_MS=60000` in the serve process's
-environment (systemd `Environment=`, launchd `EnvironmentVariables`), then
-restart `gbrain serve --http`. A watchdog thread checks the main event loop;
-when the loop has not answered for that many milliseconds, it logs and sends
-SIGTERM, and 30 seconds later, if the loop is still stuck, SIGKILL, so a
-supervisor restarts the server. It is off by default (unset or `0`); values
-below 15000 are raised to 15000. Large PGLite brains pause the loop for tens of
-seconds during checkpoints, so keep 60000 or more there. The watchdog covers
-`serve --http` only; stdio `serve` exits with its client. Before every tool
-call, `serve --http` writes `[gbrain-serve] dispatch op=<name>
-args_sha256=<16 hex>` to stderr, so the last such line before a stall names the
-request that caused it. The digest is a SHA-256 of the call's JSON arguments
-(compute it on the client to match); the arguments themselves are never
-logged.
-
-**Claude Desktop doesn't connect**
-Remote servers must be added via Settings > Integrations, NOT
-`claude_desktop_config.json`. See [CLAUDE_DESKTOP.md](CLAUDE_DESKTOP.md).
-
-**`gbrain mcp expose` stops on a Tailscale error or `verify.tailnet: pending`**
-The pre-checks (`tailscale_https_not_enabled`, `tailscale_funnel_not_enabled`
-— exit 2 with the admin-console URL, nothing published), the classified
-errors (`https_not_enabled`, `funnel_not_enabled`, `needs_operator`,
-`daemon_not_running`, …), the pending-certificate wait, and the
-service/`--status` checks are tabled in the
-[remote MCP guide](../guides/remote-mcp.md#troubleshooting).
-
-## Expected Latencies
-
-| Operation | Typical Latency | Notes |
-|-----------|----------------|-------|
-| get_page | < 100ms | Single DB query |
-| list_pages | < 200ms | DB query with filters |
-| search (keyword) | 100-300ms | Full-text search |
-| query (hybrid) | 1-3s | Embedding + vector + keyword + RRF |
-| put_page | 100-500ms | Write + trigger search_vector update |
-| get_stats | < 100ms | Aggregate query |
-
-**Note:** `gbrain serve --http` has OAuth 2.1 + the admin dashboard baked
-into the binary. The custom HTTP wrapper pattern (see
-[voice recipe](../../recipes/twilio-voice-brain.md)) is supported for
-teams that need bespoke middleware, but for most remote deployments the
-built-in server is the recommended path.
-
----
-
## docs/protocol/MEMORY_VERBS_v1.md
Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/protocol/MEMORY_VERBS_v1.md
@@ -9538,25 +8696,27 @@ From the CLI: `gbrain call edit_page '{"slug":"projects/example","expected_revis
One deterministic, budget-packed bundle for a set of standing
entities — entity cards + open threads + hot facts. Built for **session
-boundaries**: call it at session start to warm cold context, and immediately
-after compaction to rehydrate what the summary dropped. Composes existing arms
-(`entity` card builder + the hot-facts arm); never calls an LLM.
+boundaries**: call it at session start and right after compaction. Never
+calls an LLM.
`entities` is comma-separated, capped at 8 (the response echoes the capped list). `budget_tokens` packs
-server-side (cards first, then facts; each item costs its rendered line and the
-envelope + section headers are reserved first, so `text` fits the budget) and the
-response reports `budget_used` (the token estimate of `text`) + `dropped_count`
-— it never trims client-side. `since` filters
+server-side (cards first, then facts; each item costs its rendered line after the
+envelope and headers are reserved, so `text` fits) and reports `budget_used`
+(tokens of `text`) + `dropped_count`. `since` filters
open-thread events to those after the cursor. **Visibility is WORLD-ONLY by
-default** on every arm (a pack is injected into an agent context window that may
-be logged or synced to a cloud model). `include_private` widens ALL arms in
+default** on every arm (a pack lands in a context window that may be logged or
+synced to a cloud model). `include_private` widens ALL arms in
lockstep, and is honored ONLY for trusted-local callers (`remote === false`); a
remote caller never widens (fail-closed).
Response: `{ protocol_version, entities, cards[], open_threads[], facts[], text,
degraded_reason?, budget_tokens?, budget_used?, dropped_count?, core? }`. `text` is the
-pre-rendered, envelope-wrapped injectable block; with `budget_tokens` it is
-rendered from the packed sets and never exceeds the declared budget.
+envelope-wrapped injectable block, rendered from the packed sets within `budget_tokens`.
+
+`entities` scopes cards and threads, not the hot facts (the session's recent
+memory), so other facts can appear; `recall` with `entity` reads one entity
+strictly. `facts[]` here and in `delta` carry `fact_id` (what `forget` takes)
+and `provenance` (the stored source), never rendered into `text`.
#### context_pack core memory (additive)
@@ -9677,7 +8837,7 @@ isolation on every read. Remote callers see `visibility = world` facts only.
Read verbs redact credential-shaped values in their responses with the
canonical secret scanner: a value becomes `<REDACTED:pattern>`. `recall`,
`context_pack` and `delta` redact the facts' `fact`, `context` and `source`
-fields for remote callers (`ctx.remote !== false`; every MCP transport,
+(`provenance`) fields for remote callers (`ctx.remote !== false`; every MCP transport,
including stdio, and thin clients) and return them as stored to the trusted
local CLI, so a remembered credential is readable only with `gbrain recall` on
the brain host. Search results, the rendered `text` and `entity` cards are
@@ -11677,9 +10837,10 @@ candidate one class:
| `replay` | No later write supersedes it. | Replayed on apply. |
| `already_written` | A later request with the same intent committed, or an earlier apply replayed it. | Kept. |
| `duplicate` | A later request with the same intent exists; that one is the candidate. | Kept. |
-| `superseded` | A later write or delete of the page committed or is still pending; for `put_page`, also a later failed `put_page` of the page (the newer content) or a page that changed after the revision the caller read. | Kept. Read the page and re-issue the change by hand if it is still wanted. |
+| `superseded` | A later write or delete of the page committed or is pending; for `put_page`, also a later failed `put_page` (newer content) or a page changed since the caller read it. | Kept; re-issue by hand if still wanted. |
| `unpinned_target` | A `remember` saved unattributed; replaying would infer its subject again and could pick another page. | Kept. Re-issue it with an explicit `entity` if it is still wanted. |
-| `producer_owned` | gbrain produced it (sync or file import, reconcile, relink, maintenance page, job). | Kept. The preview prints the command that produces it again from current content, such as `gbrain sync --source <id> --no-pull --retry-failed --json`. |
+| `file_database_drift` | Its last replay hit `source_changed` (file and database differ). | Kept until the page changes; reconcile it first. |
+| `producer_owned` | gbrain produced it (sync or file import, reconcile, relink, maintenance page, job). | Kept. The preview prints the command that produces it again from current content (sync: `gbrain sync --source <id> --no-pull --retry-failed`). |
The apply replays exactly the previewed set. Each write is classified again
and its original caller's authority is checked again first: a write that
diff --git a/plugin-variants/gbrain-coding/skills/enrich/SKILL.md b/plugin-variants/gbrain-coding/skills/enrich/SKILL.md
index 9e7301d3ce..76135ffa1b 100644
--- a/plugin-variants/gbrain-coding/skills/enrich/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/enrich/SKILL.md
@@ -166,11 +166,25 @@ the raw data shows exactly what the API returned.
#### CREATE path
1. Check notability gate (see `skills/_brain-filing-rules.md`)
-2. Check filing rules -- where does this entity go?
-3. Create page with the appropriate template (below)
+2. Resolve the entity's type, directory and subtype from the ACTIVE schema
+ pack, never from the templates below: follow
+ `skills/brain-taxonomist/SKILL.md` (`gbrain schema show --json`, or MCP
+ `get_active_schema_pack`; `schema_explain_type` for one type). When the
+ pack declares an entity type the evidence fits better than `person` or
+ `company` (an investment firm, a protocol foundation), file it under that
+ type's directory with its subtype. If no declared type fits, say so and
+ ask; don't fall back to `companies/`.
+3. Create the page from the template below, with the `type` and directory
+ from step 2. Frontmatter carries only keys the pack declares for the type or
+ that existing pages of the type already use, and only with known values:
+ omit an unknown field entirely, never write `null`, an empty value or a
+ placeholder.
4. Fill compiled truth with citations
5. Add first timeline entry
6. Leave empty sections as `[No data yet]` (don't fill with boilerplate)
+7. In a batch, create the pages other pages will link to first. A link to a
+ page that doesn't exist yet is recorded as a wanted page and becomes an
+ edge once that page is written (`gbrain wanted` lists them).
#### UPDATE path
@@ -191,10 +205,7 @@ updated: YYYY-MM-DD
tags: []
company: Current Company
relationship: How the user knows them
-email:
-linkedin:
-twitter:
-location:
+# email, linkedin, twitter, location: add each only when you know it
---
# Full Name
diff --git a/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md b/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md
index 5749e5cffc..89e46e59ea 100644
--- a/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md
@@ -232,7 +232,8 @@ read — fix the converter and regenerate, don't hand-patch individual pages.
# Preview: segmentation + counts, no DB writes
gbrain extract-conversation-facts --types conversation --dry-run --limit 5
-# Real run, cost-capped; use --background for large archives
+# Real run (paid, cost-capped): only after the user agrees to the cap;
+# use --background for large archives
gbrain extract-conversation-facts --types conversation --max-cost-usd 5
```
diff --git a/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md b/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md
index a2a457defc..fbc74d2b81 100644
--- a/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md
@@ -124,7 +124,10 @@ page with `type: source` at `sources/meetings/YYYY-MM-DD-{slug}-transcript`
(the default pack files raw evidence as `source` under `sources/`; never
invent `meeting-transcript`, and don't write the `transcript` alias) or keep
the source file reachable, and link it from the meeting page. The transcript is the canonical
-evidence for every quote and claim check downstream.
+evidence for every quote and claim check downstream. Put
+`facts_backstop: false` in the sidecar's frontmatter: automatic fact
+extraction would otherwise mine the raw transcript, garbles and banter
+included, beside the verified meeting page (Phase 5).
**Redact before you retain.** A raw transcript routinely captures pasted
secrets and PII (a read-aloud API key, a screen-shared token, a private phone
@@ -230,6 +233,7 @@ and sometimes confidently WRONG names. Resolve by evidence:
---
type: meeting
attendees: [{comma-separated slugs of the same people, e.g. people/alice-example}]
+facts_backstop: false
---
# {Meeting Title} — {Date}
@@ -284,6 +288,21 @@ next cycle extracts it (`gbrain dream --phase chronicle` runs it now, paid), and
`life/events/` pages; edit the meeting page and extraction updates its events.
See `docs/guides/life-chronicle.md`.
+Facts (what `recall` returns) are also extracted from saved pages in the
+background, on by default, one paid chat call each time a page's body changes.
+Extraction files each fact on the entity page it names, so it reaches people
+and company pages without passing Phase 6, and it never takes back facts it
+filed from an earlier version of the page. That is why the template drafts
+the meeting page with `facts_backstop: false` (the receipt reads
+`facts_backstop: { skipped: "opted_out" }`): nothing is extracted while the
+page is still being corrected. When the verification checklist passes, save
+the page once more without that line; the receipt then reads
+`facts_backstop: { queued: true }`. Everything on the verified page is
+extraction input, so an uncertain note kept under the downgrade protocol
+becomes a lower-confidence fact. The transcript sidecar keeps its
+`facts_backstop: false`. Don't call `extract_facts` for the meeting or its
+transcript.
+
### Phase 6: Claim verification + consistency check (gate for every entity write)
Recorder summaries inject false facts: speech-to-text garbles proper nouns,
@@ -323,7 +342,9 @@ it as an explicitly-uncertain note on the meeting page — never in an entity
page's compiled truth or frontmatter.
**Propagation rule:** a claim that fails verification must not fan out. Do not
-copy it to other entity pages or timeline entries. A false claim written to
+copy it to other entity pages or timeline entries, and keep it off the
+verified meeting page too: fact extraction carries that page's claims to entity
+pages (Phase 5). A false claim written to
five pages costs five corrections.
### Phase 7: Attendee enrichment (MANDATORY)
@@ -500,13 +521,15 @@ failure axes, and V1–V5 never look at order. Verify the narrated sequence:
in the report, don't block on it.
**The loop:** fix → re-check → fix, until every item passes (or V6 is
-explicitly waived). Only then report.
+explicitly waived). Then save the meeting page without the draft
+`facts_backstop: false` line (Phase 5), and report.
## Sensitive meetings
If the title or transcript signals legal or deeply personal content
(deposition, attorney, counsel, privileged, health): keep the page minimal and
-factual, do not extract biographical color into other pages, and prefer
+factual, keep its `facts_backstop: false` unless the user agrees to fact
+extraction, do not extract biographical color into other pages, and prefer
restraint on back-links. When in doubt about whether content should propagate,
ask the user.
@@ -517,7 +540,9 @@ ingested: {N} attendees enriched, {N} entities updated, {N} action items
captured. Verification: passed. Sequence: PASS." If the sequence check was
waived, say so explicitly: "Sequence: WAIVED by user — {contradiction} stands
(acknowledged, not resolved)." If the recording was split, report one line per
-resulting meeting page. If a claim was withheld or a contradiction flagged by
+resulting meeting page. Name the final meeting-page save's `facts_backstop`
+receipt: `queued`, or `opted_out` with the reason extraction stays off (a
+sensitive meeting the user did not clear). If a claim was withheld or a contradiction flagged by
Phase 6, list each flag — the user resolves them, not silence. If any
checklist item cannot be made to pass, report the meeting as NOT ingested and
name the failing item.
diff --git a/plugin/skills/cold-start/SKILL.md b/plugin/skills/cold-start/SKILL.md
index 23a3228d55..a239634556 100644
--- a/plugin/skills/cold-start/SKILL.md
+++ b/plugin/skills/cold-start/SKILL.md
@@ -477,7 +477,12 @@ After completing available phases:
- Calendar: daily cron
- Email: periodic sweep (4-8 hours)
- X: daily ingest
- - Brain repo: `gbrain sync --repo <path>` every 5-30 minutes
+ - Brain repo: `gbrain sync --repo <path>` every 5-30 minutes. A managed brain
+ (`gbrain sources writer status --json` shows `"mode": "managed"`) refuses
+ that line: use the managed recipe in `skills/cron-scheduler/SKILL.md`
+ ("Managed brain") with `--source <id>`, e.g.
+ `gbrain sources refresh <id>; gbrain sync --source <id> --no-pull --hard-deadline 13m`
+ every 15 minutes on the owner host.
4. **Track state:**
```json
diff --git a/plugin/skills/conversation-archive/SKILL.md b/plugin/skills/conversation-archive/SKILL.md
index 5749e5cffc..89e46e59ea 100644
--- a/plugin/skills/conversation-archive/SKILL.md
+++ b/plugin/skills/conversation-archive/SKILL.md
@@ -232,7 +232,8 @@ read — fix the converter and regenerate, don't hand-patch individual pages.
# Preview: segmentation + counts, no DB writes
gbrain extract-conversation-facts --types conversation --dry-run --limit 5
-# Real run, cost-capped; use --background for large archives
+# Real run (paid, cost-capped): only after the user agrees to the cap;
+# use --background for large archives
gbrain extract-conversation-facts --types conversation --max-cost-usd 5
```
diff --git a/plugin/skills/cron-scheduler/SKILL.md b/plugin/skills/cron-scheduler/SKILL.md
index 4cdb796f63..c125041ed0 100644
--- a/plugin/skills/cron-scheduler/SKILL.md
+++ b/plugin/skills/cron-scheduler/SKILL.md
@@ -82,6 +82,39 @@ per-source cron pattern doesn't benefit from the parallelism that
`gbrain doctor` surfaces the recommended line as a `sync_consolidation`
check whenever it detects 2+ active sources. Paste-ready from there.
+### Managed brain
+
+A managed brain refuses the line above: managed sync needs `--no-pull` and
+rejects `--skip-failed` (`writer_coordinator_required`). Check the mode first:
+`gbrain sources writer status --json` reports `"mode": "managed"` or
+`"mode": "classic"`, and its `bindings` name each source's owner host.
+
+On a managed brain, install this line instead, on the host that owns the
+sources:
+
+```cron
+*/15 * * * * gbrain sources refresh <id>; gbrain sync --all --no-pull --hard-deadline 13m
+```
+
+- `gbrain sources refresh <id>` is the only way a managed checkout takes
+ upstream commits (a fetch and `git merge --ff-only`, then a managed sync of
+ the sources on that checkout). Add one refresh per checkout that tracks a
+ remote, with its real source id; drop it for checkouts with no remote. The
+ `;` is deliberate: the sync still runs when a refresh refuses.
+- `--hard-deadline 13m` stays under the 15-minute interval. Managed sync takes
+ no per-source lock, so a run that outlives the interval would overlap the
+ next tick. A run stopped at its deadline ends `resumable` and the next tick
+ continues it. Sources drain one at a time, so `--parallel` does not apply.
+- `owner_unavailable` for a source: another host owns it. Install a
+ per-source line on that host (`gbrain sync --source <id> --no-pull
+ --hard-deadline 13m`, plus its refresh) instead of claiming the source here.
+- Failed files: run the `--retry-failed` command the failure prints
+ (`gbrain sync --source <id> --no-pull --retry-failed …`) after fixing the
+ files; never add `--skip-failed`.
+
+`gbrain doctor` prints this managed line in `sync_consolidation` on a managed
+brain with 2+ active sources.
+
## When it fails
Follow the [agent operator protocol](../conventions/agent-operator-protocol.md) for any gbrain error `code`, exit code, `[AGENT]` block or notice block. Specific to this skill:
@@ -89,6 +122,9 @@ Follow the [agent operator protocol](../conventions/agent-operator-protocol.md)
- A scheduled `gbrain sync` hits `sync_in_progress` / `lock_busy`: an earlier tick still runs. Widen the interval or stagger the job; never add a second overlapping schedule.
- Doctor reports a stale source after the cron change: check `gbrain sources status <id>` for held items or errors before changing the schedule again.
- `checkpoint_validation_timeout` in a sync log: run the retry command the error prints; do not cancel the request.
+- `writer_coordinator_required` from a scheduled sync: the brain is managed. Replace the line with the [managed brain](#managed-brain) recipe; never retry with `--skip-failed` or without `--no-pull`.
+- `sync_in_progress` from `gbrain sources refresh`: a managed sync cursor is unfinished, and the refresh never waits on it. Run the `gbrain sync --source <id> --no-pull …` command the refusal prints; the next tick's refresh then runs.
+- `worktree_refreshing` from a sync: a refresh is draining or merging that checkout. Leave it; the next tick syncs it.
## Anti-Patterns
diff --git a/plugin/skills/enrich/SKILL.md b/plugin/skills/enrich/SKILL.md
index 9e7301d3ce..76135ffa1b 100644
--- a/plugin/skills/enrich/SKILL.md
+++ b/plugin/skills/enrich/SKILL.md
@@ -166,11 +166,25 @@ the raw data shows exactly what the API returned.
#### CREATE path
1. Check notability gate (see `skills/_brain-filing-rules.md`)
-2. Check filing rules -- where does this entity go?
-3. Create page with the appropriate template (below)
+2. Resolve the entity's type, directory and subtype from the ACTIVE schema
+ pack, never from the templates below: follow
+ `skills/brain-taxonomist/SKILL.md` (`gbrain schema show --json`, or MCP
+ `get_active_schema_pack`; `schema_explain_type` for one type). When the
+ pack declares an entity type the evidence fits better than `person` or
+ `company` (an investment firm, a protocol foundation), file it under that
+ type's directory with its subtype. If no declared type fits, say so and
+ ask; don't fall back to `companies/`.
+3. Create the page from the template below, with the `type` and directory
+ from step 2. Frontmatter carries only keys the pack declares for the type or
+ that existing pages of the type already use, and only with known values:
+ omit an unknown field entirely, never write `null`, an empty value or a
+ placeholder.
4. Fill compiled truth with citations
5. Add first timeline entry
6. Leave empty sections as `[No data yet]` (don't fill with boilerplate)
+7. In a batch, create the pages other pages will link to first. A link to a
+ page that doesn't exist yet is recorded as a wanted page and becomes an
+ edge once that page is written (`gbrain wanted` lists them).
#### UPDATE path
@@ -191,10 +205,7 @@ updated: YYYY-MM-DD
tags: []
company: Current Company
relationship: How the user knows them
-email:
-linkedin:
-twitter:
-location:
+# email, linkedin, twitter, location: add each only when you know it
---
# Full Name
diff --git a/plugin/skills/meeting-ingestion/SKILL.md b/plugin/skills/meeting-ingestion/SKILL.md
index a2a457defc..fbc74d2b81 100644
--- a/plugin/skills/meeting-ingestion/SKILL.md
+++ b/plugin/skills/meeting-ingestion/SKILL.md
@@ -124,7 +124,10 @@ page with `type: source` at `sources/meetings/YYYY-MM-DD-{slug}-transcript`
(the default pack files raw evidence as `source` under `sources/`; never
invent `meeting-transcript`, and don't write the `transcript` alias) or keep
the source file reachable, and link it from the meeting page. The transcript is the canonical
-evidence for every quote and claim check downstream.
+evidence for every quote and claim check downstream. Put
+`facts_backstop: false` in the sidecar's frontmatter: automatic fact
+extraction would otherwise mine the raw transcript, garbles and banter
+included, beside the verified meeting page (Phase 5).
**Redact before you retain.** A raw transcript routinely captures pasted
secrets and PII (a read-aloud API key, a screen-shared token, a private phone
@@ -230,6 +233,7 @@ and sometimes confidently WRONG names. Resolve by evidence:
---
type: meeting
attendees: [{comma-separated slugs of the same people, e.g. people/alice-example}]
+facts_backstop: false
---
# {Meeting Title} — {Date}
@@ -284,6 +288,21 @@ next cycle extracts it (`gbrain dream --phase chronicle` runs it now, paid), and
`life/events/` pages; edit the meeting page and extraction updates its events.
See `docs/guides/life-chronicle.md`.
+Facts (what `recall` returns) are also extracted from saved pages in the
+background, on by default, one paid chat call each time a page's body changes.
+Extraction files each fact on the entity page it names, so it reaches people
+and company pages without passing Phase 6, and it never takes back facts it
+filed from an earlier version of the page. That is why the template drafts
+the meeting page with `facts_backstop: false` (the receipt reads
+`facts_backstop: { skipped: "opted_out" }`): nothing is extracted while the
+page is still being corrected. When the verification checklist passes, save
+the page once more without that line; the receipt then reads
+`facts_backstop: { queued: true }`. Everything on the verified page is
+extraction input, so an uncertain note kept under the downgrade protocol
+becomes a lower-confidence fact. The transcript sidecar keeps its
+`facts_backstop: false`. Don't call `extract_facts` for the meeting or its
+transcript.
+
### Phase 6: Claim verification + consistency check (gate for every entity write)
Recorder summaries inject false facts: speech-to-text garbles proper nouns,
@@ -323,7 +342,9 @@ it as an explicitly-uncertain note on the meeting page — never in an entity
page's compiled truth or frontmatter.
**Propagation rule:** a claim that fails verification must not fan out. Do not
-copy it to other entity pages or timeline entries. A false claim written to
+copy it to other entity pages or timeline entries, and keep it off the
+verified meeting page too: fact extraction carries that page's claims to entity
+pages (Phase 5). A false claim written to
five pages costs five corrections.
### Phase 7: Attendee enrichment (MANDATORY)
@@ -500,13 +521,15 @@ failure axes, and V1–V5 never look at order. Verify the narrated sequence:
in the report, don't block on it.
**The loop:** fix → re-check → fix, until every item passes (or V6 is
-explicitly waived). Only then report.
+explicitly waived). Then save the meeting page without the draft
+`facts_backstop: false` line (Phase 5), and report.
## Sensitive meetings
If the title or transcript signals legal or deeply personal content
(deposition, attorney, counsel, privileged, health): keep the page minimal and
-factual, do not extract biographical color into other pages, and prefer
+factual, keep its `facts_backstop: false` unless the user agrees to fact
+extraction, do not extract biographical color into other pages, and prefer
restraint on back-links. When in doubt about whether content should propagate,
ask the user.
@@ -517,7 +540,9 @@ ingested: {N} attendees enriched, {N} entities updated, {N} action items
captured. Verification: passed. Sequence: PASS." If the sequence check was
waived, say so explicitly: "Sequence: WAIVED by user — {contradiction} stands
(acknowledged, not resolved)." If the recording was split, report one line per
-resulting meeting page. If a claim was withheld or a contradiction flagged by
+resulting meeting page. Name the final meeting-page save's `facts_backstop`
+receipt: `queued`, or `opted_out` with the reason extraction stays off (a
+sensitive meeting the user did not clear). If a claim was withheld or a contradiction flagged by
Phase 6, list each flag — the user resolves them, not silence. If any
checklist item cannot be made to pass, report the meeting as NOT ingested and
name the failing item.
diff --git a/scripts/llms-config.ts b/scripts/llms-config.ts
index 2da8724045..97841bf6bf 100644
--- a/scripts/llms-config.ts
+++ b/scripts/llms-config.ts
@@ -245,6 +245,12 @@ export const SECTIONS: DocSection[] = [
title: "docs/mcp/DEPLOY.md",
description: "MCP server deployment.",
path: "docs/mcp/DEPLOY.md",
+ // Fix wave 12: 42KB operator deployment runbook. Web index entry
+ // stays; the single-fetch bundle drops it to stay under
+ // FULL_SIZE_BUDGET (wave 12's onboard, dream and memory-verb doc
+ // additions passed 800KB). Operators read it once when deploying;
+ // agents follow the llms.txt link when they need it.
+ includeInFull: false,
},
{
title: "docs/protocol/MEMORY_VERBS_v1.md",
diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsv
index 48bdb78623..373c7278fb 100644
--- a/scripts/structural-suites.tsv
+++ b/scripts/structural-suites.tsv
@@ -158,6 +158,7 @@ test/extract-atoms-drain.test.ts protected-names register comment names the real
test/extract-atoms-drain.test.ts shared wiring helper holds the cycle lock (5A) 2 readFileSync
test/extract-include-frontmatter-config.serial.test.ts no extraction path hardcodes includeFrontmatter 1 readFileSync
test/facts-backstop-remedy-verb.test.ts facts backstop thin-client-fallback remedy verb (#4489) 3 readFileSync
+test/facts-eligibility.test.ts #6232 facts_backstop opt-out 1 readFileSync
test/facts-relink.test.ts relink reasons 1 readFileSync
test/features.test.ts CLI routing 2 source-surface-helper
test/fence-extraction.test.ts Layer 8 D2 — markdown fence extraction 18 readFileSync
diff --git a/skills/skills.lock.json b/skills/skills.lock.json
index 276270092e..450334a27b 100644
--- a/skills/skills.lock.json
+++ b/skills/skills.lock.json
@@ -37,7 +37,7 @@
"citation-fixer/routing-eval.jsonl": "52b23b71e66fdc18aee67d0576099b0c83997d648cf4ecf8fe7753b91b6c9c53",
"citation-graph-ingest/SKILL.md": "3c8c4abea96769458e9781ce2f5f305c75118fcb5f68cc62b5e1ed7774259035",
"citation-graph-ingest/routing-eval.jsonl": "a1ba605d35e736b741b9e8aac1e7d50b61a7cbcada893d67099b55bf5a0d2635",
- "cold-start/SKILL.md": "71887ea2cf1d01b4689a44e30fd2a820fa8fae2793ba96895b642b9df1bdbec3",
+ "cold-start/SKILL.md": "57d09cff758c48965cb25b2ec2cf317dcf014c22d9610bee83cfe581cf1a9f76",
"company-brainify/SKILL.md": "f82a78337021f3cc87ad3e3674b3fbc94698193aff772e458375a3eb144ddf11",
"company-brainify/routing-eval.jsonl": "6f27f835eda9ae77a2b694534c78a043a871349820e8c638c3d8bbba6d3aa17b",
"concept-synthesis/SKILL.md": "a5c67f981c5d0a0ef4f13134ed8602e08b0bfbe289456213b8cd465a7a009220",
@@ -62,11 +62,11 @@
"conventions/subagent-routing.md": "8b8830b815a9a8581a12b489f966c0b0a39eb9b5f66e905a691a03653eef348d",
"conventions/test-before-bulk.md": "6b2c52cda9e2cd5f04c15152b3d92aeb7187ab193a15082be0f8a3991a6a5725",
"conventions/untrusted-content.md": "259384d490892cd0e1e8e054decf752d7354f516c83aee57b332c1a96aac6a6e",
- "conversation-archive/SKILL.md": "1ef42eac7d2399f6231687e9a58f23922de3685ebffc62b1ae56acb0dd147d2b",
+ "conversation-archive/SKILL.md": "a59d3dc7076871b8605b5be0cd48fb0b7ae5c0d97bc65447233d2addc2680ac4",
"conversation-archive/routing-eval.jsonl": "ae087a84b1fd5b108b7cdab8d035a09b3ccecd8aad53ba5f71e463059108cfca",
"correction-pipeline/SKILL.md": "c19869aa60ac00e15fc97ca016dd84dd63338fdf3d7b39990b33900eb7dcc703",
"correction-pipeline/routing-eval.jsonl": "7f8d96606a8d7bed3d79fdcee6904764c8abb9fa0b506adb414b5c4805b69d0b",
- "cron-scheduler/SKILL.md": "3f3acbf48ed9c9582cebe54c59eeda0f0dd87b8be434e3b1e33a14e8dc65d712",
+ "cron-scheduler/SKILL.md": "bda1d4a55053a20b379187082c72876ab452877d49ff4607d4009ac533989717",
"cross-modal-review/SKILL.md": "fc00a04e2ff9f498bee9b0b636bceba9dcfdc869c35d9a983109f408170f0807",
"daily-task-manager/SKILL.md": "e93264a83b5fd0a19b2f06a322b3a4ad92d418f6a968c1cd51f4bea79cbca4d9",
"daily-task-manager/routing-eval.jsonl": "e98b2592e65c26952242436a960d8b2061e375b269004a18c230cbcf1d692ff9",
@@ -80,7 +80,7 @@
"draft-in-voice/routing-eval.jsonl": "590fc16277ed7c3338776e7fac6daf1270b91058941f8101079bb295d2d8f787",
"eiirp/SKILL.md": "507249ce40746c0f3d5ae2a374164797798c6ebbc6209b312e3404a2f4902e6c",
"eiirp/routing-eval.jsonl": "d0000eec8154ba48488eed07e8f1a6a0ccb66d0b39e41f29d279a875c1673227",
- "enrich/SKILL.md": "b3c205e8fc7e34f0f47f336a26f7b53c976ff4e7584e2dda9f05bab8894b2c6c",
+ "enrich/SKILL.md": "cbe6068373f4cd5006a6171a1795c3e619cfc82009ec4b3d86174b8ee2bcee2e",
"fact-check/SKILL.md": "49f0d356eee44541eddbc9cd501dc36707d417d84ca10446c0d315321f259674",
"fact-check/routing-eval.jsonl": "7519c6eada244813264b0df34ed67613e2d4404cfdf3cb209051b461749f5662",
"frontmatter-guard/SKILL.md": "1ade7903bba96faab03acc21db0ea15507256ed3bf81153e60526ff63aa26665",
@@ -100,7 +100,7 @@
"measure-before-you-fix/SKILL.md": "11906da29a1a31976b13d4796b686d9a9981825737846a85f32d88bf431b9b36",
"measure-before-you-fix/routing-eval.jsonl": "0661df9974a9cfe31216d574b1db0ef341945c2eb844ebf4ab6920fcbbc90d6c",
"media-ingest/SKILL.md": "d70374d3df21397380203f541ebdcc90c0bc6bc7207234349594a081e98f2719",
- "meeting-ingestion/SKILL.md": "63a15c1b71fa4d5b3ea5d73fc30c043a76a3b0fa6fa7b05132a10cd4da8e98f4",
+ "meeting-ingestion/SKILL.md": "ee30ec5813080d6bb3b5d487389ba2887dd119e7dde28feda65db149568ffb7d",
"meeting-ingestion/routing-eval.jsonl": "1995dc75eff09fd2e5fb403a10c81dc71b4c12035d48c77e57da0134c81f731a",
"migrate/SKILL.md": "ab7d7874bdd6cf1ef34538c2888b93b0a416f49bf04bd608dc5eccf9af9a5936",
"migrations/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -114,13 +114,13 @@
"migrations/v0.17.0.md": "761dda3b6090bfe20c9b4354aff5248d5a9b6a79a24702ecc2b29873d4f5b413",
"migrations/v0.18.0.md": "94efc1d571070600a78aca13c2735866a987e6a8f188210b7062f81b54839986",
"migrations/v0.19.0.md": "c47584e8306680f21ddc7f21a4a89f2184da522acb177f0dd73a09f1cd77ae57",
- "migrations/v0.21.0.md": "83569ce6fb2843f81964833affe5eae72c94a2983eba265c836aa05be7876957",
+ "migrations/v0.21.0.md": "b2c9e3e2fb91f6220a5af284d777f145e9994401f85e2b2a5418158ebb6b6f48",
"migrations/v0.22.14.md": "8898c109716fbc48c058a44c606f50fb7c02be599541d367380aa2e63bffea9e",
"migrations/v0.22.4.md": "5f9b2ed86cb64d92416448e744ca6c4984b89728895cd4e363f9c76a860074d9",
"migrations/v0.23.0.md": "f0363274e5071fa35d0c60e3981c4caee0494c43adb254d65acf6b743d4762d5",
"migrations/v0.25.1.md": "981ef49abadf19a891cb68b655b9f35ee67d9f4ac232ceb29d83dfc3b1c9982e",
"migrations/v0.27.1.md": "719dd4ebcc7ac81413ee79af20f80de5141577e3860e5049a49fc8f6d09ddf89",
- "migrations/v0.28.0.md": "58a98cfd5fed4e2aa41a53b51efa04a8f632e61dcf595df7eb8619c760593a27",
+ "migrations/v0.28.0.md": "5d13a3c233765feea6e6b1ff4fc346f8e43826e50af8235377693d53adeb69a5",
"migrations/v0.29.1.md": "7b85373a62a8500ee8c4238ffc9878318b44ee62543adb8b2462049c6c0cd1f8",
"migrations/v0.32.2.md": "88069b6ede3933aacb0555480bb730f75ca67602a5ae953f9f2a95a2bf6418a2",
"migrations/v0.32.6.md": "e9438a910afe8a1f7861c5222fd7db04a0f8d8b8283778476b07b7c3d539d3f0",
@@ -131,7 +131,7 @@
"migrations/v0.35.7.0.md": "c6d4454bd39e2aa243b3b3d9bc72fe5a4fd25d097be7be2bb14b25604b5c2cc5",
"migrations/v0.36.2.0.md": "18f72475a0c0de1489c518219128d331d8ed6b0cdcacfb329e18fbcc643d9c6e",
"migrations/v0.36.5.0.md": "889f42508c28835c99242ec20b610ab002f20cda821cb99039589a212cac2ce0",
- "migrations/v0.40.3.0.md": "3d3efbac6bda28e0b8775829ce51c4bed3bd21f7d844171aa96dc2745d2ef51d",
+ "migrations/v0.40.3.0.md": "ec6c3a7c1c2c1d1e78115fb43b35b293134da9405763b56016b55e9ea5da1121",
"migrations/v0.40.5.md": "f66047f1b6ef18b5b5e35445d61c0a1fe44e3c0f9e1c7a51c6b2342c67a0d92f",
"migrations/v0.41.11.0.md": "75c9741617de4c163052609e64734b4696a1105d3d015ed451097eaf6ea1eb3c",
"migrations/v0.46.3.0.md": "add5bdace741f8f0a75a114e354aa8ea3bcadf4cb54e1823338fdc69a5ae3f5d",
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.ts
index d4fea3ec69..21c431e994 100644
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@ -47,11 +47,11 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'creds': ['--allow-create-db', '--allow-docker', '--brain', '--chat-model', '--content-root', '--db-only', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--ids', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--out', '--passphrase-env', '--path', '--pglite', '--plan', '--prefer-postgres', '--provenance', '--provider', '--query', '--schema-pack', '--scopes', '--skip-embed-check', '--source', '--status', '--supabase', '--surface', '--to', '--url', '--version'],
'db-repair': ['--accept-pending', '--apply', '--apply-rewrites', '--background', '--brain', '--break-lock', '--db-url', '--dry-run', '--explain', '--filter', '--follow', '--force', '--force-retry', '--format', '--help', '--http', '--json', '--locks', '--name', '--no-accept-pending', '--path', '--prefer-postgres', '--probe', '--progress-interval', '--progress-json', '--quiet', '--remediate', '--restart', '--skip-verify', '--source', '--supabase', '--timeout', '--undo-last-rewrite', '--url', '--version', '--wait', '--yes'],
'decide': ['--all', '--all-from', '--apply', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--expect', '--from', '--help', '--include-withdrawals', '--input', '--json', '--limit', '--max-cost', '--max-usd', '--min', '--non-interactive', '--out', '--provenance', '--provider', '--query', '--recommended', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--trust', '--what-if-threshold', '--yes'],
- 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--seat', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],
+ 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--images', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--seat', '--section', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],
'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],
'edge-proposals': ['--access', '--add', '--all-applied', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--status', '--surface', '--to', '--updated-after', '--url', '--yes'],
'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],
- 'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--client', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--harness', '--help', '--http', '--id', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-facts', '--max-usd', '--no-accept-pending', '--no-autopilot-install', '--no-embed', '--no-embedding', '--no-hooks', '--only', '--pace', '--pace-max-concurrency', '--path', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--scopes', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--surface', '--timeout', '--to', '--wait', '--yes'],
+ 'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--client', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--full', '--harness', '--help', '--http', '--id', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-facts', '--max-usd', '--no-accept-pending', '--no-autopilot-install', '--no-embed', '--no-embedding', '--no-hooks', '--only', '--pace', '--pace-max-concurrency', '--path', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--scopes', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--surface', '--timeout', '--to', '--wait', '--yes'],
'embeddings': ['--accept-pending', '--background', '--brain', '--db-url', '--dim', '--embedding-dimensions', '--embedding-model', '--explain', '--follow', '--force', '--help', '--json', '--no-accept-pending', '--no-embedding', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--wait', '--yes'],
'engine': ['--apply-rewrites', '--brain', '--break-lock', '--db-url', '--help', '--http', '--json', '--path', '--prefer-postgres', '--probe', '--source', '--supabase', '--url', '--yes'],
'enrich': ['--accept-pending', '--access', '--add', '--allowed-operations', '--apply', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--client', '--concurrency', '--confirm-destructive', '--date', '--dated-since', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--expect', '--explain', '--federated-read', '--follow', '--force', '--full', '--fuzzy', '--group', '--help', '--http', '--id', '--include-deleted', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--non-interactive', '--order', '--output', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--rate', '--recent', '--reenrich-after', '--refresh-operations', '--resume', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--surface', '--thin', '--thin-threshold', '--timeout', '--to', '--trust', '--types', '--updated-after', '--url', '--wait', '--workers', '--yes'],
@@ -72,16 +72,16 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'graph-query': ['--brain', '--depth', '--direction', '--help', '--hop', '--include-foreign', '--json', '--mcp-only', '--source', '--type'],
'hook': ['--allow-unverified-remote', '--auto', '--brain', '--branch', '--cached', '--count', '--diff-filter', '--end-of-options', '--env', '--get', '--harness', '--help', '--jq', '--json', '--limit', '--name-only', '--others', '--path', '--porcelain', '--pure', '--quiet', '--remove', '--seat', '--session', '--show-current', '--show-toplevel', '--since', '--source', '--yes'],
'import': ['--accept-pending', '--allow-empty', '--allow-noncanonical-root', '--apply', '--background', '--brain', '--cached', '--diff-filter', '--dim', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--explain', '--follow', '--force', '--force-rechunk', '--format', '--fresh', '--help', '--include-gitignored', '--is-shallow-repository', '--json', '--log-noop', '--name-only', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-gpg-sign', '--no-pull', '--no-renames', '--no-verify', '--only', '--others', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--url', '--verify', '--wait', '--workers'],
- 'init': ['--access', '--allow-create-db', '--allow-docker', '--apply', '--brain', '--break-lock', '--budget-ms', '--chat-model', '--check', '--content-root', '--db-only', '--dest', '--dim', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--facts', '--fix', '--force', '--full', '--git', '--grant-types', '--harness', '--help', '--http', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-autopilot-install', '--no-embedding', '--no-expand', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--page', '--path', '--pglite', '--phase', '--plan', '--prefer-postgres', '--preview', '--probe', '--provenance', '--query', '--quiet', '--reference-date', '--remediate', '--remove', '--reset', '--save', '--schema-pack', '--scope', '--scopes', '--show-toplevel', '--skip-embed-check', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--workspace', '--yes'],
+ 'init': ['--access', '--allow-create-db', '--allow-docker', '--apply', '--auto', '--brain', '--break-lock', '--budget-ms', '--chat-model', '--check', '--content-root', '--db-only', '--dest', '--dim', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--facts', '--fix', '--force', '--full', '--git', '--grant-types', '--harness', '--help', '--http', '--images', '--issuer-url', '--json', '--key', '--limit', '--local-postgres', '--markdown', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-autopilot-install', '--no-embed', '--no-embedding', '--no-expand', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--page', '--params', '--path', '--pglite', '--phase', '--plan', '--prefer-postgres', '--preview', '--probe', '--provenance', '--query', '--quiet', '--reference-date', '--remediate', '--remove', '--reset', '--save', '--schema-pack', '--scope', '--scopes', '--section', '--show-toplevel', '--skip-embed-check', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--workspace', '--yes'],
'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],
'integrity': ['--accept-pending', '--auto', '--backend', '--background', '--brain', '--confidence', '--cost', '--dry-run', '--explain', '--follow', '--fresh', '--help', '--json', '--limit', '--no-accept-pending', '--probe', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--supabase', '--timeout', '--type', '--url', '--wait'],
'jobs': ['--abbrev-ref', '--access', '--add', '--admin-intent', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--check', '--cli-path', '--client', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--confirm-quiesced', '--cost-estimate', '--date', '--dated-since', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--expected-state', '--explain', '--facts', '--federated-read', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--fuzzy', '--group', '--hard-deadline', '--health-interval', '--help', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-deleted', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--lanes', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-lanes', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--probe', '--prune-orphans', '--queue', '--queue-only', '--quiet', '--reason', '--rebuild', '--recent', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--replace', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--retry-held', '--review-lower', '--row', '--scopes', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--to', '--trust', '--type', '--types', '--uninstall', '--updated-after', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
'lint': ['--abbrev-ref', '--abort', '--accept-pending', '--all', '--background', '--brain', '--branch', '--cached', '--client', '--dry-run', '--exclude', '--exit-code', '--explain', '--file', '--fix', '--follow', '--get', '--get-url', '--git-dir', '--git-path', '--help', '--id', '--is-ancestor', '--is-inside-work-tree', '--json', '--local', '--name-only', '--no-accept-pending', '--no-cron', '--no-tags', '--no-verify', '--no-write-fetch-head', '--pat-file', '--path', '--preview', '--probe', '--progress-interval', '--progress-json', '--purge', '--push', '--push-only', '--quiet', '--rebase', '--scopes', '--short', '--show-toplevel', '--slug', '--source', '--timeout', '--unset-all', '--wait', '--yes'],
'loops': ['--all', '--as-of', '--brain', '--fail-fast', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--tools-json', '--top', '--type'],
'lsd': ['--brain', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--max-usd', '--no-save', '--resume', '--save', '--source', '--strict-budget', '--yes'],
- 'maintain': ['--adopt-columns', '--adopt-permissions', '--all', '--apply', '--background', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--catch-up', '--concurrency', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--expect', '--expected-revision', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--format', '--from-meetings', '--full', '--harness', '--help', '--http', '--id', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--ner', '--no-autopilot-install', '--no-capture', '--no-embed', '--no-pull', '--once', '--only', '--operations', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--preview', '--probe', '--probe-pglite', '--project', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--reverse', '--safe', '--scope', '--scopes', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--to', '--token', '--top-k', '--type', '--url-env', '--verbose', '--version', '--window', '--workers', '--yes'],
+ 'maintain': ['--adopt-columns', '--adopt-permissions', '--all', '--apply', '--background', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--catch-up', '--concurrency', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--expect', '--expected-revision', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--format', '--from-meetings', '--full', '--hard-deadline', '--harness', '--help', '--http', '--id', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--ner', '--no-autopilot-install', '--no-capture', '--no-embed', '--no-pull', '--once', '--only', '--operations', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--preview', '--probe', '--probe-pglite', '--project', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--reverse', '--safe', '--scope', '--scopes', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--to', '--token', '--top-k', '--type', '--url-env', '--verbose', '--version', '--window', '--workers', '--yes'],
'mcp': ['--admin-token-file', '--agent', '--arg', '--bearer-token-env-var', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--credentials-file', '--credentials-out', '--delegate', '--delegated-namespace', '--delegated-slug-prefixes', '--dry-run', '--enable-dcr', '--federated-read', '--flow', '--force', '--funnel', '--harness', '--header', '--help', '--if-version', '--install', '--issuer-url', '--json', '--limit', '--mcp-only', '--mcp-url', '--no-install', '--no-service', '--no-tailscale', '--oauth-client-id', '--oauth-client-secret', '--oauth-request', '--port', '--profile', '--queue', '--redirect-uri', '--remove', '--resume', '--root', '--scope', '--scopes', '--skills', '--source', '--status', '--surface', '--timeout-ms', '--token', '--token-endpoint-auth-method', '--token-ttl', '--url', '--yes'],
- 'migrate': ['--accept-pending', '--admin-intent', '--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--follow', '--force', '--force-retry', '--harness', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--manifest', '--max-cost', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-migrate', '--non-interactive', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--plan', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--resume', '--retarget', '--rollback-to-source', '--scope', '--skip-verify', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--trigger-bypass', '--trust', '--url', '--url-env', '--wait', '--yes'],
+ 'migrate': ['--accept-pending', '--admin-intent', '--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--follow', '--force', '--force-retry', '--full', '--harness', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--manifest', '--max-cost', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-migrate', '--non-interactive', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--plan', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--resume', '--retarget', '--rollback-to-source', '--scope', '--skip-verify', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--trigger-bypass', '--trust', '--url', '--url-env', '--wait', '--yes'],
'models': ['--batch', '--brain', '--concurrent', '--cycles', '--dim', '--dimensions', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--limit', '--max-tokens', '--max-usd', '--output', '--receipt-dir', '--skip', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--source', '--status', '--task', '--to', '--yes'],
'mounts': ['--alias', '--brain', '--database-path', '--database-url', '--db-path', '--db-url', '--engine', '--help', '--id', '--json', '--mcp-url', '--path', '--skills-dir', '--source'],
'notability-eval': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--in', '--json', '--out', '--repo', '--skip-llm', '--source', '--status', '--target-high', '--target-low', '--target-medium'],
@@ -90,16 +90,16 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'orphans': ['--accept-pending', '--background', '--brain', '--count', '--explain', '--follow', '--help', '--include-pseudo', '--json', '--mode', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
'pages': ['--brain', '--dry-run', '--force', '--help', '--json', '--older-than', '--source', '--yes'],
'pglite-repair': ['--brain', '--break-lock', '--dry-run', '--expect', '--help', '--http', '--json', '--path', '--probe', '--source', '--vectors', '--yes'],
- 'post-upgrade': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--admin-intent', '--all', '--all-applied', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--catch-up', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
+ 'post-upgrade': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--admin-intent', '--all', '--all-applied', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--catch-up', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--max-usd', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
'pricing': ['--brain', '--help', '--input', '--json', '--max-cost', '--max-runtime', '--output', '--rate', '--source'],
'projections': ['--brain', '--enable-dcr', '--help', '--http', '--install', '--json', '--limit', '--now', '--port', '--public-url', '--remove', '--source', '--status', '--surface', '--user'],
- 'protocol': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--synthesize', '--target', '--to', '--token', '--updated-after', '--url', '--yes'],
+ 'protocol': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--provenance', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--synthesize', '--target', '--to', '--token', '--updated-after', '--url', '--yes'],
'providers': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--model', '--source', '--status', '--touchpoint'],
'publish': ['--accent', '--bg', '--border', '--brain', '--card-bg', '--code-bg', '--error', '--fg', '--help', '--json', '--link', '--muted', '--out', '--password', '--source', '--title'],
- 'quarantine': ['--apply', '--brain', '--force', '--force-rechunk', '--help', '--include-flagged', '--json', '--limit', '--no-embed', '--source', '--source-id', '--stale'],
+ 'quarantine': ['--admin-intent', '--apply', '--brain', '--client', '--dir', '--expected-epoch', '--expected-state', '--force', '--force-rechunk', '--help', '--id', '--include-flagged', '--json', '--limit', '--manifest', '--no-embed', '--path', '--scopes', '--self-transfer', '--source', '--source-id', '--stale'],
'recall': ['--accept-pending', '--access', '--add', '--allowed-operations', '--as-context', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--budget-policy', '--budget-tokens', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--follow', '--full', '--fuzzy', '--grep', '--help', '--http', '--id', '--include-deleted', '--include-expired', '--json', '--kind', '--limit', '--max-usd', '--mcp-only', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--page', '--params', '--path', '--pending', '--phase', '--progress-interval', '--progress-json', '--query', '--quiet', '--reason', '--recent', '--refresh-operations', '--request-id', '--rollup', '--row', '--scopes', '--session', '--session-id', '--since', '--since-last-run', '--slugs', '--source', '--source-id', '--sources', '--stale', '--supersessions', '--surface', '--timeout', '--to', '--today', '--updated-after', '--url', '--wait', '--watch', '--yes'],
'reconcile-links': ['--accept-pending', '--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
- 'reindex': ['--accept-pending', '--admin-intent', '--aliases', '--apply', '--background', '--brain', '--concurrency', '--cost-estimate', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--help', '--include-ambiguous', '--json', '--limit', '--manifest', '--markdown', '--max-usd', '--multimodal', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-llm', '--only', '--path', '--progress-interval', '--progress-json', '--quiet', '--repo', '--self-transfer', '--skip', '--slug', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--type', '--vectors', '--wait', '--workers', '--yes'],
+ 'reindex': ['--accept-pending', '--admin-intent', '--aliases', '--apply', '--background', '--brain', '--concurrency', '--cost-estimate', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--help', '--include-ambiguous', '--json', '--limit', '--manifest', '--markdown', '--max-cost', '--max-usd', '--multimodal', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-llm', '--only', '--path', '--progress-interval', '--progress-json', '--quiet', '--repo', '--self-transfer', '--skip', '--slug', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--type', '--vectors', '--wait', '--workers', '--yes'],
'reindex-code': ['--accept-pending', '--apply', '--background', '--brain', '--break-lock', '--client', '--concurrency', '--db-url', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--explain', '--follow', '--force', '--help', '--http', '--id', '--json', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--no-accept-pending', '--no-embed', '--non-interactive', '--only', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--scopes', '--source', '--status', '--timeout', '--trust', '--wait', '--workers', '--yes'],
'reindex-frontmatter': ['--apply', '--brain', '--concurrency', '--dry-run', '--expect', '--force', '--help', '--json', '--max-cost', '--max-usd', '--non-interactive', '--slug-prefix', '--source', '--trust', '--workers', '--yes'],
'reindex-search-vector': ['--accept-pending', '--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--resume', '--source', '--timeout', '--wait', '--yes'],
@@ -110,12 +110,12 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'report': ['--brain', '--content', '--dir', '--help', '--json', '--source', '--title', '--type'],
'repos': ['--abandon', '--abbrev-ref', '--abort', '--accept-suggested', '--access', '--account', '--add', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--after', '--all', '--all-new', '--allow-unverified-remote', '--allowed-operations', '--app-id', '--app-install', '--app-pem', '--apply', '--audit', '--auto-additive', '--backups', '--before', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--branch', '--budget-usd-per-day', '--cached', '--calendar-id', '--classify', '--cleanup-dead-local-locks', '--clear', '--client', '--clone-dir', '--confirm-destructive', '--confirm-quiesced', '--count', '--days', '--decisions', '--delegated-namespace', '--delegated-slug-prefixes', '--detect', '--diff-filter', '--dir', '--dry-run', '--error-unmatch', '--exclude', '--exit-code', '--expected-epoch', '--expected-incarnation', '--expected-state', '--federated', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--force', '--format', '--from', '--get', '--get-url', '--git-dir', '--git-path', '--github-repo', '--grant-types', '--help', '--history-days', '--http', '--id', '--if-version', '--include', '--include-warns', '--is-ancestor', '--is-inside-work-tree', '--json', '--keep-storage', '--kind', '--limit', '--local', '--manifest', '--max-cost-usd', '--message', '--migrate-legacy', '--migration', '--name', '--name-only', '--no-cron', '--no-embed', '--no-extract', '--no-federate', '--no-federated', '--no-harden', '--no-pull', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--operations', '--others', '--out', '--params', '--pat-file', '--path', '--plan', '--porcelain', '--preview', '--probe', '--profile', '--push', '--push-only', '--quiet', '--read-sources', '--rebase', '--redirect-uri', '--refresh-operations', '--remove-backup', '--repair', '--replace', '--repos', '--request-id', '--reset-checkpoint', '--reset-default', '--resume', '--retry-failed', '--scope', '--scopes', '--secret', '--self-transfer', '--services', '--set', '--shared-skills', '--short', '--show-toplevel', '--slug-prefixes', '--source', '--source-id', '--source-ids', '--sources', '--stale', '--status', '--surface', '--takes-holders', '--token', '--token-command', '--token-endpoint-auth-method', '--token-env', '--token-ttl', '--unset-all', '--untracked-files', '--url', '--usage', '--wait-drain', '--yes'],
'resolvers': ['--backend', '--brain', '--cost', '--help', '--json', '--source'],
- 'retrieval-upgrade': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--non-interactive', '--pace', '--pace-max-concurrency', '--priority', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--retarget', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--wait', '--yes'],
+ 'retrieval-upgrade': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--full', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--non-interactive', '--pace', '--pace-max-concurrency', '--priority', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--retarget', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--wait', '--yes'],
'routing-eval': ['--brain', '--help', '--json', '--llm', '--skills-dir', '--source'],
'salience': ['--brain', '--days', '--help', '--json', '--kind', '--limit', '--mcp-only', '--slug-prefix', '--source'],
'schema': ['--alias', '--apply', '--as-filing-rules', '--brain', '--dims', '--expert', '--expert-routing', '--extractable', '--fields', '--force', '--help', '--inverse', '--json', '--kind', '--no-prefix', '--pack', '--page-type', '--prefix', '--primitive', '--schema-pack', '--since', '--source', '--source-id', '--target-type', '--to', '--with-db'],
'self-upgrade': ['--brain', '--check-only', '--ff-only', '--force', '--force-retry', '--help', '--json', '--markdown', '--migrate-only', '--no-autopilot-install', '--no-bun-floor-check', '--non-interactive', '--refresh-cache', '--remediation-plan', '--source', '--swap-only', '--version', '--yes'],
- 'serve': ['--access', '--add', '--adopt-columns', '--adopt-permissions', '--all-new', '--apply-rewrites', '--bind', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--days', '--delegated-namespace', '--delegated-slug-prefixes', '--enable-dcr', '--enable-dcr-insecure', '--expect', '--fail-fast', '--federated-read', '--grant-types', '--harness', '--help', '--http', '--id', '--if-version', '--json', '--log-full-params', '--migrate-legacy', '--no-embedding', '--oauth-request', '--only', '--operations', '--path', '--pglite', '--port', '--prefer-postgres', '--print-admin-token', '--profile', '--public-url', '--read-sources', '--redirect-uri', '--refresh-operations', '--repair', '--reset-default', '--scopes', '--source', '--source-guard', '--sources', '--stdio-idle-timeout', '--suppress-bootstrap-token', '--surface', '--takes-holders', '--token', '--token-endpoint-auth-method', '--token-ttl', '--tools-json', '--url', '--usage', '--yes'],
+ 'serve': ['--access', '--add', '--adopt-columns', '--adopt-permissions', '--all-new', '--apply-rewrites', '--bind', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--days', '--delegated-namespace', '--delegated-slug-prefixes', '--enable-dcr', '--enable-dcr-insecure', '--expect', '--fail-fast', '--federated-read', '--grant-types', '--harness', '--help', '--http', '--id', '--if-version', '--json', '--log-full-params', '--migrate-legacy', '--no-embedding', '--oauth-request', '--only', '--operations', '--path', '--pglite', '--port', '--prefer-postgres', '--print-admin-token', '--profile', '--provenance', '--public-url', '--read-sources', '--redirect-uri', '--refresh-operations', '--repair', '--reset-default', '--scopes', '--source', '--source-guard', '--sources', '--stdio-idle-timeout', '--suppress-bootstrap-token', '--surface', '--takes-holders', '--token', '--token-endpoint-auth-method', '--token-ttl', '--tools-json', '--url', '--usage', '--yes'],
'skillify': ['--brain', '--description', '--dry-run', '--force', '--help', '--json', '--mutating', '--recent', '--skills-dir', '--source', '--strict', '--triggers', '--writes-pages', '--writes-to'],
'skillopt': ['--all', '--allow-mutate-bundled', '--background', '--batch-size', '--benchmark', '--bootstrap-from-routing', '--bootstrap-from-skill', '--bootstrap-reviewed', '--bootstrap-tasks', '--brain', '--brain-wide-max-cost-usd', '--dry-run', '--epochs', '--follow', '--force', '--held-out', '--help', '--json', '--judge-model', '--lr', '--lr-schedule', '--max-cost-usd', '--max-runtime-min', '--max-usd', '--models-strict', '--no-max-cost', '--no-mutate', '--optimizer-model', '--patch', '--reflect-max-tokens', '--resume', '--rewrite', '--skills-dir', '--source', '--split', '--status', '--target-model', '--target-models'],
'skillpack': ['--all', '--apply-clean-hunks', '--author', '--auto', '--brain', '--dest', '--dry-run', '--env', '--exit-code', '--fast', '--fix', '--force-unlock', '--format', '--from', '--full', '--harness', '--help', '--homepage', '--json', '--license', '--list', '--minimal', '--name-only', '--no-cache', '--no-lint', '--note', '--out', '--overwrite-local', '--persona', '--probe', '--pure', '--push', '--quick', '--quiet', '--refresh', '--repo', '--schema-pack', '--scope', '--short', '--since', '--skill', '--skills', '--skills-dir', '--skip-doctor', '--source', '--strict', '--stub', '--supabase', '--target', '--tier', '--trust', '--url', '--verify', '--version', '--workspace', '--yes'],
@@ -129,7 +129,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'takes': ['--accept', '--batch-size', '--before', '--brain', '--bucket-size', '--by', '--claim', '--dim', '--dir', '--domain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--evidence', '--expected-revision', '--expired', '--force', '--from-pages', '--help', '--holder', '--include-covered', '--json', '--kind', '--limit', '--max-pages', '--no-embed', '--no-embedding', '--offset', '--outcome', '--path', '--quality', '--reject', '--request-id', '--row', '--semantic', '--since', '--sort', '--source', '--source-id', '--stale', '--status', '--supabase', '--to', '--unit', '--until', '--value', '--weight', '--who', '--yes'],
'think': ['--anchor', '--brain', '--calibration-holder', '--help', '--json', '--mcp-only', '--model', '--only', '--reference-date', '--rounds', '--save', '--since', '--source', '--take', '--until', '--with-calibration'],
'transcripts': ['--accept-pending', '--all', '--all-discovery', '--apply', '--background', '--brain', '--days', '--dry-run', '--embed', '--explain', '--facts', '--follow', '--format', '--full', '--help', '--include-self', '--json', '--limit', '--max-bytes', '--max-cost-usd', '--no-accept-pending', '--only', '--progress-interval', '--progress-json', '--purge', '--quiet', '--since', '--source', '--source-id', '--timeout', '--wait'],
- 'upgrade': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--admin-intent', '--all', '--all-applied', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--catch-up', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
+ 'upgrade': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--admin-intent', '--all', '--all-applied', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--catch-up', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--max-usd', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
'waiting': ['--all', '--as-of', '--brain', '--fail-fast', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--tools-json', '--top', '--type'],
'watch': ['--brain', '--help', '--json', '--max-pages', '--min-confidence', '--source', '--window-turns'],
'whoknows': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--mcp-only', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--to', '--updated-after', '--url', '--yes'],
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
index f4ec3145f6..ea9e4cf815 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
@@ -1022,12 +1022,14 @@
"pages_coalesce_date_idx": "CREATE INDEX pages_coalesce_date_idx ON public.pages USING btree (COALESCE(effective_date, updated_at))",
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
+ "pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_last_retrieved_at_idx": "CREATE INDEX pages_last_retrieved_at_idx ON public.pages USING btree (last_retrieved_at)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_pkey": "CREATE UNIQUE INDEX pages_pkey ON public.pages USING btree (id)",
"pages_safe_chunk_pending_idx": "CREATE INDEX pages_safe_chunk_pending_idx ON public.pages USING btree (source_id) WHERE (chunker_version < 4)",
"pages_source_path_idx": "CREATE INDEX pages_source_path_idx ON public.pages USING btree (source_path) WHERE (source_path IS NOT NULL)",
+ "pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index 0b4797f8d3..6237901aaa 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -1026,12 +1026,14 @@
"pages_coalesce_date_idx": "CREATE INDEX pages_coalesce_date_idx ON public.pages USING btree (COALESCE(effective_date, updated_at))",
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
+ "pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_last_retrieved_at_idx": "CREATE INDEX pages_last_retrieved_at_idx ON public.pages USING btree (last_retrieved_at)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_pkey": "CREATE UNIQUE INDEX pages_pkey ON public.pages USING btree (id)",
"pages_safe_chunk_pending_idx": "CREATE INDEX pages_safe_chunk_pending_idx ON public.pages USING btree (source_id) WHERE (chunker_version < 4)",
"pages_source_path_idx": "CREATE INDEX pages_source_path_idx ON public.pages USING btree (source_path) WHERE (source_path IS NOT NULL)",
+ "pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
index 85f3853052..4ed157432e 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -1026,12 +1026,14 @@
"pages_coalesce_date_idx": "CREATE INDEX pages_coalesce_date_idx ON public.pages USING btree (COALESCE(effective_date, updated_at))",
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
+ "pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_last_retrieved_at_idx": "CREATE INDEX pages_last_retrieved_at_idx ON public.pages USING btree (last_retrieved_at)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_pkey": "CREATE UNIQUE INDEX pages_pkey ON public.pages USING btree (id)",
"pages_safe_chunk_pending_idx": "CREATE INDEX pages_safe_chunk_pending_idx ON public.pages USING btree (source_id) WHERE (chunker_version < 4)",
"pages_source_path_idx": "CREATE INDEX pages_source_path_idx ON public.pages USING btree (source_path) WHERE (source_path IS NOT NULL)",
+ "pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
index d924bb5400..d726ea7956 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -1022,12 +1022,14 @@
"pages_coalesce_date_idx": "CREATE INDEX pages_coalesce_date_idx ON public.pages USING btree (COALESCE(effective_date, updated_at))",
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
+ "pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_last_retrieved_at_idx": "CREATE INDEX pages_last_retrieved_at_idx ON public.pages USING btree (last_retrieved_at)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_pkey": "CREATE UNIQUE INDEX pages_pkey ON public.pages USING btree (id)",
"pages_safe_chunk_pending_idx": "CREATE INDEX pages_safe_chunk_pending_idx ON public.pages USING btree (source_id) WHERE (chunker_version < 4)",
"pages_source_path_idx": "CREATE INDEX pages_source_path_idx ON public.pages USING btree (source_path) WHERE (source_path IS NOT NULL)",
+ "pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
diff --git a/test/fixtures/goldens/cli/literal-imports.json b/test/fixtures/goldens/cli/literal-imports.json
index 41299cc086..80faecb20b 100644
--- a/test/fixtures/goldens/cli/literal-imports.json
+++ b/test/fixtures/goldens/cli/literal-imports.json
@@ -145,7 +145,9 @@
"./core/sync-concurrency.ts",
"./commands/reindex-vectors.ts",
"./commands/reindex-aliases.ts",
- "./commands/reindex.ts"
+ "./commands/reindex.ts",
+ "./core/consent.ts",
+ "./core/ops/contract.ts"
],
"reindex-code": [
"./commands/reindex-code.ts"
diff --git a/test/fixtures/goldens/cli/membership-sets.json b/test/fixtures/goldens/cli/membership-sets.json
index a7c4f22530..41e3beb528 100644
--- a/test/fixtures/goldens/cli/membership-sets.json
+++ b/test/fixtures/goldens/cli/membership-sets.json
@@ -272,6 +272,7 @@
"projections",
"protocol",
"providers",
+ "quarantine",
"reindex",
"reinit-pglite",
"remote",
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index a3b4b1e27a..d1b4b554fd 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 208653,
- "stdoutSha256": "0df2586d0d82b9edbeb6bc242a687ab5ca01bdbccca68fe1dddc3c8eceaf79bb",
+ "stdoutBytes": 208650,
+ "stdoutSha256": "85819a6dd610e66bca99074a566a435bb0d29f352391b90b3ef306e17407fbb9",
"toolNames": [
"remember",
"entity",
@@ -415,7 +415,7 @@
"scope": "read"
},
{
- "description": "Complete content REPLACES the whole page: read get_page include_content:true, then send its revision as expected_revision and a request_id. Remote callers: [[links]] to existing pages become mentions; typed links are skipped (a stdio `gbrain serve` sweeps them later, `gbrain serve --http` does not self-sweep). Edits: edit_page; over 3 pages: put_pages.",
+ "description": "Complete content REPLACES the whole page: read get_page include_content:true; send its revision as expected_revision. Keep a request_id UUID; retry with identical arguments. Remote callers: existing-page [[links]] become mentions; typed links are skipped (stdio `gbrain serve` sweeps them later, `gbrain serve --http` does not self-sweep). Edits: edit_page; >3 pages: put_pages.",
"idempotent": true,
"local_only": false,
"mutating": true,
@@ -442,7 +442,7 @@
"type": "boolean"
},
"content": {
- "description": "Complete markdown with frontmatter; read get_page include_content:true first.",
+ "description": "Complete markdown (get_page include_content:true).",
"type": "string"
},
"drop_timeline": {
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 7f111367be..71b045e1a1 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -3417,7 +3417,7 @@
"entities: string[]",
"model: string",
"reasons: string[]",
- "score: number",
+ "score: number | null",
"segments: TriageSegment[]",
"triage_version: number",
"worth_processing: boolean"
@@ -4977,7 +4977,7 @@
"kind": "function",
"name": "parseInlineCitationTimelineEntries",
"signature": [
- "(content: string, opts?: { skipLine?: (line: string) => boolean; }) => InlineCitationTimelineCandidate[]"
+ "(content: string, opts?: CitationOpts) => InlineCitationTimelineCandidate[]"
]
},
{
@@ -5859,7 +5859,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"budget_below_recent_runtime\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"cache_quota_exceeded\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"fix_not_writable\" | \"file_removed_during_scan\" | \"file_too_large\" | \"follow_approval_required\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"graph_incomplete\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"persistence_write_stall\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stale_unavailable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
+ "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"budget_below_recent_runtime\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"cache_quota_exceeded\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"fix_not_writable\" | \"file_removed_during_scan\" | \"file_too_large\" | \"follow_approval_required\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"graph_incomplete\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"maintenance_lock_busy\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pattern_claims_pending\" | \"pending_writes\" | \"persistence_write_stall\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stale_unavailable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
diff --git a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
index e33ac41521..dbdc20143b 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -1022,12 +1022,14 @@
"pages_coalesce_date_idx": "CREATE INDEX pages_coalesce_date_idx ON public.pages USING btree (COALESCE(effective_date, updated_at))",
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
+ "pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_last_retrieved_at_idx": "CREATE INDEX pages_last_retrieved_at_idx ON public.pages USING btree (last_retrieved_at)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_pkey": "CREATE UNIQUE INDEX pages_pkey ON public.pages USING btree (id)",
"pages_safe_chunk_pending_idx": "CREATE INDEX pages_safe_chunk_pending_idx ON public.pages USING btree (source_id) WHERE (chunker_version < 4)",
"pages_source_path_idx": "CREATE INDEX pages_source_path_idx ON public.pages USING btree (source_path) WHERE (source_path IS NOT NULL)",
+ "pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",