Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
P8: record the Cat 40 held-out verdict (narrowing rejected); keep new installs at the full list and drop the pending new-install switch
garrytan2d50b805c210
diff --git a/docs/eval/decisions/p8/SEALED_VERDICTS.md b/docs/eval/decisions/p8/SEALED_VERDICTS.mdindex c5fd3ddaef..971bd351de 100644--- a/docs/eval/decisions/p8/SEALED_VERDICTS.md+++ b/docs/eval/decisions/p8/SEALED_VERDICTS.md@@ -9,7 +9,7 @@ Each part's held-out result, measured by the custodian (P0) against the gates in| Quote grounding (section 6) | supported spans wrongly flagged, Wilson 95% upper bound ≤ 5% | 4.7% wrongly flagged, upper bound 7.6%; the second custodian's rescore with the fixed scorer: 16 of 319 (5.0%), upper bound 8.0% | FAIL | `think.quote_verify` and `dream.quote_verify` off by default (opt-in) || Quote grounding retest (section 6, amendment 2026-10-05) | same gate, fresh sealed quotes | pending (second custodian) | — | stays off until PASS || Semantic withdrawal review (section 3) | precision LB ≥ 0.90, end-to-end recall ≥ 0.60, zero proposals on corrected values, N5 unchanged | precision LB 0.970 (124/124 eval families, 248 actions), end-to-end recall 0.977, 0 proposals on corrected values, N5 contracts pass | PASS | `review_withdraw` on (proposes where the conflict slot is on with a TypeSafe key); reference calibration shipped |-| Advertised tool surface (section 7) | pooled success ≥ control − 3 pts, no leak rise, hidden-tool family ≥ control − 5 pts | pending | — | new installs advertise `full` |+| Advertised tool surface (section 7) | pooled success ≥ control − 3 pts, no leak rise, hidden-tool family ≥ control − 5 pts | `starter` −8.5 pts pooled (95% CI −12.5 to −4.8), hidden-tool −50.0; `verbs` −9.9 pts (−13.3 to −6.7), hidden-tool −21.2; no leaks | FAIL (both arms) | new installs advertise `full`; `mcp.advertised_surface` stays opt-in; `rate_answer` not added as an eighth verb || HTTP graph freshness (report-only) | remote `put_page`: timeline row at commit; mention links after the `links` effect; typed edges only after extract | as stated, on PGLite (`test/remote-graph-freshness.test.ts`) | REPORT | no switch || Duplicate review kinds (section 4) | per kind, as section 3 | not run until P1/P5 enqueue candidates | — | off |@@ -39,6 +39,29 @@ fresh sealed quote set and runs it against the frozen build with the same gate.default until that retest passes. The dream synthesis quote check (`dream.synthesize.quote_verify`) staysbyte-identical to master; none of these changes reach it.+## Advertised tool surface++Cat 40 on P0's seed-disjoint held-out world, callable surface `full` in every arm, uncapped tool results, four+models (`claude-sonnet-5-5`, `gpt-6.1-sol`, `claude-opus-5-5`, `claude-fable-5-1`). Disclosure: per the 2026-10-05+amendment, Fable ran 1 repeat per task; the other models ran 2. Spend about $767 of the $800 limit.++| Arm | Pooled success | Δ vs `full` (95% CI) | Hidden-tool success | Δ vs `full` |+|---|---|---|---|---|+| `full` (control) | 93.2% | — | 96.9% | — |+| `starter` | 84.7% | −8.5 (−12.5 to −4.8) | 46.9% | −50.0 |+| `verbs` | 83.3% | −9.9 (−13.3 to −6.7) | 75.6% | −21.2 |++Neither narrower arm passes the pooled gate (≥ control − 3 points) or the hidden-tool gate (≥ control − 5 points),+so the held-out result rejects narrowing the default list. Hidden-tool tasks collapse under `starter`: GPT goes from+87.5% to 5% and Fable from 100% to 25%. Opus is the only model that passes `starter`; the outcome is the same+without Fable. No arm raised leaks or context exposures, no model sat at a ceiling, and the arms cost about the+same, so the narrower lists saved no tokens.++Default: fresh installs keep advertising every callable tool, and new stdio registrations keep master's+`serve --surface starter` pin. The `mcp.advertised_surface` setting (every tool stays callable; `request_tools`+reaches the unlisted ones) ships as an opt-in. `rate_answer` stays on the `full` surface only and does not join the+verbs.+## HTTP graph freshness (report-only)Measured on master with #6025 (remote bulk writes and mention links) merged in. A remote OAuth `put_page` with adiff --git a/docs/mcp/DEPLOY.md b/docs/mcp/DEPLOY.mdindex eaa2177439..a41c4e8dc1 100644--- a/docs/mcp/DEPLOY.md+++ b/docs/mcp/DEPLOY.md@@ -78,6 +78,12 @@ listing fewer tools to the agent, set `mcp.advertised_surface`:gbrain config set mcp.advertised_surface verbs # list the 7 verbs; everything else stays callable```+Unset is the recommended default. In a held-out agent benchmark, listing only+`starter` or `verbs` lowered task success by 8–10 points pooled across four+frontier models, mostly on tasks that need an unlisted tool (agents rarely+reached for `request_tools`), and saved no tokens. Narrow the list only for a+client that cannot hold the full catalog.+`tools/list` then shows the advertised surface, and the initializeinstructions tell the agent how many more tools are callable. On stdio,`request_tools` with `tools: [names]` returns their schemas and adds them todiff --git a/llms-full.txt b/llms-full.txtindex 6db7989d64..e822ebbdd0 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -8029,6 +8029,12 @@ listing fewer tools to the agent, set `mcp.advertised_surface`:gbrain config set mcp.advertised_surface verbs # list the 7 verbs; everything else stays callable```+Unset is the recommended default. In a held-out agent benchmark, listing only+`starter` or `verbs` lowered task success by 8–10 points pooled across four+frontier models, mostly on tasks that need an unlisted tool (agents rarely+reached for `request_tools`), and saved no tokens. Narrow the list only for a+client that cannot hold the full catalog.+`tools/list` then shows the advertised surface, and the initializeinstructions tell the agent how many more tools are callable. On stdio,`request_tools` with `tools: [names]` returns their schemas and adds them todiff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsvindex 8a1d25fd3a..ae4e024914 100644--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@ -25,7 +25,7 @@ src/core/postgres-engine.ts 2932 ratchet +1 System One v1 evals: search arms clasrc/core/search/hybrid.ts 1586 ratchet +2 System One v1: HybridSearchOpts.decide (search/decide-stage.ts); refactor wave 1 split target (W4 hybrid, cut line); ceiling rationale: docs/architecture/key-files/core-search-1.md entry for src/core/search/hybrid.ts; +10 #5691: per-request embedding_query_prefix read once and threaded to the embeds and cache keysrc/core/types.ts 2210 ratchet +5 System One v1 retrieval lane: SearchResult injection_p/injection_suspected, HybridSearchMeta answerability, egress_denied degraded reason; +4 System One v1: SearchResult rerank_score_kind/decide_evidence, HybridSearchMeta decide/rerank; +3 wave review: PAGE_SORT_SQL.updated_asc source_id + id tiebreakers (total order under federated scopes); +5 #4881: OntologyReadOpts extends PageReadScope doc; +3 #4857: PAGE_SORT_SQL.slug total-order tiebreaker comment; grown v0.46.26.0 megawave: EvidenceOpts, pacing/usage result fields, PageFilters growth (#4352 #4218); wave-k: +9 SalienceOpts/AnomaliesOpts source scope (#3867); +20 2026-09 adversarial batch 2: keyword_relaxed_carried stage + relaxed_dropped meta field docs; +16 2026-09 fix wave: SearchResult.keyword_relaxed field + full fusion-demotion doc; (#3867); +9: #4648 rerank_passthrough degraded stage + empty_result_set/malformed_shape reasons | merged v0.48.1.0 true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); corrective release: shared internal PageReadScope and PageReadPolicy; ranker wave v0.48.4.0: HybridSearchMeta relational_rerank_pin / keyword_arm_confidence / metadata_boost_gate + SearchResult.relational_pinned (+48 over master's peel); +12: #4681 Page.updated_at_iso + keyset cursor precision docs; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: public page revision fields; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: typed vector pool and readiness metadata; merged company ingestion/schema routing changes; retired provider integration removed; +1 write-path wave: 'created' effective-date source; +3 read-path wave: rerank_failed degraded stage + budget reason (closed vocabularies) and its recall classification note; +8 fw3-search: SearchOpts.source_boosts + keyword_arm_failed/title_arm_failed stages; +2 wave-2 W4: ChunkInput.embedding_input_hash (#5553); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +2 at the merge; evidence delivery: optional SearchResult.delivered (+2; shape in search/evidence-delivery.ts); +2 eval wave N1-3: OntologyReadOpts.visibility (remote world-only ontology reads); +4 #5827: GraphNode.source_id and GraphPath from_source_id/to_source_id; +2 #5824: SearchOpts.vectorLegacyGuard rollback switch; +7 #5154: PageFilters.listColumnsOnly (interface field); +11 Foundations 1 F1b: WriteAttributionView + AttributedPageVersion (get_versions / get_write_attribution read shapes); +1 #5988: SearchResult.stale carries the held-file detail (interface field); +6 retrieval feedback: SearchResult feedback_boost/content_hash/relational_path_edges stamps and RelationalFanoutRow.path_edges (interface fields); +2 RelationalFanoutOpts.wide (interface field); 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop)src/core/minions/queue.ts 2528 ratchet grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; security: durable queued authority and confined filesystem dispatch; master integration: grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; merged v0.49: durable authority and delegated admission both enforced; typed readiness, configuration-blocked lifecycle and bounded release; +9: prune archives completed dream synthesis keys; +18 Lane D: deferJob (a deferral returns a job to delayed with no attempt counted and no stacktrace growth); the ceiling had 17 lines of slack; +5 agent operator follow-up Item 5 merged over master: claim-time spend fence token and legacy_default stamp (logic in minions/spend-authorization.ts)-src/commands/init.ts 1877 ratchet grown v0.46.x keyless capability notices; grown db-availability loop: initPostgresCore typed-failure extraction + --prefer-postgres ladder hook + pgvector rethrow fix; +1 at megawave/wave-k merge; +master-merge true-up; wave-k: merge; #3753 --force re-init engine-preservation guard; +1 wave-k merge-union brace (--prefer-postgres close); +10 ambient-writeback WP8: runWritebackNudge consent ask in both engine epilogues (logic lives in core/onboard/writeback-nudge.ts); +4: v0.48.2 reranker readiness at init + test seam; +1: v0.48.2 provider normalization; +3: v0.48.2 review fixes; master integration: +2: preserve typed PGLite busy errors in schema-only init; shared-skills integration on company-ingestion base; retired provider integration removed; retain stored-vector identity on re-init; -14: first-run bundle + quickstart registration helpers live in init-first-run.ts (writeback/skills asks folded into the bundle); +5 agent operator follow-up Item 2: --surface flag (value flag, parse, help line, module-level registration surface, type import) for the printed harness registration; +2 fix wave lane B3: both engine paths stamp a database init created as a fresh install for the behavior_changes notice (core/behavior-change-notice.ts)+src/commands/init.ts 1876 ratchet grown v0.46.x keyless capability notices; grown db-availability loop: initPostgresCore typed-failure extraction + --prefer-postgres ladder hook + pgvector rethrow fix; +1 at megawave/wave-k merge; +master-merge true-up; wave-k: merge; #3753 --force re-init engine-preservation guard; +1 wave-k merge-union brace (--prefer-postgres close); +10 ambient-writeback WP8: runWritebackNudge consent ask in both engine epilogues (logic lives in core/onboard/writeback-nudge.ts); +4: v0.48.2 reranker readiness at init + test seam; +1: v0.48.2 provider normalization; +3: v0.48.2 review fixes; master integration: +2: preserve typed PGLite busy errors in schema-only init; shared-skills integration on company-ingestion base; retired provider integration removed; retain stored-vector identity on re-init; -14: first-run bundle + quickstart registration helpers live in init-first-run.ts (writeback/skills asks folded into the bundle); +5 agent operator follow-up Item 2: --surface flag (value flag, parse, help line, module-level registration surface, type import) for the printed harness registration; +2 fix wave lane B3: both engine paths stamp a database init created as a fresh install for the behavior_changes notice (core/behavior-change-notice.ts)src/commands/integrations.ts 1739 ratchet grown v0.46.26.0 megawave (#4039 connector compat) + 1 nosemgrep dataflow annotation (path-traversal audit); wave-k: exported heartbeatPath seam (#3900)src/core/minions/handlers/subagent.ts 1918 ratchet merged: master v131 settle rework + dream-wave C5 peel + C6 accounting + C7 lease heartbeats/lost-lease aborts + C9 oneshot dispatch + adversarial fix batches; grown by #4078 subagent-loop capability fix; +6 lines (reasoning-item replay: adaptContentBlocksToChatBlocks handles 'reasoning' blocks); +3 wave G #4514: Anthropic-via-OpenRouter allowed on the subagent loop; +36 lines (code review, same PR): isPromptTooLongError walks a bounded .cause chain so it still matches post-normalizeAIError() wrapping, plus extractPromptTooLongDetail so the dead-lettered job's error carries the matched provider detail instead of the generic normalizeAIError() wrapper text; master integration: harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; #5105: +13 call-site wiring to shared tool-write-identity helper across fresh and replay dispatchsrc/commands/bootstrap.ts 2134 ratchet grandfathered at merge (grew past the 1500 cap on master); raised for #4066 HOME_WORKSPACE_GUARD_EXEMPT (status/uninstall/harness); +5 for the harnessDetect test seam (bulk lives in core/bootstrap/harness.ts); +23 for the contract subcommand dispatcher glue (#4105 absorb — bulk lives in core/bootstrap/contract.ts); +codex hooks-consent gate + mcp+hooks receipt registration + uninstall arm; +42 ambient-writeback WP8: interview-time SURFACE_MULTIUSER audience apply (pre-init ordering) + applyDeclaredAudienceFromInterview; +3 #4897 harness usage clause documenting --source ID semantics; +5 #5878: --refresh-skills dispatch and usage lines (logic in core/bootstrap/harness-skills.ts); +11 #5488: SUBCOMMAND_HELP harness entry (gate on --help / -h / help) — CLI help line, cannot move; +11 #4618 seat: --seat/--no-seat help lines and the runHooks parse (parse + notes live in core/bootstrap/hooks.ts parseSeatFlags)diff --git a/src/commands/init.ts b/src/commands/init.tsindex 17babe8943..32cf1542f5 100644--- a/src/commands/init.ts+++ b/src/commands/init.ts@@ -18,7 +18,6 @@ import type { BrainEngine } from '../core/engine.ts';import { readPrimaryEmbeddingStores, readStoredEmbeddingIdentity } from '../core/stored-embedding-identity.ts';import { deferInitJsonError, flushInitJsonResult, initJsonError, setInitJsonResult, writeDeferredInitJsonError } from './init-json.ts';import { deferredEmbeddingHint, firstRunBundle, firstRunJson, harnessRegistrationCommand } from './init-first-run.ts';-import { newInstallAdvertisedSurface } from '../mcp/new-install-surface.ts';import { writeCliNotices } from '../core/interop-notices.ts';import { exitCodeForCode } from '../core/error-catalogue.ts';import { promptLineStderr } from '../core/interaction.ts';@@ -1232,7 +1231,7 @@ export async function initPGLite(opts: {}// PR1: new installs publish their skill catalog over MCP by default// (existing config wins on re-init, so a prior opt-out is preserved).- config.mcp = { ...(freshContentDatabase && !existingFile.engine ? { publish_skills: true, ...newInstallAdvertisedSurface() } : {}), ...(config.mcp ?? {}) };+ config.mcp = { ...(freshContentDatabase && !existingFile.engine ? { publish_skills: true } : {}), ...(config.mcp ?? {}) };// v0.42: new installs default self-upgrade to NOTIFY (a nudge on every// gbrain invocation). mode_prompted=true so the upgrade-time banner doesn't// also fire on a fresh install. Hands-off: gbrain config set self_upgrade.mode auto@@ -1570,7 +1569,7 @@ export async function initPostgresCore(opts: {}// PR1: new installs publish their skill catalog over MCP by default// (existing config wins on re-init, so a prior opt-out is preserved).- config.mcp = { ...(freshContentDatabase && !existingFile.engine ? { publish_skills: true, ...newInstallAdvertisedSurface() } : {}), ...(config.mcp ?? {}) };+ config.mcp = { ...(freshContentDatabase && !existingFile.engine ? { publish_skills: true } : {}), ...(config.mcp ?? {}) };// v0.42: new installs default self-upgrade to NOTIFY (a nudge on every// gbrain invocation). mode_prompted=true so the upgrade-time banner doesn't// also fire on a fresh install. Hands-off: gbrain config set self_upgrade.mode autodiff --git a/src/core/mcp-registration.ts b/src/core/mcp-registration.tsindex 5f22ac14c5..afc0457e20 100644--- a/src/core/mcp-registration.ts+++ b/src/core/mcp-registration.ts@@ -11,7 +11,6 @@import { shellQuote } from './shell-quote.ts';import type { McpSurface } from '../mcp/surface.ts';-import { newInstallServeSurface } from '../mcp/new-install-surface.ts';export { shellQuote };@@ -20,11 +19,8 @@ export { shellQuote };* memory verbs plus the page reads/writes, timeline write, skills and agent* lane bootstrap's instructions name (`get_timeline` is the known gap the F6* hint and `request_tools` cover), and stays far below the full catalogue.- * Once the held-out benchmark picks an advertised surface for new installs- * (NEW_INSTALL_ADVERTISED_SURFACE), registrations pin `full` and the advertised- * surface narrows the list instead.*/-export const REGISTRATION_SURFACE: McpSurface = newInstallServeSurface();+export const REGISTRATION_SURFACE: McpSurface = 'starter';/** A registration command's surface value (`verbs`, `starter` or `full`). */export function isRegistrationSurface(v: unknown): v is McpSurface {diff --git a/src/mcp/new-install-surface.ts b/src/mcp/new-install-surface.tsdeleted file mode 100644index 608df4c6a4..0000000000--- a/src/mcp/new-install-surface.ts+++ /dev/null@@ -1,27 +0,0 @@-/**- * New-install MCP surface defaults, kept import-free so first-run and- * readiness code can read them without loading the operation catalog.- */-type Surface = 'verbs' | 'starter' | 'full';--/**- * The surface fresh installs list to agents (`gbrain init` writes it to- * `mcp.advertised_surface`). The held-out agent benchmark chooses between- * 'verbs' and 'starter'; until it does, fresh installs list everything.- */-export const NEW_INSTALL_ADVERTISED_SURFACE: Surface = 'full';--/**- * The `serve --surface` every new stdio registration pins (REGISTRATION_SURFACE- * in core/mcp-registration.ts). Once the benchmark picks an advertised surface,- * registrations call everything (`full`) and init's advertised surface narrows- * the list; until then they pin `starter`.- */-export function newInstallServeSurface(): Surface {- return NEW_INSTALL_ADVERTISED_SURFACE === 'full' ? 'starter' : 'full';-}--/** What a fresh `gbrain init` writes into `mcp`: the advertised surface, unless it is 'full'. */-export function newInstallAdvertisedSurface(): { advertised_surface?: 'verbs' | 'starter' } {- return NEW_INSTALL_ADVERTISED_SURFACE === 'full' ? {} : { advertised_surface: NEW_INSTALL_ADVERTISED_SURFACE };-}diff --git a/src/mcp/surface.ts b/src/mcp/surface.tsindex c69815afc4..34eb6e4dfb 100644--- a/src/mcp/surface.ts+++ b/src/mcp/surface.ts@@ -38,7 +38,6 @@ import type { BrainEngine } from '../core/engine.ts';import { VERB_NAMES } from '../core/verbs.ts';import { opError } from '../core/ops/contract.ts';import { BRAIN_TOOL_ALLOWLIST } from '../core/minions/tools/brain-allowlist.ts';-export { NEW_INSTALL_ADVERTISED_SURFACE, newInstallAdvertisedSurface, newInstallServeSurface } from './new-install-surface.ts';export type McpSurface = 'verbs' | 'starter' | 'full';diff --git a/test/mcp-advertised-surface.test.ts b/test/mcp-advertised-surface.test.tsindex 215b43a255..95ccc913d9 100644--- a/test/mcp-advertised-surface.test.ts+++ b/test/mcp-advertised-surface.test.ts@@ -13,7 +13,7 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';import { ToolListChangedNotificationSchema } from '@modelcontextprotocol/sdk/types.js';import { operations } from '../src/core/operations.ts';-import { advertisedOps, filterOpsForSurface, newInstallAdvertisedSurface, newInstallServeSurface, NEW_INSTALL_ADVERTISED_SURFACE, resolveAdvertisedSurface } from '../src/mcp/surface.ts';+import { advertisedOps, filterOpsForSurface, resolveAdvertisedSurface } from '../src/mcp/surface.ts';import { buildMcpInstructions } from '../src/mcp/instructions.ts';import { keylessBrainEnv } from './helpers/provider-env.ts';@@ -73,15 +73,6 @@ describe('advertised surface (pure)', () => {expect(buildMcpInstructions({ tools: { callable: () => true } })).not.toContain('more are callable');expect(buildMcpInstructions({ tools: { callable: n => n !== 'request_tools', hiddenCallable: 5 } })).not.toContain('more are callable');});- test('new installs: init and registration move together', () => {- if (NEW_INSTALL_ADVERTISED_SURFACE === 'full') {- expect(newInstallAdvertisedSurface()).toEqual({});- expect(newInstallServeSurface()).toBe('starter');- } else {- expect(newInstallAdvertisedSurface()).toEqual({ advertised_surface: NEW_INSTALL_ADVERTISED_SURFACE });- expect(newInstallServeSurface()).toBe('full');- }- });});describe('stdio session', () => {