Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
install: new MCP registrations pin the starter surface; full stays the opt-in
garrytande40a8ac08a6
diff --git a/INSTALL_FOR_AGENTS.md b/INSTALL_FOR_AGENTS.mdindex 897da9257a..15224c9441 100644--- a/INSTALL_FOR_AGENTS.md+++ b/INSTALL_FOR_AGENTS.md@@ -471,7 +471,7 @@ model gbrain removed in v0.33, needs `gbrain skillpack migrate-fence` once.)**If you are Hermes:** register gbrain as your MCP server:```bash-printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full+printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface starter```Keep `--args` last (everything after it becomes server argv) and verify with@@ -481,12 +481,12 @@ Keep `--args` last (everything after it becomes server argv) and verify with**If you are Grok Build** (xAI's `grok` CLI): register gbrain as your MCP server:```bash-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter```The add is lazy (exit 0 without connecting) — verify with`grok mcp doctor gbrain`, which spawns the server and must report the tools it-discovered (the full surface). This is the brain-only install; the `gbrain bootstrap`+discovered (the starter surface). This is the brain-only install; the `gbrain bootstrap`personal-agent path does not support Grok yet (Claude Code, Codex, and opencode only).Verified against Grok Build v1.0.4. Full reference:[docs/mcp/GROK.md](docs/mcp/GROK.md).@@ -497,7 +497,7 @@ install, follow `BOOTSTRAP_FOR_AGENTS.md` instead of this page. For thebrain-only MCP registration:```bash-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter```The add is lazy (exit 0 without connecting) — verify with `opencode mcp list`,diff --git a/README.md b/README.mdindex a9c1cb94e0..753bff4a83 100644--- a/README.md+++ b/README.md@@ -185,7 +185,7 @@ The agent starts with keyless memory and verifies it. API keys, automatic captur### Lighter ways in-**Just want a memory for your coding agent — no identity, no repo.** On Claude Code or Codex use `gbrain setup` (above). By hand: `gbrain init --pglite --no-embedding`, then `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full` (`claude mcp add` takes the same argv; `--surface verbs` or `starter` for a harness that caps its tool count), then `gbrain setup codex --instructions-only` (the brain-first block). Saved memories are brain-wide by default; pass `visibility: "private"` for local-only facts.+**Just want a memory for your coding agent — no identity, no repo.** On Claude Code or Codex use `gbrain setup` (above). By hand: `gbrain init --pglite --no-embedding`, then `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter` (`claude mcp add` takes the same argv; `--surface full` lists every tool), then `gbrain setup codex --instructions-only` (the brain-first block). Saved memories are brain-wide by default; pass `visibility: "private"` for local-only facts.**Already have a brain on a remote host** (OpenClaw, Hermes, or any `gbrain serve --http`)? Point your laptop agents at it with one command each — `--install` wires it up and smoke-tests the token before handoff:@@ -225,11 +225,11 @@ Pick your product, then run `gbrain setup <harness> --instructions-only`: agents- **[Claude Code](docs/mcp/CLAUDE_CODE.md)** — plugin: `/plugin marketplace add garrytan/gbrain` + `/plugin install gbrain@gbrain` (MCP + skills; persona variants `gbrain-coding` / `gbrain-daily` install curated subsets; pick one). Marketplace-free skills: `gbrain skillpack scaffold --harness claude-code` copies a persona-curated skill set into your user-scope skills dir. Or by hand: `claude mcp add gbrain -- "$(command -v gbrain)" serve`. Remote with just a bearer token: `gbrain connect https://your-host/mcp --token gbrain_xxx` prints a paste-ready block (or `--install` wires it up and smoke-tests the token).- **[Codex](docs/mcp/CODEX.md)** — plugin (recommended): `codex plugin marketplace add garrytan/gbrain@codex-plugin` + `codex plugin add gbrain@gbrain` installs the MCP server AND the curated skill set. Or connect-only: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent codex` (or `--install`); the token path reads `$GBRAIN_REMOTE_TOKEN` at runtime, while the private-handoff installer writes a private managed HTTP header so the connection survives a new shell.- **[Cursor / Windsurf / any stdio MCP client](docs/mcp/CLAUDE_CODE.md)** — same shape, add `{"command": "gbrain", "args": ["serve", "--surface", "full"]}` to your MCP config.-- **[Hermes](docs/mcp/HERMES.md)** — `printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full`. Keep `--args` last, and verify with `hermes mcp test gbrain` (the add exits 0 even on failure).+- **[Hermes](docs/mcp/HERMES.md)** — `printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface starter`. Keep `--args` last, and verify with `hermes mcp test gbrain` (the add exits 0 even on failure).- **[Grok Bot](docs/guides/grok-bot.md)** — recommended: keep the brain on your computer, publish it with `gbrain mcp expose --funnel`, grant the Bot a `memory-writer` client and install the thin CLI at `/workspace/gbrain`; or install memory inside the Bot computer when no machine of yours stays online. Bots share local files and credentials; sources organize memory without isolating Bots. **Say to your agent:** *"connect grok bot to my brain"*.- **[Muse personal agent](docs/guides/muse.md)** — first verify its durable user-files location; then either connect it to your published brain (`gbrain mcp expose --funnel` + thin CLI) or install the local CLI there. Native MCP configuration and skill activation are not assumed. **Say to your agent:** *"connect muse to my brain"*.-- **[Grok Build](docs/mcp/GROK.md)** — `grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full`. The add is lazy (exit 0 without connecting) — verify with `grok mcp doctor gbrain`, which spawns the server. Verified against Grok Build v1.0.4.-- **[opencode](docs/mcp/OPENCODE.md)** (opencode.ai / SST — not OpenClaw) — `opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full`, or let `gbrain bootstrap hooks --harness opencode` write the config for you. The add is lazy — verify with `opencode mcp list`, which spawns the server (`✓ gbrain connected`). Remote: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent opencode [--install]` — the config stores only the `{env:GBRAIN_REMOTE_TOKEN}` interpolation. Verified against opencode v1.18.18.+- **[Grok Build](docs/mcp/GROK.md)** — `grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter`. The add is lazy (exit 0 without connecting) — verify with `grok mcp doctor gbrain`, which spawns the server. Verified against Grok Build v1.0.4.+- **[opencode](docs/mcp/OPENCODE.md)** (opencode.ai / SST — not OpenClaw) — `opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter`, or let `gbrain bootstrap hooks --harness opencode` write the config for you. The add is lazy — verify with `opencode mcp list`, which spawns the server (`✓ gbrain connected`). Remote: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent opencode [--install]` — the config stores only the `{env:GBRAIN_REMOTE_TOKEN}` interpolation. Verified against opencode v1.18.18.- **[OpenClaw](docs/mcp/OPENCLAW.md)** — the ClawHub bundle plugin registers gbrain automatically (`openclaw.plugin.json` ships in this repo), or register the stdio server with `openclaw mcp add gbrain --command "$(command -v gbrain)" --arg serve --env GBRAIN_HOME=$HOME` (absolute path: the launchd gateway PATH lacks `~/.bun/bin`); verify with `openclaw mcp list`.- **[Claude Desktop (Cowork)](docs/mcp/CLAUDE_DESKTOP.md)** — Settings → Integrations → add the URL of your HTTP server. Remote only; the local `claude_desktop_config.json` does not work for remote servers.- **[Claude Cowork (team plan)](docs/mcp/CLAUDE_COWORK.md)** — org Owner adds the connector under Organization Settings → Connectors.diff --git a/docs/INSTALL.md b/docs/INSTALL.mdindex e9b421cd37..0982288b2f 100644--- a/docs/INSTALL.md+++ b/docs/INSTALL.md@@ -129,8 +129,8 @@ gbrain autopilot --install # background daemon for nightly enrichment**Wire this same local brain into your coding agent** — zero server, zero token:```bash-claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full # Claude Code-codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full # Codex+claude mcp add gbrain -- "$(command -v gbrain)" serve --surface starter # Claude Code+codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter # Codex```The agent spawns `gbrain serve` as a stdio subprocess against your local brain. `--surface full` (what every registration gbrain writes pins) serves every operation, the seven-verb memory protocol ([MEMORY_VERBS v1](protocol/MEMORY_VERBS_v1.md)) included; a harness that caps its tool count can register `--surface starter` (the verbs plus the daily-driver set, 40 ops) or `--surface verbs` (only the seven verbs). Full walkthrough (both this local path and connecting to a remote brain), plus the brain-first protocol to paste into `CLAUDE.md` / `AGENTS.md`: **[Give your coding agent a memory](tutorials/connect-coding-agent.md)**.@@ -138,7 +138,7 @@ The agent spawns `gbrain serve` as a stdio subprocess against your local brain.## 3. MCP server (any MCP client)```bash-gbrain serve --surface full # stdio MCP (Claude Desktop / Code / Cursor), every operation+gbrain serve --surface starter # stdio MCP (Claude Desktop / Code / Cursor); full = every operationgbrain serve --http # HTTP MCP with OAuth 2.1 + admin dashboardgbrain mcp expose # publish serve --http on your Tailscale tailnet (HTTPS + user service)```diff --git a/docs/architecture/thin-client.md b/docs/architecture/thin-client.mdindex ec01048ff2..a4b0b5e18a 100644--- a/docs/architecture/thin-client.md+++ b/docs/architecture/thin-client.md@@ -18,7 +18,7 @@ The generic `gbrain call` dispatcher is host-only and refuses before opening alocal engine; use the named CLI command or an authorized MCP tool instead.**Surface posture:** thin CLI clients use the full MCP surface for remote-command compatibility. Bootstrap pins `--surface full`; managed thin CLI grants+command compatibility. Bootstrap pins `--surface starter`; managed thin CLI grantsfor OpenClaw, Grok Bot, and Muse also select `full`. Surface visibility does notgrant authority: profiles, token scopes, operation snapshots, sources, and writefences still restrict requests. A `memory-writer` thin client gains neitherdiff --git a/docs/guides/setup.md b/docs/guides/setup.mdindex cdd08a0a1e..215273726d 100644--- a/docs/guides/setup.md+++ b/docs/guides/setup.md@@ -26,7 +26,7 @@ Before it writes anything, setup resolves and prints:| Source | `--source`, else `GBRAIN_SOURCE`, else unpinned (the server uses the brain's default source). || Transport | Local stdio: the harness starts `<launcher> serve --surface <surface>`. || Launcher | `--gbrain-bin`, else the absolute `gbrain` on `PATH` (GUI-launched hosts inherit no `PATH`, so a bare name is never written). |-| Surface | `--surface`, else `GBRAIN_SURFACE`, else the surface already registered, else `full`. |+| Surface | `--surface`, else `GBRAIN_SURFACE`, else the surface already registered, else `starter` (`--surface full` is the opt-in for every tool; an existing registration keeps its surface). || Owner | Who owns the MCP name now: nobody, this setup (its receipt), or the gbrain Claude Code or Codex plugin (setup then adds hooks only). |It refuses with a coded error, before any write, when the target is not safe:diff --git a/docs/mcp/ADMIN.md b/docs/mcp/ADMIN.mdindex eaa2a4592e..2a33fa79d3 100644--- a/docs/mcp/ADMIN.md+++ b/docs/mcp/ADMIN.md@@ -564,7 +564,7 @@ registers `gbrain serve --access read-only` as its stdio MCP command.```bashclaude mcp add gbrain -- "$(command -v gbrain)" serve --access read-only-gbrain serve --surface full --access read-only+gbrain serve --access read-only # bare serve: the full surface, read-only````--access read-only` intersects the selected `--surface` with operations thatdiff --git a/docs/mcp/CLAUDE_CODE.md b/docs/mcp/CLAUDE_CODE.mdindex c398f9605e..531dda9315 100644--- a/docs/mcp/CLAUDE_CODE.md+++ b/docs/mcp/CLAUDE_CODE.md@@ -69,7 +69,7 @@ tools use the plugin lane's own approval flow.## Option 1: Local (recommended, zero server needed)```bash-claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full+claude mcp add gbrain -- "$(command -v gbrain)" serve --surface startergbrain setup claude-code --instructions-only```@@ -90,14 +90,13 @@ tunnel, no token needed. Works with both PGLite and Supabase engines.> connections. Details:> [serve ↔ sync concurrency](../architecture/serve-sync-concurrency.md).-`--surface full` serves the whole operation catalog (`get_page`, `put_page`,-`put_pages`, `search`, graph ops, …), the seven-verb memory protocol (`recall`,-`remember`, `entity`, `synthesize`, `forget`, `context_pack`, `delta` —-[MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md)) included; it is the surface-every registration gbrain writes pins and what a bare `serve` defaults to. A-harness that caps its tool count can register `--surface starter` (the verbs-plus the daily-driver page/search/graph ops and capture) or `--surface verbs`-(only the seven verbs).+`--surface starter` lists the daily-driver tools: the seven memory verbs+([MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md)), `search`, `query`,+`get_page`, `put_page`, `capture`, graph reads and skills. It is the surface every+new registration gbrain writes pins (a bare `serve` still defaults to full). A parameter it leaves out is still accepted,+and `request_tools` returns full schemas or widens the session to a left-out tool. `--surface full` lists every+operation (`put_pages`, admin and tuning ops) and is the opt-in; `--surface verbs`+lists only the seven verbs.## Option 2: Remote, one command (fastest from a bearer token)diff --git a/docs/mcp/CODEX.md b/docs/mcp/CODEX.mdindex 21950933d1..d75c298be7 100644--- a/docs/mcp/CODEX.md+++ b/docs/mcp/CODEX.md@@ -66,14 +66,14 @@ brain (`gbrain init` — zero-config local PGLite by default). The bundledthat exact install one-liner on stderr; with no brain, it exits with"No brain configured. Run: gbrain init". Unix (macOS/Linux) only.-**What ships.** The MCP server runs `gbrain serve --surface full---source-guard` through the bundled launcher (`.agents/gbrain-launcher`,+**What ships.** The MCP server runs `gbrain serve` on the full surface with+`--source-guard` through the bundled launcher (`.agents/gbrain-launcher`,resolution order: `$GBRAIN_BIN` → `~/.bun/bin/gbrain` → `gbrain` on PATH — thesanctioned install location is preferred over PATH so a stray `gbrain` earlieron PATH can't shadow it).`full` is every operation (the seven memory verbs, page and bulk writes-such as `put_pages`, graph and skill tools), the surface every registration-gbrain writes pins; the curated skills drive host-side work through the+such as `put_pages`, graph and skill tools); the plugin keeps it because a plugin+update rewrites existing installs (new `gbrain setup` registrations pin starter). The curated skills drive host-side work through the`gbrain` CLI. A harness that caps its tool count can narrow every new sessionon this machine with `GBRAIN_SURFACE=starter` (or `verbs`) in the env thatlaunches Codex, or use the bootstrap lane below. Unlike the OpenClaw bundle, the plugin ships the host-side skills@@ -246,11 +246,10 @@ codex mcp remove gbrain- The token is a long-lived, full-access secret. Keep `GBRAIN_REMOTE_TOKEN` out ofversion control and prefer a scoped token if your host supports one.- Local stdio also works if you run the brain on the same machine:- `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full` — the- whole operation catalog, memory verbs ([MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md))- included, the surface every registration gbrain writes pins. A- `GBRAIN_SURFACE` value in the Codex server entry's `env` table overrides the- flag (`starter` or `verbs` for a harness that caps its tool count).+ `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter`, the+ daily-driver tool list every new registration gbrain writes pins (`request_tools`+ reaches the rest; `--surface full` is the opt-in for every operation). A+ `GBRAIN_SURFACE` value in the Codex server entry's `env` table overrides the flag.- **PGLite brains are single-process.** PGLite is a single-writer embeddedPostgres: the first running `gbrain serve` (the plugin's, or a stdioregistration) owns the brain's data directory via the data-dir lock. Adiff --git a/docs/mcp/DEPLOY.md b/docs/mcp/DEPLOY.mdindex eaca4d8c4d..3c9c5e4606 100644--- a/docs/mcp/DEPLOY.md+++ b/docs/mcp/DEPLOY.md@@ -59,7 +59,7 @@ the OAuth request when issuing my owner login link."*### Local stdio (zero setup)```bash-gbrain serve --surface full # full operation catalog (what registrations pin; also the bare-serve default)+gbrain serve --surface starter # what new registrations pin; a bare serve defaults to the full catalog```Works with Claude Code, Cursor, Windsurf, and any MCP client that supports stdio.diff --git a/docs/mcp/GROK.md b/docs/mcp/GROK.mdindex 36d69a0b70..44d213e269 100644--- a/docs/mcp/GROK.md+++ b/docs/mcp/GROK.md@@ -18,15 +18,16 @@ tunnel, no token needed. Works with both PGLite and Supabase engines.## Register (recommended)```bash-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter```-`--surface full` serves the whole operation catalog, the seven-verb memory-protocol (`recall`, `remember`, `entity`, `synthesize`, `forget`,-`context_pack`, `delta` — [MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md))-included; it is the surface every registration gbrain writes pins. A harness-that caps its tool count can register `--surface starter` or `--surface verbs`-(only the seven verbs) instead.+`--surface starter` lists the daily-driver tools: the seven memory verbs+([MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md)), `search`, `query`,+`get_page`, `put_page`, `capture`, graph reads and skills. It is the surface every+new registration gbrain writes pins. A parameter it leaves out is still accepted,+and `request_tools` returns full schemas or widens the session to a left-out tool. `--surface full` lists every+operation (`put_pages`, admin and tuning ops) and is the opt-in; `--surface verbs`+lists only the seven verbs.Three facts about `grok mcp add`, all observed:- **The env flag is repeatable, one `KEY=value` per flag** (`-e A=1 -e B=2`).diff --git a/docs/mcp/OPENCODE.md b/docs/mcp/OPENCODE.mdindex ee70c65814..58e375f8bc 100644--- a/docs/mcp/OPENCODE.md+++ b/docs/mcp/OPENCODE.md@@ -21,15 +21,16 @@ brain contract loads with zero extra configuration.## Register (recommended)```bash-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter```-`--surface full` serves the whole operation catalog, the seven-verb memory-protocol (`recall`, `remember`, `entity`, `synthesize`, `forget`,-`context_pack`, `delta` — [MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md))-included; it is the surface every registration gbrain writes pins. A harness-that caps its tool count can register `--surface starter` or `--surface verbs`-(only the seven verbs) instead.+`--surface starter` lists the daily-driver tools: the seven memory verbs+([MEMORY_VERBS v1](../protocol/MEMORY_VERBS_v1.md)), `search`, `query`,+`get_page`, `put_page`, `capture`, graph reads and skills. It is the surface every+new registration gbrain writes pins. A parameter it leaves out is still accepted,+and `request_tools` returns full schemas or widens the session to a left-out tool. `--surface full` lists every+operation (`put_pages`, admin and tuning ops) and is the opt-in; `--surface verbs`+lists only the seven verbs.Three facts about `opencode mcp add`, all observed:- **The local-command form is `-- <command> [args...]` after the flags** —diff --git a/docs/protocol/AGENT_OPERATOR_v1.md b/docs/protocol/AGENT_OPERATOR_v1.mdindex 2fd96466b5..f3b89a569a 100644--- a/docs/protocol/AGENT_OPERATOR_v1.md+++ b/docs/protocol/AGENT_OPERATOR_v1.md@@ -361,7 +361,7 @@ stdout (`--json`):"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",diff --git a/docs/protocol/MEMORY_VERBS_v1.md b/docs/protocol/MEMORY_VERBS_v1.mdindex a64e696b60..76982b334f 100644--- a/docs/protocol/MEMORY_VERBS_v1.md+++ b/docs/protocol/MEMORY_VERBS_v1.md@@ -49,7 +49,7 @@ the same registry.```bashgbrain init --pglite # 2-second local brain-claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full # every operation, the verbs included+claude mcp add gbrain -- "$(command -v gbrain)" serve --surface starter # daily-driver tools, the verbs includedgbrain remember "gbrain install check" --provenance install-checkgbrain recall --query "gbrain install check" # …now ask your agent in a NEW session```@@ -64,21 +64,21 @@ If `claude` is not found: install Claude Code first, or use a block below.**Codex**```bash-codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full+codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter```**Grok Build** (verify with `grok mcp doctor gbrain` — the add is lazy)```bash-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter```**opencode** (verify with `opencode mcp list` — the add is lazy, and list SPAWNS the server)```bash-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter```**OpenClaw / any stdio MCP host** — register the server command-`gbrain serve --surface full`. Remote brains: `gbrain serve --http` on the+`gbrain serve --surface starter`. Remote brains: `gbrain serve --http` on thehost, then `gbrain connect https://host/mcp --token gbrain_xxx --install` oneach client.diff --git a/docs/tutorials/connect-coding-agent.md b/docs/tutorials/connect-coding-agent.mdindex fad913c084..2c99e0b4ff 100644--- a/docs/tutorials/connect-coding-agent.md+++ b/docs/tutorials/connect-coding-agent.md@@ -83,10 +83,10 @@ Configure the agent you are using:```bash# Claude Code-claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full+claude mcp add gbrain -- "$(command -v gbrain)" serve --surface starter# Codex-codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full+codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter```These launch a local stdio MCP process. Use the same intended brain and sourcediff --git a/llms-full.txt b/llms-full.txtindex 3924df4807..6a9a1cf3c7 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -3101,7 +3101,7 @@ model gbrain removed in v0.33, needs `gbrain skillpack migrate-fence` once.)**If you are Hermes:** register gbrain as your MCP server:```bash-printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full+printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface starter```Keep `--args` last (everything after it becomes server argv) and verify with@@ -3111,12 +3111,12 @@ Keep `--args` last (everything after it becomes server argv) and verify with**If you are Grok Build** (xAI's `grok` CLI): register gbrain as your MCP server:```bash-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter```The add is lazy (exit 0 without connecting) — verify with`grok mcp doctor gbrain`, which spawns the server and must report the tools it-discovered (the full surface). This is the brain-only install; the `gbrain bootstrap`+discovered (the starter surface). This is the brain-only install; the `gbrain bootstrap`personal-agent path does not support Grok yet (Claude Code, Codex, and opencode only).Verified against Grok Build v1.0.4. Full reference:[docs/mcp/GROK.md](docs/mcp/GROK.md).@@ -3127,7 +3127,7 @@ install, follow `BOOTSTRAP_FOR_AGENTS.md` instead of this page. For thebrain-only MCP registration:```bash-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter```The add is lazy (exit 0 without connecting) — verify with `opencode mcp list`,@@ -3758,7 +3758,7 @@ stdout (`--json`):"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",@@ -5063,7 +5063,7 @@ The agent starts with keyless memory and verifies it. API keys, automatic captur### Lighter ways in-**Just want a memory for your coding agent — no identity, no repo.** On Claude Code or Codex use `gbrain setup` (above). By hand: `gbrain init --pglite --no-embedding`, then `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full` (`claude mcp add` takes the same argv; `--surface verbs` or `starter` for a harness that caps its tool count), then `gbrain setup codex --instructions-only` (the brain-first block). Saved memories are brain-wide by default; pass `visibility: "private"` for local-only facts.+**Just want a memory for your coding agent — no identity, no repo.** On Claude Code or Codex use `gbrain setup` (above). By hand: `gbrain init --pglite --no-embedding`, then `codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter` (`claude mcp add` takes the same argv; `--surface full` lists every tool), then `gbrain setup codex --instructions-only` (the brain-first block). Saved memories are brain-wide by default; pass `visibility: "private"` for local-only facts.**Already have a brain on a remote host** (OpenClaw, Hermes, or any `gbrain serve --http`)? Point your laptop agents at it with one command each — `--install` wires it up and smoke-tests the token before handoff:@@ -5103,11 +5103,11 @@ Pick your product, then run `gbrain setup <harness> --instructions-only`: agents- **[Claude Code](docs/mcp/CLAUDE_CODE.md)** — plugin: `/plugin marketplace add garrytan/gbrain` + `/plugin install gbrain@gbrain` (MCP + skills; persona variants `gbrain-coding` / `gbrain-daily` install curated subsets; pick one). Marketplace-free skills: `gbrain skillpack scaffold --harness claude-code` copies a persona-curated skill set into your user-scope skills dir. Or by hand: `claude mcp add gbrain -- "$(command -v gbrain)" serve`. Remote with just a bearer token: `gbrain connect https://your-host/mcp --token gbrain_xxx` prints a paste-ready block (or `--install` wires it up and smoke-tests the token).- **[Codex](docs/mcp/CODEX.md)** — plugin (recommended): `codex plugin marketplace add garrytan/gbrain@codex-plugin` + `codex plugin add gbrain@gbrain` installs the MCP server AND the curated skill set. Or connect-only: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent codex` (or `--install`); the token path reads `$GBRAIN_REMOTE_TOKEN` at runtime, while the private-handoff installer writes a private managed HTTP header so the connection survives a new shell.- **[Cursor / Windsurf / any stdio MCP client](docs/mcp/CLAUDE_CODE.md)** — same shape, add `{"command": "gbrain", "args": ["serve", "--surface", "full"]}` to your MCP config.-- **[Hermes](docs/mcp/HERMES.md)** — `printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full`. Keep `--args` last, and verify with `hermes mcp test gbrain` (the add exits 0 even on failure).+- **[Hermes](docs/mcp/HERMES.md)** — `printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface starter`. Keep `--args` last, and verify with `hermes mcp test gbrain` (the add exits 0 even on failure).- **[Grok Bot](docs/guides/grok-bot.md)** — recommended: keep the brain on your computer, publish it with `gbrain mcp expose --funnel`, grant the Bot a `memory-writer` client and install the thin CLI at `/workspace/gbrain`; or install memory inside the Bot computer when no machine of yours stays online. Bots share local files and credentials; sources organize memory without isolating Bots. **Say to your agent:** *"connect grok bot to my brain"*.- **[Muse personal agent](docs/guides/muse.md)** — first verify its durable user-files location; then either connect it to your published brain (`gbrain mcp expose --funnel` + thin CLI) or install the local CLI there. Native MCP configuration and skill activation are not assumed. **Say to your agent:** *"connect muse to my brain"*.-- **[Grok Build](docs/mcp/GROK.md)** — `grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full`. The add is lazy (exit 0 without connecting) — verify with `grok mcp doctor gbrain`, which spawns the server. Verified against Grok Build v1.0.4.-- **[opencode](docs/mcp/OPENCODE.md)** (opencode.ai / SST — not OpenClaw) — `opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full`, or let `gbrain bootstrap hooks --harness opencode` write the config for you. The add is lazy — verify with `opencode mcp list`, which spawns the server (`✓ gbrain connected`). Remote: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent opencode [--install]` — the config stores only the `{env:GBRAIN_REMOTE_TOKEN}` interpolation. Verified against opencode v1.18.18.+- **[Grok Build](docs/mcp/GROK.md)** — `grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter`. The add is lazy (exit 0 without connecting) — verify with `grok mcp doctor gbrain`, which spawns the server. Verified against Grok Build v1.0.4.+- **[opencode](docs/mcp/OPENCODE.md)** (opencode.ai / SST — not OpenClaw) — `opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter`, or let `gbrain bootstrap hooks --harness opencode` write the config for you. The add is lazy — verify with `opencode mcp list`, which spawns the server (`✓ gbrain connected`). Remote: `gbrain connect https://your-host/mcp --token gbrain_xxx --agent opencode [--install]` — the config stores only the `{env:GBRAIN_REMOTE_TOKEN}` interpolation. Verified against opencode v1.18.18.- **[OpenClaw](docs/mcp/OPENCLAW.md)** — the ClawHub bundle plugin registers gbrain automatically (`openclaw.plugin.json` ships in this repo), or register the stdio server with `openclaw mcp add gbrain --command "$(command -v gbrain)" --arg serve --env GBRAIN_HOME=$HOME` (absolute path: the launchd gateway PATH lacks `~/.bun/bin`); verify with `openclaw mcp list`.- **[Claude Desktop (Cowork)](docs/mcp/CLAUDE_DESKTOP.md)** — Settings → Integrations → add the URL of your HTTP server. Remote only; the local `claude_desktop_config.json` does not work for remote servers.- **[Claude Cowork (team plan)](docs/mcp/CLAUDE_COWORK.md)** — org Owner adds the connector under Organization Settings → Connectors.@@ -8908,7 +8908,7 @@ the same registry.```bashgbrain init --pglite # 2-second local brain-claude mcp add gbrain -- "$(command -v gbrain)" serve --surface full # every operation, the verbs included+claude mcp add gbrain -- "$(command -v gbrain)" serve --surface starter # daily-driver tools, the verbs includedgbrain remember "gbrain install check" --provenance install-checkgbrain recall --query "gbrain install check" # …now ask your agent in a NEW session```@@ -8923,21 +8923,21 @@ If `claude` is not found: install Claude Code first, or use a block below.**Codex**```bash-codex mcp add gbrain -- "$(command -v gbrain)" serve --surface full+codex mcp add gbrain -- "$(command -v gbrain)" serve --surface starter```**Grok Build** (verify with `grok mcp doctor gbrain` — the add is lazy)```bash-grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface full+grok mcp add gbrain -e "GBRAIN_HOME=$HOME" -- "$(command -v gbrain)" serve --surface starter```**opencode** (verify with `opencode mcp list` — the add is lazy, and list SPAWNS the server)```bash-opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface full+opencode mcp add gbrain --env GBRAIN_HOME=$HOME -- "$(command -v gbrain)" serve --surface starter```**OpenClaw / any stdio MCP host** — register the server command-`gbrain serve --surface full`. Remote brains: `gbrain serve --http` on the+`gbrain serve --surface starter`. Remote brains: `gbrain serve --http` on thehost, then `gbrain connect https://host/mcp --token gbrain_xxx --install` oneach client.diff --git a/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md b/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.mdindex 98b8739441..15cabbd726 100644--- a/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md+++ b/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md@@ -363,7 +363,7 @@ stdout (`--json`):"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",diff --git a/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md b/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.mdindex 98b8739441..15cabbd726 100644--- a/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md+++ b/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md@@ -363,7 +363,7 @@ stdout (`--json`):"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",diff --git a/plugin/skills/conventions/agent-operator-protocol.md b/plugin/skills/conventions/agent-operator-protocol.mdindex 98b8739441..15cabbd726 100644--- a/plugin/skills/conventions/agent-operator-protocol.md+++ b/plugin/skills/conventions/agent-operator-protocol.md@@ -363,7 +363,7 @@ stdout (`--json`):"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",diff --git a/scripts/generate-plugin-tree.ts b/scripts/generate-plugin-tree.tsindex e6ce6dc446..963a71dc6b 100644--- a/scripts/generate-plugin-tree.ts+++ b/scripts/generate-plugin-tree.ts@@ -20,7 +20,7 @@* _brain-filing-rules.json) always ship, mirroring the openclaw bundler.** Starter-surface gap snapshot: each bundled skill's frontmatter `tools:`- * list is compared against the REGISTRATION_SURFACE op set (the plugin lanes+ * list is compared against the PLUGIN_SURFACE op set (the plugin lanes* serve `--surface full` today, the surface every stdio registration gbrain* writes pins; the root plugin manifests must pin the same value). Harness tools (shell/exec/read/write/edit/* web_search/web_fetch), literal `gbrain` (CLI usage marker), and unknown@@ -40,7 +40,7 @@import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'fs';import { join, resolve } from 'path';import { allowedOpNames } from '../src/mcp/surface.ts';-import { REGISTRATION_SURFACE } from '../src/core/mcp-registration.ts';+import { PLUGIN_SURFACE } from '../src/core/mcp-registration.ts';import { operations } from '../src/core/operations.ts';import { cliEquivalent } from '../src/core/ops/cli-equivalent.ts';import { parseSkillFrontmatter } from '../src/core/skill-frontmatter.ts';@@ -133,7 +133,7 @@ try {}// ── Starter-gap snapshot ────────────────────────────────────────────────────-const SURFACE_OPS = allowedOpNames(operations, REGISTRATION_SURFACE);+const SURFACE_OPS = allowedOpNames(operations, PLUGIN_SURFACE);// Harness-native tool names a skill may declare that are not gbrain MCP ops.const HARNESS_TOOLS = new Set(['shell', 'exec', 'read', 'write', 'edit', 'web_search', 'web_fetch', 'gbrain']);@@ -176,7 +176,7 @@ function surfaceNote(gaps: readonly string[]): string {});return ['', '## Tools outside your MCP surface', '',- `This plugin serves the ${REGISTRATION_SURFACE} tool surface. When a step above names one of these tools and your tool list`,+ `This plugin serves the ${PLUGIN_SURFACE} tool surface. When a step above names one of these tools and your tool list`,'does not have it, call request_tools {"surface":"full"} to add it to this session, or run its gbrain CLI equivalent:', '',...rows, '',"To widen every new session, set this machine's plugin surface with GBRAIN_SURFACE=full.", '',@@ -238,7 +238,7 @@ if (writeGaps) {}}-// The root plugin manifests (copied into every variant) must pin the registration surface.+// The root plugin manifests (copied into every variant) must pin the plugin surface.function pinnedSurface(args: unknown): string | undefined {if (!Array.isArray(args)) return undefined;const i = args.indexOf('--surface');@@ -248,7 +248,7 @@ for (const file of ['.codex-plugin/mcp.json', '.claude-plugin/plugin.json']) {if (!existsSync(join(ROOT, file))) continue;const servers = (JSON.parse(readFileSync(join(ROOT, file), 'utf8')) as { mcpServers?: Record<string, { args?: unknown }> }).mcpServers;const pinned = pinnedSurface(servers?.gbrain?.args);- if (pinned !== REGISTRATION_SURFACE) fail(`${file} pins --surface ${pinned ?? '(none)'}; plugin lanes serve the registration surface '${REGISTRATION_SURFACE}' (src/core/mcp-registration.ts)`);+ if (pinned !== PLUGIN_SURFACE) fail(`${file} pins --surface ${pinned ?? '(none)'}; plugin lanes serve the plugin surface '${PLUGIN_SURFACE}' (src/core/mcp-registration.ts)`);}if (failed) process.exit(1);@@ -298,7 +298,7 @@ addition/exclusion).## MCP surface note (read once)-The plugin's MCP server runs \`gbrain serve --surface ${REGISTRATION_SURFACE}\` — ${SURFACE_OPS.size}+The plugin's MCP server runs \`gbrain serve --surface ${PLUGIN_SURFACE}\` — ${SURFACE_OPS.size}operations, the same surface every stdio registration gbrain writes pins.${gapSkills === 0? `Every gbrain operation the bundled skills name is on it. A harness that capsdiff --git a/scripts/stress/iteration-weights.json b/scripts/stress/iteration-weights.jsonindex 5d80b47655..782460cd28 100644--- a/scripts/stress/iteration-weights.json+++ b/scripts/stress/iteration-weights.json@@ -55,7 +55,7 @@"test/doctor-day-zero.test.ts": 9250,"test/doctor-early-stop-golden.serial.test.ts": 700,"test/doctor-frontmatter-holds.test.ts": 12200,- "test/doctor-harness-smoke.test.ts": 5650,+ "test/doctor-harness-smoke.test.ts": 6200,"test/doctor-hot-checks-golden.test.ts": 31400,"test/doctor-image-embedding-coverage.test.ts": 2500,"test/doctor-json-golden-latest.test.ts": 100,@@ -153,6 +153,7 @@"test/grandfather-managed.test.ts": 21800,"test/hardened-git-stream-6712.test.ts": 3900,"test/harness-skills-epoch.test.ts": 5900,+ "test/harness-wiring-redaction-6453.test.ts": 550,"test/held-read-signals.test.ts": 5800,"test/hold-action-chain-6712.test.ts": 15200,"test/import-cancellation.serial.test.ts": 1350,@@ -529,6 +530,8 @@"test/serve-http-head-watcher.serial.test.ts": 1050,"test/serve-http-run-teardown.serial.test.ts": 1400,"test/serve-sync-handoff.serial.test.ts": 4100,+ "test/setup-brain-first.test.ts": 62000,+ "test/setup.test.ts": 239000,"test/shared-content-freshness.test.ts": 6900,"test/shared-skills-catalog.test.ts": 17200,"test/shared-skills-retention-capacity.test.ts": 3800,diff --git a/skills/conventions/agent-operator-protocol.md b/skills/conventions/agent-operator-protocol.mdindex 98b8739441..15cabbd726 100644--- a/skills/conventions/agent-operator-protocol.md+++ b/skills/conventions/agent-operator-protocol.md@@ -363,7 +363,7 @@ stdout (`--json`):"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",diff --git a/skills/skills.lock.json b/skills/skills.lock.jsonindex 7b1a2864ba..5c8f83acc7 100644--- a/skills/skills.lock.json+++ b/skills/skills.lock.json@@ -44,7 +44,7 @@"concept-synthesis/routing-eval.jsonl": "96dbd7d9c1b606e9e06262d0c06282399741e2bccb8eeb7b9ca88c20f44cda0e","context-audit/SKILL.md": "6d786629d40544ddaab4f4e6e333569d270bcb8b581589dc16fb9f8bcb4f6207","context-audit/routing-eval.jsonl": "fb1832e24cc1b04163a74c5cde72bca53050a66246ca902e1a5f40303f52b5ab",- "conventions/agent-operator-protocol.md": "b42b19223aa9dffbe783ce7c5c681d762377c740f3c609cbc555b9a60a035235",+ "conventions/agent-operator-protocol.md": "4de9f74862e5e5cdec4cd0e18663fc7b437f906d4d7fcb28a1326b24a10d58c4","conventions/brain-first.md": "b98dc24e086a35f136f74ca4abd856949d8b282e1298a47a250b2d18f69e0927","conventions/brain-routing.md": "392998d9a109b330c9225af4ca5c8798b0ff02eba4d441c93fdb7c263687d0c6","conventions/calibration.md": "500dc26bd7c8400f50dc4c16fd83f1a588f3e7e68c59050a21fd8a0f69e4d198",diff --git a/src/commands/doctor/checks/harness-wiring.ts b/src/commands/doctor/checks/harness-wiring.tsindex d6bd7ebf0c..cd29fcfa6c 100644--- a/src/commands/doctor/checks/harness-wiring.ts+++ b/src/commands/doctor/checks/harness-wiring.ts@@ -430,7 +430,18 @@ function repairArgv(v: InstructionBlockView): Action {/** Registration read (full run) or registration read + smoke (`--only harness_wiring`), plus the brain-first block. */export async function harnessWiringCheck(opts: { smoke: boolean }): Promise<Check> {const regs = readHarnessRegistrations();- return withInstructionBlocks(await registrationCheck(opts, regs), instructionBlockViews(regs));+ return withSurfaceNote(withInstructionBlocks(await registrationCheck(opts, regs), instructionBlockViews(regs)), regs);+}++/**+ * Information only: a stdio registration pinned to `--surface full` keeps+ * working and is never rewritten; new installs register starter (the smaller+ * daily-driver tool list). Status and fix are unchanged.+ */+export function withSurfaceNote(check: Check, regs: HarnessRegistration[]): Check {+ const full = regs.filter((r) => r.kind === 'stdio' && !r.env?.GBRAIN_SURFACE && r.args?.[r.args.indexOf('--surface') + 1] === 'full' && r.args.includes('--surface'));+ if (full.length === 0) return check;+ return { ...check, details: { ...(check.details ?? {}), surface_note: `${full.map((r) => HARNESS_LABEL[r.harness]).join(', ')} registered with --surface full, which stays supported. New installs register starter (a smaller tool list; request_tools reaches the rest).` } };}async function registrationCheck(opts: { smoke: boolean }, regs: HarnessRegistration[]): Promise<Check> {diff --git a/src/commands/setup.ts b/src/commands/setup.tsindex ae1ee7fb47..242d48d1f3 100644--- a/src/commands/setup.ts+++ b/src/commands/setup.ts@@ -105,7 +105,8 @@ Flags:--dry-run Print the target and every step; write nothing.--json One JSON document on stdout (target, decisions, steps, states).--surface S MCP tool surface: verbs, starter or full (default: GBRAIN_SURFACE,- then the surface already registered, then full).+ then the surface already registered, then starter; full is the+ opt-in for every operation).--scope user|project Wiring scope: every Claude Code session (user, default) or onlysessions in this directory (project: ~/.claude.json projectsentry + .claude/settings.local.json). Codex: user only.diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex 979068687f..c5d8aa59c2 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -1229,6 +1229,9 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;{ since: '0.60.430.0', text: '`gbrain sources writer status --json` has a new `checkouts` block: each canonical checkout on this host against its last fetched upstream (no fetch), with branch, upstream, ahead, behind, `diverged`, each commit the upstream lacks (sha, author, date, subject, paths; at most 20) and porcelain counts (staged, modified, untracked, conflicted). doctor `git_convergence` adds the same commits and counts for a managed canonical checkout, and now warns at once when one has diverged from its upstream (it blocks `gbrain sources refresh`), with the keep-checkout publish as an ask-user fix.' },{ since: '0.60.430.0', text: 'New `gbrain sources set-sync <id> <on|off>` sets `config.syncEnabled`, which includes or excludes a source from automatic sync (`sync --all`, autopilot\'s freshness dispatcher and the full-cycle fan-out; an explicit `gbrain sync --source <id>` runs either way). `--dry-run` prints the current state and the apply command, which carries `--expect <current>`; an apply whose expectation no longer holds refuses `preview_changed` and changes nothing. Setting it used to need a raw write to `sources.config`.' },{ since: '0.60.430.0', text: 'New doctor check `cron_gbrain_home` reads `crontab -l` (read-only, 5 s; no result unless the crontab mentions gbrain or src/cli.ts) and the scripts its lines run (at most 20, 64 KiB each) and warns on each command that runs `src/cli.ts` directly without GBRAIN_HOME, or the `gbrain` binary without GBRAIN_HOME while this brain runs under one: cron passes no GBRAIN_HOME, so those commands act on `~/.gbrain` instead of this brain. A GBRAIN_HOME assignment on the line, in the crontab\'s environment lines or in the script counts. The fix asks the user to edit the crontab.' },+ // GBRA-188. since: 'TBD' is stamped at the merge slot.+ { since: 'TBD', id: 'brain_first_instructions_gbra188', text: 'Harness installs now write a short marked brain-first block into the harness\'s own instruction file by default (Claude Code ~/.claude/CLAUDE.md, Codex AGENTS.md or a non-empty AGENTS.override.md, opencode AGENTS.md, the OpenClaw workspace AGENTS.md, an existing Hermes SOUL.md, a Cursor project rule): `gbrain setup <harness>`, `gbrain connect --install`, `gbrain bootstrap harness` and the thin-client GBRAIN-INSTRUCTIONS.md. Text outside the markers is never touched and a re-run upgrades the block in place. `--no-instructions` or GBRAIN_AGENT_INSTRUCTIONS=0 removes it and is remembered; `--remove` strips it; `gbrain setup <harness> --instructions-only` manages only the block. doctor `harness_wiring` warns when a registered harness\'s block is missing, stale or damaged.' },+ { since: 'TBD', id: 'install_surface_starter_gbra188', text: 'New stdio registrations gbrain writes (`gbrain setup`, `gbrain bootstrap hooks`, the readiness and `gbrain init` registration lines) now pin `--surface starter`, the daily-driver tool list, instead of `--surface full` (Garry, 2026-10-24; gbrain-evals#191: reach and accuracy unchanged, 17-23% fewer input tokens). An existing registration keeps its surface and is never rewritten; the Codex and Claude Code plugins and a bare `gbrain serve` stay on full. `--surface full` is the opt-in for every operation, any parameter the starter list leaves out is still accepted, and `request_tools` returns full schemas or widens the session to a left-out tool. doctor `harness_wiring` notes a full registration as information only.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.tsindex 391c39cbe3..19a7193d7d 100644--- a/src/core/cli-flag-registry.generated.ts+++ b/src/core/cli-flag-registry.generated.ts@@ -76,7 +76,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'graph-query': ['--brain', '--depth', '--direction', '--help', '--hop', '--include-foreign', '--json', '--mcp-only', '--request-id', '--source', '--type'],'hook': ['--allow-unverified-remote', '--auto', '--batch-check', '--brain', '--branch', '--cached', '--count', '--diff-filter', '--enable', '--end-of-options', '--env', '--get', '--harness', '--help', '--jq', '--json', '--limit', '--name-only', '--others', '--pat-file', '--path', '--porcelain', '--pure', '--quiet', '--remove', '--seat', '--session', '--show-current', '--show-toplevel', '--since', '--source', '--yes'],'import': ['--accept-pending', '--admin-intent', '--allow-empty', '--allow-noncanonical-root', '--apply', '--background', '--batch-check', '--brain', '--cached', '--confirm-relocated-root', '--diff-filter', '--dim', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--format', '--fresh', '--help', '--include-gitignored', '--is-shallow-repository', '--json', '--literal-pathspecs', '--log-noop', '--manifest', '--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', '--self-transfer', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--timings', '--to', '--url', '--verify', '--wait', '--workers'],- 'init': ['--access', '--acknowledge-managed', '--adopt', '--after', '--aliases', '--all', '--all-drifted', '--allow-create-db', '--allow-docker', '--allow-outside-source-root', '--applied', '--apply', '--assign-corpus', '--audit', '--auto', '--auto-additive', '--background', '--batch', '--bound-slug-prefixes', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-policy', '--budget-tokens', '--budget-usd', '--by-mention', '--catch-up', '--channel', '--chat-model', '--check', '--class', '--clear-never-installed', '--cli-socket', '--client', '--close', '--confirm-relocated-root', '--conflicts', '--content-root', '--conversation', '--cursor', '--db-only', '--dest', '--detach', '--detail', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--entity', '--exclude', '--expand', '--expansion-model', '--expect', '--expect-local', '--expect-remote', '--expect-upstream', '--explain', '--facts', '--fast', '--file', '--fix', '--force', '--force-retry', '--format', '--fresh-token', '--from', '--from-meetings', '--full', '--git', '--grant-types', '--group-by', '--harness', '--held', '--help', '--hold-state', '--holds', '--http', '--id', '--images', '--include-ambiguous', '--include-cross-entity', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--infer-dates', '--install', '--issuer-url', '--job-isolation', '--json', '--keep', '--keep-checkout', '--key', '--kind', '--lanes', '--legacy-lock', '--limit', '--list', '--local-postgres', '--markdown', '--max-cost-usd', '--max-facts', '--max-rss', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--min-n', '--mode', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-extract', '--no-filters', '--no-git', '--no-lanes', '--no-llm', '--no-probe', '--no-pull', '--no-renames', '--no-repair', '--no-restart', '--no-schema-pack', '--no-verify', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--older-than', '--once', '--only', '--oversized', '--page', '--params', '--parked-code', '--parked-pushes', '--pat-file', '--path', '--pending', '--pglite', '--phase', '--plan', '--prefer', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--providers', '--pull', '--purge', '--push-only', '--query', '--question', '--quiet', '--rebase', '--rebuild', '--redact-paths', '--reference-date', '--remediate', '--remove', '--repair', '--repair-unknown-markers', '--repo', '--request', '--reset', '--resolve', '--restart-only', '--resume', '--retry-failed', '--retry-parked', '--save', '--schema-pack', '--scope', '--scopes', '--search-mode', '--section', '--self-transfer', '--semantic', '--session', '--session-id', '--show-toplevel', '--side', '--since', '--since-last-run', '--skip', '--skip-embed-check', '--skip-failed', '--slug', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--state', '--status', '--stdin', '--stop-mcp', '--strategy', '--supabase', '--surface', '--swap-only', '--tier', '--timeout', '--to', '--token', '--touchpoint', '--type', '--url', '--url-env', '--user', '--vacuum', '--verbose', '--version', '--wait', '--warn-only', '--watch', '--working-tree', '--workspace', '--yes'],+ 'init': ['--access', '--acknowledge-managed', '--adopt', '--after', '--aliases', '--all', '--all-drifted', '--allow-create-db', '--allow-docker', '--allow-outside-source-root', '--applied', '--apply', '--assign-corpus', '--audit', '--auto', '--auto-additive', '--background', '--batch', '--bound-slug-prefixes', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-policy', '--budget-tokens', '--budget-usd', '--by-mention', '--catch-up', '--channel', '--chat-model', '--check', '--class', '--clear-never-installed', '--cli-socket', '--client', '--close', '--confirm-relocated-root', '--conflicts', '--content-root', '--conversation', '--cursor', '--db-only', '--dest', '--detach', '--detail', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--entity', '--exclude', '--expand', '--expansion-model', '--expect', '--expect-local', '--expect-remote', '--expect-upstream', '--explain', '--facts', '--fast', '--file', '--fix', '--force', '--force-retry', '--format', '--fresh-token', '--from', '--from-meetings', '--full', '--git', '--grant-types', '--group-by', '--harness', '--held', '--help', '--hold-state', '--holds', '--http', '--id', '--images', '--include-ambiguous', '--include-cross-entity', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--infer-dates', '--install', '--instructions-only', '--issuer-url', '--job-isolation', '--json', '--keep', '--keep-checkout', '--key', '--kind', '--lanes', '--legacy-lock', '--limit', '--list', '--local-postgres', '--markdown', '--max-cost-usd', '--max-facts', '--max-rss', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--min-n', '--mode', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-extract', '--no-filters', '--no-git', '--no-instructions', '--no-lanes', '--no-llm', '--no-probe', '--no-pull', '--no-renames', '--no-repair', '--no-restart', '--no-schema-pack', '--no-verify', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--older-than', '--once', '--only', '--oversized', '--page', '--params', '--parked-code', '--parked-pushes', '--pat-file', '--path', '--pending', '--pglite', '--phase', '--plan', '--prefer', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--providers', '--pull', '--purge', '--push-only', '--query', '--question', '--quiet', '--rebase', '--rebuild', '--redact-paths', '--reference-date', '--remediate', '--remove', '--repair', '--repair-unknown-markers', '--repo', '--request', '--reset', '--resolve', '--restart-only', '--resume', '--retry-failed', '--retry-parked', '--save', '--schema-pack', '--scope', '--scopes', '--search-mode', '--section', '--self-transfer', '--semantic', '--session', '--session-id', '--show-toplevel', '--side', '--since', '--since-last-run', '--skip', '--skip-embed-check', '--skip-failed', '--slug', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--state', '--status', '--stdin', '--stop-mcp', '--strategy', '--supabase', '--surface', '--swap-only', '--tier', '--timeout', '--to', '--token', '--touchpoint', '--type', '--url', '--url-env', '--user', '--vacuum', '--verbose', '--version', '--wait', '--warn-only', '--watch', '--working-tree', '--workspace', '--yes'],'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],'integrity': ['--accept-pending', '--auto', '--backend', '--background', '--body', '--brain', '--check', '--confidence', '--cost', '--dry-run', '--explain', '--follow', '--fresh', '--help', '--json', '--limit', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--timeout', '--timings', '--type', '--wait'],'jobs': ['--abbrev-ref', '--access', '--account', '--acknowledge-managed', '--add', '--admin-intent', '--adopt-slug-path', '--aliases', '--all', '--all-sources', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--body', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--channel', '--check', '--cli-path', '--client', '--close', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--confirm-relocated-root', '--cost-estimate', '--cursor', '--date', '--dated-since', '--days', '--delay', '--detach', '--detail', '--diff-filter', '--dir', '--drain', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--enable', '--entities', '--exclude', '--exclude-standard', '--expect', '--expect-local', '--expect-upstream', '--expected-state', '--explain', '--facts', '--federated-read', '--ff-only', '--file', '--filters', '--finished-since', '--fix', '--follow', '--force', '--force-break-lock', '--force-retry', '--format', '--fresh', '--from-index', '--from-meetings', '--full', '--full-history', '--fuzzy', '--git', '--grammar-diagnostics', '--group', '--group-by', '--hard-deadline', '--health-interval', '--held', '--help', '--hold-state', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-ambiguous', '--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', '--keep', '--kind', '--lanes', '--legacy-lock', '--limit', '--list', '--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', '--migration', '--min-context', '--missing-path', '--mode', '--model', '--multimodal', '--name', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-embedding', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-restart', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--oversized', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--parked-code', '--pat-file', '--path', '--pause', '--pglite', '--phase', '--pid-file', '--plan', '--port', '--prefer', '--preview', '--priority', '--probe', '--prune-orphans', '--pull', '--purge', '--question', '--queue', '--queue-only', '--quiet', '--rate', '--reason', '--rebuild', '--recent', '--record', '--redact-paths', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--remediate', '--repo', '--request-id', '--reset-checkpoint', '--restart-only', '--resume', '--retry-failed', '--retry-global', '--retry-held', '--retry-parked', '--review-lower', '--row', '--scope', '--scopes', '--section', '--segment-limit', '--select', '--self-transfer', '--serial', '--session', '--show-toplevel', '--side', '--sigkill-rescue', '--since', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-guard', '--source-id', '--sources', '--src-subpath', '--stale', '--state', '--statement-timeout', '--status', '--stop-mcp', '--strategy', '--suites', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--tier', '--timeout', '--timeout-ms', '--to', '--token', '--trust', '--type', '--types', '--uninstall', '--updated-after', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],diff --git a/src/core/mcp-registration.ts b/src/core/mcp-registration.tsindex 6de0b2e738..3c7529e19d 100644--- a/src/core/mcp-registration.ts+++ b/src/core/mcp-registration.ts@@ -15,13 +15,24 @@ import type { McpSurface } from '../mcp/surface.ts';export { shellQuote };/**- * The surface a new stdio registration pins: `full`, callable and advertised- * (S0, wave 0; the maintainer chose no narrowing). Every install path reads- * this one value: README, docs/mcp, INSTALL_FOR_AGENTS.md, the plugin- * manifests and every registration gbrain writes. A narrower list, where a- * harness caps its tool count, is the user's explicit `--surface starter|verbs`.+ * The surface a new stdio registration pins: `starter`, the daily-driver tool+ * list (Garry, 2026-10-24: new installs register starter instead of full;+ * gbrain-evals#191 measured unchanged reach and accuracy with 17-23% fewer+ * input tokens). Every install path reads this one value: README, docs/mcp,+ * the plugin manifests and every registration gbrain writes. An existing+ * registration keeps its surface; `--surface full` is the opt-in for every+ * operation, and any hidden parameter or tool stays reachable through+ * `request_tools`.*/-export const REGISTRATION_SURFACE: McpSurface = 'full';+export const REGISTRATION_SURFACE: McpSurface = 'starter';++/**+ * The surface the Codex and Claude Code plugin manifests pin: `full`. A plugin+ * update rewrites the registration of every existing plugin install, so+ * narrowing it would change existing installs without asking; plugins keep+ * full (as does a bare `serve`, whose default is unchanged).+ */+export const PLUGIN_SURFACE: McpSurface = 'full';/** A registration command's surface value (`verbs`, `starter` or `full`). */export function isRegistrationSurface(v: unknown): v is McpSurface {diff --git a/test/bootstrap-codex-door.test.ts b/test/bootstrap-codex-door.test.tsindex 5b4c6fdfa6..d727022812 100644--- a/test/bootstrap-codex-door.test.ts+++ b/test/bootstrap-codex-door.test.ts@@ -8,7 +8,7 @@* 1. The RENDERED AGENTS.md carries Gate 3 ("Entity lookup (brain first)") in* full — search-the-brain-before-answering with the actual brain tools —* so a Codex agent with no hooks still pulls context every turn.- * 2. `registerCodexMcp` argv pins `serve --surface full` (REGISTRATION_SURFACE:+ * 2. `registerCodexMcp` argv pins `serve --surface starter` (REGISTRATION_SURFACE:* bootstrap's page, timeline and verb tools, not a narrowed `verbs`) and binds GBRAIN_SOURCE so a* GUI-spawned serve (which inherits no shell env) writes to the workspace* source [G1, CX-P1.4].@@ -81,10 +81,10 @@ describe('Codex door — rendered AGENTS.md pull protocol (Gate 3)', () => {});});-describe('Codex door — registerCodexMcp argv (--surface full + GBRAIN_SOURCE)', () => {+describe('Codex door — registerCodexMcp argv (--surface starter + GBRAIN_SOURCE)', () => {const BIN = '/opt/gbrain/bin/gbrain';- test('user-global stdio registration binds the source and pins the full surface', () => {+ test('user-global stdio registration binds the source and pins the starter surface', () => {const argvs = registerCodexMcp({ gbrainBin: BIN, sourceId: 'workspace' });expect(argvs.length).toBe(1);const argv = argvs[0]!;@@ -92,12 +92,12 @@ describe('Codex door — registerCodexMcp argv (--surface full + GBRAIN_SOURCE)'expect(argv).toEqual(['codex', 'mcp', 'add', 'gbrain','--env', 'GBRAIN_SOURCE=workspace',- '--', BIN, 'serve', '--surface', 'full',+ '--', BIN, 'serve', '--surface', 'starter',]);// The two contracts, asserted independently so a reshuffle can't hide a drop.const joined = argv.join(' ');expect(joined).toContain('--env GBRAIN_SOURCE=workspace');- expect(joined).toContain('serve --surface full');+ expect(joined).toContain('serve --surface starter');// `serve` argv must NOT narrow to the verbs surface.expect(joined).not.toContain('--surface verbs');});@@ -108,7 +108,7 @@ describe('Codex door — registerCodexMcp argv (--surface full + GBRAIN_SOURCE)'// GBRAIN_HOME is a second --env, GBRAIN_SOURCE still present, surface intact.expect(argv.filter((a) => a === '--env').length).toBe(2);expect(argv).toContain('GBRAIN_SOURCE=workspace');- expect(argv.join(' ')).toContain('serve --surface full');+ expect(argv.join(' ')).toContain('serve --surface starter');});test('a non-absolute gbrain binary is refused (GUI hosts inherit no PATH) [CX-P1.4]', () => {diff --git a/test/bootstrap-dispatcher.serial.test.ts b/test/bootstrap-dispatcher.serial.test.tsindex 05cb90e397..4203d43778 100644--- a/test/bootstrap-dispatcher.serial.test.ts+++ b/test/bootstrap-dispatcher.serial.test.ts@@ -641,17 +641,18 @@ describe('MCP registration verification [FIX7]', () => {const serveTail = (argv: string[]) => argv.slice(argv.indexOf('--') + 2);const adds = (calls: string[][]) => calls.filter((c) => c[1] === 'mcp' && c[2] === 'add');- test('a fresh registration pins the registration surface (full)', async () => {+ test('a fresh registration pins the registration surface (starter)', async () => {const { runner, calls } = mcpHost({ initialReg: null });expect((await runHooks(runner)).result).toBe(0);- expect(serveTail(adds(calls)[0])).toEqual(['serve', '--surface', 'full']);+ expect(serveTail(adds(calls)[0])).toEqual(['serve', '--surface', 'starter']);}, 30_000);test('never narrow: a replaced entry keeps its pinned surface, a bare serve stays bare, --surface wins', async () => {- // Pinned to a surface other than the registration default (full), so keeping it is observable.- const pinned = mcpHost({ initialReg: FOREIGN.replace('serve --surface full', 'serve --surface starter') });+ // Pinned to a surface other than the registration default (starter), so keeping it is observable:+ // an existing full registration is never narrowed.+ const pinned = mcpHost({ initialReg: FOREIGN });expect((await runHooks(pinned.runner)).result).toBe(0);- expect(serveTail(adds(pinned.calls)[1])).toEqual(['serve', '--surface', 'starter']);+ expect(serveTail(adds(pinned.calls)[1])).toEqual(['serve', '--surface', 'full']);const bare = mcpHost({ initialReg: `gbrain:\n command: /somewhere/else/gbrain serve\n env: GBRAIN_SOURCE=other-workspace` });expect((await runHooks(bare.runner)).result).toBe(0);diff --git a/test/bootstrap-hooks-writers.test.ts b/test/bootstrap-hooks-writers.test.tsindex d685e018b6..b0090163ed 100644--- a/test/bootstrap-hooks-writers.test.ts+++ b/test/bootstrap-hooks-writers.test.ts@@ -256,10 +256,10 @@ describe('removeClaudeHooks [G5]', () => {});describe('MCP registration argv builders [G1, CX-P1.4]', () => {- test('registerClaudeMcp: stdio shape with scope + source env; serve pinned to --surface full (REGISTRATION_SURFACE)', () => {+ test('registerClaudeMcp: stdio shape with scope + source env; serve pinned to --surface starter (REGISTRATION_SURFACE)', () => {const cmds = registerClaudeMcp({ gbrainBin: BIN, scope: 'project', sourceId: 'workspace' });expect(cmds).toEqual([- ['claude', 'mcp', 'add', 'gbrain', '--scope', 'project', '-e', 'GBRAIN_SOURCE=workspace', '--', BIN, 'serve', '--surface', 'full'],+ ['claude', 'mcp', 'add', 'gbrain', '--scope', 'project', '-e', 'GBRAIN_SOURCE=workspace', '--', BIN, 'serve', '--surface', 'starter'],]);});@@ -269,14 +269,14 @@ describe('MCP registration argv builders [G1, CX-P1.4]', () => {});expect(cmds[0]).toEqual(['claude', 'mcp', 'add', 'mybrain', '--scope', 'user',- '-e', 'GBRAIN_SOURCE=s1', '-e', 'GBRAIN_HOME=/ws', '--', BIN, 'serve', '--surface', 'full',+ '-e', 'GBRAIN_SOURCE=s1', '-e', 'GBRAIN_HOME=/ws', '--', BIN, 'serve', '--surface', 'starter',]);});- test('registerCodexMcp: --env shape, no scope flag; serve pinned to --surface full (REGISTRATION_SURFACE)', () => {+ test('registerCodexMcp: --env shape, no scope flag; serve pinned to --surface starter (REGISTRATION_SURFACE)', () => {const cmds = registerCodexMcp({ gbrainBin: BIN, sourceId: 'workspace', gbrainHome: '/ws' });expect(cmds).toEqual([- ['codex', 'mcp', 'add', 'gbrain', '--env', 'GBRAIN_SOURCE=workspace', '--env', 'GBRAIN_HOME=/ws', '--', BIN, 'serve', '--surface', 'full'],+ ['codex', 'mcp', 'add', 'gbrain', '--env', 'GBRAIN_SOURCE=workspace', '--env', 'GBRAIN_HOME=/ws', '--', BIN, 'serve', '--surface', 'starter'],]);});diff --git a/test/bootstrap-opencode-door.serial.test.ts b/test/bootstrap-opencode-door.serial.test.tsindex ad6a52e21d..74b2eea4e8 100644--- a/test/bootstrap-opencode-door.serial.test.ts+++ b/test/bootstrap-opencode-door.serial.test.ts@@ -188,7 +188,7 @@ describe('opencode workspace lane — default scope is USER-GLOBAL', () => {};expect(entry.type).toBe('local');expect(entry.command[0]).toBe(FAKE_BIN); // user scope: absolute path- expect(entry.command.slice(1)).toEqual(['serve', '--surface', 'full']);+ expect(entry.command.slice(1)).toEqual(['serve', '--surface', 'starter']);expect(entry.environment.GBRAIN_SOURCE).toBeDefined();expect(entry.enabled).toBe(true);@@ -322,7 +322,7 @@ describe('opencode workspace lane — explicit project opt-in', () => {const cfgPath = join(ws, 'opencode.json');const parsed = parseOpencodeConfig(readFileSync(cfgPath, 'utf8'), cfgPath);const entry = (parsed.mcp as Record<string, unknown>).gbrain as { command: string[] };- expect(entry.command).toEqual(['gbrain', 'serve', '--surface', 'full']); // committed-candidate file: PATH-resolved, never absolute+ expect(entry.command).toEqual(['gbrain', 'serve', '--surface', 'starter']); // committed-candidate file: PATH-resolved, never absoluteexpect(r.out).toContain('project (explicit opt-in)');expect(r.err).toContain('SHARING WARNING');expect(r.err).toContain('"enabled": false');diff --git a/test/bootstrap-plugin-lane.serial.test.ts b/test/bootstrap-plugin-lane.serial.test.tsindex 82415871f0..9e06330b54 100644--- a/test/bootstrap-plugin-lane.serial.test.ts+++ b/test/bootstrap-plugin-lane.serial.test.ts@@ -242,7 +242,7 @@ describe('runHooks plugin-lane skip (serial: env fixtures)', () => {expect(r.result).toBe(0);const add = calls.find((c) => c[0] === 'codex' && c[1] === 'mcp' && c[2] === 'add');expect(add).toBeDefined();- expect(add!.join(' ')).toContain('serve --surface full');+ expect(add!.join(' ')).toContain('serve --surface starter');}, 30_000);test('codex + plugin + --mcp-even-if-plugin → registration forced through', async () => {diff --git a/test/codex-plugin-manifest.test.ts b/test/codex-plugin-manifest.test.tsindex 6fe03f112b..d3277a7f5c 100644--- a/test/codex-plugin-manifest.test.ts+++ b/test/codex-plugin-manifest.test.ts@@ -15,7 +15,7 @@ import { readFileSync, readdirSync, existsSync, statSync, mkdtempSync, mkdirSyncimport { join } from 'path';import { tmpdir } from 'os';import { spawnSync } from 'child_process';-import { REGISTRATION_SURFACE } from '../src/core/mcp-registration.ts';+import { PLUGIN_SURFACE } from '../src/core/mcp-registration.ts';const ROOT = join(import.meta.dir, '..');const read = (p: string) => readFileSync(join(ROOT, p), 'utf8');@@ -394,11 +394,11 @@ describe('curated tree membership + scanner guard', () => {// #5858: the generator's only frontmatter change is one `when_to_use:` line built from triggers.const withoutWhenToUse = (text: string) => text.replace(/^when_to_use: .*\n/m, '');- // S0: the plugin serves REGISTRATION_SURFACE (full), so no bundled skill names+ // The plugin serves PLUGIN_SURFACE (full), so no bundled skill names// an MCP op beyond it: the gap snapshot is empty and every lane skill ships// byte-identical to its source (no "Tools outside your MCP surface" note).- test('F6 under the full registration surface: no starter gaps; every lane skill is byte-identical', () => {- expect(REGISTRATION_SURFACE).toBe('full');+ test('F6 under the full plugin surface: no starter gaps; every lane skill is byte-identical', () => {+ expect(PLUGIN_SURFACE).toBe('full');expect(lanes.starter_gaps).toEqual({});expect(laneSet.size).toBeGreaterThan(0);for (const slug of laneSet) {diff --git a/test/fixtures/agent-contract/v1/journey/init-first-run.json b/test/fixtures/agent-contract/v1/journey/init-first-run.jsonindex 19b1fe35a3..fc5b896bb6 100644--- a/test/fixtures/agent-contract/v1/journey/init-first-run.json+++ b/test/fixtures/agent-contract/v1/journey/init-first-run.json@@ -119,7 +119,7 @@"options": [{"id": "wire",- "label": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "label": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},{"id": "skip",diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.jsonindex 2ce794420a..fa9ebf4657 100644--- a/test/fixtures/goldens/doctor/content-pglite-json.json+++ b/test/fixtures/goldens/doctor/content-pglite-json.json@@ -47,7 +47,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -448,7 +448,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-connection-failure.json b/test/fixtures/goldens/doctor/early-stop-connection-failure.jsonindex baf1eb4a4d..cd4c19f012 100644--- a/test/fixtures/goldens/doctor/early-stop-connection-failure.json+++ b/test/fixtures/goldens/doctor/early-stop-connection-failure.json@@ -323,7 +323,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json b/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.jsonindex 75d3e56207..81fd5d86ba 100644--- a/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json@@ -232,7 +232,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json b/test/fixtures/goldens/doctor/early-stop-null-engine-fast.jsonindex 9a42e6ae7c..973b564306 100644--- a/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json@@ -232,7 +232,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json b/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.jsonindex 187d94f25d..496f1a412d 100644--- a/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json@@ -226,7 +226,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex f155d2fae3..27b84ce4e8 100644--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json@@ -48,7 +48,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -449,7 +449,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",@@ -4690,7 +4690,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -5091,7 +5091,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.jsonindex 3b9b0c58d5..41f6a7a290 100644--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json@@ -443,7 +443,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",@@ -5086,7 +5086,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex a199e65b75..e2bcaba3e7 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -44,7 +44,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -430,7 +430,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-pglite-fast.json b/test/fixtures/goldens/doctor/json-pglite-fast.jsonindex e41b800cec..7684072e69 100644--- a/test/fixtures/goldens/doctor/json-pglite-fast.json+++ b/test/fixtures/goldens/doctor/json-pglite-fast.json@@ -45,7 +45,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -320,7 +320,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex b44b131002..48da2fb817 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -47,7 +47,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -433,7 +433,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex a332f77889..c251e61bd6 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -427,7 +427,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json b/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.jsonindex 670a3155d3..8931a6638a 100644--- a/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json+++ b/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json@@ -272,7 +272,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-postgres-unreachable.json b/test/fixtures/goldens/doctor/json-postgres-unreachable.jsonindex a5dda76785..2d338abbea 100644--- a/test/fixtures/goldens/doctor/json-postgres-unreachable.json+++ b/test/fixtures/goldens/doctor/json-postgres-unreachable.json@@ -271,7 +271,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface full` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "Register `<absolute path to gbrain> serve --surface starter` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/mcp-registration.test.ts b/test/mcp-registration.test.tsindex a17099b4b7..db350d6d9a 100644--- a/test/mcp-registration.test.ts+++ b/test/mcp-registration.test.ts@@ -13,7 +13,7 @@ import { spawnSync } from 'node:child_process';import { mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';-import { REGISTRATION_SURFACE, registeredSurface, stdioServeArgv } from '../src/core/mcp-registration.ts';+import { PLUGIN_SURFACE, REGISTRATION_SURFACE, registeredSurface, stdioServeArgv } from '../src/core/mcp-registration.ts';import { harnessWiringEntry } from '../src/core/readiness.ts';import { registerClaudeMcp, registerCodexMcp } from '../src/core/bootstrap/hooks.ts';import { resolveSurfaceWithSource } from '../src/mcp/surface.ts';@@ -24,9 +24,10 @@ const wiring = (h: 'claude-code' | 'codex' | 'opencode', surface?: 'verbs' | 'stharnessWiringEntry({ transport: 'cli', harnesses: [h], lockOwner: null, gbrainBin: BIN, ...(surface ? { surface } : {}) }).fix;describe('REGISTRATION_SURFACE and stdioServeArgv', () => {- test('S0: new registrations pin full (callable and advertised); null renders a bare serve', () => {- expect(REGISTRATION_SURFACE).toBe('full');- expect(stdioServeArgv(BIN)).toEqual([BIN, 'serve', '--surface', 'full']);+ test('new registrations pin starter (Garry, 2026-10-24); plugins stay full; null renders a bare serve', () => {+ expect(REGISTRATION_SURFACE).toBe('starter');+ expect(PLUGIN_SURFACE).toBe('full');+ expect(stdioServeArgv(BIN)).toEqual([BIN, 'serve', '--surface', 'starter']);expect(stdioServeArgv(BIN, 'starter')).toEqual([BIN, 'serve', '--surface', 'starter']);expect(stdioServeArgv(BIN, 'full')).toEqual([BIN, 'serve', '--surface', 'full']);expect(stdioServeArgv(BIN, null)).toEqual([BIN, 'serve']);@@ -45,14 +46,14 @@ describe('every stdio registration path builds from REGISTRATION_SURFACE', () =>expect(wiring('claude-code')?.argv).toEqual(['claude', 'mcp', 'add', 'gbrain', '--', ...stdioServeArgv(BIN)]);expect(wiring('codex')?.argv).toEqual(['codex', 'mcp', 'add', 'gbrain', '--', ...stdioServeArgv(BIN)]);expect(wiring('opencode')?.argv).toEqual(['gbrain', 'bootstrap', 'hooks', '--harness', 'opencode', '--no-hooks']);- expect(wiring('claude-code')?.why).toContain(`${BIN} serve --surface full`);+ expect(wiring('claude-code')?.why).toContain(`${BIN} serve --surface starter`);});test('init --surface reaches the readiness fix (the quickstart line and the first-run harness decision read it)', () => {expect(wiring('claude-code', 'starter')?.argv).toEqual(['claude', 'mcp', 'add', 'gbrain', '--', BIN, 'serve', '--surface', 'starter']);expect(wiring('opencode', 'verbs')?.argv).toEqual(['gbrain', 'bootstrap', 'hooks', '--harness', 'opencode', '--no-hooks', '--surface', 'verbs']);const missing = harnessWiringEntry({ transport: 'cli', harnesses: [], lockOwner: null, gbrainBin: BIN }).fix;- expect(missing?.why).toContain('serve --surface full');+ expect(missing?.why).toContain('serve --surface starter');});test('bootstrap hooks: registerClaudeMcp and registerCodexMcp default to the surface and carry an existing form', () => {@@ -64,15 +65,15 @@ describe('every stdio registration path builds from REGISTRATION_SURFACE', () =>expect(registerCodexMcp({ gbrainBin: BIN, sourceId: 'w', surface: null })[0].slice(-2)).toEqual([BIN, 'serve']);});- test('the plugin generator states the registration surface and refuses a manifest pinned elsewhere', () => {+ test('the plugin generator states the plugin surface and refuses a manifest pinned elsewhere', () => {const out = mkdtempSync(join(tmpdir(), 'gb-reg-plugin-'));try {const ok = spawnSync('bun', ['run', join(ROOT, 'scripts/generate-plugin-tree.ts'), '--out', join(out, 'plugin')], { encoding: 'utf8', timeout: 60_000 });expect(ok.status, ok.stderr).toBe(0);- expect(readFileSync(join(out, 'plugin', 'README.md'), 'utf8')).toContain(`gbrain serve --surface ${REGISTRATION_SURFACE}`);+ expect(readFileSync(join(out, 'plugin', 'README.md'), 'utf8')).toContain(`gbrain serve --surface ${PLUGIN_SURFACE}`);for (const file of ['.codex-plugin/mcp.json', '.claude-plugin/plugin.json']) {const args = (JSON.parse(readFileSync(join(ROOT, file), 'utf8')) as { mcpServers: { gbrain: { args: string[] } } }).mcpServers.gbrain.args;- expect(args[args.indexOf('--surface') + 1]).toBe(REGISTRATION_SURFACE);+ expect(args[args.indexOf('--surface') + 1]).toBe(PLUGIN_SURFACE);}const root = join(out, 'fixture');@@ -89,7 +90,7 @@ describe('every stdio registration path builds from REGISTRATION_SURFACE', () =>encoding: 'utf8', timeout: 60_000, env: { ...process.env, GBRAIN_PLUGIN_TREE_ROOT: root },});expect(bad.status).toBe(1);- expect(bad.stderr).toContain(`.codex-plugin/mcp.json pins --surface starter; plugin lanes serve the registration surface '${REGISTRATION_SURFACE}'`);+ expect(bad.stderr).toContain(`.codex-plugin/mcp.json pins --surface starter; plugin lanes serve the plugin surface '${PLUGIN_SURFACE}'`);} finally {rmSync(out, { recursive: true, force: true });}@@ -120,13 +121,13 @@ describe('S0: README, docs/mcp, INSTALL, BOOTSTRAP, push-context and the manifesexpect(offenders).toEqual([]);});- test('the plugin manifests pin the registration surface; the OpenClaw bundle runs a bare serve, whose default is the same value', () => {+ test('the plugin manifests pin the plugin surface (full); the OpenClaw bundle runs a bare serve, whose default is full too', () => {for (const file of ['.codex-plugin/mcp.json', '.claude-plugin/plugin.json']) {const args = (JSON.parse(readFileSync(join(ROOT, file), 'utf8')) as { mcpServers: { gbrain: { args: string[] } } }).mcpServers.gbrain.args;- expect({ file, surface: args[args.indexOf('--surface') + 1] }).toEqual({ file, surface: REGISTRATION_SURFACE });+ expect({ file, surface: args[args.indexOf('--surface') + 1] }).toEqual({ file, surface: PLUGIN_SURFACE });}const openclaw = JSON.parse(readFileSync(join(ROOT, 'openclaw.plugin.json'), 'utf8')) as { mcpServers: { gbrain: { args: string[] } } };expect(openclaw.mcpServers.gbrain.args).toEqual(['serve']);- expect(resolveSurfaceWithSource(null, {})).toEqual({ surface: REGISTRATION_SURFACE, source: 'default' });+ expect(resolveSurfaceWithSource(null, {})).toEqual({ surface: PLUGIN_SURFACE, source: 'default' });});});diff --git a/test/readiness.test.ts b/test/readiness.test.tsindex ce5b4d8987..1367929d9d 100644--- a/test/readiness.test.ts+++ b/test/readiness.test.ts@@ -168,13 +168,13 @@ describe('harness_wiring by state', () => {const BIN = '/opt/gbrain/bin/gbrain';const owner = (transport: 'stdio' | 'http', is_self = false): LockOwner => ({ pid: 4242, transport, is_self });- test('one harness, no serve: harness-native stdio registration with the absolute binary and --surface full', () => {+ test('one harness, no serve: harness-native stdio registration with the absolute binary and --surface starter', () => {const claude = harnessWiringEntry({ transport: 'cli', harnesses: ['claude-code'], lockOwner: null, gbrainBin: BIN });- expect(claude.fix?.argv).toEqual(['claude', 'mcp', 'add', 'gbrain', '--', BIN, 'serve', '--surface', 'full']);+ expect(claude.fix?.argv).toEqual(['claude', 'mcp', 'add', 'gbrain', '--', BIN, 'serve', '--surface', 'starter']);expect(claude.fix?.consent).toEqual(['persistent_install']);expect(claude.fix?.why).toContain('~/.claude.json');expect(harnessWiringEntry({ transport: 'cli', harnesses: ['codex'], lockOwner: null, gbrainBin: BIN }).fix?.argv)- .toEqual(['codex', 'mcp', 'add', 'gbrain', '--', BIN, 'serve', '--surface', 'full']);+ .toEqual(['codex', 'mcp', 'add', 'gbrain', '--', BIN, 'serve', '--surface', 'starter']);expect(harnessWiringEntry({ transport: 'cli', harnesses: ['opencode'], lockOwner: null, gbrainBin: BIN }).fix?.argv).toEqual(['gbrain', 'bootstrap', 'hooks', '--harness', 'opencode', '--no-hooks']);});diff --git a/test/setup-brain-first.test.ts b/test/setup-brain-first.test.tsindex 71d16fc9db..94ecee24b8 100644--- a/test/setup-brain-first.test.ts+++ b/test/setup-brain-first.test.ts@@ -24,7 +24,7 @@ import {renderBrainFirstBlock,renderBrainFirstSnippet,} from '../src/core/setup/brain-first.ts';-import { harnessWiringCheck, instructionBlockViews, withInstructionBlocks, type InstructionBlockView } from '../src/commands/doctor/checks/harness-wiring.ts';+import { harnessWiringCheck, instructionBlockViews, withInstructionBlocks, withSurfaceNote, type InstructionBlockView } from '../src/commands/doctor/checks/harness-wiring.ts';import { installHarnessConnection } from '../src/core/harness/install.ts';import type { HarnessCredentials } from '../src/core/harness/credentials.ts';@@ -314,6 +314,18 @@ describe('brain-first block: hardening', () => {});});+describe('doctor harness_wiring: a full registration is information only', () => {+ test('a stdio registration pinned to --surface full gets a note; status and fix are unchanged; starter or a GBRAIN_SURFACE override gets none', () => {+ const ok = { name: 'harness_wiring', status: 'ok' as const, message: 'wired.' };+ const full = withSurfaceNote(ok, [{ harness: 'codex', source: '/x/config.toml', kind: 'stdio', command: '/bin/gbrain', args: ['serve', '--surface', 'full'] }]);+ expect(full.status).toBe('ok');+ expect(full.fix).toBeUndefined();+ expect(String(full.details?.surface_note)).toContain('Codex registered with --surface full, which stays supported');+ expect(withSurfaceNote(ok, [{ harness: 'codex', source: '/x', kind: 'stdio', args: ['serve', '--surface', 'starter'] }])).toEqual(ok);+ expect(withSurfaceNote(ok, [{ harness: 'codex', source: '/x', kind: 'stdio', args: ['serve', '--surface', 'full'], env: { GBRAIN_SURFACE: 'starter' } }])).toEqual(ok);+ });+});+describe('brain-first block: text', () => {test('names the tools the surface lists: search/query/get_page, recall/entity on verbs, the CLI on a thin client', () => {const full = renderBrainFirstBlock('codex', { kind: 'mcp', server: 'gbrain', surface: 'full' });diff --git a/test/setup.test.ts b/test/setup.test.tsindex 1fd3c0875c..a79ef2dcd6 100644--- a/test/setup.test.ts+++ b/test/setup.test.ts@@ -81,7 +81,7 @@ describe('gbrain setup claude-code: install lifecycle', () => {expect(first.doc.consent.providers).toMatchObject({ value: 'declined', source: 'default' });expect(readJson(join(b.gbrainHome, '.gbrain', 'config.json')).embedding_disabled).toBe(true);const entry = readJson(claudeJson(b)).mcpServers.gbrain;- expect(entry).toEqual({ type: 'stdio', command: b.bin, args: ['serve', '--surface', 'full'], env: { GBRAIN_HOME: b.gbrainHome } });+ expect(entry).toEqual({ type: 'stdio', command: b.bin, args: ['serve', '--surface', 'starter'], env: { GBRAIN_HOME: b.gbrainHome } });expect(Object.keys(readJson(settings(b)).hooks).sort()).toEqual(['SessionStart', 'UserPromptSubmit']);expect(readJson(receipt(b)).status).toBe('installed');const [bundle] = first.doc.notices;@@ -97,6 +97,16 @@ describe('gbrain setup claude-code: install lifecycle', () => {expect(existsSync(`${settings(b)}.bak`)).toBe(false);});+ test('starter is the default surface; --surface full is the opt-in, and a re-run keeps the surface already registered', async () => {+ const b = box();+ expect((await setup(b, ['claude-code', '--surface', 'full', '--json'])).exitCode).toBe(0);+ expect(readJson(claudeJson(b)).mcpServers.gbrain.args).toEqual(['serve', '--surface', 'full']);+ const rerun = await setup(b, ['claude-code', '--json']);+ expect(rerun.exitCode).toBe(0);+ expect(readJson(claudeJson(b)).mcpServers.gbrain.args).toEqual(['serve', '--surface', 'full']);+ expect(rerun.doc.steps.map((s: any) => s.action)).toEqual(['keep', 'keep', 'keep']);+ });+test('human output ends with one non-blocking settings block after Next, and none of init\'s standalone steps', async () => {const b = box();const r = await setup(b, ['claude-code']);@@ -222,7 +232,7 @@ describe('gbrain setup claude-code: install lifecycle', () => {expect(readFileSync(claudeJson(b), 'utf8')).toBe(foreignCfg);expect(existsSync(settings(b))).toBe(false);- const same = { type: 'stdio', command: b.bin, args: ['serve', '--surface', 'full'], env: { GBRAIN_HOME: b.gbrainHome } };+ const same = { type: 'stdio', command: b.bin, args: ['serve', '--surface', 'starter'], env: { GBRAIN_HOME: b.gbrainHome } };writeFileSync(claudeJson(b), JSON.stringify({ mcpServers: { gbrain: same } }));const adopted = await setup(b, ['claude-code', '--json']);expect(adopted.exitCode).toBe(0);@@ -516,7 +526,7 @@ describe('gbrain setup codex: install lifecycle', () => {expect(first.doc.capability).toMatchObject({ harness: 'codex', setup: 'supported', push: 'native-verified', read_events: ['SessionStart', 'UserPromptSubmit'] });expect(first.doc.consent.capture).toMatchObject({ value: 'declined', source: 'default' });expect(readJson(join(b.gbrainHome, '.gbrain', 'config.json')).embedding_disabled).toBe(true);- expect(toml(b).mcp_servers.gbrain).toEqual({ command: b.bin, args: ['serve', '--surface', 'full'], env: { GBRAIN_HOME: b.gbrainHome } });+ expect(toml(b).mcp_servers.gbrain).toEqual({ command: b.bin, args: ['serve', '--surface', 'starter'], env: { GBRAIN_HOME: b.gbrainHome } });expect(Object.keys(readJson(hooksJson(b)).hooks).sort()).toEqual(['SessionStart', 'UserPromptSubmit']);expect(groups(b, 'UserPromptSubmit')).toEqual([{ hooks: [{ type: 'command', timeout: 15,command: `env GBRAIN_HOOK_LANE=setup GBRAIN_HOME=${b.gbrainHome} ${b.bin} hook user-prompt --harness codex` }] }]);@@ -683,7 +693,7 @@ describe('gbrain setup codex: install lifecycle', () => {expect(readFileSync(codexToml(b), 'utf8')).toBe(foreign);expect(existsSync(hooksJson(b))).toBe(false);- const same = `[mcp_servers.gbrain]\ncommand = ${JSON.stringify(b.bin)}\nargs = ["serve", "--surface", "full"]\nenv = { GBRAIN_HOME = ${JSON.stringify(b.gbrainHome)} }\n`;+ const same = `[mcp_servers.gbrain]\ncommand = ${JSON.stringify(b.bin)}\nargs = ["serve", "--surface", "starter"]\nenv = { GBRAIN_HOME = ${JSON.stringify(b.gbrainHome)} }\n`;writeFileSync(codexToml(b), same);expect((await setup(b, ['codex'])).exitCode).toBe(0);expect(readJson(codexReceipt(b)).mcp_adopted).toBe(true);diff --git a/tests/docker/bootstrap-e2e-inner.sh b/tests/docker/bootstrap-e2e-inner.shindex b7c437a9ff..b0c0f7838a 100644--- a/tests/docker/bootstrap-e2e-inner.sh+++ b/tests/docker/bootstrap-e2e-inner.sh@@ -256,7 +256,7 @@ grep -Fq "GBRAIN_SOURCE=" "$GB_CODEX_STATE" || fail "codex registration did not# Every stdio registration gbrain writes pins REGISTRATION_SURFACE# (src/core/mcp-registration.ts); test/check-bootstrap-guards.test.ts keeps# this literal equal to it so a surface change fails on the PR, not nightly.-EXPECTED_SURFACE=full+EXPECTED_SURFACE=startergrep -Fq "serve --surface $EXPECTED_SURFACE" "$GB_CODEX_STATE" \|| fail "codex registration did not pin the registration surface '$EXPECTED_SURFACE' (registered: $(cat "$GB_CODEX_STATE")). Why: bootstrap hooks builds the serve argv from stdioServeArgv/REGISTRATION_SURFACE in src/core/mcp-registration.ts. Next: if REGISTRATION_SURFACE changed on purpose, update EXPECTED_SURFACE here; otherwise fix registerCodexMcp in src/core/bootstrap/hooks.ts, then run bash tests/docker/bootstrap-e2e.sh"