Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
feat(mcp): lighter starter tools/list; request_tools returns full schemas (GBRA-156 item 4)
garrytan5f66bf9eef34
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c75d688c3a..9942688190 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,25 @@ credits are retained; no result has been reassigned to another provider. Originaidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [0.60.433.0] - 2026-10-24++**The starter MCP tool list that harnesses re-fetch every turn is about 27% smaller: 19,489 bytes instead of 26,546 over stdio (35 tools) and 18,825 instead of 25,555 over HTTP (33 tools). Every tool is still listed, and every parameter it leaves out is still accepted and comes back from `request_tools {tools: [...]}`.**++### What changed++| Situation | Before | Now |+|---|---|---|+| Parameters on the starter tool list | every parameter except a few marked full-surface-only | the parameters an agent needs for the common call; params MCP callers cannot use (local-only, server-set provenance), legacy and duplicate params, admin and versioned skill-catalog params, image and code search params, and tuning or recovery knobs with safe defaults are left out (a refusal that needs one, such as put_page `allow_empty` or `drop_timeline`, names it) |+| Calling a tool with a parameter the starter list leaves out | accepted | still accepted, unchanged |+| `request_tools {tools: [names]}` on a server whose ceiling is `starter` | returned the starter schema, so the left-out params could not be discovered | returns each tool's full schema with every optional parameter |+| Memory verb descriptions | began with `MEMORY VERB (v1):` | the prefix is gone; tool names and the protocol are unchanged |+| verbs and full surfaces | | list every parameter as before (verbs 8,573 bytes, was 8,757) |++### What to watch for after you upgrade++- A schema-validating client on the starter surface with `mcp.strict_params reject` only sends parameters it was shown; fetch the full schema with `request_tools {tools: [name]}` or serve the full surface when an agent needs a left-out parameter.+- Nothing is rewritten on upgrade, and there is no schema migration.+## [0.60.428.0] - 2026-10-24**Production agents can now follow a stable release channel: a release a maintainer promotes only after the production-shaped soak passed on its exact git tree. `gbrain upgrade` also restarts every gbrain process on the host onto the new build and verifies that one build runs, and doctor fails when two builds run.**diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.mdindex 336abaeafa..f4ad1667e1 100644--- a/docs/TOOL_CATALOG.md+++ b/docs/TOOL_CATALOG.md@@ -53,7 +53,7 @@ Every non-localOnly operation on the MCP surface: 161 tools across 25 areas. **S| Tool | Description | Scope | Starter | Gate ||---|---|---|---|---|-| `request_tools` | More tools: no arguments lists your catalog; {tools: [names]} returns schemas; {surface} widens it (per client or stdio session). | read | yes | |+| `request_tools` | More tools and params: no arguments lists your catalog; {tools: [names]} returns full schemas, every optional param included; {surface} widens it (per client or stdio session). | read | yes | |## entities@@ -149,13 +149,13 @@ Every non-localOnly operation on the MCP surface: 161 tools across 25 areas. **S| Tool | Description | Scope | Starter | Gate ||---|---|---|---|---|-| `context_pack` | MEMORY VERB (v1): core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. | read | yes | |-| `delta` | MEMORY VERB (v1): pages, facts, thread events changed since a cursor, zero LLM. | read | yes | |-| `entity` | MEMORY VERB (v1): person/company/account card, zero LLM. | read | yes | |-| `forget` | MEMORY VERB (v1): expire a remembered fact by its fact_id (never a page slug). | write | yes | |-| `recall` | MEMORY VERB (v1): read facts by entity, since or session_id; `query` also searches pages. | read | yes | |-| `remember` | MEMORY VERB (v1): save facts with provenance. | write | yes | |-| `synthesize` | [EXPENSIVE / SLOW: LLM calls, costs money] MEMORY VERB (v1): answer a broad question across pages with citations. | read | yes | |+| `context_pack` | Core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. | read | yes | |+| `delta` | Pages, facts, thread events changed since a cursor, zero LLM. | read | yes | |+| `entity` | Person/company/account card, zero LLM. | read | yes | |+| `forget` | Expire a remembered fact by its fact_id (never a page slug). | write | yes | |+| `recall` | Read facts by entity, since or session_id; `query` also searches pages. | read | yes | |+| `remember` | Save facts with provenance; set `entity` (the subject) or recall misses it. | write | yes | |+| `synthesize` | [EXPENSIVE / SLOW: LLM calls] Cited answer to a broad question across pages. | read | yes | |## ontologydiff --git a/docs/architecture/key-files/core-persistence.md b/docs/architecture/key-files/core-persistence.mdindex 7a8a63604f..538699449c 100644--- a/docs/architecture/key-files/core-persistence.md+++ b/docs/architecture/key-files/core-persistence.md@@ -35,7 +35,7 @@ Managed facts extraction (withdrawn-candidate skip and recovery, conversation fa- `src/core/persistence/page-input.ts` — freezes scoped subagent type normalization at durable admission, after existing-request replay. An explicit undeclared model-authored type becomes `note` with `legacy_type` retained using the then-active schema pack; a replay keeps its original normalized payload when the pack changes. Caller intent remains unchanged for idempotency checks. Raw input size is checked before normalization and malformed Markdown is left to the importer’s sanitized error contract. `test/brain-allowlist.test.ts` pins changed-pack replay, raw-size refusal, and private parse-error redaction. `undeclaredPageTypeWarning` covers every other `put_page` (not managed file imports): a type the write source's pack neither declares nor aliases is stored as written and the committed result carries `type_warning` (`code: page_type_undeclared`, cause, fix, docs), also logged; pinned by `test/put-page-type-warning.test.ts`.-- `src/core/persistence/params.ts` — runtime-leaf mutation parameter and receipt schemas shared with the frozen verb registry. Its operation-contract import is type-only; runtime validators live in separate modules to avoid a registry initialization cycle. `preconditions.ts` validates UUID/revision/force syntax. `purge-params.ts` validates local-only purge shape/trust before admission and publication, keeping purge diagnostics out of generic precondition imports and unrelated command flag scans. `test/persistence-cold-import.test.ts` loads each validator/contract/registry entry in a fresh process and preserves schema and typed-error identity.+- `src/core/persistence/params.ts` — runtime-leaf mutation parameter and receipt schemas shared with the frozen verb registry. Its operation-contract import is type-only; runtime validators live in separate modules to avoid a registry initialization cycle. `preconditions.ts` validates UUID/revision/force syntax. `purge-params.ts` validates local-only purge shape/trust before admission and publication, keeping purge diagnostics out of generic precondition imports and unrelated command flag scans. `test/persistence-cold-import.test.ts` loads each validator/contract/registry entry in a fresh process and preserves schema and typed-error identity. `CAPTURE_EVENT_PARAMS` are full-surface-only.- `src/core/persistence/write-wait.ts` — the CLI write-wait and exit contract (#5232). `resolveCliWriteWaitMs` (`--wait` seconds > `GBRAIN_WRITE_WAIT_MS` > file-plane `persistence.write_wait_ms` > 30 s; agents keep `AGENT_WRITE_WAIT_MS`); `writeExchangeBudget` (transport deadline = wait + 15 s admission headroom; an explicit `--timeout` shortens the requested owner wait instead); `replayWhilePending` (replays the identical request ID while an older owner, a remote server or a subagent tool's own bounded wait reports pending; the caller-supplied `sleep` decides how each pause ends, which is how subagent tool writes stop on abort); `writeErrorExitCode` keys on an admitted non-terminal receipt (`admittedPendingReceipt` in `types.ts`): pending → `PENDING_WRITE_EXIT_CODE` (0 with `--accept-pending`/`GBRAIN_ACCEPT_PENDING=1`), anything else → 1. Pinned by `test/pending-write-exit.serial.test.ts` and `test/pending-write-exit-owner.test.ts`. `pollCommand` (#6255) renders the envelope's receipt `fix.argv` (`gbrain write-request --brain <id> -- <request_id>`), else pins that argv to the CLI routing; each argument is shell-quoted (`src/core/shell-quote.ts`, fix wave 13 P1.15).- `src/core/persistence/page-edit.ts` — `edit_page` (#5616): splits the canonical serialization into editable text and protected takes/facts segments whose remote view matches get_page's sanitized `content` byte for byte; `applyPageEdits` applies ordered exact-once replacements inside editable text only (typed `edit_no_match`/`edit_ambiguous_match`/`edit_protected_span`/`edit_invalid`), so canonical fences never move; `editDiff` caps the caller-view diff at 8 KB; `boundedUnifiedDiff` keeps its LCS table under `EDIT_PAGE_DIFF_CELL_BUDGET` (4M cells) by diffing only the window between common leading/trailing lines, and a window still over budget becomes one coarse hunk flagged `diff_coarse` (pinned by `test/large-pages/edit-diff-bounded.test.ts`). Called at submission (`page-mutations.ts`, before admission; skipped for a segmented page) and again on the locked snapshot in `page-prepare.ts`, which gives edit_page put_page's revision-bound `editing` timeline semantics. Pinned by `test/edit-page.test.ts`. `within` and the segmented path: [large page writes](core-services-2-continued.md#large-page-writes).- `src/core/persistence/{effect-schema,effect-model,effect-journal,effect-recovery,effect-git,effects}.ts` — bounded postcommit outbox (migration 155). Canonical publication atomically queues Git and embedding work; withdrawals queue three versioned, bounded exact-page manifests with durable slug cursors. `effect-targets.ts` converts legacy source scans with complete bounded discovery keyed on the request's own forgotten fact (falling back to the whole source ledger only when that fact row is gone) while retaining each cursor; ambiguous or over-capacity legacy intent stays pending. Older workers must be quiesced before rollout. Independent mirror recovery reserves capacity before file effects, finishes forward without changing revision or receipt, and blocks only its worktree until reconciled. Git holds the native root lock, disables hooks, uses literal pathspecs and target-only commits, and pushes without pull/rebase. A claimed single-file Git effect brings up to 99 more ready single-file Git effects of its worktree (`claimCoalescedGitEffects`, same readiness, recovery and withdrawal-mirror ordering predicates, `SKIP LOCKED`); the runner validates each path under the worktree lock, makes one `commit --only` per group (`commitGitTargets`: one `ls-files`, `status`, `add` and `diff` for the group; untracked absent or ignored targets take the per-target refusal path) and pushes each root once at the end of the pass (`pushGitRoot`). A page file target's optional `commit` note (`GitCommitNote`, set only by trusted local preparers: a fence repair's `fenceRepairCommit`) is queued as `commit_subject`/`commit_line` in the Git effect's data and passed by the runner to `commitGitTargets`/`publishGitEffect`: a noted path committing alone takes its subject; a group keeps `gbrain: persist N canonical memory updates` and lists the noted paths' lines in the body, in path order; control characters are stripped, and targets without a note commit exactly as before (`test/fence-repair-receipts.test.ts`). A group yields to publications still queued or running for its worktree (one update requeues it with `publication_pending`, 250 ms apart) for at most 20 claims, so a serial producer publishes ahead and its Git work lands as one group, and a write admitted behind a backlog of full groups takes the worktree lock after the group already committing (wave 9; on master it waited out the backlog and its 5 s write wait); the v0.13.1 grandfather step admits a 50-page window (`admitCanonicalGrandfather`) before waiting for it. `claimCoalescedGitEffects` checks the worktree-wide conditions (owner, refresh fence, recovery blocks) once as an InitPlan, so the claim walks `persistence_effects_pending` in order and stops at its limit (351 → 25 ms per claim with 22k ready effects). A path failure fails only its effect; a push failure leaves the group queued with `git_push_unavailable`, and the next pass finds nothing to commit and pushes once. Every path listing compares relative to the source root, which may sit below the Git toplevel (#7091: status prefix stripped, `diff --relative`). That holds for a removal too (#7089): its retry finds the path untracked and absent (`target_absent`), and it joins the push while the root is ahead of its upstream (`gitRootAhead`, a local `rev-list @{upstream}..HEAD`, no upstream is not ahead), as does `publishGitEffect`, recording `target_absent` with the push result; on a root that is not ahead it completes without a push, so a down remote never parks it. A Git page walk that ends while its durable root is ahead pushes before completing (`test/persistence-git-removal-push-7089.test.ts` + Postgres wrapper). In a root without the durability hook a group runs no git command: it takes each root's lock once, guards each source incarnation once, validates every path as before and records the `durability_not_enabled` outcomes in one update (a 50k import's ~30k queued effects drain inside a minute of serve) (#5530; tests: `persistence-git-coalescing-5530.slow.test.ts` + Postgres wrapper). A Git effect for a declared db_only page completes as skipped (`reason: db_only`), keeping its gitignored cache file out of Git. A Git or withdrawal target parks after five consecutive execution failures (`data.target_failures` for `data.failing_target`, reset when the target advances or a different target fails; shutdown cancellation, contention, dependency waits (including recovery-capacity waits), transient database failures and raw errors `classifyItemFailure` calls run-scoped (a lost connection, a failed transaction, an abort, a full disk) do not count). A `links` or `facts-backstop` effect counts its failures the same way (`data.target_failures`, no target; run-scoped failures, including run-scoped refusal codes, never count, and a 57014 counts as `statement_timeout`): at five a links effect completes as skipped with the code (`outcome: { links: 'skipped', reason }`; the edges are derived and `gbrain extract --stale` recovers them) and a facts-backstop effect fails with it; a pass's counted failures settle when the pass ends under an `ItemRun` (`effects.derived_retry_budget`), and a pass where most of them failed counts none (each retries as `item_failures_systemic`) (GBRA-130 A-11, `test/pathological/a11-effect-retry-budget.test.ts`). An embedding scan (a withdrawal's exact targets or a source scan) parks the page whose provider call keeps failing once its per-page budget (`MAX_RATE_LIMIT_RETRIES`) is spent, with the failure's code, and moves on with a fresh budget; provider throttling (`isEmbedRetriableError`), configuration, budget and disabled errors and run-scoped failures stay effect-wide (A-13, `a13-embedding-target-park.test.ts`): a scan records it in `data.parked` and moves on, a single-target effect or a failure outside any target parks the whole effect, and an effect with parked targets finishes as `failed`/`targets_parked`, never committed. A mirror or Git scan never parks on a sync-skip metafile page (`RESOLVER.md` carries the managed durability block by design) or on a file whose bytes hold an uncoordinated local edit (`file_database_drift`): the mirror materializes the withdrawal in the database without touching the file, both scans record the page in `data.skipped` (at most 100) and advance, so the request's Git and embedding effects are no longer gated behind a parked mirror (#5396). A page stored in segments is mirrored and committed too, streamed (see the segmented withdrawal mirror entry in `core-persistence-request-indexes.md`). Both claim queries hold a request's Git and embedding effects only while its withdrawal mirror is queued or running; each Git or embedding attempt rereads its mirror (`mirrorGates`, every mirror not committed plus a committed one that recorded its publications): a mirror queued or running again (retry-effects after the claim) makes the attempt wait (`withdrawal_mirror_pending`); otherwise the mirror's recovery records each page whose file it rewrote (`data.published`) and its cursor is never proof: a Git page walk commits a page the mirror passed only when the file's raw bytes hash-equal the mirror rendering of the current snapshot (the serialization `mirrorPage` writes; this also covers a mirror from before publications were recorded and a published file later reverted by hand) and otherwise skips it (`withdrawal_not_mirrored`), a single-file Git effect needs the recorded publication, embedding behind a failed mirror needs the recorded publication, and behind a failed mirror every other page, including a single-file Git effect's page in a coalesced group, is parked with `withdrawal_mirror_failed`, so Git never commits a file that may still hold withdrawn text. When the mirror commits, the same transaction re-arms its request's Git and embedding targets parked `withdrawal_mirror_failed` (`rearmWithheldTargets`: a scan revisits them through `data.retry_slugs`; other parks stay), and each effect pass repeats it for the requests it touched, so no second retry-effects is needed. Lifecycle settlement (`topology-locks.ts`) waits on a queued mirror, not a failed one (A-12, `a12-withdrawal-mirror-gate.test.ts`). Migration 170 indexes parked effects for the `parked_effects` doctor check. `retryParkedEffects` (the `retry-effects` admin path) previews parked targets or authorizes one more attempt per target (`data.retry_slugs`, visited before the cursor); it also covers parked embedding targets, failed Git, withdrawal-mirror, links and facts-backstop effects without parked targets (one more attempt; a mirror that failed `source_changed` reruns from its cursor once the source is back) and an embedding effect that failed `source_changed`, so one call reruns a failed mirror and re-arms the pages it withheld; `parkedOnly` keeps the credential-change retry (`retryParkedPushes`) to parked Git and withdrawal effects; tests: `persistence-effect-parking.test.ts`. `repair embedding-effects` skips failed embedding effects with parked targets and zero-norm refusals. Old targets resolve under the same hash/confinement checks without changing frozen data; ambiguous absent spellings refuse after scoped staged/unstaged deletion checks. Embedding runs outside transactions/OS locks and installs with projection CAS. Receipt helpers return only public effect state/reason/push. Consumer shutdown aborts providers and awaits workers; receipt compaction is bounded. Tests: `persistence-effects.test.ts`, `persistence-git-publication.test.ts`, `persistence-publication-native.serial.test.ts`. Embedding completion checks active column/vector, embedded stamp, text hash, model and page signature; partial work sends only stale chunks and preserves valid siblings. A partial synopsis rebuild completes before title demotion. Provider timeouts use the gateway budget, five durable page claims/backoff, execution-token CAS after provider work and atomic vector/stamp/effect completion. Keyless work skips cleanly. `retry-effects` is an explicit one-shot failed-effect allowance; current vectors reconcile provider-free without changing canonical receipts. A git refusal on an index lock (git's own message names the lock, so linked worktrees resolve) is `git_index_locked` contention (retried, not counted toward parking) while the lock is younger than 10 minutes, and `git_index_stale` (counted, naming the lock) when older or future-dated. Only the writer, holding its writer lock, removes a lock `index-lock-reclaim.ts` proves abandoned (its header lists the proof), with a receipt doctor `parked_effects` reports, then retries the step and the effects that lock parked; otherwise `git_index_stale` carries an `ask_user` fix. Steps run with `GIT_OPTIONAL_LOCKS=0`, an index-scaled deadline (`gitStepTimeoutMs`) and a 10 s SIGTERM grace (#6932).diff --git a/docs/architecture/key-files/core-services-2.md b/docs/architecture/key-files/core-services-2.mdindex 2d0c277458..c2a078030b 100644--- a/docs/architecture/key-files/core-services-2.md+++ b/docs/architecture/key-files/core-services-2.md@@ -39,18 +39,18 @@ Fact and page purge modules (`src/core/facts/purge*.ts`, `deletion-inventory.ts`- `src/core/ops/insights.ts` — `find_contradictions` (`filtered`, takes `min_trust`) returns the stored report as written only to explicitly trusted, unscoped, unfloored local callers. Remote, source-scoped and floored callers get `eval-contradictions/scoped-read.ts` findings (both sides re-read live, `total_visible` instead of the run total); a remote context with no source scope gets an empty list and a note. Expert search threads page and holder policy and performs final authorized-page admission after enrichment.-- `src/core/ops/links.ts` — the link-domain op module (`add_link`, `remove_link`, `get_links`, `get_backlinks`, `list_link_sources`, `traverse_graph`); `get_backlinks`' `type`/`group`/`limit`/`cursor` live in `backlinks-paged.ts`. Three load-bearing behaviors. (1) Pack vocabulary at the write surface: an EXPLICIT `link_type` on `add_link` must be declared by the active schema pack when one resolves (`schema-pack/write-vocabulary.ts`; no resolvable pack = no enforcement; omitted/empty link_type is the untyped-edge default and stays unchecked; the check runs before the dry-run return so dry runs preview the rejection). (2) `traverse_graph` output shape: trusted local no-filter callers (`ctx.remote === false`, no `link_type`/`direction`) keep the legacy `GraphNode[]` shape that `gbrain graph` renders; remote callers default to `direction: 'both'` and always receive explicit `GraphPath[]` edges, so a page whose typed edges are all inbound does not read as edge absence. An explicit `direction` param wins for every caller. Depth: default 5 (`DEFAULT_TRAVERSE_DEPTH`), except a remote call that let direction default to `both` ALSO defaults depth to `REMOTE_BIDIRECTIONAL_DEFAULT_DEPTH` (2) — bidirectional path enumeration is combinatorial on entity hubs and this is the per-agent-turn path; a `link_type`-only remote call still takes both/2; an explicit depth is honored up to `TRAVERSE_DEPTH_CAP` (10, clamped with a warn). The edge walk runs through `engine.traversePathsDetailed`, and a hit on `TRAVERSE_PATH_ROW_CAP` (`engine-constants.ts`) surfaces as a stderr warn naming the cap (shallowest edges kept) — the `GraphPath[]` wire shape stays unchanged. Pinned by `test/traverse-graph-op-default.test.ts` + `test/traverse-paths-row-cap.test.ts`. (3) Link-read source scope: the three read ops take `source_id` (`parseSourceIdParam`, `__all__` admitted) and `all_sources` (equivalent to `__all__`; both together is `invalid_params`). `resolveLinkReadScope` composes `federatedSearchScope` (grant check, #5081 admission, unqualified no-grant widening to `localFederatedSourceIds`; a grant never widens), then `assertExplicitSourceLive` (so an archived source outside the caller's admission answers `permission_denied`, not `unknown_source`), then `linkReadScopeOpts` (remote scalar promoted to `sourceIds[]` for the engine's all-endpoints branch), then `readPolicyOpts`. A trusted local unqualified read that comes back as the federated `sourceIds[]` runs the scalar read once per federated source (set order, resolved source first) and merges de-duplicated on link identity, keeping the scalar branch's cross-source far endpoints; `traverse_graph` walks the federated set in one query because its scalar walk already scopes every node. A trusted local unqualified link read that returns nothing prints a stderr rerun hint naming sources outside the read that hold links for the slug (quiet under `json`, never for remote callers). CLI names: `links` (alias `get_links`), `backlinks`, `graph`. (4) Row paging (#6876): rows are keyset-paged by `ops/link-paging.ts` (cap after the source/identity merge; see its header). Pinned by `test/link-read-paging.test.ts`. Pinned by `test/federated-link-reads-5827.test.ts`, `test/link-reads-thin-client-5827.serial.test.ts` and `test/e2e/federated-link-reads-postgres.test.ts`. `traverse_graph` `hops` (1-3 `{link_type, toward}`) runs a typed chain through `runRelationalChain` under the op's read scope, returns `{anchor, answers, paths, diagnostics}` with evidence edges (remote context sanitized), refuses `hops` combined with `depth`/`link_type`/`direction` and bad hops as `invalid_params` naming the parameter path, and emits a `relational_chain` notice with the next call when the chain finds nothing. Pinned by `test/traverse-graph-hops.test.ts`.+- `src/core/ops/links.ts` — the link-domain op module (`add_link`, `remove_link`, `get_links`, `get_backlinks`, `list_link_sources`, `traverse_graph`); `get_backlinks`' `type`/`group`/`limit`/`cursor` live in `backlinks-paged.ts`. Three load-bearing behaviors. (1) Pack vocabulary at the write surface: an EXPLICIT `link_type` on `add_link` must be declared by the active schema pack when one resolves (`schema-pack/write-vocabulary.ts`; no resolvable pack = no enforcement; omitted/empty link_type is the untyped-edge default and stays unchecked; the check runs before the dry-run return so dry runs preview the rejection). (2) `traverse_graph` output shape: trusted local no-filter callers (`ctx.remote === false`, no `link_type`/`direction`) keep the legacy `GraphNode[]` shape that `gbrain graph` renders; remote callers default to `direction: 'both'` and always receive explicit `GraphPath[]` edges, so a page whose typed edges are all inbound does not read as edge absence. An explicit `direction` param wins for every caller. Depth: default 5 (`DEFAULT_TRAVERSE_DEPTH`), except a remote call that let direction default to `both` ALSO defaults depth to `REMOTE_BIDIRECTIONAL_DEFAULT_DEPTH` (2) — bidirectional path enumeration is combinatorial on entity hubs and this is the per-agent-turn path; a `link_type`-only remote call still takes both/2; an explicit depth is honored up to `TRAVERSE_DEPTH_CAP` (10, clamped with a warn). The edge walk runs through `engine.traversePathsDetailed`, and a hit on `TRAVERSE_PATH_ROW_CAP` (`engine-constants.ts`) surfaces as a stderr warn naming the cap (shallowest edges kept) — the `GraphPath[]` wire shape stays unchanged. Pinned by `test/traverse-graph-op-default.test.ts` + `test/traverse-paths-row-cap.test.ts`. (3) Link-read source scope: the three read ops take `source_id` (`parseSourceIdParam`, `__all__` admitted) and `all_sources` (equivalent to `__all__`; both together is `invalid_params`). `resolveLinkReadScope` composes `federatedSearchScope` (grant check, #5081 admission, unqualified no-grant widening to `localFederatedSourceIds`; a grant never widens), then `assertExplicitSourceLive` (so an archived source outside the caller's admission answers `permission_denied`, not `unknown_source`), then `linkReadScopeOpts` (remote scalar promoted to `sourceIds[]` for the engine's all-endpoints branch), then `readPolicyOpts`. A trusted local unqualified read that comes back as the federated `sourceIds[]` runs the scalar read once per federated source (set order, resolved source first) and merges de-duplicated on link identity, keeping the scalar branch's cross-source far endpoints; `traverse_graph` walks the federated set in one query because its scalar walk already scopes every node. A trusted local unqualified link read that returns nothing prints a stderr rerun hint naming sources outside the read that hold links for the slug (quiet under `json`, never for remote callers). CLI names: `links` (alias `get_links`), `backlinks`, `graph`. (4) Row paging (#6876): rows are keyset-paged by `ops/link-paging.ts` (cap after the source/identity merge; see its header). Pinned by `test/link-read-paging.test.ts`. Pinned by `test/federated-link-reads-5827.test.ts`, `test/link-reads-thin-client-5827.serial.test.ts` and `test/e2e/federated-link-reads-postgres.test.ts`. `traverse_graph` `hops` (1-3 `{link_type, toward}`) runs a typed chain through `runRelationalChain` under the op's read scope, returns `{anchor, answers, paths, diagnostics}` with evidence edges (remote context sanitized), refuses `hops` combined with `depth`/`link_type`/`direction` and bad hops as `invalid_params` naming the parameter path, and emits a `relational_chain` notice with the next call when the chain finds nothing. Pinned by `test/traverse-graph-hops.test.ts`. `all_sources` is full-surface-only (starter passes `source_id: '__all__'`).-- `src/core/ops/pages.ts` — page operations share source validation and the persistence coordinator. Replacements require `expected_revision` or explicit `force`; omitted preconditions permit creation only. The put_page description keeps `Keep a request_id UUID; retry with identical arguments` within its 1,460-character schema budget (pinned by `test/mcp-schema-budget.test.ts` minimum guidance; the description and the content param both keep the get_page include_content:true read that `test/mcp-tool-defs.test.ts` pins). `get_page` and `fetch` use `page-state/snapshot.ts` for exact/alias resolution, content, tags, revision and withdrawal overlays in one SQL snapshot; fuzzy fallback uses a short repeatable-read transaction with the same visibility and source ceilings. `get_page` `content_only` (`ops/get-page-projection.ts`) returns slug, source_id, type, title, revision, tags, content and chars (keys pinned by `test/get-page-content-roundtrip-2225.test.ts`). A put_page `revision_conflict` (`ops/put-page-revision-source.ts`) whose expected_revision is the current revision of the same slug in another source the caller may read (grant via `federatedSearchScope`, private pages excluded for untrusted readers) names that source and gets a re-read fix; otherwise the refusal is unchanged. `get_page` adds `file_held` when sync holds the page's newer file (`persistence/held-reads.ts`; path for trusted local callers only). Missing migration dependencies and connection errors propagate. Capture freezes target/type/timestamp/provenance before admission and resolves same-ID replay first. `persistence/links-preparation.ts` prepares trusted automatic graph reconciliation outside locks, then installs it with canonical projections and the receipt; delayed oneshot reconciliation validates its originating revision. `persistence/page-advisories.ts` prepares bounded, content-free lint findings. Tests cover source/alias ownership, concurrent graph replacements, stale delayed reconciliation, private fences and durable retries. `list_pages` passes `listColumnsOnly` so `engine-sql/pages.ts:listPages` projects identity, type, title and dates without reading page bodies or frontmatter (`list-pages-columns-5154.test.ts`). `delete_page` accepts a strict boolean `purge` only from trusted local callers. Immediate purge uses the same durable journal, observed revision (or explicit `force`), stored/current authority and exact request-ID replay as other page mutations. Owner preparation resolves the recorded file from a coherent snapshot, including tombstones; file removal precedes hard deletion and receipt commitment in the guarded publication transaction. Failed publication preserves the prior active row or existing tombstone and never overwrites unexpected file bytes. The receipt reports the actual filesystem/database persistence outcome and warns that repository history, synced copies, exports and derived artifacts may retain content. The `gbrain delete <slug> --purge` flag derives from the operation contract. `list_pages` probes `limit + 1` rows: a local CLI caller gets a stderr truncation notice; every dispatched caller gets `_meta.pagination` (`truncated`, `limit`, `clamped_from?`, `next?`) and a remote caller whose page was truncated also gets the model-visible `listing_truncated` notice whose `fix.mcp` is the next-page call (`ops/list-pages-pagination.ts`; `next` is the `updated_asc` keyset or an offset). Test: `test/list-pages-truncation.test.ts`. An `updated_after` the database cannot cast (SQLSTATE 22007/22008, the shared `isDatetimeInputError` in `core/utils.ts` that the hybrid lexical arms also use) is `invalid_params` with a read-only list_pages fix, never echoing the value; other SQLSTATEs pass through (`test/list-pages-timestamp-input.test.ts`). put_page (dry runs included) refuses a new `.md`/`.mdx`-suffixed slug (`persistence/suffixed-slug.ts`). #6212: `delete_page` and `restore_page` (dry runs included) go through `persistence/page-mutations.ts:validateMutationSlug`, which admits a legacy stored slug (`ops/context.ts:isLegacyStoredPageSlug`: refused by today's grammar, still accepted by `validateSlug`) only when an existing row in the target source holds it; every other operation keeps `validatePageSlug`, and remote purge stays denied by `assertPurgeParams`. Large pages: `get_page` resolves its body mode first (`parseBodyRequest`, `src/core/ops/get-page-body.ts`) and returns `readPartialBody` for none/outline/window/auto-above-256 KB, `assertFullReadFits` guarding whole remote reads; `fetch` of a page over the inline size returns `fetchWindowResult` (window around the id's chunk anchor, `metadata.next_id`); remote `put_page` runs `assertLargePageAdmission` before queueing. A committed segmented write's outcome records `searchable` (`true`, `'pending'` when its projection runs after commit, `false` when quarantined); `persistence/searchable.ts:liveSearchable` re-reads a pending one whenever the receipt is served (the put_page reply in `page-mutations.ts`, `get_write_request`) and adds `searchable_retry_after_ms` and a `searchable_fix` that reads the receipt again (`test/large-pages/segmented-create-searchable.test.ts`). Only writes load `page-mutations.ts` (`test/cold-read-module-graph.test.ts`).+- `src/core/ops/pages.ts` — page operations share source validation and the persistence coordinator. Replacements require `expected_revision` or explicit `force`; omitted preconditions permit creation only. The put_page description keeps `Keep a request_id UUID; retry with identical arguments` within its 1,460-character schema budget (pinned by `test/mcp-schema-budget.test.ts` minimum guidance; the description and the content param both keep the get_page include_content:true read that `test/mcp-tool-defs.test.ts` pins). `get_page` and `fetch` use `page-state/snapshot.ts` for exact/alias resolution, content, tags, revision and withdrawal overlays in one SQL snapshot; fuzzy fallback uses a short repeatable-read transaction with the same visibility and source ceilings. `get_page` `content_only` (`ops/get-page-projection.ts`) returns slug, source_id, type, title, revision, tags, content and chars (keys pinned by `test/get-page-content-roundtrip-2225.test.ts`). A put_page `revision_conflict` (`ops/put-page-revision-source.ts`) whose expected_revision is the current revision of the same slug in another source the caller may read (grant via `federatedSearchScope`, private pages excluded for untrusted readers) names that source and gets a re-read fix; otherwise the refusal is unchanged. `get_page` adds `file_held` when sync holds the page's newer file (`persistence/held-reads.ts`; path for trusted local callers only). Missing migration dependencies and connection errors propagate. Capture freezes target/type/timestamp/provenance before admission and resolves same-ID replay first. `persistence/links-preparation.ts` prepares trusted automatic graph reconciliation outside locks, then installs it with canonical projections and the receipt; delayed oneshot reconciliation validates its originating revision. `persistence/page-advisories.ts` prepares bounded, content-free lint findings. Tests cover source/alias ownership, concurrent graph replacements, stale delayed reconciliation, private fences and durable retries. `list_pages` passes `listColumnsOnly` so `engine-sql/pages.ts:listPages` projects identity, type, title and dates without reading page bodies or frontmatter (`list-pages-columns-5154.test.ts`). `delete_page` accepts a strict boolean `purge` only from trusted local callers. Immediate purge uses the same durable journal, observed revision (or explicit `force`), stored/current authority and exact request-ID replay as other page mutations. Owner preparation resolves the recorded file from a coherent snapshot, including tombstones; file removal precedes hard deletion and receipt commitment in the guarded publication transaction. Failed publication preserves the prior active row or existing tombstone and never overwrites unexpected file bytes. The receipt reports the actual filesystem/database persistence outcome and warns that repository history, synced copies, exports and derived artifacts may retain content. The `gbrain delete <slug> --purge` flag derives from the operation contract. `list_pages` probes `limit + 1` rows: a local CLI caller gets a stderr truncation notice; every dispatched caller gets `_meta.pagination` (`truncated`, `limit`, `clamped_from?`, `next?`) and a remote caller whose page was truncated also gets the model-visible `listing_truncated` notice whose `fix.mcp` is the next-page call (`ops/list-pages-pagination.ts`; `next` is the `updated_asc` keyset or an offset). Test: `test/list-pages-truncation.test.ts`. An `updated_after` the database cannot cast (SQLSTATE 22007/22008, the shared `isDatetimeInputError` in `core/utils.ts` that the hybrid lexical arms also use) is `invalid_params` with a read-only list_pages fix, never echoing the value; other SQLSTATEs pass through (`test/list-pages-timestamp-input.test.ts`). put_page (dry runs included) refuses a new `.md`/`.mdx`-suffixed slug (`persistence/suffixed-slug.ts`). #6212: `delete_page` and `restore_page` (dry runs included) go through `persistence/page-mutations.ts:validateMutationSlug`, which admits a legacy stored slug (`ops/context.ts:isLegacyStoredPageSlug`: refused by today's grammar, still accepted by `validateSlug`) only when an existing row in the target source holds it; every other operation keeps `validatePageSlug`, and remote purge stays denied by `assertPurgeParams`. Large pages: `get_page` resolves its body mode first (`parseBodyRequest`, `src/core/ops/get-page-body.ts`) and returns `readPartialBody` for none/outline/window/auto-above-256 KB, `assertFullReadFits` guarding whole remote reads; `fetch` of a page over the inline size returns `fetchWindowResult` (window around the id's chunk anchor, `metadata.next_id`); remote `put_page` runs `assertLargePageAdmission` before queueing. A committed segmented write's outcome records `searchable` (`true`, `'pending'` when its projection runs after commit, `false` when quarantined); `persistence/searchable.ts:liveSearchable` re-reads a pending one whenever the receipt is served (the put_page reply in `page-mutations.ts`, `get_write_request`) and adds `searchable_retry_after_ms` and a `searchable_fix` that reads the receipt again (`test/large-pages/segmented-create-searchable.test.ts`). Only writes load `page-mutations.ts` (`test/cold-read-module-graph.test.ts`). The starter list leaves out (`fullSurfaceOnly`, still accepted) get_page `fuzzy`/`content_only`/`include_deleted`/`include_timeline_entries`/`include_quarantined`, list_pages `offset`/`include_deleted`, put_page `allow_empty`/`drop_timeline` (their refusals name them) and the server-set provenance params, and capture `expected_revision`/`force`/`local_file`.- `src/core/persistence/large-page-guard.ts` — put_page against a page over 256 KB: `assertLargePageAdmission` (remote, before queueing) refuses `force` without `expected_revision` (`revision_required`) and content under half the stored body (`page_shrink_refused`) unless `allow_shrink`; `assertLargePageReplacement` re-checks the parsed body against the locked snapshot in preparation (`page-prepare.ts`).- `src/core/ops/page-edit.ts` — the `edit_page` operation (write scope, starter surface, client slug-fence allowlist): validates edits and the optional `within` range (full surface only), then submits through `submitPageMutation` like put_page; matching and the diff live in `persistence/page-edit.ts`.-- `src/core/ops/persistence.ts` — get/list/cancel own-write receipt controls, all requiring write scope and an explicit current operation grant. SQL principal/source/incarnation plus current operation and prefix predicates precede list pagination; original accepted authority and current source/slug grants remain the final guard. Public output selects receipt fields and target metadata only; a failed receipt adds `write_error_message`, the same allowlisted `writeFailureDiagnostic` message managed sync prints, never raw journal error text (`test/sync-frontmatter-slug-conflict.test.ts`). A terminal or recovery-holding receipt also returns `write_error_reason`, `suggestion` and a `diagnosis` from `classifyTerminal` with a rendered `fix` (#6650, `test/write-request-diagnosis-6650.test.ts`). Cancellation rechecks receipt permission under the same transaction grant locks as the original write. Starter/full expose the helpers; frozen verbs stay unchanged, and existing operation snapshots require explicit regrant. Tests: `test/persistence-receipt-operations.test.ts`, `test/client-grants.test.ts`, `test/mcp-surface.test.ts`.+- `src/core/ops/persistence.ts` — get/list/cancel own-write receipt controls, all requiring write scope and an explicit current operation grant. SQL principal/source/incarnation plus current operation and prefix predicates precede list pagination; original accepted authority and current source/slug grants remain the final guard. Public output selects receipt fields and target metadata only; a failed receipt adds `write_error_message`, the same allowlisted `writeFailureDiagnostic` message managed sync prints, never raw journal error text (`test/sync-frontmatter-slug-conflict.test.ts`). A terminal or recovery-holding receipt also returns `write_error_reason`, `suggestion` and a `diagnosis` from `classifyTerminal` with a rendered `fix` (#6650, `test/write-request-diagnosis-6650.test.ts`). Cancellation rechecks receipt permission under the same transaction grant locks as the original write. Starter/full expose the helpers (list_write_requests `limit` is full-surface-only); frozen verbs stay unchanged, and existing operation snapshots require explicit regrant. Tests: `test/persistence-receipt-operations.test.ts`, `test/client-grants.test.ts`, `test/mcp-surface.test.ts`.- `src/core/ops/raw-data.ts` — `put_raw_data` / `get_raw_data`. `get_raw_data` follows the page soft-delete (a tombstoned page reads as `[]`, `restore_page` brings the rows back; there is no remote `include_deleted` param — `get_page include_deleted: true` verifies the tombstone) and, per #4352, a `visibility: private` page's raw data reads exactly like a missing page's for untrusted callers. Scope comes from `readPolicyOpts(ctx)`, never from MCP parameters.-- `src/core/ops/search.ts` — the search-domain op module (`search`, `query`, `search_stats`, `search_modes`, `search_tune`, `cache_stats`). `query` is the hybrid entry (`hybridSearchCached`) plus two non-hybrid legs that share ONE effective-row-contract helper, `resolveEffectiveLimit(ctx, p)`: an explicit `limit` wins, otherwise the mode-derived `searchLimit` resolved through the same trust-gated chain `hybridSearch` uses (`resolvePerCallMode` ignores a remote caller's `mode`, so a remote client cannot select the tokenmax row count); the config reads run lazily on those paths only. The legs: the image-similarity branch (`embedding_image` vector search, `test/query-image-mode-limit.serial.test.ts`) and the CRAG escalation slice — when `search.crag_escalation` is on and `shouldEscalateRetrieval` (`src/core/search/crag.ts`) says the first pass graded `weak`, was not already escalated, AND did not already run with the caller's expansion on (`callerExpanded`), the op re-runs once at `limit: max(effectiveLimit, 50)` with expansion + relational on and autocut off, keeping the better-graded run. `buildRetrievalResponseMeta(ctx, scope, …)` is the ONE producer of the `retrieval` response-meta channel (keyword-only path included): when a remote caller's scope holds pages of any kind below the safe-chunk index version (`hasUnsealedPagesInScope`: sargable `chunker_version < SAFE_FENCE_CHUNKER_VERSION` LIMIT 1 probe served by the unsealed-only partial `pages_safe_chunk_pending_idx` — NOT the COALESCE `safeChunksFilter` form; pinned by `test/search-safe-index-probe.test.ts`; fail-open; retains source, private, quarantine and live-page policy), it appends the `safe_index_pending` degraded stage to empty and partial results alike, so neither reads as a clean or complete answer; the drain is `gbrain repair safe-chunks`. The withholding itself is unchanged. Empty and nonempty replies also carry projection_readiness, with projection_pending/projection_status_unknown degradation when appropriate (projection_by_design when the only unsealed pages in scope are protected-OCR images, #6803). Vector candidate incompleteness and scoped pool details survive the public CLI/MCP serialization boundary; public type filters constrain the current-projection probe. Retrieval output copies and sanitizes result/metadata after grading and capture using the canonical scanner, before snippet truncation; internal pipeline/capture remains unredacted. `searchOutput` then projects the returned rows to the caller's row shape (`src/core/search/lean-rows.ts`: lean for remote callers unless `fields: "full"`, the transport chose full rows, or the caller is trusted-local; a lean row keeps `id` only when `ctx.isCallable('fetch')`, the MCP dispatch predicate `buildOperationContext` threads in, says the caller can call `fetch` (unset keeps it), and prints `score` at 4 significant digits) and reports it as `retrieval.rows` for remote callers and whenever `fields` is passed. The CLI formatter repeats this on JSON, explain and human output. System One: the `query` op asks S4 answerability (`decide.answerability`, diagnostic only) and surfaces `meta.answerability`; the crag escalation re-run keeps S2-S5 off (`rerankOnly`). Each handler times its request (`SearchTimings`, search/stage-timings.ts) and `searchOutput` emits `retrieval.timings` last. The typed-search type check lives in `ops/search-type-filter.ts` (`reconcileTypeFilter`): one statement of per-type `EXISTS` probes over each type's schema-expanded set, with the `DISTINCT` type list for the `type_filter_notice` evaluated only when a probe misses, run `jitOff` and unprepared (a generic plan scans every page per missing type); pinned by `test/search-type-filter-reconcile.test.ts` and `test/e2e/typed-search-jit-postgres.test.ts`. `buildRetrievalResponseMeta` also stamps `stale` on hits whose page's newer file is held, adds `held_files` per source in scope and emits the `held_files` degraded notice (`persistence/held-reads.ts`; Test: `test/held-read-signals.test.ts`); `coverage` counts pending, held and embedding-held items with `could_affect` (`search/retrieval-coverage.ts`). Its safe-index probe, projection readiness, entity saved facts, saved-fact match and held-file coverage run concurrently, each with its own catch; the answer-feedback write runs after them (`test/search-response-meta-concurrency.test.ts`). The saved-fact match is one statement: an uncorrelated `EXISTS` probe (a one-time filter) skips its `LIKE ANY` scan when no fact qualifies. The handlers start the alias fan-out's `resolveQueryEntity` alongside the hybrid search, and `evidenceOutput` reads page trust (`loadPageTrust` over the rows every delivered row is copied from) alongside evidence delivery (`test/search-post-rerank-concurrency.test.ts`).+- `src/core/ops/search.ts` — the search-domain op module (`search`, `query`, `search_stats`, `search_modes`, `search_tune`, `cache_stats`). `query` is the hybrid entry (`hybridSearchCached`) plus two non-hybrid legs that share ONE effective-row-contract helper, `resolveEffectiveLimit(ctx, p)`: an explicit `limit` wins, otherwise the mode-derived `searchLimit` resolved through the same trust-gated chain `hybridSearch` uses (`resolvePerCallMode` ignores a remote caller's `mode`, so a remote client cannot select the tokenmax row count); the config reads run lazily on those paths only. The legs: the image-similarity branch (`embedding_image` vector search, `test/query-image-mode-limit.serial.test.ts`) and the CRAG escalation slice — when `search.crag_escalation` is on and `shouldEscalateRetrieval` (`src/core/search/crag.ts`) says the first pass graded `weak`, was not already escalated, AND did not already run with the caller's expansion on (`callerExpanded`), the op re-runs once at `limit: max(effectiveLimit, 50)` with expansion + relational on and autocut off, keeping the better-graded run. `buildRetrievalResponseMeta(ctx, scope, …)` is the ONE producer of the `retrieval` response-meta channel (keyword-only path included): when a remote caller's scope holds pages of any kind below the safe-chunk index version (`hasUnsealedPagesInScope`: sargable `chunker_version < SAFE_FENCE_CHUNKER_VERSION` LIMIT 1 probe served by the unsealed-only partial `pages_safe_chunk_pending_idx` — NOT the COALESCE `safeChunksFilter` form; pinned by `test/search-safe-index-probe.test.ts`; fail-open; retains source, private, quarantine and live-page policy), it appends the `safe_index_pending` degraded stage to empty and partial results alike, so neither reads as a clean or complete answer; the drain is `gbrain repair safe-chunks`. The withholding itself is unchanged. Empty and nonempty replies also carry projection_readiness, with projection_pending/projection_status_unknown degradation when appropriate (projection_by_design when the only unsealed pages in scope are protected-OCR images, #6803). Vector candidate incompleteness and scoped pool details survive the public CLI/MCP serialization boundary; public type filters constrain the current-projection probe. Retrieval output copies and sanitizes result/metadata after grading and capture using the canonical scanner, before snippet truncation; internal pipeline/capture remains unredacted. `searchOutput` then projects the returned rows to the caller's row shape (`src/core/search/lean-rows.ts`: lean for remote callers unless `fields: "full"`, the transport chose full rows, or the caller is trusted-local; a lean row keeps `id` only when `ctx.isCallable('fetch')`, the MCP dispatch predicate `buildOperationContext` threads in, says the caller can call `fetch` (unset keeps it), and prints `score` at 4 significant digits) and reports it as `retrieval.rows` for remote callers and whenever `fields` is passed. The CLI formatter repeats this on JSON, explain and human output. System One: the `query` op asks S4 answerability (`decide.answerability`, diagnostic only) and surfaces `meta.answerability`; the crag escalation re-run keeps S2-S5 off (`rerankOnly`). Each handler times its request (`SearchTimings`, search/stage-timings.ts) and `searchOutput` emits `retrieval.timings` last. The typed-search type check lives in `ops/search-type-filter.ts` (`reconcileTypeFilter`): one statement of per-type `EXISTS` probes over each type's schema-expanded set, with the `DISTINCT` type list for the `type_filter_notice` evaluated only when a probe misses, run `jitOff` and unprepared (a generic plan scans every page per missing type); pinned by `test/search-type-filter-reconcile.test.ts` and `test/e2e/typed-search-jit-postgres.test.ts`. `buildRetrievalResponseMeta` also stamps `stale` on hits whose page's newer file is held, adds `held_files` per source in scope and emits the `held_files` degraded notice (`persistence/held-reads.ts`; Test: `test/held-read-signals.test.ts`); `coverage` counts pending, held and embedding-held items with `could_affect` (`search/retrieval-coverage.ts`). Its safe-index probe, projection readiness, entity saved facts, saved-fact match and held-file coverage run concurrently, each with its own catch; the answer-feedback write runs after them (`test/search-response-meta-concurrency.test.ts`). The saved-fact match is one statement: an uncorrelated `EXISTS` probe (a one-time filter) skips its `LIKE ANY` scan when no fact qualifies. The handlers start the alias fan-out's `resolveQueryEntity` alongside the hybrid search, and `evidenceOutput` reads page trust (`loadPageTrust` over the rows every delivered row is copied from) alongside evidence delivery (`test/search-post-rerank-concurrency.test.ts`). The starter list leaves out (`fullSurfaceOnly`, still accepted) `mode`, `snippet_chars`, `return_window`, `token_budget`, `salience`, `recency`, `fields`, and on `query` `image`/`image_mime`/`embedding_column`, the code params, `detail`, `adaptive_return`, `autocut` and `relational`.- `src/core/ops/sources.ts` — `sources_remove` is confined to the caller's WRITE authority via `assertSourceInCallerWriteScope(ctx, id)` (context.ts): an untrusted caller may hard-remove only its own write source; a federated read grant naming a source does not make it removable; any other id answers `OperationError('not_found', 'Unknown source: <id>')`, byte-identical to a nonexistent source so the error is not an existence oracle. `sources_status` keeps the read-scope helper (`assertSourceInCallerScope`), so a federated grant can still diagnose a source it cannot remove. Trusted local CLI keeps the full operator view. Over HTTP every client carries a write source (registration default `default`) and its own `oauth_clients.source_id` row FK-RESTRICTs removing that source, so hard removal is effectively an operator action (`gbrain sources remove`); a source a remote `sources_admin` caller just created via `sources_add` stays outside its authority until the operator rescopes the client. There is no `sources_archive` op — archive lives in the CLI (`gbrain sources archive`). Pinned by `test/sources-mcp.test.ts` (federated-read-only id → not_found while status still answers; write-source id → removed; unbound → any; local → any; `remote: undefined` fail-closed) and `test/e2e/sources-remote-mcp.test.ts` (real server: not_found before AND after a read-grant widen; operator CLI completes; rescoping `--source` moves the authority).diff --git a/docs/architecture/key-files/core-services-3.md b/docs/architecture/key-files/core-services-3.mdindex a656eef192..fed832f5d5 100644--- a/docs/architecture/key-files/core-services-3.md+++ b/docs/architecture/key-files/core-services-3.md@@ -15,7 +15,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/core/transcripts/` (directory) — the transcript-adapter seam. `types.ts`: the `TranscriptAdapter` contract — `parse(path): AsyncGenerator<ParsedSession, FileDiagnostics>` (one FILE may hold many sessions; the generator RETURN value carries bytes/skipped-lines/zero-session diagnostics so an empty file explains itself), format-specific byte caps (JSONL 50MB hard cap — the 10MB default in `claude-code-jsonl.ts` belongs to the hook-lane tail reader, not imports; monolithic export JSON rejects-not-truncates at 200MB), and the ONE `buildTranscriptSlug` helper (per-provider dirs matching the conversation-archive layout; id suffixes are sha256 prefixes of the session id — hash12 in slugs, hash16 for the dedup identity — never a cleaned prefix of the source id, which would let same-prefix session ids collide). `detect.ts`: adapter registry + head-sample detection (filesystem admission first for every path, explicit format included: symlinks lstat-rejected, an unreadable path carries its `errno`, which ingest copies to the file outcome with a per-cause next step; then the explicit format wins without sniffing) + injectable `harnessRoots` (the confined discovery surface). Adapters, each with a DATED `SPEC_TARGET` + scrubbed fixture + `bytes>0 && sessions==0` drift alarm: `claude-code.ts` (thin wrapper over the shipped `claude-code-jsonl.ts`, which also exposes the full-file `parseClaudeSessionFile` with real per-message timestamps — hook-lane `parseTranscript` output is pinned byte-identical; owns `isClaudeCodeSubagentFile` (a literal `subagents` path segment at ANY depth + `agent-*.jsonl` basename — both `<session>/subagents/agent-*.jsonl` and the workflow-nested `<session>/subagents/workflows/<wf>/agent-*.jsonl` are all-sidechain, zero-turn files carrying the PARENT session id; a project slug containing "subagents" is one segment and never matches) and `isClaudeCodeWorkflowArtifactFile` (everything under `<session>/subagents/workflows/<wf>/` — the agent logs plus the `journal.jsonl` run log that matches no adapter format; a UUID-named session directly under `subagents/` stays discoverable); `discover.ts` and the CLI's `expandPaths` skip both, so they never read as gap-table backlog, drift, or `unknown format` errors that hold the since-last watermark frozen; the adapter sets `expectedEmpty` when zero accepted turn-shaped records and zero skipped lines remain after root metadata/sidechain and explicit non-human user-text filtering. Metadata-only, non-human-text-only, and all-subagent files are understood empties and do not freeze the watermark; accepted turn records that yield no text and unparseable lines still signal drift. Pinned by `test/claude-code-jsonl-origin.test.ts`), `codex.ts` (turn selection is STRUCTURAL: user turns from `event_msg` user_message (through 0.152) or `event_msg` item_completed with item.type UserMessage, text blocks only (0.153+, #5163; a turn recorded in both shapes is kept once, other item types incl. AgentMessage skipped), assistant from `response_item` output_text; a file with assistant turns and zero user turns sets `FileDiagnostics.userTurnsMissing` (codex and claude-code; E-N4), which ingest counts as drift and the session-end hook heartbeats as `degraded`/`no_user_turns` on whole-file reads (pinned by `test/codex-rollout-0154.serial.test.ts`); role user/developer response_items are injected preambles and never leak; identity is `payload.id` — the per-thread id codex embeds in the rollout filename — with `payload.session_id` (the ROOT session shared by every forked/subagent thread) only as the legacy fallback, and the FIRST `session_meta` header wins because a child rollout carries its inherited parent header later in the file; the hook lane's `parseCodexHookTranscript` follows the same two rules), `openclaw.ts` (session header + message lines; `.checkpoint.*.jsonl` snapshots rejected), `hermes.ts` (COPY-THEN-READ of state.db + wal/shm sidecars — readonly WAL opens need -shm write access and lock against a live writer; schema from the installed hermes-agent source; `json:`-prefixed and bare block arrays unwrap to text, image blocks to `[image]`; PROVISIONAL), `grok.ts` (Grok Build session dirs — structural turn selection, sidecar-aware discovery; see its own entry), `chatgpt-export.ts` (the `mapping`-tree current_node walk; branches dropped by design, orphaned parents terminate quietly, latest-leaf fallback; extracted conversations.json only) + `claude-export.ts` (flat chat_messages); both export adapters load through the shared `export-json.ts` (monolithic JSON over the cap REJECTS with a split hint; a zip or wrong-shape file gets the unzip-first hint) and give id-less conversations content-derived fallback ids so two id-less exports cannot dedup-skip or overwrite each other. `render.ts`: session → part pages — imessage-slack line format with the regex IMPORTED from `conversation-parser/builtins.ts` (round-trip pinned), REAL timestamps (missing ones carry forward; zero-timestamp sessions refused — provenance is never fabricated), anchor-shaped BODY lines backslash-escaped (hostile message content cannot forge speakers), quoted facts/takes fence-marker tokens backslash-escaped at the same per-message seam (`gbrain\:facts:begin` — a session that read another page cannot plant a live or unbalanced fence on the transcript page; every fence consumer is a substring matcher, so the escape lands inside the token), fail-closed redaction (secret-scan + `harvest-private-patterns.txt` user patterns, slack-channel default excluded because it eats issue refs; imperatives COUNTED into hash-covered `transcript_import` frontmatter, never content_flag), message-boundary splitting at `PART_TARGET_BYTES` = 45,000 bytes (0.9 × the 50,000-byte content-sanity warn line, so no part takes the oversize-warn branch; far under the embed-skip threshold) with 2-message overlap, part 1 keeps the base slug, `frontmatter.id` unique per part. `ingest.ts`: the engine-facing core — a session whose part-1 `frontmatter.id` already has a live page imports at that page's slug (a renamed or re-dated conversation updates in place instead of being skipped as a cross-slug duplicate), SESSION atomicity (a failed session records its `classifyItemFailure` code and the run continues; a part the coordinator accepted but has not published leaves the session pending under a request id derived from source, slug, revision and content, so a rerun waits on that write and a write that ended without committing is retried under the next attempt id; only run-scoped failures and the `item_failures_systemic` breaker abort the run, GBRA-130 A-2, pinned by `test/pathological/a2-transcripts-ingest.test.ts`), stale-part reconciliation (deletes `part > of` leftovers), session metadata banked in the base page's raw_data as the REDACTED copy and healed by content-compare even on hash-skipped re-runs (a run that died before `putRawData`, or a private pattern added after first import, repairs on the next pass), `cleanScan`/`maxSessionTs` for the watermark. `ingest-facts.ts`: ONE `runExtractConversationFactsCore` invocation (batch `slugs` selector) inside ONE `withBudgetTracker`, `isFactsExtractionEnabled` pre-checked. Pinned by `test/transcript-adapters.test.ts`, `test/transcript-render.test.ts`, `test/transcripts-retitle.test.ts`, `test/transcripts-ingest-pglite.test.ts`, `test/e2e/transcripts-writeback-fidelity.test.ts` (raw files through the adapters into the gold-extractor facts path).-- `src/core/verbs.ts` — MEMORY_VERBS v1: the four frozen protocol verbs (`remember`, `entity`, `synthesize`, `forget`) as first-class Operations, plus `MEMORY_VERBS_VERSION` (single source of truth, =1), `VERB_NAMES`, the hand-authored `RESPONSE_SCHEMAS` registry (Operation carries input params only; response shapes live here and conformance validates LIVE responses against them), and `ERROR_SCHEMA`. The extended `recall` op is defined in ops/facts.ts and registered through operations.ts. Its response registry advertises optional `budget_packing` policy/applied/reason and per-arm integer accounting without changing required default fields or protocol version; `test/protocol-document.test.ts` pins discovery and malformed metadata rejection. The `context_pack` and `delta` fact items advertise optional `fact_id` and `provenance` (#6146). The recall registry advertises optional `facts_order`, `facts_degraded` and per-fact `relevance` (question ranking). RUNTIME LEAF invariant: operations.ts spreads `verbOperations` into its array at module-eval time, so this file must never statically import operations.ts VALUES (type-only imports fine; handlers use dynamic import) — violating it causes a TDZ crash on whichever module evaluates second. Every verb error carries a populated `suggestion` + `protocol_version` (via `verbError` in operations.ts). The `forget` verb deliberately has NO cliHints (CLI_ONLY `forget` dispatches first and would shadow it). Frozen contract: docs/protocol/MEMORY_VERBS_v1.md; pinned by test/memory-verbs-conformance.test.ts.+- `src/core/verbs.ts` — MEMORY_VERBS v1: the four frozen protocol verbs (`remember`, `entity`, `synthesize`, `forget`) as first-class Operations, plus `MEMORY_VERBS_VERSION` (single source of truth, =1), `VERB_NAMES`, the hand-authored `RESPONSE_SCHEMAS` registry (Operation carries input params only; response shapes live here and conformance validates LIVE responses against them), and `ERROR_SCHEMA`. The extended `recall` op is defined in ops/facts.ts and registered through operations.ts. Its response registry advertises optional `budget_packing` policy/applied/reason and per-arm integer accounting without changing required default fields or protocol version; `test/protocol-document.test.ts` pins discovery and malformed metadata rejection. The `context_pack` and `delta` fact items advertise optional `fact_id` and `provenance` (#6146). The recall registry advertises optional `facts_order`, `facts_degraded` and per-fact `relevance` (question ranking). RUNTIME LEAF invariant: operations.ts spreads `verbOperations` into its array at module-eval time, so this file must never statically import operations.ts VALUES (type-only imports fine; handlers use dynamic import) — violating it causes a TDZ crash on whichever module evaluates second. Every verb error carries a populated `suggestion` + `protocol_version` (via `verbError` in operations.ts). The `forget` verb deliberately has NO cliHints (CLI_ONLY `forget` dispatches first and would shadow it). Frozen contract: docs/protocol/MEMORY_VERBS_v1.md; pinned by test/memory-verbs-conformance.test.ts. The starter list leaves out remember's `expected_revision`/`force`/`valid_from`/`infer_entity`/`visibility` and, in `ops/facts.ts`, recall's `budget_policy`/`include_expired`/`supersessions`/`limit`/`grep`/`include_pending`/`return_unit`/`return_window`, context_pack's `since`/`session_id`/`include_private` and delta's `since_slug`/`entities`/`include_private` (`fullSurfaceOnly`); the verbs surface lists every param.- `src/core/verbs/conformance.ts` + `src/core/verbs/conformance-fixtures.ts` — the conformance runner core (transport-agnostic: minimal `ConformanceClient` = list_tools + call_tool) and the embedded fixture set. Deterministic by construction: shape/enum/behavior/round-trip checks only, never ranking quality. Validation is NON-STRICT on extra fields (additive-forever means unknown fields are always legal). Entity-card cases seed via put_page when the target exposes it and skip honestly on verbs-only targets; synthesize is cost-gated behind --synthesize. `validateAgainstSchema` is a minimal JSON-Schema-subset validator (type unions, required, properties, enum, const, items). Fixtures mirror to `test/fixtures/memory-verbs/cases.json` (BrainBench seeds; drift-guarded by the conformance test). The negative self-test (test/memory-verbs-conformance.test.ts) proves the runner FAILS a lying server.- `src/core/entity-references-config.ts` — the one reader for `entity.names_references` (default on: found `names` rows and siblings carry `referenced_by_count` and a row-level `next` to the card) and `entity.record_types` (comma-separated canonical page types, default empty: no `records`), plus `readRowPageStatus` for `entity.row_page_status` (F3, default on: `page_status` on `context_pack` cards and newer-mention rows and on `get_backlinks` rows; record rows keep it when off). `readEntityReferencesConfig(engine)` fails closed to `{namesRow: true, recordTypes: []}`; the names verb and the MCP instruction builder (`readInstructionContent`) both read it. Test: `test/mcp-instructions-references.test.ts`.diff --git a/docs/architecture/key-files/mcp.md b/docs/architecture/key-files/mcp.mdindex d8dbfb7aec..c9715e6500 100644--- a/docs/architecture/key-files/mcp.md+++ b/docs/architecture/key-files/mcp.md@@ -22,7 +22,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/core/mcp-registration.ts` — `REGISTRATION_SURFACE` (`full` since S0, wave 0: callable and advertised; README, docs/mcp, INSTALL_FOR_AGENTS.md and the plugin manifests name the same value, which the S0 grep test in `test/mcp-registration.test.ts` keeps so), `stdioServeArgv(bin, surface = REGISTRATION_SURFACE)` (`null` → bare `serve`) and `registeredSurface(text)` (an existing entry's pinned surface, `null` for bare, `undefined` when no serve command is visible): every stdio registration gbrain writes builds from them (readiness `harness_wiring`, init's quickstart, `bootstrap hooks` for Claude Code / Codex / opencode, the plugin generator, which also refuses root plugin manifests pinned elsewhere). The OpenClaw manifest stays a bare `serve`. Also the HTTP+bearer wiring helpers `connect.ts` re-exports. Test: `test/mcp-registration.test.ts`.- `src/core/serve-log.ts` — serve's own log hygiene (#7246), installed by `src/cli/commands/serve.ts` before `runServe`. For each of stderr, and stdout under `--http` only (stdio serve's stdout is the JSON-RPC channel), whose descriptor is a regular file, it routes console and stream writes through a `ServeLogFile`: `LineDeduper` writes the first occurrence of a line at once and counts repeats inside the window (a leading timestamp ignored), then writes one `[gbrain serve-log] repeated N more time(s) in the last Ws: <line>` line when the window ends or the process exits; rotation is copy-then-truncate on the inherited append-mode descriptor (`<log>.N-1` → `<log>.N`, `<log>` → `<log>.1`, truncate), each write placed at the file's current end, and only when the descriptor's path is known (`/proc/self/fd` or the `serveLogPath`/`serveErrPath` inode) and still names the same inode. TTYs, pipes and journald are untouched. `GBRAIN_SERVE_LOG_MAX_BYTES` (10 MiB; 0 off), `GBRAIN_SERVE_LOG_MAX_FILES` (5), `GBRAIN_SERVE_LOG_DEDUPE_SECONDS` (600; 0 off). Tests: `test/serve-log-7246.test.ts`.-- `src/core/ops/request-tools.ts` — `request_tools`: catalog (no args), descriptors (`{tools}`; D1: an empty list or one with no caller-visible name returns the catalog plus `did_you_mean` drawn only from `visibleOpsForCaller`, never echoing the requested names, so an invisible existing op and a nonexistent one answer byte-identically), and `{surface}`: per OAuth client on HTTP (ceiling, operator lock, rate limit, audit), and on the owner's stdio pipe `widenStdioSession` widens `ctx.stdioSurface` for the session (refused with the persistent route when `mcp.allow_session_widen` is off; clamped by `GBRAIN_MCP_FORCE_SURFACE`; returns `persisted:false, scope:'session'` and the new tools' schemas). A widenable stdio session's catalog lists the full surface. Tests: `test/request-tools.test.ts`, `test/request-tools-stdio.test.ts`.+- `src/core/ops/request-tools.ts` — `request_tools`: catalog (no args), descriptors (`{tools}`; D1: an empty list or one with no caller-visible name returns the catalog plus `did_you_mean` drawn only from `visibleOpsForCaller`, never echoing the requested names, so an invisible existing op and a nonexistent one answer byte-identically), and `{surface}`: per OAuth client on HTTP (ceiling, operator lock, rate limit, audit), and on the owner's stdio pipe `widenStdioSession` widens `ctx.stdioSurface` for the session (refused with the persistent route when `mcp.allow_session_widen` is off; clamped by `GBRAIN_MCP_FORCE_SURFACE`; returns `persisted:false, scope:'session'` and the new tools' schemas). A widenable stdio session's catalog lists the full surface. `{tools}` returns each visible op's registry schema, so a starter client also gets the `fullSurfaceOnly` params its tools/list leaves out (dispatch accepts them on every surface). Tests: `test/request-tools.test.ts`, `test/request-tools-stdio.test.ts`.- `src/mcp/surface.ts` — MCP tool-surface modes: `'verbs'` (exactly the ops marked `verb: true`) | `'starter'` (the ~27-op daily-driver set) | `'full'` (default — identity; existing installs unchanged). `STARTER_OPS` is composed PROGRAMMATICALLY: a spread of `VERB_NAMES` (never a hand-count) + the fallback daily slice (`BRAIN_TOOL_ALLOWLIST` + the agent lane `submit_agent`/`get_agent_job`) + `whoami` + `request_tools` + `capture` (a DIRECT literal, deliberately NOT via the allowlist); re-derived from production usage via `scripts/derive-starter-ops.ts` (paste-in proposal, never an auto-edit). `ALWAYS_INCLUDED_STARTER_OPS` (verbs + `whoami` + `request_tools` + the agent lane + `capture`) is the exported always-set consumed by BOTH `derive-starter-ops.ts` and the advisor starter-fit collector, so neither re-types the composition. `parseSurfaceFlag` (strict, loud reject), `resolveSurface`/`resolveSurfaceWithSource` (flag > config `mcp_surface` > full, the `serve --http` order), `resolveStdioSurface` (stdio: `GBRAIN_SURFACE` > flag > config > full; an invalid env value is returned as `invalidEnv`, never fatal; `surfaceEnvInvalidNotice` builds its notice), `SURFACE_SOURCE_LABEL`, `filterOpsForSurface`, `allowedOpNames`, `createStdioSurfaceState` (the stdio session's one mutable allow-set; `widen(to)` recomputes it, read-only stays read-only), `sessionWidenAllowed` (`mcp.allow_session_widen`, DB > file, default true). `STARTER_OPS` also carries `mute_notice`, the dismissal for the coaching notices starter sessions receive. Enforcement is TWO-layer and fail-closed: the advertised list AND `dispatchToolCall`'s `allowedOps` set (a hidden op returns `unknown_tool` even when called by name) — applied on stdio (server.ts) and BOTH HTTP paths (serve-http.ts after `!localOnly`, and the second transport http-transport.ts). Per-client ceiling machinery (OAuth transport only): `effectiveSurfaceForClient` is the pure composition `clamp(min(server ceiling, client row surface ?? mcp.default_surface_dcr ?? ceiling))`; the per-REQUEST application lives in serve-http.ts's `resolveEffectiveSurface`, which short-circuits a `verbs` ceiling (min() cannot go lower, so the config read is skipped) and, on a default-surface read failure, applies the LAST successfully read default (held per process, fail-closed) so a transient config outage cannot silently widen a NULL-surface client to the ceiling; `resolveClientRowSurface` ignores unknown row values with a bounded warn-once (the column's value space is documented OPEN for future tier names); `resolveDefaultClientSurface` reads the DCR default dual-plane (DB > file > null) and never throws; `clampSurface`/`readForceSurfaceEnv` fold in the `GBRAIN_MCP_FORCE_SURFACE` kill switch — NARROW-ONLY by construction (min(); can never widen past the ceiling). `minSurface`/`surfaceWiderThan` own the verbs < starter < full rank math. Pinned by test/mcp-surface.test.ts (membership, monotonicity verbs ⊆ starter ⊆ full, ceiling + force-narrow cases). `--access read-only` (`parseAccessFlag`, stdio only; HTTP refuses it) intersects the surface with `isReadOnlyOperation` (read scope, not mutating, no required capability scope); `src/mcp/server.ts` uses that one set for tools/list, the capabilities resource (`access`), skill resources and dispatch `allowedOps`. Pinned by `test/serve-stdio-read-only.test.ts`. `mcp.advertised_surface` (`resolveAdvertisedSurface`, DB plane > file plane) narrows only what `tools/list` shows (`advertisedOps`, never wider than the callable set); dispatch keeps the ceiling. Stdio lists the advertised set plus tools `request_tools` described in this session (`OperationContext.revealTools` → `tools/list_changed`); the OAuth HTTP server lists a client's own row surface in full and otherwise the advertised set; the simple bearer transport reads the file plane once at startup. Initialize instructions carry `hiddenCallable` and name `request_tools` when tools are unlisted. `NEW_INSTALL_ADVERTISED_SURFACE` is what a fresh `gbrain init` writes (`'full'` writes nothing; the held-out agent benchmark picks verbs or starter). Pinned by `test/mcp-advertised-surface.test.ts`. Once a session widens (`request_tools {surface}`), the whole widened surface is listed.- `src/mcp/tool-catalog.ts` — `renderToolCatalogMarkdown()`: the docs/TOOL_CATALOG.md renderer. Config-independent + deterministic (no engine/config reads, no timestamps): non-localOnly ops grouped one section per `Operation.area`, per-op first-sentence description (from `buildToolDefs`'s non-strict shape), scope, STARTER_OPS membership, publish-gate key. Generated by `scripts/generate-tool-catalog.ts`; freshness-guarded by `scripts/check-tool-catalog-fresh.sh` in `bun run verify` (the METRIC_GLOSSARY pattern). Pinned by test/tool-catalog.test.ts.diff --git a/docs/mcp/TOOL_REFERENCE.md b/docs/mcp/TOOL_REFERENCE.mdindex d53be8c7fc..63dea0a7f1 100644--- a/docs/mcp/TOOL_REFERENCE.md+++ b/docs/mcp/TOOL_REFERENCE.md@@ -6,6 +6,11 @@ the longer guidance for people: what each starter-surface tool does, itsdefaults, and the edge cases behind each parameter. The served schemasremain the contract; when they and this page differ, the schemas win.+The starter surface lists the parameters an agent needs for the common call.+Local-only, admin, legacy and tuning parameters stay callable on every+surface, and `request_tools {tools: ["name"]}` returns a tool's full schema+with every optional parameter.+Say to your agent: *"Before you call a gbrain tool you have not used yet,check docs/mcp/TOOL_REFERENCE.md for its defaults."*diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex 722d9c8be4..9162f666d0 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -1224,6 +1224,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;// GBRA-175 (stable channel, upgrade restarts every process). `since` is stamped at the merge slot.{ since: '0.60.428.0', id: 'upgrade_restarts_7245', text: '`gbrain upgrade` now restarts every gbrain process this brain runs on the host onto the new build (serve and autopilot through their installed services, the jobs supervisor and its worker with `gbrain jobs supervisor stop` then `start --detach`) and verifies that they all report one build and that the warm CLI socket accepts it. Before installing anything it refuses with `restart_refused` (exit 3) when a process cannot be restarted automatically: a serve or worker started by hand, an autopilot without its service, a running sync, or an MCP server an agent harness started (rerun with `--stop-mcp` to stop those; reconnect gbrain in each harness afterwards). `--no-restart` installs without restarting; `gbrain upgrade --restart-only` restarts onto the installed build (`--dry-run` previews). The autopilot `--swap-only` channel is unchanged.' },{ since: '0.60.428.0', id: 'runtime_build_skew_fails_7245', text: 'doctor `runtime_build_skew` now fails (was a warning) when two or more gbrain builds run on this host, and its fix asks the user before running `gbrain upgrade --restart-only`; one process older than its install alone still warns. New release channel: `gbrain upgrade --channel stable` or `gbrain config set self_upgrade.channel stable` installs only releases a maintainer promoted after the production-shaped soak passed on their exact tree, and the update checks then offer only that release; the default channel (`latest`) is unchanged.' },+ { since: '0.60.433.0', id: 'starter_tools_list_params_gbra156', text: 'The starter MCP tool list is about 27% smaller: it leaves out parameters MCP callers cannot use (local-only, server-set provenance) and rarely needed ones (legacy, admin, versioned skill catalog, image and code search, tuning and recovery knobs with safe defaults). Every left-out parameter is still accepted, and `request_tools {tools: [names]}` now returns each tool\'s full schema with every optional parameter, also on a server capped at starter. Memory verb descriptions no longer start with `MEMORY VERB (v1):`. The verbs and full surfaces list every parameter as before.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */diff --git a/src/core/operation-manifest.generated.ts b/src/core/operation-manifest.generated.tsindex 2ee7cf1e52..9bdd7806fb 100644--- a/src/core/operation-manifest.generated.ts+++ b/src/core/operation-manifest.generated.ts@@ -14,7 +14,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["name": "remember","idempotent": true,"outputRedaction": "no_stored_text",- "description": "MEMORY VERB (v1): save facts with provenance. Set `entity` (the subject) or recall misses it. Branch on `status` (inserted|duplicate|superseded); write_pending: poll get_write_request.",+ "description": "Save facts with provenance; set `entity` (the subject) or recall misses it. Branch on `status`; write_pending: poll get_write_request.","params": {"source_id": {"type": "string",@@ -22,11 +22,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"expected_revision": {"type": "string",- "description": "Revision read; omit to create."+ "description": "Revision read; omit to create.",+ "fullSurfaceOnly": true},"force": {"type": "boolean",- "description": "Ignore the revision."+ "description": "Ignore the revision.",+ "fullSurfaceOnly": true},"request_id": {"type": "string",@@ -63,7 +65,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"valid_from": {"type": "string",- "description": "When true (ISO)."+ "description": "When true (ISO).",+ "fullSurfaceOnly": true},"entity": {"type": "string",@@ -71,7 +74,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"infer_entity": {"type": "boolean",- "description": "Default true."+ "description": "Default true.",+ "fullSurfaceOnly": true},"kind": {"type": "string",@@ -90,7 +94,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["world","private"],- "description": "world (default) or private (local CLI)."+ "description": "world (default) or private (local CLI).",+ "fullSurfaceOnly": true},"replaces": {"type": "string",@@ -118,7 +123,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["mutating": false,"idempotent": true,"outputRedaction": "retrieval",- "description": "MEMORY VERB (v1): person/company/account card, zero LLM. Previews are not evidence: fetch the page before stating status or dates. Miss: found:false with near matches (create_safety). Facts: recall.",+ "description": "Person/company/account card, zero LLM. Previews are not evidence: fetch the page before stating status or dates. Miss: found:false with near matches (create_safety). Facts: recall.","params": {"name": {"type": "string",@@ -166,7 +171,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["mutating": false,"idempotent": true,"outputRedaction": "retrieval",- "description": "[EXPENSIVE / SLOW: LLM calls, costs money] MEMORY VERB (v1): answer a broad question across pages with citations. For lookups use recall or entity.",+ "description": "[EXPENSIVE / SLOW: LLM calls] Cited answer to a broad question across pages. Lookups: recall or entity.","params": {"question": {"type": "string",@@ -200,7 +205,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["name": "forget","idempotent": true,"outputRedaction": "no_stored_text",- "description": "MEMORY VERB (v1): expire a remembered fact by its fact_id (never a page slug). Idempotent; the audit trail is kept.",+ "description": "Expire a remembered fact by its fact_id (never a page slug). Idempotent; the audit trail is kept.","params": {"request_id": {"type": "string",@@ -246,7 +251,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"fuzzy": {"type": "boolean",- "description": "Fuzzy match."+ "description": "Fuzzy match.",+ "fullSurfaceOnly": true},"include_content": {"type": "boolean",@@ -254,7 +260,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"content_only": {"type": "boolean",- "description": "Round-trip fields."+ "description": "Round-trip fields.",+ "fullSurfaceOnly": true},"body": {"type": "string",@@ -357,11 +364,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"include_deleted": {"type": "boolean",- "description": "Soft-deleted too."+ "description": "Soft-deleted too.",+ "fullSurfaceOnly": true},"include_timeline_entries": {"type": "boolean",- "description": "Timeline rows."+ "description": "Timeline rows.",+ "fullSurfaceOnly": true},"grammar_diagnostics": {"type": "boolean",@@ -374,7 +383,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"include_quarantined": {"type": "boolean",- "description": "Admin: quarantined body."+ "description": "Admin: quarantined body.",+ "fullSurfaceOnly": true},"min_trust": {"type": "string",@@ -450,7 +460,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["allow_empty": {"type": "boolean","required": false,- "description": "Allow an empty page."+ "description": "Allow an empty page.",+ "fullSurfaceOnly": true},"allow_shrink": {"type": "boolean",@@ -461,7 +472,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["drop_timeline": {"type": "boolean","required": false,- "description": "No Timeline in content: delete its entries."+ "description": "No Timeline in content: delete its entries.",+ "fullSurfaceOnly": true},"wait_ms": {"type": "number",@@ -470,17 +482,20 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["source_kind": {"type": "string","description": "Server-set remotely.",- "required": false+ "required": false,+ "fullSurfaceOnly": true},"source_uri": {"type": "string","description": "Server-set remotely.",- "required": false+ "required": false,+ "fullSurfaceOnly": true},"ingested_via": {"type": "string","description": "Server-set remotely.",- "required": false+ "required": false,+ "fullSurfaceOnly": true}},"mutating": true,@@ -552,15 +567,16 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"limit": {"type": "number",- "description": "Max rows (default 50; remote max 100)."+ "description": "Remote max 100."},"offset": {"type": "number",- "description": "Rows to skip."+ "description": "Rows to skip.",+ "fullSurfaceOnly": true},"updated_after": {"type": "string",- "description": "Pages updated after this ISO time."+ "description": "ISO time."},"updated_after_slug": {"type": "string",@@ -578,7 +594,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"include_deleted": {"type": "boolean",- "description": "Include soft-deleted pages."+ "description": "Include soft-deleted pages.",+ "fullSurfaceOnly": true},"slug_prefix": {"type": "string",@@ -690,11 +707,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"expected_revision": {"type": "string",- "description": "Revision read; omit to create."+ "description": "Revision read; omit to create.",+ "fullSurfaceOnly": true},"force": {"type": "boolean",- "description": "Ignore the revision."+ "description": "Ignore the revision.",+ "fullSurfaceOnly": true},"request_id": {"type": "string",@@ -712,23 +731,28 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"who": {"type": "string",- "description": "Event: comma-separated entity slugs."+ "description": "Event: comma-separated entity slugs.",+ "fullSurfaceOnly": true},"what": {"type": "string",- "description": "Event."+ "description": "Event.",+ "fullSurfaceOnly": true},"where": {"type": "string",- "description": "Event place."+ "description": "Event place.",+ "fullSurfaceOnly": true},"kind": {"type": "string",- "description": "Event kind."+ "description": "Event kind.",+ "fullSurfaceOnly": true},"depth": {"type": "string",- "description": "Event depth page to link."+ "description": "Event depth page to link.",+ "fullSurfaceOnly": true},"source_kind": {"type": "string",@@ -756,7 +780,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["local_file": {"type": "string","description": "Local CLI only.",- "required": false+ "required": false,+ "fullSurfaceOnly": true},"slug": {"type": "string",@@ -839,7 +864,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["edits": {"type": "array","required": true,- "description": "1 to 50 {old_text, new_text} replacements.",+ "description": "1-50 replacements.","items": {"type": "object","properties": {@@ -1202,7 +1227,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["limit": {"type": "number","default": 25,- "description": "1-100 (default 25)."+ "description": "1-100 (default 25).",+ "fullSurfaceOnly": true},"before": {"type": "string",@@ -1298,7 +1324,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"mode": {"type": "string",- "description": "Local callers only."+ "description": "Local callers only.",+ "fullSurfaceOnly": true},"source_id": {"type": "string",@@ -1319,7 +1346,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"snippet_chars": {"type": "number",- "description": "Chars per row (0 = full)."+ "description": "Chars per row (0 = full).",+ "fullSurfaceOnly": true},"return_unit": {"type": "string",@@ -1334,11 +1362,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"return_window": {"type": "number",- "description": "Window radius 1-3."+ "description": "Window radius 1-3.",+ "fullSurfaceOnly": true},"token_budget": {"type": "number",- "description": "Default 6000."+ "description": "Default 6000.",+ "fullSurfaceOnly": true},"salience": {"type": "string",@@ -1347,7 +1377,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["on","strong"],- "description": "Boost emotional pages."+ "description": "Boost emotional pages.",+ "fullSurfaceOnly": true},"recency": {"type": "string",@@ -1356,7 +1387,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["on","strong"],- "description": "Boost recent pages."+ "description": "Boost recent pages.",+ "fullSurfaceOnly": true},"fields": {"type": "string",@@ -1364,7 +1396,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["lean","full"],- "description": "lean (remote default) or full."+ "description": "lean (remote default) or full.",+ "fullSurfaceOnly": true},"min_trust": {"type": "string",@@ -1403,11 +1436,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"image": {"type": "string",- "description": "Base64 image."+ "description": "Base64 image.",+ "fullSurfaceOnly": true},"image_mime": {"type": "string",- "description": "MIME type of image."+ "description": "MIME type of image.",+ "fullSurfaceOnly": true},"limit": {"type": "number",@@ -1432,7 +1467,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"snippet_chars": {"type": "number",- "description": "Chars per row (0 = full)."+ "description": "Chars per row (0 = full).",+ "fullSurfaceOnly": true},"return_unit": {"type": "string",@@ -1447,11 +1483,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"return_window": {"type": "number",- "description": "Window radius 1-3."+ "description": "Window radius 1-3.",+ "fullSurfaceOnly": true},"token_budget": {"type": "number",- "description": "Evidence token cap."+ "description": "Evidence token cap.",+ "fullSurfaceOnly": true},"expand": {"type": "boolean",@@ -1459,7 +1497,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"detail": {"type": "string",- "description": "low (compiled truth), medium (default) or high (all chunks)."+ "description": "low (compiled truth), medium (default) or high (all chunks).",+ "fullSurfaceOnly": true},"fields": {"type": "string",@@ -1467,27 +1506,33 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["lean","full"],- "description": "lean (remote default) or full."+ "description": "lean (remote default) or full.",+ "fullSurfaceOnly": true},"mode": {"type": "string",- "description": "Local callers only."+ "description": "Local callers only.",+ "fullSurfaceOnly": true},"lang": {"type": "string",- "description": "Code language."+ "description": "Code language.",+ "fullSurfaceOnly": true},"symbol_kind": {"type": "string",- "description": "Code symbol type."+ "description": "Code symbol type.",+ "fullSurfaceOnly": true},"near_symbol": {"type": "string",- "description": "Anchor code symbol."+ "description": "Anchor code symbol.",+ "fullSurfaceOnly": true},"walk_depth": {"type": "number",- "description": "Code walk depth 1-2."+ "description": "Code walk depth 1-2.",+ "fullSurfaceOnly": true},"salience": {"type": "string",@@ -1496,7 +1541,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["on","strong"],- "description": "Boost emotional pages."+ "description": "Boost emotional pages.",+ "fullSurfaceOnly": true},"recency": {"type": "string",@@ -1505,7 +1551,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["on","strong"],- "description": "Boost recent pages."+ "description": "Boost recent pages.",+ "fullSurfaceOnly": true},"since": {"type": "string",@@ -1531,19 +1578,23 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"embedding_column": {"type": "string",- "description": "Registered embedding column."+ "description": "Registered embedding column.",+ "fullSurfaceOnly": true},"adaptive_return": {"type": "boolean",- "description": "true for one answer (fewer rows, never empty); omit for breadth."+ "description": "true for one answer (fewer rows, never empty); omit for breadth.",+ "fullSurfaceOnly": true},"autocut": {"type": "boolean",- "description": "Default on (never empty); false: full top-K for breadth."+ "description": "Default on (never empty); false: full top-K for breadth.",+ "fullSurfaceOnly": true},"relational": {"type": "boolean",- "description": "Relationship-graph arm (default on)."+ "description": "Relationship-graph arm (default on).",+ "fullSurfaceOnly": true},"min_trust": {"type": "string",@@ -1606,7 +1657,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"return_window": {"type": "number",- "description": "Window radius 1-3."+ "description": "Window radius 1-3.",+ "fullSurfaceOnly": true},"token_budget": {"type": "number",@@ -2071,7 +2123,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"all_sources": {"type": "boolean",- "description": "Same as source_id __all__."+ "description": "Same as source_id __all__.",+ "fullSurfaceOnly": true},"limit": {"type": "number",@@ -2129,7 +2182,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"all_sources": {"type": "boolean",- "description": "Same as source_id __all__."+ "description": "Same as source_id __all__.",+ "fullSurfaceOnly": true},"type": {"type": "string",@@ -2229,7 +2283,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"all_sources": {"type": "boolean",- "description": "Same as source_id __all__."+ "description": "Same as source_id __all__.",+ "fullSurfaceOnly": true}},"scope": "read",@@ -2638,7 +2693,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["params": {"schema_version": {"type": "number",- "description": "2 for the source-qualified catalog."+ "description": "2 for the source-qualified catalog.",+ "fullSurfaceOnly": true},"limit": {"type": "number",@@ -2646,15 +2702,18 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"cursor": {"type": "string",- "description": "Version 2 cursor."+ "description": "Version 2 cursor.",+ "fullSurfaceOnly": true},"source_id": {"type": "string",- "description": "Version 2: one source."+ "description": "Version 2: one source.",+ "fullSurfaceOnly": true},"section": {"type": "string",- "description": "Only this routing section."+ "description": "Only this routing section.",+ "fullSurfaceOnly": true},"query": {"type": "string",@@ -2681,27 +2740,33 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["params": {"schema_version": {"type": "number",- "description": "2 for an exact canonical revision."+ "description": "2 for an exact canonical revision.",+ "fullSurfaceOnly": true},"qualified_id": {"type": "string",- "description": "Version 2 skill id."+ "description": "Version 2 skill id.",+ "fullSurfaceOnly": true},"expected_brain_id": {"type": "string",- "description": "Brain id to assert."+ "description": "Brain id to assert.",+ "fullSurfaceOnly": true},"source_incarnation": {"type": "string",- "description": "From discovery."+ "description": "From discovery.",+ "fullSurfaceOnly": true},"pack_id": {"type": "string",- "description": "Pack id."+ "description": "Pack id.",+ "fullSurfaceOnly": true},"revision": {"type": "string",- "description": "Exact revision (default: head)."+ "description": "Exact revision (default: head).",+ "fullSurfaceOnly": true},"name": {"type": "string",@@ -2785,7 +2850,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"source_incarnation": {"type": "string",- "description": "From the qualified catalog."+ "description": "From the qualified catalog.",+ "fullSurfaceOnly": true},"name": {"type": "string",@@ -2793,15 +2859,18 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"pack_id": {"type": "string",- "description": "Pack id."+ "description": "Pack id.",+ "fullSurfaceOnly": true},"qualified_id": {"type": "string",- "description": "Version 2 skill id."+ "description": "Version 2 skill id.",+ "fullSurfaceOnly": true},"expected_brain_id": {"type": "string",- "description": "Brain id to assert."+ "description": "Brain id to assert.",+ "fullSurfaceOnly": true},"revision": {"type": "string",@@ -3820,7 +3889,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"model": {"type": "string",- "description": "provider:model (default: subagent tier)."+ "description": "provider:model (default: subagent tier).",+ "fullSurfaceOnly": true},"allowed_tools": {"type": "array",@@ -3834,15 +3904,18 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["description": "Subset of your write prefixes.","items": {"type": "string"- }+ },+ "fullSurfaceOnly": true},"max_turns": {"type": "number",- "description": "Default 20, max 100."+ "description": "Default 20, max 100.",+ "fullSurfaceOnly": true},"queue": {"type": "string",- "description": "Default \"default\"."+ "description": "Default \"default\".",+ "fullSurfaceOnly": true}},"mutating": true,@@ -4741,15 +4814,14 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["name": "request_tools","idempotent": false,"outputRedaction": "no_stored_text",- "description": "More tools: no arguments lists your catalog; {tools: [names]} returns schemas; {surface} widens it (per client or stdio session).",+ "description": "More tools and params: no arguments lists your catalog; {tools: [names]} returns full schemas, every optional param included; {surface} widens it (per client or stdio session).","area": "discovery","agentCallable": true,"params": {"tools": {"type": "array","items": {- "type": "string",- "description": "A tool name from the catalog."+ "type": "string"},"description": "Tool names to fetch."},@@ -4760,7 +4832,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["starter","full"],- "description": "Surface to widen to (stdio: this session only)."+ "description": "stdio: this session only."}},"scope": "read",@@ -4776,15 +4848,16 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["params": {"days": {"type": "number",- "description": "Window in days (default 14)."+ "description": "Default 14."},"limit": {"type": "number",- "description": "Max results (default 20)."+ "description": "Default 20."},"slugPrefix": {"type": "string",- "description": "Slug prefix."+ "description": "Slug prefix.",+ "fullSurfaceOnly": true},"recency_bias": {"type": "string",@@ -4792,7 +4865,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["flat","on"],- "description": "flat (default) or on (per-prefix decay)."+ "description": "flat (default) or on (per-prefix decay).",+ "fullSurfaceOnly": true}},"cliHints": {@@ -4815,11 +4889,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"lookback_days": {"type": "number",- "description": "Baseline days (default 30)."+ "description": "Baseline days (default 30).",+ "fullSurfaceOnly": true},"sigma": {"type": "number",- "description": "Threshold (default 3)."+ "description": "Threshold (default 3).",+ "fullSurfaceOnly": true}},"cliHints": {@@ -5540,7 +5616,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = []}},- "description": "MEMORY VERB (v1): read facts by entity, since or session_id; `query` also searches pages. Remote callers: world facts only. One card: entity; reasoning: synthesize.",+ "description": "Read facts by entity, since or session_id; `query` also searches pages. Remote callers: world facts only. One card: entity; reasoning: synthesize.","params": {"entity": {"type": "string",@@ -5564,7 +5640,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["facts_first","query_first"],- "description": "Default facts_first."+ "description": "Default facts_first.",+ "fullSurfaceOnly": true},"source_id": {"type": "string",@@ -5580,23 +5657,28 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"include_expired": {"type": "boolean",- "description": "Also expired; question ranks them."+ "description": "Also expired; question ranks them.",+ "fullSurfaceOnly": true},"supersessions": {"type": "boolean",- "description": "Supersession log only."+ "description": "Supersession log only.",+ "fullSurfaceOnly": true},"limit": {"type": "number",- "description": "Per-arm max (default 50, cap 100)."+ "description": "Per-arm max (default 50, cap 100).",+ "fullSurfaceOnly": true},"grep": {"type": "string",- "description": "Text substring."+ "description": "Text substring.",+ "fullSurfaceOnly": true},"include_pending": {"type": "boolean",- "description": "Pending count."+ "description": "Pending count.",+ "fullSurfaceOnly": true},"return_unit": {"type": "string",@@ -5607,11 +5689,13 @@ export const OPERATION_MANIFEST: OperationMeta[] = ["page","auto"],- "description": "results[] unit (see search)."+ "description": "results[] unit (see search).",+ "fullSurfaceOnly": true},"return_window": {"type": "number",- "description": "Window 1-3."+ "description": "Window 1-3.",+ "fullSurfaceOnly": true},"min_trust": {"type": "string",@@ -5646,7 +5730,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = []}},- "description": "MEMORY VERB (v1): core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.",+ "description": "Core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.","params": {"entities": {"type": "string",@@ -5658,15 +5742,18 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"since": {"type": "string",- "description": "Open-thread events after this ISO time."+ "description": "Open-thread events after this ISO time.",+ "fullSurfaceOnly": true},"session_id": {"type": "string",- "description": "Opaque session id."+ "description": "Opaque session id.",+ "fullSurfaceOnly": true},"include_private": {"type": "boolean",- "description": "Local trusted callers only."+ "description": "Local trusted callers only.",+ "fullSurfaceOnly": true},"min_trust": {"type": "string",@@ -5749,7 +5836,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = []}},- "description": "MEMORY VERB (v1): pages, facts, thread events changed since a cursor, zero LLM. Pass session_id, cursor or since.",+ "description": "Pages, facts, thread events changed since a cursor, zero LLM. Pass session_id, cursor or since.","params": {"since": {"type": "string",@@ -5757,7 +5844,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"since_slug": {"type": "string",- "description": "Legacy: next_cursor.slug."+ "description": "Legacy: next_cursor.slug.",+ "fullSurfaceOnly": true},"cursor": {"type": "string",@@ -5765,7 +5853,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"entities": {"type": "string",- "description": "Entities for thread events (max 8)."+ "description": "Entities for thread events (max 8).",+ "fullSurfaceOnly": true},"budget_tokens": {"type": "number",@@ -5777,7 +5866,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [},"include_private": {"type": "boolean",- "description": "Local trusted callers only."+ "description": "Local trusted callers only.",+ "fullSurfaceOnly": true},"min_trust": {"type": "string",diff --git a/src/core/ops/facts.ts b/src/core/ops/facts.tsindex 98543390b2..dcceb507c1 100644--- a/src/core/ops/facts.ts+++ b/src/core/ops/facts.ts@@ -272,23 +272,23 @@ const recall: Operation = {mutating: false,idempotent: true,outputRedaction: { retrieval: { localVerbatim: ['facts'] } },- description: 'MEMORY VERB (v1): read facts by entity, since or session_id; `query` also searches pages. Remote callers: world facts only. One card: entity; reasoning: synthesize.',+ description: 'Read facts by entity, since or session_id; `query` also searches pages. Remote callers: world facts only. One card: entity; reasoning: synthesize.',params: {entity: { type: 'string', description: 'Entity slug; its facts.' },question: { type: 'string', description: 'Rank facts by relevance to it.' },query: { type: 'string', description: 'Also search pages (results[]).' },budget_tokens: { type: 'number', description: 'Token budget; facts pack first.' },- budget_policy: { type: 'string', enum: ['facts_first', 'query_first'], description: 'Default facts_first.' },+ budget_policy: { type: 'string', enum: ['facts_first', 'query_first'], description: 'Default facts_first.', fullSurfaceOnly: true },source_id: { type: 'string', description: 'One readable source.' },since: { type: 'string', description: 'ISO 8601 or "8 hours ago".' },session_id: { type: 'string', description: "This session's facts." },- include_expired: { type: 'boolean', description: 'Also expired; question ranks them.' },- supersessions: { type: 'boolean', description: 'Supersession log only.' },- limit: { type: 'number', description: 'Per-arm max (default 50, cap 100).' },- grep: { type: 'string', description: 'Text substring.' },- include_pending: { type: 'boolean', description: 'Pending count.' },- return_unit: { type: 'string', enum: ['chunk', 'window', 'section', 'page', 'auto'], description: 'results[] unit (see search).' },- return_window: { type: 'number', description: 'Window 1-3.' },+ include_expired: { type: 'boolean', description: 'Also expired; question ranks them.', fullSurfaceOnly: true },+ supersessions: { type: 'boolean', description: 'Supersession log only.', fullSurfaceOnly: true },+ limit: { type: 'number', description: 'Per-arm max (default 50, cap 100).', fullSurfaceOnly: true },+ grep: { type: 'string', description: 'Text substring.', fullSurfaceOnly: true },+ include_pending: { type: 'boolean', description: 'Pending count.', fullSurfaceOnly: true },+ return_unit: { type: 'string', enum: ['chunk', 'window', 'section', 'page', 'auto'], description: 'results[] unit (see search).', fullSurfaceOnly: true },+ return_window: { type: 'number', description: 'Window 1-3.', fullSurfaceOnly: true },min_trust: MIN_TRUST_PARAM,},scope: 'read',@@ -704,13 +704,13 @@ const context_pack: Operation = {mutating: false,idempotent: true,outputRedaction: { retrieval: { localVerbatim: ['facts'] } },- description: 'MEMORY VERB (v1): core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.',+ description: 'Core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.',params: {entities: { type: 'string', description: 'Comma-separated names or slugs (max 8).' },budget_tokens: { type: 'number', description: 'Token budget; cards pack first.' },- since: { type: 'string', description: 'Open-thread events after this ISO time.' },- session_id: { type: 'string', description: 'Opaque session id.' },- include_private: { type: 'boolean', description: 'Local trusted callers only.' },+ since: { type: 'string', description: 'Open-thread events after this ISO time.', fullSurfaceOnly: true },+ session_id: { type: 'string', description: 'Opaque session id.', fullSurfaceOnly: true },+ include_private: { type: 'boolean', description: 'Local trusted callers only.', fullSurfaceOnly: true },min_trust: MIN_TRUST_PARAM,include_quarantined: { type: 'boolean', description: 'Admin or memory_confirm: quarantined cards.', fullSurfaceOnly: true },counterparty: { type: 'string', description: 'Person or company (name or slug): adds a pulled brief of dated items about them.', fullSurfaceOnly: true },@@ -941,15 +941,15 @@ const delta: Operation = {mutating: false,idempotent: true,outputRedaction: { retrieval: { localVerbatim: ['facts'] } },- description: 'MEMORY VERB (v1): pages, facts, thread events changed since a cursor, zero LLM. Pass session_id, cursor or since.',+ description: 'Pages, facts, thread events changed since a cursor, zero LLM. Pass session_id, cursor or since.',params: {since: { type: 'string', description: 'ISO 8601 start time.' },- since_slug: { type: 'string', description: 'Legacy: next_cursor.slug.' },+ since_slug: { type: 'string', description: 'Legacy: next_cursor.slug.', fullSurfaceOnly: true },cursor: { type: 'string', description: 'next_cursor.cursor (exact).' },- entities: { type: 'string', description: 'Entities for thread events (max 8).' },+ entities: { type: 'string', description: 'Entities for thread events (max 8).', fullSurfaceOnly: true },budget_tokens: { type: 'number', description: 'Token budget; pages pack first.' },session_id: { type: 'string', description: 'Session id; keeps a cursor.' },- include_private: { type: 'boolean', description: 'Local trusted callers only.' },+ include_private: { type: 'boolean', description: 'Local trusted callers only.', fullSurfaceOnly: true },min_trust: MIN_TRUST_PARAM,beliefs: { type: 'boolean', fullSurfaceOnly: true, description: 'Add `beliefs`: each belief that changed in the window, before and after, with cause and evidence (belief ledger); entities narrows it.' },},diff --git a/src/core/ops/jobs.ts b/src/core/ops/jobs.tsindex 37b009e7fb..fca8b58e69 100644--- a/src/core/ops/jobs.ts+++ b/src/core/ops/jobs.ts@@ -353,11 +353,11 @@ const submit_agent: Operation = {description: 'Submit an agent job (agent scope; tools and budget bound to your client). Poll get_agent_job.',params: {prompt: { type: 'string', description: 'Task prompt.', required: true },- model: { type: 'string', description: 'provider:model (default: subagent tier).' },+ model: { type: 'string', description: 'provider:model (default: subagent tier).', fullSurfaceOnly: true },allowed_tools: { type: 'array', description: 'Subset of your bound tools.', items: { type: 'string' } },- allowed_slug_prefixes: { type: 'array', description: 'Subset of your write prefixes.', items: { type: 'string' } },- max_turns: { type: 'number', description: 'Default 20, max 100.' },- queue: { type: 'string', description: 'Default "default".' },+ allowed_slug_prefixes: { type: 'array', description: 'Subset of your write prefixes.', items: { type: 'string' }, fullSurfaceOnly: true },+ max_turns: { type: 'number', description: 'Default 20, max 100.', fullSurfaceOnly: true },+ queue: { type: 'string', description: 'Default "default".', fullSurfaceOnly: true },},mutating: true,scope: 'agent',diff --git a/src/core/ops/links.ts b/src/core/ops/links.tsindex 3ff7c306d1..e0e5b2b9ae 100644--- a/src/core/ops/links.ts+++ b/src/core/ops/links.ts@@ -229,6 +229,7 @@ const LINK_SOURCE_ID_PARAM = {const LINK_ALL_SOURCES_PARAM = {type: 'boolean',description: 'Same as source_id __all__.',+ fullSurfaceOnly: true,} as const;const LINK_LIMIT_PARAM = { type: 'number', description: `Rows per call (default ${LINK_READ_DEFAULT_LIMIT}, max ${LINK_READ_MAX_LIMIT}).` } as const;const LINK_CURSOR_PARAM = { type: 'string', description: 'next_cursor from the previous call (same filters).' } as const;diff --git a/src/core/ops/page-edit.ts b/src/core/ops/page-edit.tsindex 4bfc3f20c1..793a27ad6a 100644--- a/src/core/ops/page-edit.ts+++ b/src/core/ops/page-edit.ts@@ -17,7 +17,7 @@ const edit_page: Operation = {expected_revision: { type: 'string', required: true, description: 'From get_page include_content:true.' },edits: {type: 'array', required: true,- description: `1 to ${EDIT_PAGE_MAX_EDITS} {old_text, new_text} replacements.`,+ description: `1-${EDIT_PAGE_MAX_EDITS} replacements.`,items: {type: 'object',properties: {diff --git a/src/core/ops/pages.ts b/src/core/ops/pages.tsindex 7ddce71a7b..38b2ce653f 100644--- a/src/core/ops/pages.ts+++ b/src/core/ops/pages.ts@@ -95,15 +95,15 @@ const get_page: Operation = {description: 'Read a page; `section` or `grep` reads one part. Edit: include_content:true, `content` to put_page, or edit_page. >256 KB: outline+window, then `next`.',params: {slug: { type: 'string', description: 'Page slug.', required: true },- fuzzy: { type: 'boolean', description: 'Fuzzy match.' },+ fuzzy: { type: 'boolean', description: 'Fuzzy match.', fullSurfaceOnly: true },include_content: { type: 'boolean', description: 'Markdown + revision.' },- content_only: { type: 'boolean', description: 'Round-trip fields.' },+ content_only: { type: 'boolean', description: 'Round-trip fields.', fullSurfaceOnly: true },...GET_PAGE_BODY_PARAMS,- include_deleted: { type: 'boolean', description: 'Soft-deleted too.' },- include_timeline_entries: { type: 'boolean', description: 'Timeline rows.' },+ include_deleted: { type: 'boolean', description: 'Soft-deleted too.', fullSurfaceOnly: true },+ include_timeline_entries: { type: 'boolean', description: 'Timeline rows.', fullSurfaceOnly: true },grammar_diagnostics: { type: 'boolean', description: 'Also return every line-grammar finding for the page.', fullSurfaceOnly: true },source_id: { type: 'string', description: "One source, or '__all__'." },- include_quarantined: { type: 'boolean', description: 'Admin: quarantined body.' },+ include_quarantined: { type: 'boolean', description: 'Admin: quarantined body.', fullSurfaceOnly: true },min_trust: MIN_TRUST_PARAM,known_as_of: KNOWN_AS_OF_PARAM,},@@ -338,9 +338,9 @@ const put_page: Operation = {...AGENT_CONTENT_PARAMS,slug: { type: 'string', description: 'Page slug.', required: true },content: { type: 'string', required: true, description: 'Complete markdown (get_page include_content:true).' },- allow_empty: { type: 'boolean', required: false, description: 'Allow an empty page.' },+ allow_empty: { type: 'boolean', required: false, description: 'Allow an empty page.', fullSurfaceOnly: true },allow_shrink: { type: 'boolean', required: false, description: 'Allow content under half a >256 KB page. To add text use append_page, not a re-put; a page over one request goes by begin_page_upload.', fullSurfaceOnly: true },- drop_timeline: { type: 'boolean', required: false, description: 'No Timeline in content: delete its entries.' },+ drop_timeline: { type: 'boolean', required: false, description: 'No Timeline in content: delete its entries.', fullSurfaceOnly: true },wait_ms: WRITE_WAIT_PARAM,// v0.39.3.0 provenance write-through (WARN-8 + A1 + CV6). Optional fields// for trusted local callers (capture CLI, autopilot, dream cycle). Remote@@ -348,9 +348,9 @@ const put_page: Operation = {// server stamps below; the params are accepted on the wire only so the// op schema stays uniform across transports. Audit-trail spoofing is// closed structurally — clients cannot poison source_kind labels.- source_kind: { type: 'string', description: 'Server-set remotely.', required: false },- source_uri: { type: 'string', description: 'Server-set remotely.', required: false },- ingested_via: { type: 'string', description: 'Server-set remotely.', required: false },+ source_kind: { type: 'string', description: 'Server-set remotely.', required: false, fullSurfaceOnly: true },+ source_uri: { type: 'string', description: 'Server-set remotely.', required: false, fullSurfaceOnly: true },+ ingested_via: { type: 'string', description: 'Server-set remotely.', required: false, fullSurfaceOnly: true },},mutating: true,scope: 'write',@@ -506,14 +506,14 @@ const list_pages: Operation = {params: {type: { type: 'string', description: 'Page type.' },tag: { type: 'string', description: 'Tag.' },- limit: { type: 'number', description: 'Max rows (default 50; remote max 100).' },+ limit: { type: 'number', description: 'Remote max 100.' },offset: {- type: 'number', description: 'Rows to skip.',+ type: 'number', description: 'Rows to skip.', fullSurfaceOnly: true,},// v0.29 — surface filter that already exists on PageFilters.updated_after: {type: 'string',- description: 'Pages updated after this ISO time.',+ description: 'ISO time.',},updated_after_slug: {type: 'string',@@ -523,7 +523,7 @@ const list_pages: Operation = {type: 'string', description: 'Default updated_desc.',enum: [...LIST_PAGES_SORT_VALUES],},- include_deleted: { type: 'boolean', description: 'Include soft-deleted pages.' },+ include_deleted: { type: 'boolean', description: 'Include soft-deleted pages.', fullSurfaceOnly: true },slug_prefix: { type: 'string', description: "Literal slug prefix, e.g. 'deals/'.", fullSurfaceOnly: true },where: WHERE_PARAM,// #4400 — list_pages had no source-scoping param at all: unlike@@ -690,10 +690,10 @@ const capture: Operation = {outputRedaction: 'no_stored_text',description: CAPTURE_DESCRIPTION,params: {- ...AGENT_CONTENT_PARAMS,+ ...AGENT_CONTENT_PARAMS, expected_revision: { ...AGENT_CONTENT_PARAMS.expected_revision, fullSurfaceOnly: true }, force: { ...AGENT_CONTENT_PARAMS.force, fullSurfaceOnly: true },...CAPTURE_EVENT_PARAMS, ...CAPTURE_CLI_PROVENANCE_PARAMS,content: { type: 'string', required: true, description: 'Markdown or text (not a file path).' },- local_file: { type: 'string', description: 'Local CLI only.', required: false },+ local_file: { type: 'string', description: 'Local CLI only.', required: false, fullSurfaceOnly: true },slug: { type: 'string', required: false, description: 'Default inbox/<date>-<hash>.' },type: { type: 'string', required: false, description: 'Page type (default note).' },},diff --git a/src/core/ops/persistence.ts b/src/core/ops/persistence.tsindex 9f6beea9c8..03309e3dee 100644--- a/src/core/ops/persistence.ts+++ b/src/core/ops/persistence.ts@@ -185,7 +185,7 @@ export const persistenceOperations: Operation[] = [description: 'Your write receipts in one source, newest first (for a lost request_id).',params: {source_id: { type: 'string', description: 'Default: yours.' },- limit: { type: 'number', default: 25, description: '1-100 (default 25).' },+ limit: { type: 'number', default: 25, description: '1-100 (default 25).', fullSurfaceOnly: true },before: { type: 'string', description: "Previous page's next cursor." },},scope: 'write', mutating: false, area: 'pages',diff --git a/src/core/ops/request-tools.ts b/src/core/ops/request-tools.tsindex 7a314bb31c..1b6fa71b7a 100644--- a/src/core/ops/request-tools.ts+++ b/src/core/ops/request-tools.ts@@ -159,20 +159,20 @@ const request_tools: Operation = {name: 'request_tools',idempotent: false,outputRedaction: 'no_stored_text',- description: 'More tools: no arguments lists your catalog; {tools: [names]} returns schemas; {surface} widens it (per client or stdio session).',+ description: 'More tools and params: no arguments lists your catalog; {tools: [names]} returns full schemas, every optional param included; {surface} widens it (per client or stdio session).',area: 'discovery',// FOV-4: callable by read OR agent scope — discovery for every token class.agentCallable: true,params: {tools: {type: 'array',- items: { type: 'string', description: 'A tool name from the catalog.' },+ items: { type: 'string' },description: 'Tool names to fetch.',},surface: {type: 'string',enum: ['verbs', 'starter', 'full'],- description: 'Surface to widen to (stdio: this session only).',+ description: 'stdio: this session only.',},},scope: 'read',@@ -315,7 +315,10 @@ const request_tools: Operation = {// ── descriptor branch (D5: read-only) ───────────────────────────────if (p.tools !== undefined) {const requested = (p.tools as unknown[]).filter((t): t is string => typeof t === 'string');- const byName = new Map(visible.map(o => [o.name, o]));+ // Registry definitions, not the surface-filtered ones: dispatch accepts a starter op's full-surface-only params, so the details path names them.+ const { operations } = await import('../operations.ts');+ const visibleSet = new Set(visible.map(o => o.name));+ const byName = new Map(operations.filter(o => visibleSet.has(o.name)).map(o => [o.name, o]));const picked: Operation[] = [];const seen = new Set<string>();for (const name of requested) {diff --git a/src/core/ops/salience.ts b/src/core/ops/salience.tsindex 6fb9e72a5a..9644bdf881 100644--- a/src/core/ops/salience.ts+++ b/src/core/ops/salience.ts@@ -29,16 +29,18 @@ const get_recent_salience: Operation = {description: GET_RECENT_SALIENCE_DESCRIPTION,scope: 'read',params: {- days: { type: 'number', description: 'Window in days (default 14).' },- limit: { type: 'number', description: 'Max results (default 20).' },+ days: { type: 'number', description: 'Default 14.' },+ limit: { type: 'number', description: 'Default 20.' },slugPrefix: {type: 'string',description: 'Slug prefix.',+ fullSurfaceOnly: true,},recency_bias: {type: 'string',enum: ['flat', 'on'],description: 'flat (default) or on (per-prefix decay).',+ fullSurfaceOnly: true,},},handler: async (ctx, p) => {@@ -78,10 +80,12 @@ const find_anomalies: Operation = {lookback_days: {type: 'number',description: 'Baseline days (default 30).',+ fullSurfaceOnly: true,},sigma: {type: 'number',description: 'Threshold (default 3).',+ fullSurfaceOnly: true,},},handler: async (ctx, p) => {diff --git a/src/core/ops/search.ts b/src/core/ops/search.tsindex 6af0998086..09b9401c00 100644--- a/src/core/ops/search.ts+++ b/src/core/ops/search.ts@@ -154,6 +154,7 @@ const FIELDS_PARAM = {type: 'string' as const,enum: ['lean', 'full'],description: "lean (remote default) or full.",+ fullSurfaceOnly: true,};/** Evidence delivery params shared by `search` and `query`. */@@ -165,6 +166,7 @@ const RETURN_UNIT_PARAM = {const RETURN_WINDOW_PARAM = {type: 'number' as const,description: 'Window radius 1-3.',+ fullSurfaceOnly: true,};/**@@ -593,7 +595,7 @@ function normalizeTypesParam(ctx: OperationContext, tool: 'search' | 'query', raconst TYPES_PARAM_DESCRIPTION = "Page types, e.g. ['person'].";const SOURCE_ID_PARAM_DESCRIPTION = "One source, or '__all__'.";-const SALIENCE_PARAM = { type: 'string' as const, enum: ['off', 'on', 'strong'], description: 'Boost emotional pages.' };+const SALIENCE_PARAM = { type: 'string' as const, enum: ['off', 'on', 'strong'], description: 'Boost emotional pages.', fullSurfaceOnly: true };/*** Ranking explanation params, declared on `query` only and advertised on the@@ -669,9 +671,9 @@ function finishExplainTarget(const { fix: _fix, ...wire } = diag;return wire as ExplainTargetDiagnosis;}-const RECENCY_PARAM = { type: 'string' as const, enum: ['off', 'on', 'strong'], description: "Boost recent pages." };+const RECENCY_PARAM = { type: 'string' as const, enum: ['off', 'on', 'strong'], description: "Boost recent pages.", fullSurfaceOnly: true };-const SNIPPET_CHARS_PARAM_DESCRIPTION = 'Chars per row (0 = full).';+const SNIPPET_CHARS_PARAM = { type: 'number' as const, description: 'Chars per row (0 = full).', fullSurfaceOnly: true };/** The query op's image branch embed; a brain that opted out of embedding refuses before the image reaches a provider. */async function embedSearchImage(ctx: OperationContext, data: string, mime: string): Promise<Float32Array> {@@ -715,7 +717,7 @@ const search: Operation = {offset: { type: 'number', description: 'Rows to skip.' },match: { type: 'string', enum: ['hybrid', 'keyword'], description: SEARCH_MATCH_DESCRIPTION },cursor: { type: 'string', description: 'From next.' },- mode: { type: 'string', description: 'Local callers only.' },+ mode: { type: 'string', description: 'Local callers only.', fullSurfaceOnly: true },// #4398: per-call source scope, mirroring `query` — MCP clients passed it// here, got 'unknown parameter ignored', and read UNSCOPED results.source_id: { type: 'string', description: SOURCE_ID_PARAM_DESCRIPTION },@@ -723,10 +725,10 @@ const search: Operation = {types: { type: 'array', items: { type: 'string' }, description: TYPES_PARAM_DESCRIPTION },where: WHERE_PARAM,// #3800: subagent token economy — per-call snippet cap.- snippet_chars: { type: 'number', description: SNIPPET_CHARS_PARAM_DESCRIPTION },+ snippet_chars: SNIPPET_CHARS_PARAM,return_unit: RETURN_UNIT_PARAM,return_window: RETURN_WINDOW_PARAM,- token_budget: { type: 'number', description: 'Default 6000.' },+ token_budget: { type: 'number', description: 'Default 6000.', fullSurfaceOnly: true },// #4415: explicit ranking-axis overrides (the same knobs `query` has had// since v0.29.1). The auto-detect banks are English regex, so on a// non-English brain the recency/salience stages never fire — these flags@@ -872,8 +874,8 @@ const query: Operation = {/** v0.27.1: image-similarity search. Path resolved on the CLI side* before the op fires (the op receives raw bytes neither side; the* CLI loads the file, base64-encodes, and passes through `image`). */- image: { type: 'string', description: 'Base64 image.' },- image_mime: { type: 'string', description: 'MIME type of image.' },+ image: { type: 'string', description: 'Base64 image.', fullSurfaceOnly: true },+ image_mime: { type: 'string', description: 'MIME type of image.', fullSurfaceOnly: true },// #4356 — the text/hybrid path no longer hard-defaults this to 20; an// omitted OR falsy (0) `limit` resolves from the active search mode's// searchLimit (10/25/50 for conservative/balanced/tokenmax by default,@@ -896,20 +898,20 @@ const query: Operation = {types: { type: 'array', items: { type: 'string' }, description: TYPES_PARAM_DESCRIPTION },where: WHERE_PARAM,// #3800: subagent token economy — per-call snippet cap.- snippet_chars: { type: 'number', description: SNIPPET_CHARS_PARAM_DESCRIPTION },+ snippet_chars: SNIPPET_CHARS_PARAM,return_unit: RETURN_UNIT_PARAM,return_window: RETURN_WINDOW_PARAM,- token_budget: { type: 'number', description: 'Evidence token cap.' },+ token_budget: { type: 'number', description: 'Evidence token cap.', fullSurfaceOnly: true },expand: { type: 'boolean', description: 'Default off; one LLM call, rarely helps.' },- detail: { type: 'string', description: 'low (compiled truth), medium (default) or high (all chunks).' },+ detail: { type: 'string', description: 'low (compiled truth), medium (default) or high (all chunks).', fullSurfaceOnly: true },fields: FIELDS_PARAM,- mode: { type: 'string', description: 'Local callers only.' },+ mode: { type: 'string', description: 'Local callers only.', fullSurfaceOnly: true },// v0.20.0 Cathedral II Layer 10 C1/C2: language + symbol-kind filters.- lang: { type: 'string', description: 'Code language.' },- symbol_kind: { type: 'string', description: 'Code symbol type.' },+ lang: { type: 'string', description: 'Code language.', fullSurfaceOnly: true },+ symbol_kind: { type: 'string', description: 'Code symbol type.', fullSurfaceOnly: true },// v0.20.0 Cathedral II Layer 7 (A2) / Layer 10 C3: two-pass structural expansion.- near_symbol: { type: 'string', description: 'Anchor code symbol.' },- walk_depth: { type: 'number', description: 'Code walk depth 1-2.' },+ near_symbol: { type: 'string', description: 'Anchor code symbol.', fullSurfaceOnly: true },+ walk_depth: { type: 'number', description: 'Code walk depth 1-2.', fullSurfaceOnly: true },// v0.29.1 — orthogonal recency + salience axes. YOU (the agent) decide.salience: SALIENCE_PARAM,recency: RECENCY_PARAM,@@ -917,10 +919,10 @@ const query: Operation = {until: { type: 'string', description: 'On/before.' },source_id: { type: 'string', description: SOURCE_ID_PARAM_DESCRIPTION },cross_modal: { type: 'string', enum: ['text', 'image', 'both', 'auto'], description: 'Default auto.' },- embedding_column: { type: 'string', description: 'Registered embedding column.' },- adaptive_return: { type: 'boolean', description: 'true for one answer (fewer rows, never empty); omit for breadth.' },- autocut: { type: 'boolean', description: 'Default on (never empty); false: full top-K for breadth.' },- relational: { type: 'boolean', description: 'Relationship-graph arm (default on).' },+ embedding_column: { type: 'string', description: 'Registered embedding column.', fullSurfaceOnly: true },+ adaptive_return: { type: 'boolean', description: 'true for one answer (fewer rows, never empty); omit for breadth.', fullSurfaceOnly: true },+ autocut: { type: 'boolean', description: 'Default on (never empty); false: full top-K for breadth.', fullSurfaceOnly: true },+ relational: { type: 'boolean', description: 'Relationship-graph arm (default on).', fullSurfaceOnly: true },min_trust: MIN_TRUST_PARAM,...EXPLAIN_PARAMS,},diff --git a/src/core/ops/skills-catalog.ts b/src/core/ops/skills-catalog.tsindex bdd81a17b7..8b5aa4df7d 100644--- a/src/core/ops/skills-catalog.ts+++ b/src/core/ops/skills-catalog.ts@@ -29,13 +29,14 @@ const list_skills: Operation = {description: LIST_SKILLS_DESCRIPTION,publishGateKey: 'mcp.publish_skills',params: {- schema_version: { type: 'number', description: '2 for the source-qualified catalog.' },+ schema_version: { type: 'number', description: '2 for the source-qualified catalog.', fullSurfaceOnly: true },limit: { type: 'number', description: 'Page size or rank cap (1-100).' },- cursor: { type: 'string', description: 'Version 2 cursor.' },- source_id: { type: 'string', description: 'Version 2: one source.' },+ cursor: { type: 'string', description: 'Version 2 cursor.', fullSurfaceOnly: true },+ source_id: { type: 'string', description: 'Version 2: one source.', fullSurfaceOnly: true },section: {type: 'string',description: 'Only this routing section.',+ fullSurfaceOnly: true,},query: {type: 'string',@@ -81,12 +82,12 @@ const get_skill: Operation = {description: GET_SKILL_DESCRIPTION,publishGateKey: 'mcp.publish_skills',params: {- schema_version: { type: 'number', description: '2 for an exact canonical revision.' },- qualified_id: { type: 'string', description: 'Version 2 skill id.' },- expected_brain_id: { type: 'string', description: 'Brain id to assert.' },- source_incarnation: { type: 'string', description: 'From discovery.' },- pack_id: { type: 'string', description: 'Pack id.' },- revision: { type: 'string', description: 'Exact revision (default: head).' },+ schema_version: { type: 'number', description: '2 for an exact canonical revision.', fullSurfaceOnly: true },+ qualified_id: { type: 'string', description: 'Version 2 skill id.', fullSurfaceOnly: true },+ expected_brain_id: { type: 'string', description: 'Brain id to assert.', fullSurfaceOnly: true },+ source_incarnation: { type: 'string', description: 'From discovery.', fullSurfaceOnly: true },+ pack_id: { type: 'string', description: 'Pack id.', fullSurfaceOnly: true },+ revision: { type: 'string', description: 'Exact revision (default: head).', fullSurfaceOnly: true },name: {type: 'string',description: 'Skill name from list_skills.',@@ -145,11 +146,11 @@ const get_skill_asset: Operation = {outputRedaction: { exempt: 'skill catalog files are installed instructions read verbatim; redaction would corrupt approved revisions' },scope: 'read', publishGateKey: 'mcp.publish_skills',cliHints: { name: 'skill-asset', positional: [] },- params: { source_id: sharedSkillKeyParams.source_id, source_incarnation: sharedSkillKeyParams.source_incarnation,+ params: { source_id: sharedSkillKeyParams.source_id, source_incarnation: { ...sharedSkillKeyParams.source_incarnation, fullSurfaceOnly: true },name: { type: 'string', description: 'Skill name.' },- pack_id: { type: 'string', description: 'Pack id.' },- qualified_id: { type: 'string', description: 'Version 2 skill id.' },- expected_brain_id: { type: 'string', description: 'Brain id to assert.' },+ pack_id: { type: 'string', description: 'Pack id.', fullSurfaceOnly: true },+ qualified_id: { type: 'string', description: 'Version 2 skill id.', fullSurfaceOnly: true },+ expected_brain_id: { type: 'string', description: 'Brain id to assert.', fullSurfaceOnly: true },revision: { type: 'string', required: true, description: 'Revision from get_skill.' },path: { type: 'string', required: true, description: 'Path in that revision manifest.' } },handler: async (ctx, p) => (await import('../shared-skills/catalog.ts')).getSharedSkillAsset(ctx, { ...sharedSkillReadSelector(p), path: String(p.path ?? '') }),diff --git a/src/core/persistence/params.ts b/src/core/persistence/params.tsindex 6f067a75ad..c56679ad38 100644--- a/src/core/persistence/params.ts+++ b/src/core/persistence/params.ts@@ -2,11 +2,11 @@ import type { ParamDef } from '../ops/contract.ts';/** Capture input sugar stays data; the owner materializes generated fields once. */export const CAPTURE_EVENT_PARAMS: Record<string, ParamDef> = {- who: { type: 'string', description: 'Event: comma-separated entity slugs.' },- what: { type: 'string', description: 'Event.' },- where: { type: 'string', description: 'Event place.' },- kind: { type: 'string', description: 'Event kind.' },- depth: { type: 'string', description: 'Event depth page to link.' },+ who: { type: 'string', description: 'Event: comma-separated entity slugs.', fullSurfaceOnly: true },+ what: { type: 'string', description: 'Event.', fullSurfaceOnly: true },+ where: { type: 'string', description: 'Event place.', fullSurfaceOnly: true },+ kind: { type: 'string', description: 'Event kind.', fullSurfaceOnly: true },+ depth: { type: 'string', description: 'Event depth page to link.', fullSurfaceOnly: true },};/*** #6524: the provenance the trusted local CLI stamps on its own capturesdiff --git a/src/core/verbs.ts b/src/core/verbs.tsindex 46e9b6bd56..8fcb0a7055 100644--- a/src/core/verbs.ts+++ b/src/core/verbs.ts@@ -65,9 +65,11 @@ const remember: Operation = {name: 'remember',idempotent: true,outputRedaction: 'no_stored_text',- description: 'MEMORY VERB (v1): save facts with provenance. Set `entity` (the subject) or recall misses it. Branch on `status` (inserted|duplicate|superseded); write_pending: poll get_write_request.',+ description: 'Save facts with provenance; set `entity` (the subject) or recall misses it. Branch on `status`; write_pending: poll get_write_request.',params: {...AGENT_CONTENT_PARAMS,+ expected_revision: { ...AGENT_CONTENT_PARAMS.expected_revision, fullSurfaceOnly: true },+ force: { ...AGENT_CONTENT_PARAMS.force, fullSurfaceOnly: true },fact: { type: 'string', description: 'One claim.' },items: {type: 'array',@@ -86,6 +88,7 @@ const remember: Operation = {valid_from: {type: 'string',description: 'When true (ISO).',+ fullSurfaceOnly: true,},entity: {type: 'string',@@ -94,6 +97,7 @@ const remember: Operation = {infer_entity: {type: 'boolean',description: 'Default true.',+ fullSurfaceOnly: true,},kind: {type: 'string', description: 'Default fact.',@@ -103,6 +107,7 @@ const remember: Operation = {type: 'string',enum: ['world', 'private'],description: 'world (default) or private (local CLI).',+ fullSurfaceOnly: true,},replaces: { type: 'string', description: 'fact_id this fact replaces (same entity, or none).', fullSurfaceOnly: true },},@@ -220,7 +225,7 @@ const entity: Operation = {mutating: false,idempotent: true,outputRedaction: 'retrieval',- description: 'MEMORY VERB (v1): person/company/account card, zero LLM. Previews are not evidence: fetch the page before stating status or dates. Miss: found:false with near matches (create_safety). Facts: recall.',+ description: 'Person/company/account card, zero LLM. Previews are not evidence: fetch the page before stating status or dates. Miss: found:false with near matches (create_safety). Facts: recall.',params: {name: { type: 'string', description: 'Name, alias or slug.' },names: { type: 'array', items: { type: 'string' }, description: 'Or up to 50 names/codes at once: compact rows.' },@@ -312,7 +317,7 @@ const synthesize: Operation = {mutating: false,idempotent: true,outputRedaction: 'retrieval',- description: '[EXPENSIVE / SLOW: LLM calls, costs money] MEMORY VERB (v1): answer a broad question across pages with citations. For lookups use recall or entity.',+ description: '[EXPENSIVE / SLOW: LLM calls] Cited answer to a broad question across pages. Lookups: recall or entity.',params: {question: { type: 'string', description: 'The question.', required: true },since: { type: 'string', description: 'Window start (ISO 8601).' },@@ -447,7 +452,7 @@ const forget: Operation = {name: 'forget',idempotent: true,outputRedaction: 'no_stored_text',- description: 'MEMORY VERB (v1): expire a remembered fact by its fact_id (never a page slug). Idempotent; the audit trail is kept.',+ description: 'Expire a remembered fact by its fact_id (never a page slug). Idempotent; the audit trail is kept.',params: {request_id: WRITE_REQUEST_PARAM,id: { type: 'string', required: true, description: 'fact_id from remember or recall.' },diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.jsonindex 7400005fa8..a29ea80032 100644--- a/test/fixtures/goldens/cli/tools-json.json+++ b/test/fixtures/goldens/cli/tools-json.json@@ -2,8 +2,8 @@"golden": {"exitCode": 0,"stderr": "",- "stdoutBytes": 262702,- "stdoutSha256": "bfd962a82f16847c7969963ab23410170196491231dcdef214ab3863873b495e",+ "stdoutBytes": 262380,+ "stdoutSha256": "7f06d5a892fa311d10dce3072da5dbc144de4965ee400e0de8cd00ba18aaa982","toolNames": ["remember","entity",@@ -190,7 +190,7 @@],"tools": [{- "description": "MEMORY VERB (v1): save facts with provenance. Set `entity` (the subject) or recall misses it. Branch on `status` (inserted|duplicate|superseded); write_pending: poll get_write_request.",+ "description": "Save facts with provenance; set `entity` (the subject) or recall misses it. Branch on `status`; write_pending: poll get_write_request.","idempotent": true,"local_only": false,"mutating": true,@@ -301,7 +301,7 @@"scope": "write"},{- "description": "MEMORY VERB (v1): person/company/account card, zero LLM. Previews are not evidence: fetch the page before stating status or dates. Miss: found:false with near matches (create_safety). Facts: recall.",+ "description": "Person/company/account card, zero LLM. Previews are not evidence: fetch the page before stating status or dates. Miss: found:false with near matches (create_safety). Facts: recall.","idempotent": true,"local_only": false,"mutating": false,@@ -346,7 +346,7 @@"scope": "read"},{- "description": "[EXPENSIVE / SLOW: LLM calls, costs money] MEMORY VERB (v1): answer a broad question across pages with citations. For lookups use recall or entity.",+ "description": "[EXPENSIVE / SLOW: LLM calls] Cited answer to a broad question across pages. Lookups: recall or entity.","idempotent": true,"local_only": false,"mutating": false,@@ -380,7 +380,7 @@"scope": "read"},{- "description": "MEMORY VERB (v1): expire a remembered fact by its fact_id (never a page slug). Idempotent; the audit trail is kept.",+ "description": "Expire a remembered fact by its fact_id (never a page slug). Idempotent; the audit trail is kept.","idempotent": true,"local_only": false,"mutating": true,@@ -768,7 +768,7 @@"type": "boolean"},"limit": {- "description": "Max rows (default 50; remote max 100).",+ "description": "Remote max 100.","type": "number"},"offset": {@@ -802,7 +802,7 @@"type": "string"},"updated_after": {- "description": "Pages updated after this ISO time.",+ "description": "ISO time.","type": "string"},"updated_after_slug": {@@ -1064,7 +1064,7 @@"schema": {"properties": {"edits": {- "description": "1 to 50 {old_text, new_text} replacements.",+ "description": "1-50 replacements.","items": {"additionalProperties": false,"properties": {@@ -5682,7 +5682,7 @@"scope": "read"},{- "description": "More tools: no arguments lists your catalog; {tools: [names]} returns schemas; {surface} widens it (per client or stdio session).",+ "description": "More tools and params: no arguments lists your catalog; {tools: [names]} returns full schemas, every optional param included; {surface} widens it (per client or stdio session).","idempotent": false,"local_only": false,"mutating": true,@@ -5695,7 +5695,7 @@"schema": {"properties": {"surface": {- "description": "Surface to widen to (stdio: this session only).",+ "description": "stdio: this session only.","enum": ["verbs","starter",@@ -5706,7 +5706,6 @@"tools": {"description": "Tool names to fetch.","items": {- "description": "A tool name from the catalog.","type": "string"},"type": "array"@@ -5733,11 +5732,11 @@"schema": {"properties": {"days": {- "description": "Window in days (default 14).",+ "description": "Default 14.","type": "number"},"limit": {- "description": "Max results (default 20).",+ "description": "Default 20.","type": "number"},"recency_bias": {@@ -6572,7 +6571,7 @@"scope": "write"},{- "description": "MEMORY VERB (v1): read facts by entity, since or session_id; `query` also searches pages. Remote callers: world facts only. One card: entity; reasoning: synthesize.",+ "description": "Read facts by entity, since or session_id; `query` also searches pages. Remote callers: world facts only. One card: entity; reasoning: synthesize.","idempotent": true,"local_only": false,"mutating": false,@@ -6688,7 +6687,7 @@"scope": "read"},{- "description": "MEMORY VERB (v1): core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.",+ "description": "Core memory, budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.","idempotent": true,"local_only": false,"mutating": false,@@ -6790,7 +6789,7 @@"scope": "read"},{- "description": "MEMORY VERB (v1): pages, facts, thread events changed since a cursor, zero LLM. Pass session_id, cursor or since.",+ "description": "Pages, facts, thread events changed since a cursor, zero LLM. Pass session_id, cursor or since.","idempotent": true,"local_only": false,"mutating": false,diff --git a/test/mcp-schema-budget.test.ts b/test/mcp-schema-budget.test.tsindex b8bd37e74b..0caa7a30ee 100644--- a/test/mcp-schema-budget.test.ts+++ b/test/mcp-schema-budget.test.ts@@ -44,6 +44,15 @@* on request_id, examples that repeat the description); the served list is* measured at 24,768 and must keep SERVED_STARTER_MIN_HEADROOM free so the* next description edit does not land on the ceiling again.+ * GBRA-156 (harnesses re-fetch tools/list every turn): the served list was+ * 26,546 bytes; the starter list now leaves out params MCP callers cannot use+ * (local-only, server-set), legacy and duplicate params, admin, versioned+ * skill-catalog, image and code-search params, and tuning or recovery knobs+ * with safe defaults (a refusal that needs one names it). Dispatch accepts+ * them on every surface and request_tools {tools} returns them; MEMORY VERB+ * prefixes went too. Measured 19,489 bytes (17,737 model-visible characters,+ * 4,037 tokens); every ceiling below came down with it, keeping room for the+ * parallel search/query source_ids param.*/import { afterAll, beforeAll, describe, expect, test } from 'bun:test';import { PGLiteEngine } from '../src/core/pglite-engine.ts';@@ -54,12 +63,14 @@ import { stdioVisibleTools } from '../src/mcp/server.ts';import { buildMcpInstructions, GBRAIN_MCP_INSTRUCTIONS } from '../src/mcp/instructions.ts';import { cl100kAvailable, estimateTokens } from '../src/core/chunkers/token-estimate.ts';-const SERVED_STARTER_MAX_CHARS = 25_000;+const SERVED_STARTER_MAX_CHARS = 18_200;/** Headroom the served starter list must keep under the ceiling (wave 16: 24,998 of 25,000 left 2 characters; 200 is what the wave reaches without touching text other threads own, raised to 300 once the entity card and query/search trims land). */const SERVED_STARTER_MIN_HEADROOM = 200;-const SERVED_STARTER_MAX_TOKENS = 5_700;+const SERVED_STARTER_MAX_TOKENS = 4_300;/** The whole tools/list JSON, annotations included (25,735 measured at v0.60.46.0; traverse_graph's `hops` is full-surface-only, 25,941 measured; 26,402 once mute_notice, the dismissal for the coaching notices starter sessions receive, joined starter; 26,671 with #6007's put_page wait_ms param and write guidance, which carry the put_pages hint and the receipt poll rule starter agents need; 26,679 with delta's opaque `cursor` param, paid for by trimming delta's own descriptions, model-visible 24,985; 26,692 with recall's `question` param, paid for by trimming recall's own parameter text, model-visible 24,998; 24,996 after the #6446 merge, recall's grep text trimmed again). */-const SERVED_STARTER_MAX_JSON_CHARS = 26_700;+const SERVED_STARTER_MAX_JSON_CHARS = 19_800; // GBRA-156: 19,431 measured+/** GBRA-156: the UTF-8 bytes of the served starter tools/list result (`{"tools":[...]}`, annotations included) that harnesses re-fetch every turn. */+const SERVED_STARTER_MAX_RESULT_BYTES = 19_800; // 26,546 before GBRA-156, 19,489 after/** 4,042 at the cost wave + 586 for the operator contract's error protocol, notice prefix and memory loop (F1); no schema guidance moved here. */const INSTRUCTIONS_MAX_CHARS = 5_108; // #6007: +240 for the issue-required write guidance (put_pages, wait_ms); Cat 40 Hard round 4: +107 for batching lists of names (entity names, keyword OR) and sending independent calls together; d5b: +70 for the brief naming the fields compact `entity names` rows carry (the maximal rendering, record types enrolled; +39 at the default) instead of a `referenced_by` walk batch mode cannot do; F4: +63 for instruction 7's governing rule (the record whose terms are in effect on the date asked about governs; page dates are named as page dates), 74 characters longer than the "prefer the newest governing source" sentence it replaces, 11 paid by cutting "the best-ranked excerpts" to "top excerpts" in the same clauseconst DESCRIPTION_HARD_CAP = 1_200;@@ -81,6 +92,9 @@ const PARAM_DESCRIPTION_HARD_CAP = 200;* list_write_requests, traverse_graph and list_link_sources lost redundant* words (no pinned phrase, every description still >= 60 characters) so the* served starter list stays at or under 25,000.+ * GBRA-156 lowered the budgets of every tool whose starter params or text it cut+ * to the measured size plus 20-30 (search and query plus about 150, the room+ * their parallel source_ids param needs).* search 1800 -> 1830 (wave 16, #6040 item 1): the redirect reads* `Concepts/landscape or people/companies/projects by topic: \`query\``, measured* at 1,826. Without it Haiku 4.5 routes "all the people that work on X" to@@ -88,13 +102,13 @@ const PARAM_DESCRIPTION_HARD_CAP = 200;* `Name lists: entity names.` stays, so the growth is paid by other tools.*/const TOOL_BUDGETS: Record<string, number> = {- add_timeline_entry: 730, cancel_job: 270, cancel_write_request: 350, capture: 1250, context_pack: 760,- delete_skill: 810, delta: 830, edit_page: 1090, entity: 550, find_anomalies: 520, forget: 560, get_agent_job: 270,- get_backlinks: 770, get_ingest_log: 280, get_page: 930, get_recent_salience: 660, get_skill: 910,- get_skill_asset: 790, get_write_request: 360, join_brain: 560, leave_brain: 540, list_brain_skillpack: 230,- list_link_sources: 220, list_pages: 1060, list_skills: 670, list_write_requests: 450, put_page: 1460,- mute_notice: 460, put_skill: 1420, query: 3100, recall: 1540, remember: 1370, request_tools: 560, resolve_slugs: 410, search: 1830,- submit_agent: 750, sync_brain_skills: 770, synthesize: 550, traverse_graph: 810, whoami: 230,+ add_timeline_entry: 730, cancel_job: 270, cancel_write_request: 350, capture: 710, context_pack: 500,+ delete_skill: 810, delta: 580, edit_page: 1040, entity: 550, find_anomalies: 400, forget: 530, get_agent_job: 270,+ get_backlinks: 710, get_ingest_log: 280, get_page: 510, get_recent_salience: 450, get_skill: 490,+ get_skill_asset: 530, get_write_request: 360, join_brain: 560, leave_brain: 540, list_brain_skillpack: 230,+ list_link_sources: 220, list_pages: 850, list_skills: 400, list_write_requests: 370, put_page: 1090,+ mute_notice: 420, put_skill: 1420, query: 1700, recall: 840, remember: 940, request_tools: 530, resolve_slugs: 410, search: 1420,+ submit_agent: 420, sync_brain_skills: 770, synthesize: 510, traverse_graph: 600, whoami: 230,};/** DX-14: phrases each tool's description must keep. */@@ -147,7 +161,7 @@ async function served(publishSkills: boolean): Promise<Operation[]> {}describe('served starter tool list (Cat 40 configuration)', () => {- test('publish_skills on (the fresh-init default): 35 tools within 25,000 characters', async () => {+ test('publish_skills on (the fresh-init default): 35 tools within the character ceiling', async () => {const ops = await served(true);expect(ops.map(o => o.name)).toContain('get_skill');expect(ops.length).toBe(35);@@ -155,7 +169,7 @@ describe('served starter tool list (Cat 40 configuration)', () => {expect(json(ops)).toBeLessThanOrEqual(SERVED_STARTER_MAX_JSON_CHARS);});- test('publish_skills off: within 25,000 characters', async () => {+ test('publish_skills off: within the character ceiling', async () => {const ops = await served(false);expect(ops.map(o => o.name)).not.toContain('get_skill');expect(size(ops)).toBeLessThanOrEqual(SERVED_STARTER_MAX_CHARS);@@ -168,6 +182,13 @@ describe('served starter tool list (Cat 40 configuration)', () => {}});+ test('the tools/list result stays within its byte budget, publish_skills on and off (GBRA-156)', async () => {+ for (const publishSkills of [true, false]) {+ const bytes = Buffer.byteLength(JSON.stringify({ tools: buildToolDefs(await served(publishSkills)) }));+ expect(bytes, `publish_skills=${publishSkills}`).toBeLessThanOrEqual(SERVED_STARTER_MAX_RESULT_BYTES);+ }+ });+test('cl100k token ceiling', async () => {if (!cl100kAvailable()) return;expect(estimateTokens(JSON.stringify(modelVisible(await served(true))))).toBeLessThanOrEqual(SERVED_STARTER_MAX_TOKENS);diff --git a/test/request-tools.test.ts b/test/request-tools.test.tsindex 70ab56da09..1ec800b786 100644--- a/test/request-tools.test.ts+++ b/test/request-tools.test.ts@@ -199,6 +199,18 @@ describe('request_tools {tools: [...]} descriptor fetch (D5)', () => {const raw = res.content[0].text;expect(raw).not.toContain('no_such_tool_xyz');});++ test('a starter ceiling still returns every parameter the starter tool list omits (GBRA-156)', async () => {+ const res = await dispatchToolCall(engine, 'request_tools', { tools: ['get_page', 'capture', 'query'] }, {+ ...HTTP, surfaceCeiling: 'starter',+ });+ const body = parsed(res);+ const byName = new Map(body.tools.map((t: { name: string; inputSchema: { properties: Record<string, unknown> } }) => [t.name, t.inputSchema.properties]));+ for (const name of ['get_page', 'capture', 'query']) {+ const op = operations.find(o => o.name === name)!;+ expect(Object.keys(byName.get(name) as Record<string, unknown>).sort(), name).toEqual(Object.keys(op.params).sort());+ }+ });});describe('D1: request_tools with an empty or unknown-only list returns the catalog', () => {