Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Merge origin/master into gbra200-degraded-stamp (drop sources_not_readable from the stamp codes now that #7598 refuses it)

garrytan6ee16590ad97
diff --cc docs/architecture/key-files/agent-contract.md
index be33db9262,c84e82b0b7..812eb2be8f
--- a/docs/architecture/key-files/agent-contract.md
+++ b/docs/architecture/key-files/agent-contract.md
@@@ -24,8 -25,7 +25,8 @@@ Spec: `docs/designs/AGENT_OPERATOR_WAVE
- `src/cli/json-guard.ts` — picks the `--json` guard mode for an invocation: on only when `jsonRequested(argv)` and the command-table record declares `json: 'document' | 'ndjson'`; wires the E11 `json_document_missing` hook (document mode, exit 0; the event records `command`, `version`, `guard: 'document'` and `exit_code: 0`, never argv values; `outcome` keeps its value, #6629/D26). The guard itself is `installStdoutPipeDelivery({ json })` in `src/core/cli-force-exit.ts`: stdout writes and console.log/info/debug go to stderr, only `writeStdoutFinal`/`writeNdjsonLine` reach fd 1, a non-zero exit with no document writes the fallback document, `spawnCliChild` pipes child stdout to stderr. Test: `test/cli-json-guard.test.ts`. A record whose subcommands differ in shape declares `jsonSubcommands` (keyed by the first positional after the command; `eval`). `writeCliError` adds `status:'error'` to the envelope under the ndjson guard; `writeCliRefusal` (cli-error.ts) keeps a site's pre-v1 stderr line and writes the envelope under `--json`. D5 (`test/cli-contract.test.ts`) has one row per declaration, `<command> <sub>` included.
- `scripts/check-agent-contract.ts` — syntax-only AST scanner (≈2 s) in `bun run verify` and `guards-manifest.tsv` (fixtures `test/fixtures/guards/check-agent-contract.ts/`). Rules: suggestion-less `OperationError`, `throw new Error` in ops/mcp/handlers, hand-built `fix`/`next_action` command strings, legacy advice keys, raw interactive stdin/readline/raw-mode outside `interaction.ts`/`consent.ts`, raw "re-run with --yes" strings outside `consent.ts`, `stdio: 'inherit'` outside `spawnCliChild`, marker literals outside `agent-output.ts`/`agent-markers.ts`, `verify.argv` naming a non-read-only command (read_only command-table records + a static read-only list), plus unregistered codes and code naming (never baselined). Two more never-baselined rules keep every refusal's next step site-specific: `defaulted-suggestion` (a function that builds an error through `opError`, `new OperationError`, `usageError`, `invalidParam` or `hostOnlyError` from a `*suggestion`/`*hint` parameter with a default, an optional marker or a `??` fallback) and `generic-suggestion` (a suggestion whose whole text is a denylisted phrase such as "see --help", "check your input" or "try again", at a constructor or at a call site of a file-local funnel). `funnelSites(files?)` lists every funnel call site (`invalid`, `fail`, `usage`, `deny`, …) with its literal suggestion texts, resolving file-level string constants; `test/helpers/agent-envelope.ts` (`expectFunnelSuggestions`, `envelopeFor`, `caught`) drives the per-funnel table tests in each module's owner test. Per-rule shrink-only baselines in `scripts/agent-contract-baselines/<rule>.tsv`; `--update` lowers them and refuses growth.
- `src/core/interop-notices.ts` — Lane F notice producers (pure; callers emit). `DEGRADED_STAGE_GUIDANCE` (closed, typed exhaustive over recall-affecting stages + the verbs' markers) → one `degraded_recall` notice (kind degraded: names the stages, says a thin result is not proof of absence; fix = the embeddings enablement or a doctor diagnostic; a `rerank_failed` stage names its reason, the `fused_order` fallback and the session's reranker-degraded call count, and when no other stage needs a fix its fix follows the reason: `timeout`/`rate_limited` repeat the same call after 5/20 s (`actor: provider`, `next: wait`), `auth` is the user's key (credentials), the rest run doctor verified by `reranker_health` (`test/rerank-degraded-notice.serial.test.ts`); none on a brain keyless by choice, whose why says no query text was sent and that `gbrain doctor --json` names the enable command). `embeddingOptedOutFor` reads the opt-out markers (search/query degraded reason `embedding_disabled`, recall `keyword_only_embedding_disabled` in `search_degraded` or `facts_degraded.reason`, think `QUESTION_EMBED_SKIPPED_EMBEDDING_DISABLED`); `factEmbeddingDisabled` (src/core/embedding-disabled.ts) gates every query and fact embed. With the call's `_meta.retrieval.coverage`, `degradedRecallNotice` leaves `projection_pending` out when no pending page could match the query, otherwise names the count in its why, and escalates when it is the only stage. `sourceBindingNarrowedNotice` (per-call info: a GBRAIN_SOURCE/.gbrain-source bound stdio read that came back empty while other sources are readable; fix = the explicit `source_id` read). `recallStagesFor` maps recall's `search_degraded` and `facts_degraded.reason` (question ranking) to stages. `recallInteropNotices` is dispatch's one producer call. `chatKeyFix` (credentials + paid, both providers, free fallback, never a key on a command line), `keylessThinkNotice`, `thinkNotSavedNotice`, `degradedDedupNotice`, `privateFactNotice` (#6606: a local... (line truncated to 2000 chars)
- - `src/core/unreadable-sources-notice.ts` — `unreadableSourcesNotice`, dispatch's producer of the per-call `sources_not_readable` notice (kind degraded): an unscoped `search`/`query`/`recall`/`list_pages` from a connection with no source grant (no `allowedSources`, `hasSourceGrant` not true, no stdio binding; OAuth clients always carry a grant) that came back empty while its `federatedSearchScope` holds no live page and another live source does. The why says the result is not proof of absence and never names a hidden source; the fix is the host's `gbrain sources federate <source>` (input `source`), with the token grant named in the why. Never throws (`test/mcp-unreadable-sources-notice.test.ts`).
+ - `src/core/sources-not-readable.ts` — `assertUnscopedReadReachesPages`, the `sources_not_readable` refusal (class host_only) dispatch runs after a handler's empty result (`emptyRead`, so a read that returns rows costs no extra query): an unscoped `search`/`query`/`recall`/`list_pages` (no `source_id`, no non-empty `source_ids`) from a remote connection with no source grant (no `allowedSources`, `hasSourceGrant` not true, no stdio binding; OAuth clients always carry a grant) whose `federatedSearchScope` holds no live page (for `recall` and `query`, no world fact either) while another live, unarchived source does. One `CASE WHEN EXISTS` read, fail-open on any error. The message and suggestion never name a hidden source; the fix is the host's `gbrain sources federate <source>` (`hostFix`, input `source`: ask the user), with the token rescope named in the suggestion. A scope holding pages that matched nothing and a brain with no pages read as before (`test/mcp-sources-not-readable.test.ts`).
+- `src/core/degraded-stamp.ts` — GBRA-200 degraded stamp (pure). `degradedStampFor(op, result, meta, notices)` derives `{reasons}` from the call's `_meta.retrieval.degraded` recall-affecting stages (keyword-only markers normalized to `embed_unavailable`; `projection_pending` dropped when no pending page could match), the result body's degraded fields (recall `search_degraded`/`facts_degraded`, `degraded_reason`, get_page `file_held`, think/synthesize `GATHER_*` warnings, search_exact, open_loops, rank_entities) and the call's `kind: degraded` result notices, read before the notice ledger dedupes them; null when clean. Dispatch writes `_meta.degraded` and appends `degradedStampLine` as the last content block; `src/cli/op-notices.ts` `withDegradedStamp` puts it on a `--json` object as `degraded`, else on stderr (the routed thin-client path uses the server's stamp). Vocabulary: AGENT_OPERATOR_v1.md, "Degraded stamp". Tests: `test/degraded-stamp.test.ts` (each class, pure), `test/degraded-stamp-paths.serial.test.ts` (dispatch on PGLite: provider down, timeout, rank bound, recall, think, keyless dedupe), `test/degraded-stamp-cli.test.ts` (real CLI).
- `src/mcp/status-mode.ts` + `src/commands/serve-status.ts` + `src/commands/serve-http-status.ts` + `src/core/serve-http-status-marker.ts` — F4 status-only serve, stdio and `--http`. cli.ts hands over a host-brain `serve` (not `--fail-fast`/`GBRAIN_SERVE_FAIL_FAST=1`) with no config, an unreadable config, a missing or repair-failed brain, or a PGLite lock held by a live holder; `runStatusModeServe` is the one entry point for both transports and logs `serve_status_mode_enter` / `serve_status_mode_recovered` (`reason`, `transport`, `elapsed_ms`) as one-line JSON on stderr. `probeStatus` reads config + `peekLock` only; `reprobe(state, connect)` is the one re-probe (no lock attempt while blocked, `resetReadinessMemo()` before the throw-only connect from `src/core/engine-connect.ts`); a check that must run on every re-probe hooks the `probeAgain` wrapper in `runStatusModeServe`. stdio: a gated lazy engine (`createDegradedEngine` with the configured `kind`, reconnect `statusReconnect`, ≤1 attempt / 5 s inside tool calls) marked with `StatusModeState`; `statusPayload` → `{status, reason, why (lock owner PID/transport, brain path, config path), fix, user_message, decisions, share_http_plan}`. `--http`: `runHttpStatusServe` binds one `node:http` listener with a mutable handler (`/health` 503 + `Retry-After: 5` + `instance`; `/mcp` stateless SDK server with only `gbrain_status`; every other route a 503 `serve_status_only` envelope), each response built from the allowlist in `httpStatusPayload`/`httpStatusEnvelope` with `reason` collapsed to `unavailable`; a single-flight chained 5 s tick runs the re-probe, and on a connect `runServe(..., { adoptServer })` builds the full app and swaps the handler on the same listener; a failed build disconnects the engine and stays status-only (`brain_unopenable`); SIGINT/SIGTERM during a recovery waits for it, then closes once. The marker `GBRAIN_HOME/serve-http-status-<port>.json` `{pid, instance_nonce, brain_id, bind, port, reason, since}`... (line truncated to 2000 chars)
- `src/mcp/initialize-context.ts` — per-initialize inputs for the generated instructions (`httpInstructionTools`: the tools/list filters with publish gates read on initialize; `instructionReadiness`: config plane + probed tier within 250 ms, HTTP view redacted) and `stdioCapabilityReadiness` (F2). Test: `test/mcp-capabilities-readiness.test.ts`.
- `src/mcp/hidden-tool-hint.ts` + `src/core/ops/cli-equivalent.ts` — F6: on the owner's stdio pipe a real tool outside the surface/read-only access gets `unknown_tool` naming itself and its CLI equivalent (`cliEquivalent`: `cliOnly` argv, curated overrides, `cliHints.name`, else `gbrain call`). Where `request_tools` is callable and session widening is on, the fix is `request_tools {surface:'full'}` (`next: run`, argv kept); otherwise the CLI equivalent with actor `user` and a `user_message`; `why` names the lasting route (`GBRAIN_SURFACE=full` in the harness's per-server env, or a `--surface full` re-registration) and that an inherited `GBRAIN_SURFACE` overrides a pinned `--surface`. Read-only access never offers a widen. HTTP stays opaque. `scripts/generate-plugin-tree.ts` appends the same map as a per-skill note to generated starter-gap skills. Test: `test/hidden-tool-hint.test.ts`. D2: `hiddenToolRoute(op, ToolConnection)` is the one decision for every transport (`callable` | `widen {surface}` | `host {read_only|surface|grant}`): a widen is offered only when the widened connection could call the tool (read-only access, `GBRAIN_MCP_FORCE_SURFACE`, the grant's snapshot/scopes and an operator pin all hold); dispatch builds the connection with `toolConnection(opts)`. `hiddenToolNext` turns a route into the D2 fix (the call itself; request_tools; on HTTP the D4 grant repair; on stdio the CLI equivalent with the call's arguments as flags).
diff --cc docs/protocol/MCP_META_CHANNELS.md
index 6a935112b7,9200bd3611..cbd394887f
--- a/docs/protocol/MCP_META_CHANNELS.md
+++ b/docs/protocol/MCP_META_CHANNELS.md
@@@ -30,9 -30,9 +30,10 @@@ shape for it
| Key | Producer | Contents |
|-----|----------|----------|
- | `brain_hot_memory` | serve-http `metaHook` (`getBrainHotMemoryMeta`) | Hot-memory facts relevant to the call; each fact carries `trust_tier` and `origin`, and `suppressed` (`{withheld, review}`, present only when non-zero) counts unconfirmed agent-written facts activation control withheld, never their content |
+ | `brain_hot_memory` | dispatch `metaHook` on stdio and HTTP (`getBrainHotMemoryMeta`, [details](#brain_hot_memory)) | Hot-memory facts relevant to the call; each fact carries `trust_tier` and `origin`, and `suppressed` (`{withheld, review}`, present only when non-zero) counts unconfirmed agent-written facts activation control withheld, never their content |
-| `retrieval` | `search`/`query` op handlers | `returned_count`, `retrieved_count`, `vector_enabled`, `expansion_applied`, `cache`, `token_budget`, `degraded[]` (closed stage vocabulary), `rerank_degraded` (on a call whose reranker failed: `{reason, fallback: "fused_order", calls_this_session}`; reason is `timeout`, `budget`, `rate_limited`, `unreachable`, `auth` or `provider_error`; no `fields: "full"` needed), `hint` (non-contractual prose), `rows` (`"lean"` or `"full"`: the row shape of content[0]; reported for remote callers and whenever `fields` is passed), `timings` (`{total_ms, stages_ms, other_ms, overlapped_ms?, parts_ms?}`, integer ms, every response; [search-explain.md](../guides/search-explain.md#see-where-the-time-went)) |
+| `degraded` | dispatch (`src/core/degraded-stamp.ts`), on every transport | `{reasons: [...]}`: present only when the result is partial or degraded; sorted, unique stable codes ([AGENT_OPERATOR_v1.md, Degraded stamp](AGENT_OPERATOR_v1.md#degraded-stamp)). Mirrored as the last content block, `[gbrain degraded: <codes>] …` |
+| `retrieval` | `search`/`query` op handlers; `recall` and `find_experts` emit `{degraded[]}` when their page search degraded | `returned_count`, `retrieved_count`, `vector_enabled`, `expansion_applied`, `cache`, `token_budget`, `degraded[]` (closed stage vocabulary), `rerank_degraded` (on a call whose reranker failed: `{reason, fallback: "fused_order", calls_this_session}`; reason is `timeout`, `budget`, `rate_limited`, `unreachable`, `auth` or `provider_error`; no `fields: "full"` needed), `hint` (non-contractual prose), `rows` (`"lean"` or `"full"`: the row shape of content[0]; reported for remote callers and whenever `fields` is passed), `timings` (`{total_ms, stages_ms, other_ms, overlapped_ms?, parts_ms?}`, integer ms, every response; [search-explain.md](../guides/search-explain.md#see-where-the-time-went)) |
+ | `access` | dispatch (`appliedAccessSummary`, `src/core/access/caller.ts`), every remote response that reached the operation | The view the call was answered under: `member` and `groups` it read as (null and `[]` for an unbound caller or an audience of several entries), `audience` (the normalized `on_behalf_of` principals, or null), `policy_rev` (each source's applied folder-rule revision; null on a brain with no restriction), `relaxation` (`none`, `granted_sources` or `operator`: what relaxed `visibility: private`). `whoami` returns the same object as `access.applied`. An attested call adds `actor` (`{system}`); an unlinked `memory_recall` carries `code: "actor_unlinked"`, `member: null` and the id as sent. |
| `warnings` | dispatch strict-params warn mode | `[{code: 'unknown_param', param, suggestion?}]` |
| `pagination` | `list_pages` op handler | `truncated` (more rows match), `limit` (effective), `clamped_from?` (the caller's limit when capped), `next?` (params for the following page: `{sort, updated_after, updated_after_slug}` under `updated_asc`, else `{offset}`). The model-visible counterpart is the `listing_truncated` notice block (kind `info`, never deduped), whose `fix.mcp` is the next-page call. |
@@@ -43,20 -116,43 +117,61 @@@ recall rides content/hooks, not `_meta`
Adding a key: register it in the table above, one producer, additive-forever.
+ ## `brain_hot_memory`: when it appears and how to turn it off
+
+ **When.** On every successful tool call over stdio (`gbrain serve`) and
+ HTTP (`gbrain serve --http`), except `recall`, `extract_facts` and
+ `forget_fact`, whenever the source below has facts to show. Errors never carry
+ it.
+
+ **Which facts.** Up to 10 recent facts from one source: the connection's own
+ source. Over HTTP that is the token's or client's write source (the first id
+ of its source grant), or `default` with no grant. Over stdio it is the source
+ the server resolved (`GBRAIN_SOURCE`, `.gbrain-source`, then `default`). With
+ a `_meta.session_id`, the block holds that session's facts. Without one, or
+ when the session has none, it holds the source's facts from the last 24 hours,
+ unless the host set `context.hot_memory.session_only`. A remote caller only
+ ever gets facts with `visibility: world`, and never a fact from a source its
+ grant can't read.
+
+ **Why it matters for shared sessions.** A member token whose first source is
+ that member's private source (`private-alice-example`) gets that member's own
+ recent facts in the block, such as preferences from a direct message. That is
+ correct for the member's own session. A harness that answers several people in
+ a channel and puts the block into the model's context can carry those facts
+ into a reply everyone reads.
+
+ **Turning it off for one call.** Set `_meta.hot_memory: "off"` on the request,
+ beside `arguments` (MCP request-level `_meta`), or inside the tool arguments
+ (`{"query": "…", "_meta": {"hot_memory": "off"}}`) for clients that fold
+ `_meta` into the arguments. That call's response carries no
+ `brain_hot_memory`. Other values, or no value, leave the block as it is. A
+ channel or shared session should send it on every call. A member's own
+ direct-message session can leave it out. The opt-out removes only this
+ `_meta` block: a `context_pack` or `delta` body still lists the connection's
+ recent facts, so a channel harness should not call them with a member token
+ whose first source is that member's private source.
+
+ ```json
+ {"jsonrpc": "2.0", "id": 7, "method": "tools/call",
+ "params": {"name": "search", "arguments": {"query": "standup time"},
+ "_meta": {"session_id": "channel-a", "hot_memory": "off"}}}
+ ```
++
+## Degraded stamp codes
+
+The codes in `_meta.degraded.reasons` ([AGENT_OPERATOR_v1.md, Degraded stamp](AGENT_OPERATOR_v1.md#degraded-stamp)). The list grows; a code never changes meaning.
+
+| Code | Ops | Meaning |
+|---|---|---|
+| a retrieval stage: `embed_unavailable`, `embed_timeout`, `expansion_failed`, `expansion_partial`, `rescore_skipped`, `vector_arm_failed`, `keyword_arm_failed`, `title_arm_failed`, `budget_dropped_all`, `budget_truncated`, `keyword_zero`, `cache_prestamp`, `rerank_passthrough`, `rerank_failed`, `keyword_relaxed_carried`, `safe_index_pending`, `vector_candidates_incomplete`, `keyword_candidates_incomplete`, `projection_pending`, `projection_by_design`, `projection_status_unknown`, `keyword_count_unavailable` | search, query, recall, find_experts; think and synthesize (their page search) | the stage in `_meta.retrieval.degraded` (every stage except the ranking-only `reranker_skipped`; `projection_pending` only when a pending page could match). `embed_unavailable` also covers a keyless brain and recall's keyword-only markers, so a keyless brain stamps every search |
+| `no_query_terms`, `facts_embedding_column_missing`, `facts_read_failed` | recall | `facts_degraded.reason` of a question-ranked recall |
+| `facts_unembedded` | recall | some facts in scope could not be compared with the question |
+| `deadline`, `server_budget`, `budget_trimmed` | context_pack | `degraded_reason`: the pack is partial |
+| `delta_incomplete` | delta | delta delivered less than is waiting |
+| `file_held` | get_page | the page's newer file is held by sync; this is its last good revision |
+| `gather_hybrid_failed`, `gather_takes_keyword_failed`, `gather_takes_vector_failed`, `gather_graph_failed`, `gather_anchor_hydrate_failed`, `gather_window_floor_failed` | think, synthesize | an evidence stream failed (the matching `GATHER_*_FAILED` warning) |
- | `held_files`, `sources_not_readable`, `references_unavailable`, `mention_index`, `relational_chain`, `graph_walk_truncated`, `pinned_answer_stale` | the ops that emit the notice of that code | a `kind: degraded` notice about this result |
++| `held_files`, `references_unavailable`, `mention_index`, `relational_chain`, `graph_walk_truncated`, `pinned_answer_stale` | the ops that emit the notice of that code | a `kind: degraded` notice about this result |
+| `scan_deadline`, `unreadable_pages` | search_exact | `incomplete_reasons` other than the caller's `limit` |
+| `source_stale`, `held_items` | open_loops | `stale` or `completeness: "partial"` |
+| `link_coverage_behind`, `link_coverage_unread` | rank_entities | `coverage.state` |
diff --cc scripts/module-size-limits.tsv
index 60bbe675d5,eca661562c..66301f1fef
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@@ -34,17 -34,17 +34,17 @@@ src/commands/sources.ts 2102 ratchet +
src/core/link-extraction.ts 2424 ratchet grown v0.46.26.0 megawave: link-aware timeline split + delimiter-outside-links (#3957 #4062 #3737); +37 wave-k #3908 reimpl: isCrossSourceLinksEnabled config ladder; +10 wave #4277: parseTimelineEntries skips generated backlink receipts; +17 #4855: latin-fold in normalizeBasename + dir-hint step tries both slug grammars; +17: #4855 Latin stroke-letter fold; +5: #4873 ./-relative markdown links kept as live references; +34 wave review: `../y.md` sibling links resolve on the DB path + folded bare-wikilink grammar (#4873 class); +62 #4977: role-prior suppression in machine-list sections (rolePriorSuppressedRanges, EntityRef.index); +3 composed with #4985 (variation-selector strip) in the same wave; +4 #4995: markdown-link anchor strip + lowercase-candidate rationale comments; +6 pre-landing review: #4977 suppression on code-stripped content + truthful watermark/section-list comments; T2: source-qualified inference and atomic origin-scoped derived links; canonical attendance evidence, source-qualified orientation, strict attendee resolution, and relocated filesystem link scanner (command export preserved); +4: pack-owned fallback and ambiguous attendee guards Display-label attendance exclusion, indexed evidence membership, and bounded strict resolver caching; attendance-boundary review.; complete attendance resolution and fence-safe evidence traversal; frontmatter discovery, canonical basename admission and code-aware attendance comment masking; exclude inline HTML comment spans from admitted attendance ranges; +17 write-path wave: same-name rule for entity fuzzy matches + rename-alias fallback in makeResolver; +1 #5567: materialized marker ends bullet detail; +30 #5749: unique global-basename step before fuzzy and live keyword resolution (ResolveOptions, watermark note); #5765: bold **Attendees:** label accepted + LINK_EXTRACTOR_VERSION_TS bump note; +10 eval-wave N9-2/N9-3/N12-7: pack frontmatter mappings inherit FRONTMATTER_LINK_MAP direction, page-type-bound pack attended follows canonical attendance, LINK_EXTRACTOR_VERSION_TS bump note; +1 #5623: normalizeBasename collapses hyphen runs like slugifySegment (extractor watermark note); +11 #5562: parseTimelineEntries accepts dated ### headings (FS-extractor parity); +3 eval-wave N12-6: Participants accepted as attendance evidence + LINK_EXTRACTOR_VERSION_TS bump note; +22 P5 wanted pages: AuthoredRef on body link candidates; -33 lowered: P5 moved machine-section ranges to core/machine-sections.ts and stated relation types to core/line-grammar.ts; +7 P5: ExtractPageLinksOptions interface + wikilinkAuthoredRef helper (keeps extractPageLinks under the function-size limit); +32 P5: per-edge verb attachment (attachedVerb, VERB_RULES) + joined-as works_at + extractor watermark note; P5 x temporal-edges merge: verb attachment reads the verb at the link's own position in the window (excerptAnchor) and the within-page dedup (now dedupeCandidates) drops a mention of a target the page also links with a typed edge; links joined only by commas/conjunctions share the verb before the first (coordinated); board roles (BOARD_RE, BOARD_AFTER_RE) resolve to invested_in for an investor page and advises otherwise, never works_at; +1 fix wave 11 #6191: imports targetTakesVerb (role-verb target guard lives in link-target-roles.ts); v0.60.105.0 merge: #5984 Phase 5 link preparation (+6) re-summed over wave 11 at 2211; +109 Q2 Track C: stable verb-rule ids, traceLinkType/explainLinkType (reasons for every typing decision), per-occurrence typer hoisted out of extractPageLinks (makeTypeFor); unit logic lives in core/link-typing-units.ts; +25 Q2 Track C: typing-unit verb rules and vetoes in attachedVerb/traceLinkType, validity stints in explainLinkType; +4 U3: board-seat rule split out of INVESTED_RE (same verb and precedence) and investor-prior/link offsets passed to unit vetoes; +11 U2: locateLink shared by attachedVerb and the U2 post-pass in traceLinkType; -11 lowered: Q2 verdict reverted U2 (locateLink and the post-pass); +21 fix wave 13 P4.10 #6266: resolveSameDirSlug + exported resolveMarkdownLinkSlug, shared with the link validator; +41 Wave B PR 2 lane 2e: extractPageLinks split into extractBodyLinks (window-scoped, offset-shifted, pass-tagged candidates) and frontmatterLinks, plus entityRefPasses, candidateKey, rolePriorPhrases and the roleText/regexBudget/window options, so a segmented page streams through the same extractor (window and merge logic in core/page-body/segment-links.ts); +1 at the #6869 gate-ahead merge: the #6803 wave EXTRACTOR_BUMP_NOTES comment composed with lane 2e (2420 + 1); +3 G5 (GBRA-60): extractBodyLinks masks the ## Links fence (links-fence.ts), whose rows are projected as their own edges
src/core/embedding-migration.ts 1587 ratchet new row: crossed 1500 in v0.46.25.0 fix waves (#4305 #4306 chunk-model truth helpers); retired provider integration removed; safety wave: canonical projection readiness and fact-aware completion; file configuration publication retains lease-row locks; +8 transactional retained-vector rebuildability checks before destructive migration boundaries; archived eligibility: source-locked reconciliation and live/current smoke revalidation; +2 #5680: authorization_generation field and its carry-forward on same-target re-apply (settle idempotency); +10 #5226: plan carries chunks_to_restamp beside chunks_to_embed; +9 #5088: schema transition defers HNSW builds into the marker (deferred_ann_indexes), carry-forward on re-apply, verify blocks on pending/INVALID ANN indexes (build phase in embedding-ann-build.ts); +10 #5088: dim-pinned tables (query_cache, facts, and any later entry of TEXT_EMBEDDING_DIM_PINNED_TABLES) defer their HNSW through the same worklist (DEFERRED_ANN_TABLES, recordDeferredAnnIndexes); +25 wave 8 lane D1 #5885: takes in the dim-pinned column list, plan (takes_to_embed), status (takes_pending) and completion verify; +17 #5334: smoke check samples one representative chunk per distinct page (bounded index-ordered batch walk, longest chunk re-read under the page lock, title-prefixed bounded query); +1 #5334: the smoke-query length limits are shared with the worst-case budget
src/core/github-source.ts 1530 ratchet new row: crossed the 1500 unlisted cap in v0.46.23.0 review fix wave (scope-state gating, client hardening, symlink containment); merged reliability/shared-skills source integration; managed sweep lease wrapper; fix wave 3 lane A: config parser peeled to github-source-config.ts (-47), +account pin wiring and pinned-installation refresh
- src/commands/hook.ts 1932 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read; +1 #5371: the stop-hook dirty probe ignores physical-root ownership metadata (root-metadata.ts, engine-free); 2 core memory: user-prompt context-pressure notice wiring (logic in core/context/pressure.ts; session-start composition in core/context/session-start-output.ts); +3 fix wave 11 W2.1 #6091: PreCompact/SessionEnd capture-time consent record calls (logic in core/context/capture-consent.ts); +5 fix wave 11 W2.9 #6083: the three detached-push call sites skip a managed canonical worktree (push_managed_coordinator) + import; +2 fix wave 11 integration: W1 router help guard import beside the W2 managed-root import; +2 fix wave 13 P4.9 #6399: a header-only Codex rollout ends empty_session, not parser_drift; +3 W14 P4.16 (#5799): banner and SessionStart note read livePushStatuses (predicate in core/workspace-push.ts); +1 W15 P5.7 (#4992): gitChildEnv import for the hook git probes (launches moved onto core/spawn.ts)
+ src/commands/hook.ts 1996 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read; +1 #5371: the stop-hook dirty probe ignores physical-root ownership metadata (root-metadata.ts, engine-free); 2 core memory: user-prompt context-pressure notice wiring (logic in core/context/pressure.ts; session-start composition in core/context/session-start-output.ts); +3 fix wave 11 W2.1 #6091: PreCompact/SessionEnd capture-time consent record calls (logic in core/context/capture-consent.ts); +5 fix wave 11 W2.9 #6083: the three detached-push call sites skip a managed canonical worktree (push_managed_coordinator) + import; +2 fix wave 11 integration: W1 router help guard import beside the W2 managed-root import; +2 fix wave 13 P4.9 #6399: a header-only Codex rollout ends empty_session, not parser_drift; +3 W14 P4.16 (#5799): banner and SessionStart note read livePushStatuses (predicate in core/workspace-push.ts); +1 W15 P5.7 (#4992): gitChildEnv import for the hook git probes (launches moved onto core/spawn.ts); +13 GBRA-188 per-turn brain-first rule: user-prompt emission and its HookIo seam (rule and ledger read in core/setup/brain-first.ts); +3 GBRA-188 plugin lane: GBRAIN_HOOK_LANE=plugin yields to another gbrain lane wiring the event (import, comment and guard; detection in bootstrap/plugin-lanes.ts otherLaneWiresHook); +5 GBRA-243 turn-rule lane: GBRAIN_HOOK_LANE=turn-rule yields to every other lane and answers rule-only (import, two guards and comments; logic in core/setup/turn-hook.ts), user-prompt passes cwd to the scope-aware rule; +34 #8064/#8016/#8028: the session-speaker banking decision at compact, stop and session-end (logic in context/session-speaker.ts), the harness-prompt skip and the lane-scoped parser_drift clear; +1 #8424: hookSessionCwd import (the session directory the hook launcher records; logic in core/setup/hook-launcher.ts); +1 #8424 review: runHook captures the launcher-recorded session directory first (logic in setup/hook-launcher.ts captureHookSessionCwd); +7 #8427: the hook git probes skip core.fsmonitor and run only in the workspace the install receipt names
src/core/chunkers/code.ts 1602 ratchet new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (decorated-python defs #3821, version-gate + timeout chunker fixes); grown wave-g (#4511): named defs never folded into merged chunks; grown #4669: skip WASM parse for languages without TOP_LEVEL_TYPES; +6 N13-1: CodeChunkMetadata.definesFunction field + merge-guard stamp (predicate lives in def-types.ts); +10 Lua grammar swap: GRAMMAR_REVISIONS + chunkerStamp() (per-language re-chunk gate); +4: CodeChunkOptions.timeoutMs (per-call parse cap; markdown fences parse under a short cap) and the "Parsing failed" → ChunkerTimeoutError mapping in parseWithTimeout
- src/core/config.ts 2012 ratchet +2 W5: search.page_rank_cut / page_rank_cut_factor KNOWN_CONFIG_KEYS rows (read in search/page-rank-cut.ts); +3 W3 confidence-gated reranking: search.reranker.gate / gate_min_gap KNOWN_CONFIG_KEYS rows (values parsed in search/crag.ts); re-summed at the W3 merge onto master v0.60.169.0 (1951 measured); +1 budgeted delivery PR 1: the search.auto_packing KNOWN_CONFIG_KEYS row (values validated in search/evidence-packing.ts); +1 #6278: persistence.sync_preparation_ms/maintenance_preparation_ms/preparation_ceiling_ms/max_preparation_attempts/preparation_deadlines key row (logic in persistence/preparation-budget.ts, switches.ts); +22 fix wave 11 W6.2/W6.3 (#5989, #6132): search.cjk_keyword_deadline_ms and search.hnsw_iterative_scan type fields, KNOWN_CONFIG_KEYS rows and the mergeSearchScanKnobs helper that keeps loadConfigWithEngine under its function-size baseline (logic in search/cjk-keyword-deadline.ts, search/hnsw-iterative-scan.ts); +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +2 fix wave 10 lane L1 #4907: cycle.synthesize_concepts.budget_usd registered (validation in cycle/phase-config-values.ts); +2 #5958: dream.propose_takes.call_timeout_ms registered; 3 core memory: memory.core.* and memory.pressure.* known keys; +15 P5: wanted_pages.enabled/remote, line_grammar.enabled/allow_undeclared_types/effective_ranges and put_page.similar_pages key rows (logic in wanted-links.ts, line-grammar.ts, similar-pages.ts); +1 P2 extraction.date_grounding / facts.attribution keys; +1 #6188: fences.normalize registered in KNOWN_CONFIG_KEYS; +2 #6188: fences.repair.max_usd_per_page/per_day key rows; +1 fix wave 12 W2.3 #6231: facts.page_write_notability_filter key row (resolver in facts/notability-filter.ts); +1 #6317: persistence.single_consumer key row (logic in persistence/switches.ts, consumer-election.ts); +2 newer mentions on context_pack cards: mentions.newer_on_cards key row (logic in mentions/newer-mentions.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +1 #5329 (W14 PR3): chronicle.max_events_per_page registered in KNOWN_CONFIG_KEYS (validation in chronicle/config.ts); +2 C1/C2 memory proof wave: search.evidence_date_header + facts.candidate_fusion registry rows; +1 facts.supersession_thresholds registry row (per-model supersession calibration); +1 C4: models.standing_questions key row; +1 search.entity_anchoring key registration (default off; search/entity-anchor.ts); +1 search.query_facts_arm key registration (default off; search/facts-arm.ts); re-summed at the master 6ccf30c3e merge (1871 integration + 1868 master - 1865 base); +1 search.temporal_fact_reserve key registration (default off; search/facts-arm.ts); +1 fix wave 13 PR2: persistence.publication_ceiling_ms (P2.1/P2.3); v0.60.165.0 merge: W14 PR4 +7 and master +2 compose (1947 measured); +1 memory proof wave 2 W1: the recall.question_admission KNOWN_CONFIG_KEYS row (values validated in facts/question-recall.ts); +2 Cat 40 Hard fix wave (#6271) on top: mentions.alias_deny/multiword_aliases/sibling_merge and search.alias_fanout_max/demote_generated KNOWN_CONFIG_KEYS rows (1950 measured); +1 wave 15 P7.1 #5213: cycle.propose_takes.types KNOWN_CONFIG_KEYS row (parse + filter live in cycle/propose-takes.ts); +1 wave 15 P7.2 #6451: autopilot.git_pull KNOWN_CONFIG_KEYS row (read in persistence/automatic-sync-policy.ts); +1 wave 15 P7.3 #6369: cycle.lint.enabled KNOWN_CONFIG_KEYS row (read in cycle/lint-fix-setting.ts); +2 wave 15 P7.4 #5461: think.pages_budget_chars / think.excerpt_ceiling_chars KNOWN_CONFIG_KEYS rows (validation in think/pages-budget.ts); +6 wave 16 G5.1 (#6495): search.keyword_statement_timeout_ms type field, DB merge and KNOWN_CONFIG_KEYS row, toEngineConfig carries it (range + resolver live in postgres-engine/keyword-statement-timeout.ts); +1 GBRA-81 item 1: search.mode_source registered; +1 GBRA-60 S1: search.diverse_pool_depth in the known search keys; +3 #6643: sync.knock_on_refreeze_limit / sync.knock_on_run_limit KNOWN_CONFIG_KEYS rows (read by persistence/sync-run.ts knockOnLimits); +3 #6696: KNOWN_CONFIG_KEYS rows for persistence.maintenance.compaction_stale_hours and refusal_breaker_threshold; +1 wave 5 D5: context.proactive_brief KNOWN_CONFIG_KEYS row (read in context/proactive-brief.ts); +3 Cat 40 next wave part 1: KNOWN_CONFIG_KEYS rows for entity.names_references + entity.record_types + entity.row_page_status (one line), mcp.instructions_governing_rule and search.long_page_unit (re-summed at the 0.60.242.0 merge: master 1975 + 3); +1 wave 17 (#6667): cycle.consolidate.enabled KNOWN_CONFIG_KEYS row (read in cycle/phases/consolidate.ts); +2 Wave B PR 1: pages.segmented_storage and the segmented ceiling/retention keys (page-body/limits.ts); merge v0.60.249.0: Wave B PR 1 and master growth compose at 1981; +1 #6297: dream.patterns.min_interval_hours / child_read_budget_kb known keys; +1 #5012: loops.updates_require_reciprocity known key; +1 wave 18b lane 2 (#6495): search.keyword_timeout_negative_cache_seconds KNOWN_CONFIG_KEYS row; integrated at wave 18b: master 1981 + 4 (lanes 2, 3, 5 known keys); +1 #6948: sync.origin_twins.auto_resolve KNOWN_CONFIG_KEYS row (read in repair/origin-twins-heal.ts); +1 #6948 sweep C-9: facts.absorb_retry.max_resubmits KNOWN_CONFIG_KEYS row (read in facts/dead-absorb-retry.ts); +1 #6907: backup.remote_timeout_ms KNOWN_CONFIG_KEYS row (resolver in backup/repository.ts); +1 at the #6712 PR 4b merge onto master v0.60.310.0 (both sides added a key); +3 #7130: sync.max_deletes / sync.max_delete_ratio / purge.retention_hours KNOWN_CONFIG_KEYS rows and the two per-source cap prefixes (parsers live in core/sync-reconcile.ts); +2 GBRA-154: search.collapse / search.rank_priors KNOWN_CONFIG_KEYS rows (read in search/mode.ts); +1 GBRA-150: sync.metafile_pages KNOWN_CONFIG_KEYS row (read in core/sync.ts); +1 GBRA-159: visibility.honor_aliases KNOWN_CONFIG_KEYS row (read in search/private-visibility.ts); +4 GBRA-156 warm CLI socket: GBrainConfig.serve_cli_socket slot and the published-config.ts import/re-export (snapshot-only merge and MERGED_CONFIG_BY_ENGINE live in core/published-config.ts); re-summed at the GBRA-159 hotfix merge (2000 measured); +2 #7242 GBrainConfig.minions.terminal_hook (interface field); #7252 merge of master v0.60.343.0: both sides grew the file, re-summed (2002 measured); +1 GBRA-155: entity.name_variants KNOWN_CONFIG_KEYS row (read in verbs/entity-variants.ts); +2 GBRA-161: the generations.* KNOWN_CONFIG_KEYS rows and their comment (bounds and reader in generations/config.ts); +1 GBRA-156: search.evidence_tail_trim KNOWN_CONFIG_KEYS row (read in search/evidence-tail-trim.ts); +2 GBRA-175: self_upgrade.channel (the GBrainConfig field and its KNOWN_CONFIG_KEYS row; resolved in core/self-upgrade.ts); re-summed at the master 440eeef6 merge (2009 measured); +2 GBRA-156 vector prewarm: GBrainConfig.serve_vector_prewarm slot (snapshot merge lives in core/published-config.ts); +1 GBRA-95 G7a: storage.git_lfs KNOWN_CONFIG_KEYS row (read in persistence/git-declared.ts); re-summed at the v0.60.449.0 merge (2012 measured)
- src/core/persistence/sync-run.ts 1686 ratchet new row: crossed the 1500 unlisted cap in #6643 (knock-on re-freeze, checkpoint revival, root cause and the truthful --retry-failed wait all drive the private cursor/gate machinery: holdUnderGate, freezeEntry, saveCursor); classification lives in sync-knock-on.ts, the checkpoint clause in checkpoint-validation.ts; peel the settle path (settleFailedRequest and its recoveries) into a sibling module next; +3 #6722: committed pages' size_state tallied into the cursor and the sync receipt size_states (logic in page-embedding-budget.ts addSizeState); merge v0.60.240.0: large pages and master growth compose at 1687; +2 #6694: the slug-mode checkpoint revival import and its doc line (predicate lives in persistence/sync-slug-mode.ts); +11 #6712 PR 3 (L7): a plain sync retries the recorded failure --retry-failed used to (retryRecordedFailure; the unchanged-refusal replay lives in persistence/sync-stop-class.ts replaysUnchangedRefusal), the moved-checkpoint and company content-refusal exceptions; #6712 PR 3 integration: lanes L7 (retryRecordedFailure, +19) and L8 (#6727 legacy-slug refusal line, #6735 timeout revival, +6) compose at 1762; +2 wave 18a integration: #6729 (lane 2, written against the 1745 ceiling) records identity downgrades in performManagedPass through noteIdentityDowngrades (logic in core/sync-identity-downgrades.ts), composed with master 1762; +14 Wave B PR 2: freezeEntry freezes a Markdown file over the read bound by reference (body_ref) and holdFailedFenceRequest holds a streamed refusal; both set freezeEntry/holdFailedFenceRequest locals (blob, oversize, rawHash) so they stay here, the hashing and preparation live in persistence/sync-streamed.ts and the hold in sync-screen.ts streamedRefusalHold; integrated at the master 4e29d0904 merge: master 1764 + Wave B PR 2 14 = 1778 measured; +4 #6948: freezeEntry holds an entry several live pages claim (hold in sync-screen.ts originConflictHold, verdict in persistence/origin-twins.ts); +1 #7167: managedDryRun reports the writer state (the import of persistence/sync-dry-run-writer.ts, where the read lives); +4 G3 git-canonical: freezeEntry reads a strict source's entry from its commit (pinnedBlob) and carries committedOnly to publication; both use freezeEntry locals (rule in persistence/sync-classify.ts)
- src/core/bootstrap/harness.ts 2592 ratchet +29 live-PGLite-serve lane: LIVE_SERVE refusal ahead of source resolution + unpinned --token hooks (CI e2e fix); +46 wave review: resolveHookSource dep (serve-parity resolver + federated grant), --source shape validation, loud SOURCE_UNRESOLVED instead of a silent 'default'; +10: #4574 parseCodexBlockBearer http_headers shape + legacy bearer_token fallback; +4 at megawave/wave-k merge; +codex hooks lane: step-7 codex hooks.json + config.toml trust pair, removeHarness arm; +234 ambient-writeback WP3: kind:'instructions' targets (plan/apply/converge-off/remove/status probes, OV-A4 override pre-check) — splice/render mechanics live in instructions-block.ts; +59 adversarial fix wave: registrar-mode block suppression, converge-failure receipt tracking, MCP-confirmed guard before block install; +26 round-3 fixes: codex-lane MCP-confirmed guard + smoke-rollback block strip; master: | merged v0.48.1.0 true-up; +41 #4897 resolveImplicitSource dep + defaultResolveImplicitSource: hooks/token/receipt bind to the serve's implicit default source when --source is omitted; +23 #4586 statusHarness live claude-code mcp verdict (URL mismatch or same-scope non-HTTP registration reads failed, receipt untouched); shared-skills integration on company-ingestion base; +18 #5671: logAmbientPostureNotes helper (registrar note moved out of applyHarness + pre-consent warning when an explicit private facts default meets the HTTP harness; text shared with doctor in facts/writeback-config.ts); +24 #5893: rotation grant carry wiring and its rotationCarry/withheldOperationsNote helpers (carry rules live in token-mint.ts carryLegacyGrant); +6 #5878: --refresh-skills flag and status epoch line (refresh logic lives in harness-skills.ts); +7 #4618 seat: HarnessFlags.seat field, --seat/--no-seat parse via hooks.ts parseSeatFlags, GBRAIN_SEAT in the hook env; -119 #6082: plugin-lane detectors moved to plugin-lanes.ts (re-exported); +18 #6092/#6171: hook ownership identity on write/remove/converge, permission ownership carry, --remove --dry-run and the --status hook census (logic in hooks.ts + harness-hooks.ts); +5 D8 Codex slice: the Codex SessionEnd capture hook obeys the recorded consent (wireCodexCapture: hooks on, capture accepted, never registrar mode) and is disclosed in the consent block; -31 #6743: cleanup gate moved to harness-cleanup.ts; +8 #6798: supersededEnrollments dep (interface field + default) and the --status epoch hint printed only for a superseded enrollment (the brain read lives in harness-skills.ts brainSupersededEnrollments)
+ src/core/config.ts 2016 ratchet +1 search.saved_facts_supersede KNOWN_CONFIG_KEYS row (read in search/saved-facts-match.ts; re-summed at the #7703 merge: 2014 + 1); +2 W5: search.page_rank_cut / page_rank_cut_factor KNOWN_CONFIG_KEYS rows (read in search/page-rank-cut.ts); +3 W3 confidence-gated reranking: search.reranker.gate / gate_min_gap KNOWN_CONFIG_KEYS rows (values parsed in search/crag.ts); re-summed at the W3 merge onto master v0.60.169.0 (1951 measured); +1 budgeted delivery PR 1: the search.auto_packing KNOWN_CONFIG_KEYS row (values validated in search/evidence-packing.ts); +1 #6278: persistence.sync_preparation_ms/maintenance_preparation_ms/preparation_ceiling_ms/max_preparation_attempts/preparation_deadlines key row (logic in persistence/preparation-budget.ts, switches.ts); +22 fix wave 11 W6.2/W6.3 (#5989, #6132): search.cjk_keyword_deadline_ms and search.hnsw_iterative_scan type fields, KNOWN_CONFIG_KEYS rows and the mergeSearchScanKnobs helper that keeps loadConfigWithEngine under its function-size baseline (logic in search/cjk-keyword-deadline.ts, search/hnsw-iterative-scan.ts); +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +2 fix wave 10 lane L1 #4907: cycle.synthesize_concepts.budget_usd registered (validation in cycle/phase-config-values.ts); +2 #5958: dream.propose_takes.call_timeout_ms registered; 3 core memory: memory.core.* and memory.pressure.* known keys; +15 P5: wanted_pages.enabled/remote, line_grammar.enabled/allow_undeclared_types/effective_ranges and put_page.similar_pages key rows (logic in wanted-links.ts, line-grammar.ts, similar-pages.ts); +1 P2 extraction.date_grounding / facts.attribution keys; +1 #6188: fences.normalize registered in KNOWN_CONFIG_KEYS; +2 #6188: fences.repair.max_usd_per_page/per_day key rows; +1 fix wave 12 W2.3 #6231: facts.page_write_notability_filter key row (resolver in facts/notability-filter.ts); +1 #6317: persistence.single_consumer key row (logic in persistence/switches.ts, consumer-election.ts); +2 newer mentions on context_pack cards: mentions.newer_on_cards key row (logic in mentions/newer-mentions.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +1 #5329 (W14 PR3): chronicle.max_events_per_page registered in KNOWN_CONFIG_KEYS (validation in chronicle/config.ts); +2 C1/C2 memory proof wave: search.evidence_date_header + facts.candidate_fusion registry rows; +1 facts.supersession_thresholds registry row (per-model supersession calibration); +1 C4: models.standing_questions key row; +1 search.entity_anchoring key registration (default off; search/entity-anchor.ts); +1 search.query_facts_arm key registration (default off; search/facts-arm.ts); re-summed at the master 6ccf30c3e merge (1871 integration + 1868 master - 1865 base); +1 search.temporal_fact_reserve key registration (default off; search/facts-arm.ts); +1 fix wave 13 PR2: persistence.publication_ceiling_ms (P2.1/P2.3); v0.60.165.0 merge: W14 PR4 +7 and master +2 compose (1947 measured); +1 memory proof wave 2 W1: the recall.question_admission KNOWN_CONFIG_KEYS row (values validated in facts/question-recall.ts); +2 Cat 40 Hard fix wave (#6271) on top: mentions.alias_deny/multiword_aliases/sibling_merge and search.alias_fanout_max/demote_generated KNOWN_CONFIG_KEYS rows (1950 measured); +1 wave 15 P7.1 #5213: cycle.propose_takes.types KNOWN_CONFIG_KEYS row (parse + filter live in cycle/propose-takes.ts); +1 wave 15 P7.2 #6451: autopilot.git_pull KNOWN_CONFIG_KEYS row (read in persistence/automatic-sync-policy.ts); +1 wave 15 P7.3 #6369: cycle.lint.enabled KNOWN_CONFIG_KEYS row (read in cycle/lint-fix-setting.ts); +2 wave 15 P7.4 #5461: think.pages_budget_chars / think.excerpt_ceiling_chars KNOWN_CONFIG_KEYS rows (validation in think/pages-budget.ts); +6 wave 16 G5.1 (#6495): search.keyword_statement_timeout_ms type field, DB merge and KNOWN_CONFIG_KEYS row, toEngineConfig carries it (range + resolver live in postgres-engine/keyword-statement-timeout.ts); +1 GBRA-81 item 1: search.mode_source registered; +1 GBRA-60 S1: search.diverse_pool_depth in the known search keys; +3 #6643: sync.knock_on_refreeze_limit / sync.knock_on_run_limit KNOWN_CONFIG_KEYS rows (read by persistence/sync-run.ts knockOnLimits); +3 #6696: KNOWN_CONFIG_KEYS rows for persistence.maintenance.compaction_stale_hours and refusal_breaker_threshold; +1 wave 5 D5: context.proactive_brief KNOWN_CONFIG_KEYS row (read in context/proactive-brief.ts); +3 Cat 40 next wave part 1: KNOWN_CONFIG_KEYS rows for entity.names_references + entity.record_types + entity.row_page_status (one line), mcp.instructions_governing_rule and search.long_page_unit (re-summed at the 0.60.242.0 merge: master 1975 + 3); +1 wave 17 (#6667): cycle.consolidate.enabled KNOWN_CONFIG_KEYS row (read in cycle/phases/consolidate.ts); +2 Wave B PR 1: pages.segmented_storage and the segmented ceiling/retention keys (page-body/limits.ts); merge v0.60.249.0: Wave B PR 1 and master growth compose at 1981; +1 #6297: dream.patterns.min_interval_hours / child_read_budget_kb known keys; +1 #5012: loops.updates_require_reciprocity known key; +1 wave 18b lane 2 (#6495): search.keyword_timeout_negative_cache_seconds KNOWN_CONFIG_KEYS row; integrated at wave 18b: master 1981 + 4 (lanes 2, 3, 5 known keys); +1 #6948: sync.origin_twins.auto_resolve KNOWN_CONFIG_KEYS row (read in repair/origin-twins-heal.ts); +1 #6948 sweep C-9: facts.absorb_retry.max_resubmits KNOWN_CONFIG_KEYS row (read in facts/dead-absorb-retry.ts); +1 #6907: backup.remote_timeout_ms KNOWN_CONFIG_KEYS row (resolver in backup/repository.ts); +1 at the #6712 PR 4b merge onto master v0.60.310.0 (both sides added a key); +3 #7130: sync.max_deletes / sync.max_delete_ratio / purge.retention_hours KNOWN_CONFIG_KEYS rows and the two per-source cap prefixes (parsers live in core/sync-reconcile.ts); +2 GBRA-154: search.collapse / search.rank_priors KNOWN_CONFIG_KEYS rows (read in search/mode.ts); +1 GBRA-150: sync.metafile_pages KNOWN_CONFIG_KEYS row (read in core/sync.ts); +1 GBRA-159: visibility.honor_aliases KNOWN_CONFIG_KEYS row (read in search/private-visibility.ts); +4 GBRA-156 warm CLI socket: GBrainConfig.serve_cli_socket slot and the published-config.ts import/re-export (snapshot-only merge and MERGED_CONFIG_BY_ENGINE live in core/published-config.ts); re-summed at the GBRA-159 hotfix merge (2000 measured); +2 #7242 GBrainConfig.minions.terminal_hook (interface field); #7252 merge of master v0.60.343.0: both sides grew the file, re-summed (2002 measured); +1 GBRA-155: entity.name_variants KNOWN_CONFIG_KEYS row (read in verbs/entity-variants.ts); +2 GBRA-161: the generations.* KNOWN_CONFIG_KEYS rows and their comment (bounds and reader in generations/config.ts); +1 GBRA-156: search.evidence_tail_trim KNOWN_CONFIG_KEYS row (read in search/evidence-tail-trim.ts); +2 GBRA-175: self_upgrade.channel (the GBrainConfig field and its KNOWN_CONFIG_KEYS row; resolved in core/self-upgrade.ts); re-summed at the master 440eeef6 merge (2009 measured); +2 GBRA-156 vector prewarm: GBrainConfig.serve_vector_prewarm slot (snapshot merge lives in core/published-config.ts); +1 GBRA-95 G7a: storage.git_lfs KNOWN_CONFIG_KEYS row (read in persistence/git-declared.ts); re-summed at the v0.60.449.0 merge (2012 measured); +2 GBRA-205: search.evidence_titles / query_budget_unit / query_facts_block / fact_source_pages KNOWN_CONFIG_KEYS rows (read in search/evidence-date.ts, evidence-packing.ts, facts-arm.ts); +1 GBRA-156: search.remote_page_cap KNOWN_CONFIG_KEYS row (read in search/remote-page-cap.ts)
+ src/core/persistence/sync-run.ts 1695 ratchet new row: crossed the 1500 unlisted cap in #6643 (knock-on re-freeze, checkpoint revival, root cause and the truthful --retry-failed wait all drive the private cursor/gate machinery: holdUnderGate, freezeEntry, saveCursor); classification lives in sync-knock-on.ts, the checkpoint clause in checkpoint-validation.ts; peel the settle path (settleFailedRequest and its recoveries) into a sibling module next; +3 #6722: committed pages' size_state tallied into the cursor and the sync receipt size_states (logic in page-embedding-budget.ts addSizeState); merge v0.60.240.0: large pages and master growth compose at 1687; +2 #6694: the slug-mode checkpoint revival import and its doc line (predicate lives in persistence/sync-slug-mode.ts); +11 #6712 PR 3 (L7): a plain sync retries the recorded failure --retry-failed used to (retryRecordedFailure; the unchanged-refusal replay lives in persistence/sync-stop-class.ts replaysUnchangedRefusal), the moved-checkpoint and company content-refusal exceptions; #6712 PR 3 integration: lanes L7 (retryRecordedFailure, +19) and L8 (#6727 legacy-slug refusal line, #6735 timeout revival, +6) compose at 1762; +2 wave 18a integration: #6729 (lane 2, written against the 1745 ceiling) records identity downgrades in performManagedPass through noteIdentityDowngrades (logic in core/sync-identity-downgrades.ts), composed with master 1762; +14 Wave B PR 2: freezeEntry freezes a Markdown file over the read bound by reference (body_ref) and holdFailedFenceRequest holds a streamed refusal; both set freezeEntry/holdFailedFenceRequest locals (blob, oversize, rawHash) so they stay here, the hashing and preparation live in persistence/sync-streamed.ts and the hold in sync-screen.ts streamedRefusalHold; integrated at the master 4e29d0904 merge: master 1764 + Wave B PR 2 14 = 1778 measured; +4 #6948: freezeEntry holds an entry several live pages claim (hold in sync-screen.ts originConflictHold, verdict in persistence/origin-twins.ts); +1 #7167: managedDryRun reports the writer state (the import of persistence/sync-dry-run-writer.ts, where the read lives); +4 G3 git-canonical: freezeEntry reads a strict source's entry from its commit (pinnedBlob) and carries committedOnly to publication; both use freezeEntry locals (rule in persistence/sync-classify.ts); +1 #7886: the import of persistence/sync-receipt-wait.ts, where the managed sync receipt waits and their test seam live; +3 #7931: the freeze drift screen also accepts a file that holds the page as prepareFileTarget reads it (fileMatchesSnapshot import, comment, the split condition line); +5 GBRA-218: performManagedSync wraps every managed pass (sync, drain, sources refresh, git conversion, owner slice) in withCommittedPolicy (logic in access/policy-git.ts) and keeps the lease path in performLeasedPass
+ src/core/bootstrap/harness.ts 2614 ratchet +29 live-PGLite-serve lane: LIVE_SERVE refusal ahead of source resolution + unpinned --token hooks (CI e2e fix); +46 wave review: resolveHookSource dep (serve-parity resolver + federated grant), --source shape validation, loud SOURCE_UNRESOLVED instead of a silent 'default'; +10: #4574 parseCodexBlockBearer http_headers shape + legacy bearer_token fallback; +4 at megawave/wave-k merge; +codex hooks lane: step-7 codex hooks.json + config.toml trust pair, removeHarness arm; +234 ambient-writeback WP3: kind:'instructions' targets (plan/apply/converge-off/remove/status probes, OV-A4 override pre-check) — splice/render mechanics live in instructions-block.ts; +59 adversarial fix wave: registrar-mode block suppression, converge-failure receipt tracking, MCP-confirmed guard before block install; +26 round-3 fixes: codex-lane MCP-confirmed guard + smoke-rollback block strip; master: | merged v0.48.1.0 true-up; +41 #4897 resolveImplicitSource dep + defaultResolveImplicitSource: hooks/token/receipt bind to the serve's implicit default source when --source is omitted; +23 #4586 statusHarness live claude-code mcp verdict (URL mismatch or same-scope non-HTTP registration reads failed, receipt untouched); shared-skills integration on company-ingestion base; +18 #5671: logAmbientPostureNotes helper (registrar note moved out of applyHarness + pre-consent warning when an explicit private facts default meets the HTTP harness; text shared with doctor in facts/writeback-config.ts); +24 #5893: rotation grant carry wiring and its rotationCarry/withheldOperationsNote helpers (carry rules live in token-mint.ts carryLegacyGrant); +6 #5878: --refresh-skills flag and status epoch line (refresh logic lives in harness-skills.ts); +7 #4618 seat: HarnessFlags.seat field, --seat/--no-seat parse via hooks.ts parseSeatFlags, GBRAIN_SEAT in the hook env; -119 #6082: plugin-lane detectors moved to plugin-lanes.ts (re-exported); +18 #6092/#6171: hook ownership identity on write/remove/converge, permission ownership carry, --remove --dry-run and the --status hook census (logic in hooks.ts + harness-hooks.ts); +5 D8 Codex slice: the Codex SessionEnd capture hook obeys the recorded consent (wireCodexCapture: hooks on, capture accepted, never registrar mode) and is disclosed in the consent block; -31 #6743: cleanup gate moved to harness-cleanup.ts; +8 #6798: supersededEnrollments dep (interface field + default) and the --status epoch hint printed only for a superseded enrollment (the brain read lives in harness-skills.ts brainSupersededEnrollments); +13 brain-first block lane: --no-instructions flag field + parse, opencodeAgentsPath dep (field + default) and the step-10b / remove call sites (logic lives in harness-brain-first.ts); +7 GBRA-243 per-turn rule hook: consent-block interface field, step-10c call site, turn_hooks JSON field, exit code and the remove arm (writer, host list and consent text live in harness-brain-first.ts); +2 #8428: the harness lane Claude Code and Codex SessionEnd hooks start gbrain through the hook launcher
src/core/oauth-provider.ts 1236 ratchet new row: crossed the 1500 unlisted cap absorbing #3819 (DCR 400 invalid_client_metadata + scope filtering + custom-scheme redirect_uris + pseudo-scheme guard); merged v0.49: transactional grant enforcement shared with hosted grant policies; +1 #5222 resourceUrl option
- src/core/ops/pages.ts 728 ratchet crossed the unlisted 1500 cap in the fix wave: pack-vocabulary enforcement on capture (#4721) + get_page alias follow (#4275) landed together; next growth should peel a pages-ops submodule; +3: alias hop reads the canonical in the owning source (ship-review); +5: explicit source_id liveness check in get_page/list_pages (#4620); +3: #4857 total-order slug sort + list_pages source_id parse; +5: #4620 explicit removed-source id fails loudly; master integration: +4: authenticated delegated private-write boundary and auto-link suppression; #5105: canonical page mutations peeled into persistence modules; +2 v0.50.5.0 purge parameter and shared preflight call; preparation composes through the persistence modules; +7: source-qualified deep-research fetch authorization and ambiguity refusal (codec lives in deep-research-id.ts); +1 #5567: remote get_page keeps materialized markers; +1 #5622: trusted local capture file parameter; +5 #5709: get_page include_timeline_entries (rows via get_timeline's read policy); +8 GBRA-36 security wave: required outputRedaction policy on each pages op; +1 #5154: list_pages passes listColumnsOnly; +17 #5641: list_pages exposes the updated_after_slug keyset cursor and updated_at_iso; +8 agent operator wave A2: every op declares mutating + idempotent (tags only); +7 F3b (#5954): list_pages pagination meta + listing_truncated notice for MCP callers (logic in ops/list-pages-pagination.ts); +4 #5988: get_page file_held (one indexed hold lookup; logic in persistence/held-reads.ts); +6 #6103: list_pages maps an unreadable updated_after (SQLSTATE 22007/22008) to invalid_params; wave 10 collector: #6103 (+6) and #4807 (+2) compose; +1 wave 11 W4.3 (#5969 D3): put_page drop_timeline param; +1 wave 11 security review: purge_deleted_pages yes param + trusted-CLI guard (consent logic in persistence/purge-deleted.ts); +1 Q2 parser gaps: get_page grammar_diagnostics param (report logic in core/line-grammar-report.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +21 large pages (Wave A): get_page body-mode dispatch, fetch window branch, put_page large-page admission and allow_shrink param, description text (logic in ops/get-page-body.ts and persistence/large-page-guard.ts); +1 D8 funnel: committed put_page records a save when the opt-in funnel is on; +1 #6609: restore_page detach param (logic in persistence/detached-pages.ts); +1 Wave B gem A: post-batch auto-link reads a segmented page materialized (helpers in persistence/segmented-apply.ts); merge v0.60.249.0: composes at 707; +4 Wave B PR 2: get_page refuses a segmented page whole and fetch windows one (logic in ops/get-page-body.ts and page-window/segmented.ts); +2 Wave B PR 2 lane F: get_page and fetch pin segmented reads to the authorized snapshot (pin logic in ops/get-page-body.ts authorizedReadPin); +3 W2 page-at-time: get_page known_as_of param and dispatch (logic in ops/known-as-of.ts and belief/page-at-time.ts); GBRA-151 retrieval P0 x operability wave merge: both sides grew the file, re-summed (721 measured); GBRA-151 #7147 follow-up re-summed at the v0.60.334.0 merge (727 measured); +1 #7305: capture dry run applies the hyphen-run slug admission (logic in persistence/suffixed-slug.ts)
- src/core/search/mode.ts 1704 ratchet +53 W3 confidence-gated reranking: reranker_gate / reranker_gate_min_gap bundle fields, overrides, config parse and KNOB_CONFIG_KEY rows, knobsHash v=31 rrg=/rrgg=/ecf= parts (parse contracts in crag.ts); +10 System One v1: decide.* snapshot subset in loadSearchModeConfig, append-only dec= knobsHash part; +5 #3617 follow-up: v27 same-knobs behavioral-change note (relaxed-row fusion demotion rides the bump); new row: crossed the 1500 unlisted cap in the 2026-08 eval fix wave — KNOBS_HASH v=27 adaptive-return fold (ar/arem/arom/armk/ari parts + KnobsHashContext.adaptiveReturn field + contamination rationale comments) | merged v0.48.1.0 (+#4787) true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); ranker wave v0.48.4.0: four knobs (expansion_variant_budget, relational_rerank_pin, keyword_arm_confidence_floor, metadata_boost_gate) + v29 hash parts + doc receipts (+218); #4781 loadSearchModeConfig reads the config table once via loadConfigSnapshot (+6); +4 #4359: update loadSearchModeConfig docstring — the cached path now reads config once (threaded snapshot), not twice; retired provider integration removed; +12 fw3-search: search.source_boosts + search.alias_token_hop read in the mode snapshot; +10 #5691: KnobsHashContext.queryPrefix and its append-only qp= part; P7 relational_planner / relational_orient_onehop knobs (interface docs, bundles, overrides, config parse, hash parts); +18 P7 relational_chain_slots knob (interface doc, bundles, override, config parse, rcs= hash part); +22 GBRA-60 S1 diverse_pool_depth knob (interface doc, bundles, overrides, pick, config parse, append-only dpd= hash part); +35 GBRA-154: collapse and rank_priors knobs (interface docs, bundles, overrides, pick, config parse, append-only col=/rpr= hash parts); GBRA-151 retrieval P0 x operability wave merge: both sides grew the file, re-summed (1704 measured)
+ src/core/ops/pages.ts 732 ratchet crossed the unlisted 1500 cap in the fix wave: pack-vocabulary enforcement on capture (#4721) + get_page alias follow (#4275) landed together; next growth should peel a pages-ops submodule; +3: alias hop reads the canonical in the owning source (ship-review); +5: explicit source_id liveness check in get_page/list_pages (#4620); +3: #4857 total-order slug sort + list_pages source_id parse; +5: #4620 explicit removed-source id fails loudly; master integration: +4: authenticated delegated private-write boundary and auto-link suppression; #5105: canonical page mutations peeled into persistence modules; +2 v0.50.5.0 purge parameter and shared preflight call; preparation composes through the persistence modules; +7: source-qualified deep-research fetch authorization and ambiguity refusal (codec lives in deep-research-id.ts); +1 #5567: remote get_page keeps materialized markers; +1 #5622: trusted local capture file parameter; +5 #5709: get_page include_timeline_entries (rows via get_timeline's read policy); +8 GBRA-36 security wave: required outputRedaction policy on each pages op; +1 #5154: list_pages passes listColumnsOnly; +17 #5641: list_pages exposes the updated_after_slug keyset cursor and updated_at_iso; +8 agent operator wave A2: every op declares mutating + idempotent (tags only); +7 F3b (#5954): list_pages pagination meta + listing_truncated notice for MCP callers (logic in ops/list-pages-pagination.ts); +4 #5988: get_page file_held (one indexed hold lookup; logic in persistence/held-reads.ts); +6 #6103: list_pages maps an unreadable updated_after (SQLSTATE 22007/22008) to invalid_params; wave 10 collector: #6103 (+6) and #4807 (+2) compose; +1 wave 11 W4.3 (#5969 D3): put_page drop_timeline param; +1 wave 11 security review: purge_deleted_pages yes param + trusted-CLI guard (consent logic in persistence/purge-deleted.ts); +1 Q2 parser gaps: get_page grammar_diagnostics param (report logic in core/line-grammar-report.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +21 large pages (Wave A): get_page body-mode dispatch, fetch window branch, put_page large-page admission and allow_shrink param, description text (logic in ops/get-page-body.ts and persistence/large-page-guard.ts); +1 D8 funnel: committed put_page records a save when the opt-in funnel is on; +1 #6609: restore_page detach param (logic in persistence/detached-pages.ts); +1 Wave B gem A: post-batch auto-link reads a segmented page materialized (helpers in persistence/segmented-apply.ts); merge v0.60.249.0: composes at 707; +4 Wave B PR 2: get_page refuses a segmented page whole and fetch windows one (logic in ops/get-page-body.ts and page-window/segmented.ts); +2 Wave B PR 2 lane F: get_page and fetch pin segmented reads to the authorized snapshot (pin logic in ops/get-page-body.ts authorizedReadPin); +3 W2 page-at-time: get_page known_as_of param and dispatch (logic in ops/known-as-of.ts and belief/page-at-time.ts); GBRA-151 retrieval P0 x operability wave merge: both sides grew the file, re-summed (721 measured); GBRA-151 #7147 follow-up re-summed at the v0.60.334.0 merge (727 measured); +1 #7305: capture dry run applies the hyphen-run slug admission (logic in persistence/suffixed-slug.ts); +1 GST-687: get_page include_timeline_entries quotes rows for remote readers (import only; logic in ops/timeline-quote.ts); +2 #8384: the quoted_unverified_origin notice call in get_page and fetch (logic lives in get-page-projection.ts); +1 GBRA-218: put_page checks a remote readable_by before admission (logic in persistence/page-visibility.ts assertSubmittedReaders) (re-summed at the train M merge of master v0.60.539.0: 732 measured)
+ src/core/search/mode.ts 1717 ratchet +53 W3 confidence-gated reranking: reranker_gate / reranker_gate_min_gap bundle fields, overrides, config parse and KNOB_CONFIG_KEY rows, knobsHash v=31 rrg=/rrgg=/ecf= parts (parse contracts in crag.ts); +10 System One v1: decide.* snapshot subset in loadSearchModeConfig, append-only dec= knobsHash part; +5 #3617 follow-up: v27 same-knobs behavioral-change note (relaxed-row fusion demotion rides the bump); new row: crossed the 1500 unlisted cap in the 2026-08 eval fix wave — KNOBS_HASH v=27 adaptive-return fold (ar/arem/arom/armk/ari parts + KnobsHashContext.adaptiveReturn field + contamination rationale comments) | merged v0.48.1.0 (+#4787) true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); ranker wave v0.48.4.0: four knobs (expansion_variant_budget, relational_rerank_pin, keyword_arm_confidence_floor, metadata_boost_gate) + v29 hash parts + doc receipts (+218); #4781 loadSearchModeConfig reads the config table once via loadConfigSnapshot (+6); +4 #4359: update loadSearchModeConfig docstring — the cached path now reads config once (threaded snapshot), not twice; retired provider integration removed; +12 fw3-search: search.source_boosts + search.alias_token_hop read in the mode snapshot; +10 #5691: KnobsHashContext.queryPrefix and its append-only qp= part; P7 relational_planner / relational_orient_onehop knobs (interface docs, bundles, overrides, config parse, hash parts); +18 P7 relational_chain_slots knob (interface doc, bundles, override, config parse, rcs= hash part); +22 GBRA-60 S1 diverse_pool_depth knob (interface doc, bundles, overrides, pick, config parse, append-only dpd= hash part); +35 GBRA-154: collapse and rank_priors knobs (interface docs, bundles, overrides, pick, config parse, append-only col=/rpr= hash parts); GBRA-151 retrieval P0 x operability wave merge: both sides grew the file, re-summed (1704 measured); +5 GBRA-156 #7593: private-pages grant part in the cache key; +7 GBRA-218 A1: append-only xid=/xhp= knobsHash parts (member identity, operator privacy relaxation); +1 GBRA-231: append-only xau= knobsHash part (shared-agent audience identities) (re-summed at the train M .538 merge: 1717 measured)
src/commands/eval-longmemeval.ts 1545 ratchet new row: crossed the 1500 unlisted cap in fw3-search (#5092 benchmark-brain recycling: configureBrain split + recycler wiring + test seams; the recycler itself lives in src/eval/longmemeval/harness.ts); +1 P6: tokenmax synopsis-tier wiring (logic in eval/longmemeval/synopsis-tier.ts); +13 GBRA-81 lane A: --via-operation query|search (flags, per-call expansion pin, the run's expectExpansion, the op branch in runOneQuestion, row field, via_operation_summary and its FAIL line; logic in eval/longmemeval/via-operation.ts); +12 --call-plan FILE / --call-plan-gate CMD: two LME_FLAGS entries (CLI help lines), two ParsedArgs fields, the parseArgs pairing check and the header invariant (planner lives in eval/longmemeval/call-plan.ts; runEvalLongMemEval is one line shorter); +1 #7619: parseArgs refuses a value on a switch (--judge=false turned the paid judge on)
src/commands/doctor/checks/extraction-sync.ts 1500 ratchet +7 GBRA-130 A-1: links_extraction_lag held bucket and its retry fix (logic in core/extraction-lag.ts heldExtractionReport); +1 undeclared_db_only_pages computes the source Git scope once per source (logic in core/markdown.ts sourceGitScope); new row: crossed the 1500 unlisted cap at the fix wave 9 merge: +7 lane W #5028 (extract_atoms freshness judged by the phase itself) and +3 lane F #5863 (extract_health dates a high halt rate by its last halt), each under the cap alone; +7 #5019: content_hash_duplicates fix pins the pairs' source (GBRAIN_SOURCE) and names a delete that runs; +1 fix wave 10 lane L1 #5556: links_extraction_lag denominator excludes quarantined pages (quarantineFilterFragment import); +11 fix wave 15 P2.8 (#5495): extract_health reads the 7-day halt reasons per kind (halt_reasons, top_halt_reason in details and the top reason in the warn line); the read, the unknown bucket and the ranking live in core/extract/rollup-writer.ts; +20 wave 18b lane 1: links_extraction_lag names the columns its pre-migration degrade reads (#6599 strict predicate), sync_freshness separates sync outcome from freshness for a source with no successful sync (#4960; verdict text, fixes and the attempt read live in doctor/sync-outcome.ts and core/sync-attempt.ts) and exempts read-only skill-pack catalogs (#6076; core/shared-skills/adopted-packs.ts); -51 #6803 (D1): links_extraction_lag reads its counts and verdict from core/extraction-lag.ts (shared with the sync nudge); +1 #7145: content_hash_duplicates reads one group past its list to report a floor ("at least 50")
- src/core/search/evidence-delivery.ts 1733 ratchet +5 W5: EvidencePlan.rankCut resolved with the plan (logic in search/page-rank-cut.ts); +20 W5 whole_pages: wholeCost prices a block as delivery would emit it whole (needs the private Block/enrichBlock internals) and the cut is wired before allocate (cutWholePages lives in search/page-rank-cut.ts); new row: crossed the 1500 unlisted cap at the #6367 merge (master 1479, its explicit-budget cap) by the C1 date header threaded through every block path, cap included; pagePlanHits (search/page-plan-hits.ts) and the header loader (evidence-date.ts blockDateHeaders) were peeled first; peel candidate: allocateCapped; +8 at the #6396 merge: page evidence text cut through the fence-chunk trust overlay and the caller minTrust floor (re-summed: our 1504 + master +8); +119 Cat 40 next wave F2: the search.long_page_unit policy (withLongPagePolicy, selectLongPages size preflight with page/byte/deadline limits) and the long-page fetch and fallback in deliverEvidence, kept in the shared seam the plan names (gbrain-evals docs/plans/2026-10-11-cat40-next-wave, F2); +17 F2 rework to the frozen-comparison policy: search.long_page_min_chars (rendered-body characters, default 20,000) read in withLongPagePolicy, a character count in the preflight, the rendered-body confirmation in deliverEvidence, and the long-page row exemption in capDeliveredSnippets (re-summed at the 0.60.225.0 merge: master 1537 + F2 136); +39 Wave B PR 2 lane 2b: planSegmentedBlock joins the windows search/segmented-evidence.ts reads around a segmented page's hits into one run-marked document (needs the private Doc/Piece/buildDoc/locateAnchor internals), planBlock's unit cut split into blockFromDoc for both, sections bounded by their run, selectionCost counts a gap between runs, and the fetch skips the whole-body fence overlay for a segmented page; +4 segmented pages read at once before planning (segmentedReads; the read is search/segmented-evidence.ts, the statements page-body/read-range.ts); +17 GBRA-156: tail trim plan flag, DeliverOptions.query, DeliveryMeta.tail_trim, the trim call and the frozen-hit score/query library fields (logic in search/evidence-tail-trim.ts; interface fields cannot move)
+ src/core/search/evidence-delivery.ts 1759 ratchet +5 W5: EvidencePlan.rankCut resolved with the plan (logic in search/page-rank-cut.ts); +20 W5 whole_pages: wholeCost prices a block as delivery would emit it whole (needs the private Block/enrichBlock internals) and the cut is wired before allocate (cutWholePages lives in search/page-rank-cut.ts); new row: crossed the 1500 unlisted cap at the #6367 merge (master 1479, its explicit-budget cap) by the C1 date header threaded through every block path, cap included; pagePlanHits (search/page-plan-hits.ts) and the header loader (evidence-date.ts blockDateHeaders) were peeled first; peel candidate: allocateCapped; +8 at the #6396 merge: page evidence text cut through the fence-chunk trust overlay and the caller minTrust floor (re-summed: our 1504 + master +8); +119 Cat 40 next wave F2: the search.long_page_unit policy (withLongPagePolicy, selectLongPages size preflight with page/byte/deadline limits) and the long-page fetch and fallback in deliverEvidence, kept in the shared seam the plan names (gbrain-evals docs/plans/2026-10-11-cat40-next-wave, F2); +17 F2 rework to the frozen-comparison policy: search.long_page_min_chars (rendered-body characters, default 20,000) read in withLongPagePolicy, a character count in the preflight, the rendered-body confirmation in deliverEvidence, and the long-page row exemption in capDeliveredSnippets (re-summed at the 0.60.225.0 merge: master 1537 + F2 136); +39 Wave B PR 2 lane 2b: planSegmentedBlock joins the windows search/segmented-evidence.ts reads around a segmented page's hits into one run-marked document (needs the private Doc/Piece/buildDoc/locateAnchor internals), planBlock's unit cut split into blockFromDoc for both, sections bounded by their run, selectionCost counts a gap between runs, and the fetch skips the whole-body fence overlay for a segmented page; +4 segmented pages read at once before planning (segmentedReads; the read is search/segmented-evidence.ts, the statements page-body/read-range.ts); +17 GBRA-156: tail trim plan flag, DeliverOptions.query, DeliveryMeta.tail_trim, the trim call and the frozen-hit score/query library fields (logic in search/evidence-tail-trim.ts; interface fields cannot move); +7 GBRA-205: EvidencePlan.titleHeader and DeliveryMeta.title_header (interface fields cannot move) and the titles option on the header loader (logic in search/evidence-date.ts; the query budget key lives in search/evidence-packing.ts); +11 #7600: assemble_evidence quotes conversation rows and capEvidenceToBudget counts the quote fence (logic in search/transcript-quote.ts); +2 GBRA-156 /ship review: the cut-path admission and title room count the quote fence; +2 GBRA-156 /ship review pass 2: capEvidenceToBudget counts the fence only for the paths that fence (quote flag; recall counts the text as returned); +4 GST-687: page evidence and the extractive fallback quote below-owner-tier text for untrusted readers (untrusted flag; logic in search/transcript-quote.ts)
src/commands/config.ts 1524 ratchet new row: crossed the 1500 unlisted cap in wave 15 P7.4 #5461: set-time validation of think.pages_budget_chars / think.excerpt_ceiling_chars (range + parser live in core/think/pages-budget.ts), mirroring the cycle.consolidate.cluster_threshold hook; +1 wave 16 G5.1 (#6495): set-time refusal hook for search.keyword_statement_timeout_ms (check lives in commands/config/keyword-timeout-value.ts); +1 wave 18b lane 5 (#5012 item 6): search.contextual_retrieval prints the existing-pages hint after the write (text lives in commands/config/contextual-mode-hint.ts); +1 #6712 PR 2: retired/rollback sync key dispatch line (logic in core/sync-config-keys.ts handleSyncKeyConfig); +1 #6865: sync.slug_conflicts.auto_remove boolean validation at set time (refusal text in repair/slug-autoheal.ts); +1 #6948: sync.origin_twins.auto_resolve boolean validation at set time (refusal text in repair/origin-twins-heal.ts); +2 #6795: config set chat_model/expansion_model help line and the model-pin import (shadow report and file-pin unset live in commands/config/model-pin-shadow.ts); +1 #6712 PR 4b: sync.admission set-time hook (value logic in commands/config/sync-admission-value.ts); +4 #7130: set-time refusal hook for sync.max_deletes / sync.max_delete_ratio (and .source.<id>) / purge.retention_hours (check lives in core/sync-reconcile.ts deleteSafetyConfigRefusal); +1 GBRA-150: sync.metafile_pages set-time route (body in config/sync-metafile-pages-value.ts); re-summed at the v0.60.330.0 merge (1520 measured); +2 #7242 minions.terminal_hook file-plane key and its set branch (logic in minions/terminal-hook.ts); +1 GBRA-161: generations.* set-time route (refusal in commands/config/generations-values.ts); +1 GBRA-207 #7630: sync.repo_path set-time refusal hook (refusal in core/sync-config-keys.ts syncRepoPathRefusal)
- src/commands/mcp-expose.ts 1512 ratchet hosted_option: Session carries the gbrain.io coaching notice on the first-receipt run and Tailscale/service friction exits (copy, refs and gating live in core/onboard/hosted-option.ts)
- src/core/behavior-change-notice.ts 1521 ratchet the BEHAVIOR_CHANGES table grows by one row per disclosed change: +3 GBRA-200 comment, write-grant refusal and degraded-stamp rows (re-summed at the master merge: 1518 + 3), +2 strict door planned-state row (#7705, re-summed at the 0.60.470.0 merge: master 1514 + 2), +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, +1 G5 lane C trust_release row, +1 #7619 cli_flag_equals, +3 GBRA-207 #7630 relative-anchor and stalled-write rows, +2 the #7632 function search_path disclosure row and +2 the #7679 orphaned worktree refresh row (re-summed at the 0.60.471.0 merge: master 1516 + 2); the behavior-change table split (#7607) retires this row
+ src/commands/mcp-expose.ts 1519 ratchet hosted_option: Session carries the gbrain.io coaching notice on the first-receipt run and Tailscale/service friction exits (copy, refs and gating live in core/onboard/hosted-option.ts); +7 GBRA-199: --surface help lines, surfaceChosen option field and the advertise pass-through (registrationAdvertise in core/mcp-registration.ts)
-src/core/behavior-change-notice.ts 1612 ratchet the BEHAVIOR_CHANGES table grows by one row per disclosed change: +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +2 GBRA-205 saved_facts_stems row and its comment (re-summed at the #7901 0.60.492.0 merge: 1541 + 2); +2 GBRA-205 search.query_facts_block default-on row and its approval comment (re-summed at the #7610 0.60.490.0 merge: 1539 + 2); +2 the #7900 content checkpoint host-move row (since TBD until the merge slot), +2 the #7897 private-hold sweep row (since TBD until the merge slot), +2 the #7880 ingest_capture and company-brain private-hold row (since TBD until the merge slot), +5 the frozen-source wave comment and four rows (#7868, #7850, #7869/#7870, #7871), +2 the #7848 visibility_noncanonical hold row (since TBD until the merge slot), +2 the #7846 extract_atoms session-source row (re-summed at the 0.60.481.0 merge: master 1524 + 2), +2 the #7805 synthesize session-source and #7841 visibility_not_applied rows (re-summed at the 0.60.480.0 merge: master 1522 + 2), +2 strict door planned-state row (#7705, re-summed at the 0.60.470.0 merge: master 1514 + 2), +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, +1 G5 lane C trust_release row, +1 #7619 cli_flag_equals, +3 GBRA-207 #7630 relative-anchor and stalled-write rows, +2 the #7632 function search_path disclosure row and +2 the #7679 orphaned worktree refresh row (re-summed at the 0.60.471.0 merge: master 1516 + 2), +2 the #7814 retired v0.13.1 grandfather row, +2 the #7618 conversion withhold/progress/push row (master 1520 + 2); the behavior-change table split (#7607) retires this row; +4 GBRA-188 #7489: the wave comment and three rows (brain-first instructions, starter surface default, per-turn rule); +1 GBRA-188 plugin_turn_hook_gbra188 row; +1 GBRA-242 provider_key_rules_7959 row (#7959), +2 the GBRA-199 registration_lists_verbs row (since TBD until the merge slot); +2 GBRA-133 #7652: the #7611 pass_abandoned reader row and the lean read-only serve socket row (re-summed at the 0.60.503.0 merge: master 1555 + 2); +1 GBRA-243: the per-turn hook disclosure row (rows are data and cannot move); +4 GBRA-156 #7598 harness wave comment and rows (remote page cap, sources_not_readable refusal, sources add next step); +4 GBRA-156 #7601 search_quotes_transcript_rows comment and row; +1 GBRA-175 #7475 autopilot_restarts_serve_7475 row (re-summed at the #8012 merge: 1566 + 1); +3 #7997/#8014/#8015 rows (redaction markers, company db_only keep, ignored supabase_only scope); +2 #7199 (re-port of #7228) classic_drift_rescreen_7199 comment and row; +2 #7931 file_drift_agrees_7931 comment and row; +1 #7950 file_drift_slug_release_7950 row; +1 #7974 file_drift_followups_7974 row; +1 #8059 quoted_fence_marker_8059 row; +2 GBRA-247 #8009 provenance_repair_held_8009 and #7982 pass_transient_streak_7982 rows; +4 GBRA-247 #7973 plain_directory_sync_7973, #7988 managed_marker_own_directory_7988, #7985 former_binding_parked_group_7985 and settle_effects_retire_7985 rows Train S merge: 1570 base + 5 (master since the #8077 base) + 13 (#8077) = 1588.; +2 GST-687 remote_quotes_unverified_text_gst687 row and its comment (re-summed at the gate-ahead on train S 0.60.534.0: 1588 + 2); +2 #8377: the quote fence follow-ups row and its comment; +2 #8384: the quote fence follow-ups 2 row and its comment; +2 #8384 wave 3: the quote fence follow-ups 3 row and its comment; +5 GBRA-218 train M rows (A1 member_read_access_gbra218 and member_access_hatch_scope_gbra218, B shared_agent_audience_gbra231, A2 folder_access_rules_gbra218, folder_access_scoped_role_gbra218), re-summed at the train M merge of master v0.60.541.0: 1596 + 5 = 1601 measured; +3 GST-359 train C rows (C1 qm_attested_actor_gst359, C2 member_facts_gst359, D qm_memory_provider_gst359), re-summed at the train C merge of master v0.60.543.0: 1601 + 3 = 1604 measured; +2 #8424: hook_launcher_8424 row and its comment (rows are data and cannot move), re-summed at the #8418 v0.60.546.0 merge: 1604 + 2 = 1606 measured; +2 #8426: mcp_lane_launcher_8426 row and its comment (rows are data and cannot move); +2 GST-927: empty_nonstring_args_gst927 row and its comment, re-summed at the gate-ahead on master v0.60.550.0 plus #8420: 1610 measured; +2 GBRA-283 Wave A (#8460): engine_keyed_caches_gbra283 row and its comment (rows are data and cannot move)
++src/core/behavior-change-notice.ts 1615 ratchet the BEHAVIOR_CHANGES table grows by one row per disclosed change: +3 GBRA-200 comment, write-grant refusal and degraded-stamp rows (re-summed at the 0.60.55x master merge: 1612 + 3); +4 the #7891 provenance-drift and #7917/#7918 maintenance-lowering rows and their comments (re-summed at the 0.60.495.0 merge: 1547 + 4); +2 GBRA-205 saved_facts_stems row and its comment (re-summed at the #7901 0.60.492.0 merge: 1541 + 2); +2 GBRA-205 search.query_facts_block default-on row and its approval comment (re-summed at the #7610 0.60.490.0 merge: 1539 + 2); +2 the #7900 content checkpoint host-move row (since TBD until the merge slot), +2 the #7897 private-hold sweep row (since TBD until the merge slot), +2 the #7880 ingest_capture and company-brain private-hold row (since TBD until the merge slot), +5 the frozen-source wave comment and four rows (#7868, #7850, #7869/#7870, #7871), +2 the #7848 visibility_noncanonical hold row (since TBD until the merge slot), +2 the #7846 extract_atoms session-source row (re-summed at the 0.60.481.0 merge: master 1524 + 2), +2 the #7805 synthesize session-source and #7841 visibility_not_applied rows (re-summed at the 0.60.480.0 merge: master 1522 + 2), +2 strict door planned-state row (#7705, re-summed at the 0.60.470.0 merge: master 1514 + 2), +2 Bun floor 1.4.4 row (#7644), the GBRA-95 RLS backfill row (+2), +3 rows for #7596 pass_interrupted, #7599 read-only serve and the --access=read-only ceiling, +1 G5 lane C trust_release row, +1 #7619 cli_flag_equals, +3 GBRA-207 #7630 relative-anchor and stalled-write rows, +2 the #7632 function search_path disclosure row and +2 the #7679 orphaned worktree refresh row (re-summed at the 0.60.471.0 merge: master 1516 + 2), +2 the #7814 retired v0.13.1 grandfather row, +2 the #7618 conversion withhold/progress/push row (master 1520 + 2); the behavior-change table split (#7607) retires this row; +4 GBRA-188 #7489: the wave comment and three rows (brain-first instructions, starter surface default, per-turn rule); +1 GBRA-188 plugin_turn_hook_gbra188 row; +1 GBRA-242 provider_key_rules_7959 row (#7959), +2 the GBRA-199 registration_lists_verbs row (since TBD until the merge slot); +2 GBRA-133 #7652: the #7611 pass_abandoned reader row and the lean read-only serve socket row (re-summed at the 0.60.503.0 merge: master 1555 + 2); +1 GBRA-243: the per-turn hook disclosure row (rows are data and cannot move); +4 GBRA-156 #7598 harness wave comment and rows (remote page cap, sources_not_readable refusal, sources add next step); +4 GBRA-156 #7601 search_quotes_transcript_rows comment and row; +1 GBRA-175 #7475 autopilot_restarts_serve_7475 row (re-summed at the #8012 merge: 1566 + 1); +3 #7997/#8014/#8015 rows (redaction markers, company db_only keep, ignored supabase_only scope); +2 #7199 (re-port of #7228) classic_drift_rescreen_7199 comment and row; +2 #7931 file_drift_agrees_7931 comment and row; +1 #7950 file_drift_slug_release_7950 row; +1 #7974 file_drift_followups_7974 row; +1 #8059 quoted_fence_marker_8059 row; +2 GBRA-247 #8009 provenance_repair_held_8009 and #7982 pass_transient_streak_7982 rows; +4 GBRA-247 #7973 plain_directory_sync_7973, #7988 managed_marker_own_directory_7988, #7985 former_binding_parked_group_7985 and settle_effects_retire_7985 rows Train S merge: 1570 base + 5 (master since the #8077 base) + 13 (#8077) = 1588.; +2 GST-687 remote_quotes_unverified_text_gst687 row and its comment (re-summed at the gate-ahead on train S 0.60.534.0: 1588 + 2); +2 #8377: the quote fence follow-ups row and its comment; +2 #8384: the quote fence follow-ups 2 row and its comment; +2 #8384 wave 3: the quote fence follow-ups 3 row and its comment; +5 GBRA-218 train M rows (A1 member_read_access_gbra218 and member_access_hatch_scope_gbra218, B shared_agent_audience_gbra231, A2 folder_access_rules_gbra218, folder_access_scoped_role_gbra218), re-summed at the train M merge of master v0.60.541.0: 1596 + 5 = 1601 measured; +3 GST-359 train C rows (C1 qm_attested_actor_gst359, C2 member_facts_gst359, D qm_memory_provider_gst359), re-summed at the train C merge of master v0.60.543.0: 1601 + 3 = 1604 measured; +2 #8424: hook_launcher_8424 row and its comment (rows are data and cannot move), re-summed at the #8418 v0.60.546.0 merge: 1604 + 2 = 1606 measured; +2 #8426: mcp_lane_launcher_8426 row and its comment (rows are data and cannot move); +2 GST-927: empty_nonstring_args_gst927 row and its comment, re-summed at the gate-ahead on master v0.60.550.0 plus #8420: 1610 measured; +2 GBRA-283 Wave A (#8460): engine_keyed_caches_gbra283 row and its comment (rows are data and cannot move)
diff --cc skills/skills.lock.json
index 5069159d9a,b7092e07a6..c08b76dd16
--- a/skills/skills.lock.json
+++ b/skills/skills.lock.json
@@@ -44,9 -44,9 +44,9 @@@
"concept-synthesis/routing-eval.jsonl": "96dbd7d9c1b606e9e06262d0c06282399741e2bccb8eeb7b9ca88c20f44cda0e",
"context-audit/SKILL.md": "6d786629d40544ddaab4f4e6e333569d270bcb8b581589dc16fb9f8bcb4f6207",
"context-audit/routing-eval.jsonl": "fb1832e24cc1b04163a74c5cde72bca53050a66246ca902e1a5f40303f52b5ab",
- "conventions/agent-operator-protocol.md": "19007782dfc86d4d744b8df73a5b83dfca49b89dd396919291183ecfcb41d8f5",
- "conventions/agent-operator-protocol.md": "d7ea0c80658d7cf9b187d80296fe6336f6299ff5bc26b0c895f80134e5ca45c5",
++ "conventions/agent-operator-protocol.md": "1dc2a6a71469b1802cb2e9802c609a61a066a78afae9499e92ed0490221022a4",
"conventions/brain-first.md": "e0e4d7c4b760213325dffd286baf934720816a0b6aac5338538a0463e8fe77d2",
- "conventions/brain-routing.md": "392998d9a109b330c9225af4ca5c8798b0ff02eba4d441c93fdb7c263687d0c6",
+ "conventions/brain-routing.md": "f11c3e7c4f98163aa6c68aa7d8f09a7acb7b6a8695f42eb7d92d4ee5787d428a",
"conventions/calibration.md": "500dc26bd7c8400f50dc4c16fd83f1a588f3e7e68c59050a21fd8a0f69e4d198",
"conventions/cron-via-minions.md": "badb1cd6cd825d6f1ac0b6b28cc47e5d80facc783a3e59a14146ae901ee0f933",
"conventions/cross-modal.yaml": "c012c3d72614a87b1ee698173dce2a0fb0d057a54df7aab87993c4b07fff6280",
diff --cc src/core/behavior-change-notice.ts
index 03bd490bb0,223941d769..712ccd6187
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@@ -1317,12 -1321,99 +1321,102 @@@ export const BEHAVIOR_CHANGES: Readonly
// #7632 function search_path. `since` is stamped at the merge slot.
{ since: '0.60.470.0', id: 'function_search_path_pg_temp', text: 'Every gbrain function that pins a search_path now ends it with `pg_temp` (`ALTER FUNCTION ... SET search_path`, no body changes). Before, the purge and withdrawal guards pinned `pg_catalog, public`, which leaves the session\'s temporary schema first for tables and views: any session, the owner included, could create an empty temp table or view named like a ledger (`fact_purges`, `page_purges`, `take_purges`, `fact_withdrawals`, `page_segment_derivation_purges`) and store a purged claim, page, take or derivation again, or save a withdrawn fact active. The guards are otherwise unchanged (SECURITY INVOKER, same bodies, same timing). Only gbrain\'s own functions change; another application\'s functions in the same database keep their search_path. Still open, not fixed here: on Postgres, a write role with no RLS policy on a ledger reads it empty, so its purged or withdrawn writes still go through (gbrain#7659). Where the migrating role does not own a function, the migration leaves it, names it on stderr and carries on, and `gbrain doctor` (`function_search_path`) prints the `ALTER FUNCTION` to run as its owner; that changes no owner, so later boots still succeed. An older gbrain binary that replays its schema against the brain (`gbrain init` or `gbrain upgrade` from it; an ordinary boot replays nothing) drops `pg_temp` from the functions it re-creates; doctor flags them, and `gbrain init` or `gbrain upgrade` with this release, or the printed `ALTER FUNCTION`, puts it back. An ordinary boot of this release does not.' },
// #7705 (strict door planned state). `since` is stamped at the merge slot.
- { since: '0.60.471.0', id: 'door_planned_state', text: 'On a source with `canonical: git`, a page write now commits exactly the bytes it published, or nothing. A file edited on disk while the write was publishing refuses `git_target_changed`: nothing is committed, the edit stays on disk and the source\'s writes pause until `gbrain repair stuck-recovery` resolves it (before, Git committed the edit while the database recorded the write\'s content). A staged change of the page\'s file refuses `git_index_conflict`, with the index untouched; commit or unstage it, then retry (before, the write replaced the staged change in the index). When the index still holds the version from before an earlier gbrain commit whose index update failed, the next write restores it and says so with a `git_index_restored` notice.' },
+ { since: '0.60.471.0', id: 'door_planned_state', text: 'On a source with `canonical: git`, a page write now commits exactly the bytes it published, or nothing. A file edited on disk while the write was publishing refuses `git_target_changed`: nothing is committed and the edit stays on disk; when the file holds neither the write\'s bytes nor the version before it, the source\'s writes pause until `gbrain repair stuck-recovery` resolves it, and when it holds the version before the write, the write fails with nothing held (before, Git committed the edit while the database recorded the write\'s content). A staged change of the page\'s file refuses `git_index_conflict`, with the index untouched; commit or unstage it, then retry (before, the write replaced the staged change in the index). When the index still holds the version from before an earlier gbrain commit whose index update failed, the next write restores it and says so with a `git_index_restored` notice.' },
// #7679 / #7685 orphaned worktree refresh. `since` is stamped at the merge slot.
{ since: '0.60.472.0', id: 'refresh_orphan_7679', text: 'A managed `gbrain sources refresh` whose process died (for example a container replaced mid-refresh) no longer wedges the checkout: the next plain `gbrain sources refresh` on the owner host finishes the orphaned refresh through the `--resume` path before its own refresh and reports it as `recovered`, and the owner completes an orphaned `syncing` refresh once every member has synced to its target. A refresh whose holder is still running, or is recorded on another host, is never taken over. `gbrain sources writer status` and `gbrain sync status` now name the holder and its `liveness` (`live`, `orphaned`, `unknown`) with a fix naming `--resume`. With `--json`, a refusal that carries a structured fix (`refresh_in_progress`, `refresh_diverged`, a git read failure) now prints `fix` as an object (argv, actor, next) instead of a string; the prose stays in `suggestion`, so read that when a script needs text. A plain refresh of a checkout whose interrupted refresh needs a reset decision now refuses `refresh_recovery_required` (it refused `refresh_in_progress`).' },
+ // #7814 retired v0.13.1 grandfather. `since` is stamped at the merge slot.
+ { since: '0.60.479.0', id: 'v0_13_1_grandfather_retired', text: 'Upgrading a brain whose migration ledger never recorded v0.13.1 (one created by `gbrain init` before v0.60.412.0, or opened from a new GBRAIN_HOME) no longer writes `validate: false` into every page\'s frontmatter: `gbrain apply-migrations` records v0.13.1 complete and changes no page, so no content_hash moves and a repo brain\'s files and Git history stay as the user wrote them. The stamp only opted a page out of the BrainWriter validators, which never refuse a write, and out of `gbrain integrity` scans, so on such a brain those scans now include the pages a fresh brain would scan. A page that already carries `validate` keeps it, and a grandfather write an older gbrain left queued ends `conflict` without writing. Pages an older release stamped keep the stamp; their pre-stamp frontmatter is in `~/.gbrain/migrations/v0_13_1-rollback.jsonl` on the machine that ran it.' },
+ // #7617 / #7618 / #7644 / #7655 conversion. `since` is stamped at the merge slot.
+ { since: '0.60.480.0', id: 'git_conversion_withhold_progress_push', text: '`gbrain sources canonical <source> --to git --apply` now converts a source with private pages instead of refusing: a private page whose committed file differs from it has the file\'s removal committed and stays in the database (`withhold` in the preview; before, the apply refused `git_conversion_blocked`), a private page whose file was removed by hand is withheld instead of deleted by the strict pass, and a private page whose committed file still equals it keeps that file in Git, as before. The apply prints a progress line on stderr at each phase and every 10 seconds, and prints a partial report on stdout when stopped by SIGTERM, SIGINT or SIGHUP (exit 143, 130 or 129). The source is git-canonical once `recordConversion` runs before strict_pass_2; the runtime report is authoritative: a stop before that leaves the source mixed, and a new preview lists what is left. Where the source pushes its commits, the apply pushes its own; a push that does not land is named in the receipt with the command that pushes now. One path Git cannot check no longer discards every adoption candidate, and holds clear only after the strict recheck passes.' },
+ { since: '0.60.481.0', id: 'synthesize_session_source_7805', text: 'Dream synthesis writes a captured session only into the source its session recorded (the `.src-<id>` name in the corpus `sourced/` folder, or the session\'s frozen record), never into the source the cycle runs for. A session of another source waits for `gbrain dream --source <id> --phase synthesize`; a session whose source never resolved, and a file written before sessions recorded their source on a brain with more than one source, is held, already-extracted ones included, until `gbrain sweep --assign-corpus <source>` previews and `--apply` maps it. The phase summary and `details.source_routing` count both. Pages an earlier release already wrote into the wrong source are not moved (#7805, reported by @exGeni).' },
+ { since: '0.60.481.0', id: 'put_visibility_not_applied_7841', text: '`put_page`, `edit_page` and `capture` content that asks for `visibility: private` in a form gbrain does not apply (`Private`, `PRIVATE`, or a `Visibility` key, however YAML spells it) is refused with `visibility_not_applied` instead of committing a world-readable page. Write `visibility: private` on its own frontmatter line, lowercase. Nothing ever widens a page\'s visibility (#7841).' },
+ // #7846 extract_atoms session source. `since` is stamped at the merge slot.
+ { since: '0.60.482.0', id: 'extract_atoms_session_source_7846', text: 'Dream `extract_atoms` writes a captured session\'s atoms only into the source its session recorded (the `.src-<id>` name in the corpus `sourced/` folder, or the session\'s frozen record), never into `default`. Each source\'s run now reads the session corpus and keeps only its own sessions (`gbrain dream --source <id> --phase extract_atoms`); meeting transcripts stay with `default`. A session whose source never resolved, and a file written before sessions recorded their source on a brain with more than one source (already-swept ones included), is held until `gbrain sweep --assign-corpus <source>` previews and `--apply` maps it. The phase summary and `details.source_routing` count both. Atoms an earlier release already wrote into the wrong source are not moved (#7846).' },
+ // #7868, #7850, #7869, #7870, #7871 frozen-source privacy wave. `since` is stamped at the merge slot.
+ { since: '0.60.483.0', id: 'corpus_session_tier4_only_7868', text: 'A captured session whose source was never recorded is no longer filed under `sources.default`, the only non-default source or `default` when the brain resolves it later: only a registered source whose folder contains the session\'s working directory counts. Any other session stays held as `corpus_source_unresolved` until `gbrain sweep --assign-corpus <source>` previews and `--apply` maps it. A brain with one source still uses that source, without recording it, so a source added later holds the session instead. Sessions an earlier release already recorded keep their source (#7868).' },
+ { since: '0.60.483.0', id: 'synthesize_session_recheck_7850', text: 'A dream synthesis job checks its session\'s source again when it runs and is refused (`session_source_changed`) before any model call when the session now belongs to another source or its source was deleted and recreated; on a managed brain, jobs queued by an earlier release are checked too. `gbrain dream --dry-run` no longer records a session\'s source while previewing synthesize or extract_atoms (#7850).' },
+ { since: '0.60.483.0', id: 'atom_retry_resume_session_source_7869_7870', text: 'An explicit atom retry (`gbrain jobs submit extract-atoms-drain` with `retryRequestId`) of a captured session that does not belong to the retry\'s source is refused with `transcript_source_mismatch` and starts nothing. A crashed atom generation whose pending members came from such a session is not resumed: the members are held, their atom pages left as they are, and counted in `details.source_routing.generation_members_held` (#7869, #7870).' },
+ { since: '0.60.483.0', id: 'corpus_realpath_7871', text: 'Dream synthesis and extract_atoms recognize a session-corpus file through symlinks (a meeting folder or corpus path that points into the corpus, a linked `sourced/` folder), so such a file is routed to its session\'s source instead of being read as an ordinary transcript; a listed file whose real path cannot be read is held as `corpus_path_unresolvable` (#7871).' },
+ // #7848 non-canonical private requests on file ingestion. `since` is stamped at the merge slot.
+ { since: '0.60.483.0', id: 'visibility_noncanonical_hold_7848', text: 'Git sync (classic and managed) and `gbrain import` (with or without a Git checkout) hold a file whose frontmatter asks for `visibility: private` in a spelling page privacy does not read (`Visibility: private`, `visibility: Private`, a block scalar, a list, a flow mapping or a merge key) as `visibility_noncanonical` instead of storing a world-readable page; the rest of the source syncs and an existing page keeps its last imported version. Write `visibility: private` on its own frontmatter line (lowercase) and commit, or import the file again. Doctor `git_held_files` counts the held files and the stored pages that already ask for private this way (`details.visibility_noncanonical`); nothing rewrites them. On a brain without managed persistence, `gbrain put --file` and `gbrain capture --file` of a page over the single-string ceiling refuse such a request with `visibility_not_applied`, as a smaller write does.' },
+ // #7880 ingest_capture and company-brain imports on a brain without managed persistence. `since` is stamped at the merge slot.
+ { since: '0.60.485.0', id: 'ingest_capture_private_hold_7880', text: 'On a brain without managed persistence, an `ingest_capture` job (the webhook `POST /ingest` route and the ingestion daemon) whose content asks for `visibility: private` in a spelling page privacy does not read (`Visibility: private`, `visibility: Private`, a block scalar, a list, a flow mapping or a merge key) is refused `visibility_not_applied` and dead-letters on its first attempt instead of storing a world-readable page, as a managed brain already refused it. A legacy company-brain connect or sync holds such a file as `visibility_noncanonical` instead of importing it world-readable, and the GitHub and Google connectors hold it on a database-only source as they do with a checkout. Write `visibility: private` on its own frontmatter line (lowercase) and send it again. Nothing rewrites pages already stored (#7880).' },
+ // #7897 the remaining content imports without the private-request hold. `since` is stamped at the merge slot.
+ { since: '0.60.487.0', id: 'private_hold_sweep_7897', text: 'Three more writers refuse content that asks for `visibility: private` in a spelling page privacy does not read (`Visibility: private`, `visibility: Private`, a block scalar, a list, a flow mapping or a merge key) instead of storing a world-readable page. `gbrain repair url-clone-fences` lists such a clone file under `visibility_noncanonical`; apply keeps its fence rows database-only and restores the file from HEAD so the clone can pull again, but does not import HEAD as the page and reports `held`, not `restored` (an approval previewed before this release applies the same way). On a brain without managed persistence, `gbrain brainstorm` / `gbrain lsd` `--save` refuses it `visibility_not_applied` and exits 1, as a managed brain already did, and a save whose import is refused for another reason is reported not saved. `gbrain sources reconcile` refuses a merge that takes a file\'s `Visibility: private` with `visibility_not_applied`. Write `visibility: private` on its own frontmatter line (lowercase) and try again. Nothing rewrites pages already stored (#7897).' },
+ // #7900 v0.53.0 content checkpoint after a host move. `since` is stamped at the merge slot.
+ { since: '0.60.488.0', id: 'content_checkpoint_host_move_7900', text: 'After a brain moves hosts, `gbrain apply-migrations` at v0.53.0 (`content-checkpoints`) still refuses `The canonical root changed after setup began` when an unfinished shared-skills content setup checkpoint names the old host\'s root, but its fix is now `gbrain repair content-receipt-root --source <source>` (before, it told you to resume at the old root). That repair, and doctor `sync_freshness` (`content_receipt_stale`), now list unfinished checkpoints that name another root as well as complete receipts (before, the repair found nothing). The preview names the step that proves the new root; for a source claimed on the new host that is a self-transfer on the owner host, which rebinds the checkpoint, followed by `gbrain sources writer activate --confirm-quiesced --shared-skills` when shared skills are on. Then `gbrain apply-migrations --force-retry 0.53.0` completes. Nothing is rewritten without those explicit steps.' },
+ // GBRA-205: Garry approved the default ("Yes", 2026-10-26), on the sealed held-out result (gbrain-evals docs/benchmarks/2026-10-26-gbrain-8k-conversion.md).
+ { since: '0.60.491.0', text: '`query` with a token budget now puts question-ranked dated saved facts ahead of the pages (the facts block): up to 22% of the budget and 40 rows, oldest first, each with its date header, in place of the facts arm (and of the temporal fact reserve when it is on). On a sealed held-out set of 200 questions it answered 183 against 151 without it. It adds about 70 tokens to a median budgeted result (p95 about 700) and no model call. Queries without a budget, `search` and `think` are unchanged; remote callers see only facts whose source pages they could read. `gbrain config set search.query_facts_block false` restores the previous results.' },
+ // GBRA-205 saved-facts wave (harness case cr-05). `since` is stamped at the merge slot.
+ { since: '0.60.493.0', id: 'saved_facts_stems', text: 'Search `saved_facts` matches a saved fact\'s words the way the facts keyword index does: whole words after stemming with the brain\'s full-text language, so a query for "seats renewal" finds a fact that says "renews at 52 seats", and "count" no longer matches inside "countersigned". A fact still needs three quarters of the query\'s words, and never more than four, so a question asked in full finds the short fact that answers it, not counting words that frame a question about a figure (count, number, total, amount); words of a CJK script still match as substrings. Among facts matching as many words, the newest comes first, and at most five facts ride a reply. On by default (`gbrain config set search.saved_facts_supersede false` turns it off): search also returns a newer fact with a correction cue that shares two matched words with a returned fact, ahead of the fact it corrects, which is labelled `corrected_by`; every such correction comes back, not only the newest, and an acknowledgement that adds no figure (dates left out) corrects nothing, and a reply that only reports a correction ("corrected", "correcting") makes none; nor does a cue fact saved under another entity, of lower trust, or sharing none of the names the older fact matched.' },
+ // GBRA-188. since: '0.60.495.0' is stamped at the merge slot.
+ { since: '0.60.495.0', id: 'brain_first_instructions_gbra188', text: 'Harness installs now write a short marked brain-first block into the harness\'s own instruction file by default (Claude Code ~/.claude/CLAUDE.md, Codex AGENTS.md or a non-empty AGENTS.override.md, opencode AGENTS.md, the OpenClaw workspace AGENTS.md, an existing Hermes SOUL.md, a Cursor project rule): `gbrain setup <harness>`, `gbrain connect --install`, `gbrain bootstrap harness` and the thin-client GBRAIN-INSTRUCTIONS.md. Text outside the markers is never touched and a re-run upgrades the block in place. `--no-instructions` or GBRAIN_AGENT_INSTRUCTIONS=0 removes it and is remembered; `--remove` strips it; `gbrain setup <harness> --instructions-only` manages only the block. doctor `harness_wiring` warns when a registered harness\'s block is missing, stale or damaged.' },
+ { since: '0.60.495.0', id: 'install_surface_starter_gbra188', text: 'New stdio registrations gbrain writes (`gbrain setup`, `gbrain bootstrap hooks`, the readiness and `gbrain init` registration lines) now pin `--surface starter`, the daily-driver tool list, instead of `--surface full` (Garry, 2026-10-24; gbrain-evals#191: reach and accuracy unchanged, 17-23% fewer input tokens). An existing registration keeps its surface and is never rewritten; the Codex and Claude Code plugins and a bare `gbrain serve` stay on full. `--surface full` is the opt-in for every operation, any parameter the starter list leaves out is still accepted, and `request_tools` returns full schemas or widens the session to a left-out tool. doctor `harness_wiring` notes a full registration as information only.' },
+ { since: '0.60.495.0', id: 'brain_first_turn_rule_gbra188', text: 'The brain-first rule now rides every turn, not only the system prompt (Garry, 2026-10-25). The block (v2) opens with "before answering any turn, check GBrain first"; while it is installed, the Claude Code and Codex UserPromptSubmit hook leads each turn with that one-line rule, with or without a context block; `gbrain setup openclaw` writes a hook-only plugin (gbrain-turn-rule, before_prompt_build prependContext) under the OpenClaw state dir and installs it with the openclaw CLI (install --link --accept-capabilities, enable, plugins.entries.gbrain-turn-rule.hooks.allowConversationAccess true), or prints those commands with no openclaw on PATH; and `gbrain setup hermes` adds a marked, self-contained `pre_llm_call` shell hook (`/bin/echo` of the rule) to $HERMES_HOME/config.yaml and approves that command in Hermes\'s shell-hooks-allowlist.json, or prints the entry when config.yaml already has a `hooks:` section. `--no-instructions` or GBRAIN_AGENT_INSTRUCTIONS=0 turns the rule off with the block.' },
+ // #7891 provenance-stamp drift check and repair. `since` is stamped at the merge slot.
+ { since: '0.60.496.0', id: 'provenance_stamp_drift_7891', text: 'New doctor check `provenance_stamp_drift` warns when a page\'s provenance stamps (`source_kind`, `ingested_via`, `ingested_at`) or its lowering `trust_tier` marker were removed or rewritten by a write that is not the owner\'s own (before v0.60.486.0, #7892, made the stamps server-owned), or when a classified page\'s file would re-read above its stored tier. It reads page history and write receipts only and writes nothing. New explicit-only repair `gbrain repair provenance --source <id>` previews each page with its stamps, marker and tier before and after; `--apply --expect <hash> --yes` puts the stamps back, stamps the lower marker, lowers the page to it and files a `lower_page` proposal that `gbrain trust review` confirms or reverts. It only lowers trust, never writes the owner\'s own edits, writes unattributed ones only with `--include-ambiguous`, and never runs from `--all`, the remediation plan or an upgrade.' },
+ // #7917 / #7918 maintenance lowerings and unreadable derivation declarations. `since` is stamped at the merge slot.
+ { since: '0.60.496.0', id: 'maintenance_lowering_7917_7918', text: 'A maintenance publication that lowers a page\'s trust tier (a dream or patterns write over a page the owner wrote, such as a grounding repair outside the output prefix) now files a `lower_page` proposal, so the page shows up in `gbrain trust review`; before, only agent content writes did. A maintenance write whose derivation declaration is present but unreadable now publishes at `unknown` and stamps an `unknown` trust marker into the file, instead of taking the write channel\'s tier and leaving the file unmarked. Both only lower trust. `gbrain trust backfill --repair-unknown-markers` and `gbrain repair provenance` on a classic (unmanaged) checkout now also write the repaired page to its file in the same step, and leave a page whose file holds an edit sync has not imported untouched (run `gbrain sync` first).' },
+ { since: '0.60.498.0', id: 'plugin_turn_hook_gbra188', text: 'The Claude Code and Codex plugins (gbrain, gbrain-coding, gbrain-daily) now declare the UserPromptSubmit hook `gbrain setup` writes, run through the plugin launcher with GBRAIN_HOOK_LANE=plugin (Claude Code `hook user-prompt`, 3 s; Codex `hook user-prompt --harness codex`, 15 s, skipped until trusted in /hooks). While a brain-first block is installed it adds the per-turn rule, and with a serve running the read-context block; it exits without output when setup, bootstrap or a workspace install already wires the event, so a turn gets it once; a recorded `gbrain setup <harness> --no-hooks` turns it off too. doctor `harness_wiring` and `gbrain post-upgrade` now name `gbrain setup <harness> --instructions-only` for a plugin-only install with no brain-first block.' },
+ { since: '0.60.502.0', id: 'provider_key_rules_7959', text: 'The secret scanner now catches OpenRouter (`sk-or-v1-`), Groq (`gsk_`), xAI (`xai-`), Perplexity (`pplx-`) and Replicate (`r8_`) API keys: `gbrain sources push` refuses a page that holds one, and search, recall and transcript import redact it. Rotate such a key with its provider rather than allowlisting it. `gbrain doctor` asks once for a fresh `gbrain transcripts audit-secrets` run.' },
+ { since: '0.60.504.0', text: '`gbrain sync status` and doctor `managed_sync_blocked` no longer read a managed sync pass `pass_abandoned` while a process still renews its drain lease (a pass started over earlier interrupted ones), nor `pass_interrupted` when the pass ended between their pass and lease reads; liveness reads the database clock, and doctor keeps status\'s quiet-window rule when the lock read fails. A pass stopped by a lost database connection, a statement timeout, write back-pressure or a lost drain lease now ends `resumable` (`stop_reason` `transient` or `lease_lost`) instead of reading killed. The on-commit notifier, the notifier block and `sources status` `writer_heartbeat` no longer count a killed holder\'s lock row as a live holder, so the notifier starts the sync that takes its expired lease over.' },
+ { since: '0.60.504.0', text: 'On Postgres, `gbrain serve --access read-only` (stdio) binds its own read socket for resolve, turn_context and context_pack instead of the source and legacy sockets, so a read-write serve started later for the same source always answers delegated sync, nudge and sweep requests; before, a read-only serve that bound first made the CLI fall back with `unsupported_kind`.' },
+ { since: '0.60.505.0', id: 'turn_hook_every_install_gbra243', text: 'Every harness install path now wires the per-turn brain-first hook: `gbrain setup claude-code|codex --instructions-only` (after a plain `mcp add`), `gbrain connect --install`, `gbrain connect --harness … --install` and `gbrain bootstrap harness` (Codex, and Claude Code when its own hooks are off) add one UserPromptSubmit entry that prints only the "check gbrain first" rule and reads no brain data; it yields to setup, bootstrap and plugin hooks, so a turn still gets the rule once. Each install runs the hook (or `openclaw plugins inspect gbrain-turn-rule --runtime --json`, `hermes hooks doctor`) and exits non-zero with `turn_hook_not_loaded` when it does not load; doctor `harness_wiring` warns the same way. `--no-instructions` or `--no-hooks` installs none, and registrar mode stays MCP-only. On OpenClaw and Hermes the per-turn rule now names the gbrain tools and the `tool_search` route.' },
+ // GBRA-156 harness wave (#7598). since is stamped at the merge slot.
+ { since: '0.60.506.0', id: 'remote_page_cap_gbra156', text: 'A remote `search` or `query` that names no `limit` now returns every page that matched its words, a name or an exact identity, plus pages that matched only by meaning up to 3 pages in total (`search.remote_page_cap`, default 3; `0` turns it off). A line after the results says how many pages were left out, and `_meta.retrieval.page_cap` counts them. An explicit `limit`, a paged call, an image `query`, a host-run subagent tool call and every CLI call on the brain host (a thin-client CLI call is remote and gets the cap) return the same rows as before.' },
+ { since: '0.60.506.0', id: 'sources_not_readable_refusal_gbra156', text: 'An unscoped remote `search`, `query`, `recall` or `list_pages` from a connection with no source grant that comes back empty, when every source it reads holds no page (for `recall` and `query`, no world fact either) and other sources do, is now refused with `sources_not_readable` (host fix `gbrain sources federate <source>` with the source the user picks, or a grant for the token) instead of answering empty with a degraded notice. A scope that holds pages but matched nothing, a brain with no pages, granted tokens, OAuth clients, bound connections and reads that name a source behave as before.' },
+ { since: '0.60.506.0', id: 'sources_add_next_gbra156', text: '`gbrain sources add` without `--federated` or `--no-federated`, on a brain that is not managed where connections with no source grant read no page, now prints `next: gbrain sources federate <id>` on stdout. `--json` prints `{id, name, local_path, remote_url, federated, next?}` on stdout and moves the human lines to stderr. A managed brain prints its lifecycle receipt as before.' },
+ // GBRA-156 #7601 quoted transcript rows. since is stamped at the merge slot.
+ { since: '0.60.507.0', id: 'search_quotes_transcript_rows', text: '`search`, `query` and `assemble_evidence` now return a row from a conversation page (type `conversation`, what transcript imports write) with `quoted: "transcript"` and its text wrapped as a quoted excerpt: a line naming the page as source material, then a code fence. Tool-call and function-call JSON inside (Gemini `functionCall` included), and XML-style `function_calls`, `invoke`, `tool_use` and `tool_call` blocks, become `[tool call: <name>, arguments omitted]`. Under `return_unit: auto` an explicit `token_budget` pays for the fence, so a conversation-heavy result can return fewer or shorter rows. Stored pages, ranking, scores and other page types are unchanged; read `quoted` to tell these rows apart, and `get_page` for the text as stored.' },
+ { since: '0.60.511.0', id: 'storage_invalid_holds_8007', text: 'A managed sync no longer deletes a live page whose file is gone while gbrain.yml\'s storage section is invalid (tiers that overlap), declares `db_only` in a form that resolves no directory (a flow list split over lines, a key outside `storage:`), or lists a deprecated `supabase_only` next to canonical keys (which ignores it): it cannot tell which pages are database-only, so it keeps each such page and holds its path as `file_drift` with `meta.reason` `storage_invalid`. Run `gbrain storage status`, fix gbrain.yml, commit it and sync again; the holds clear and each page is decided under the fixed config. `gbrain repair file-drift --prefer file` and `sync.apply_held_deletions` skip these pages too.' },
+ { since: '0.60.511.0', id: 'storage_flow_lists_8007', text: 'gbrain.yml storage tiers written as a one-line flow list (`db_only: [media/x/, \'archive/\']`, likewise `db_tracked` and `keep_db`) now take effect; they used to resolve nothing. After upgrading, directories declared that way are treated as declared: sync adds `db_only` ones to .gitignore and publishes new pages there database-only, and `keep_db` ones get database-wins writes. An explicit `db_only: []` declares no directory and no longer makes the sync baseline commit refuse.' },
+ { since: '0.60.514.0', id: 'storage_ignored_dirs_8015', text: 'When gbrain.yml lists a deprecated `supabase_only` next to canonical keys (which ignores it), a managed sync now holds only the missing-file pages under the ignored directories `db_only` does not already cover, and deletes other missing-file pages as usual; it used to hold every missing-file page of the source. `gbrain storage status` now names those directories, and the deprecation warning no longer points to a `gbrain doctor --fix` rename that does not exist. A `db_only` or `supabase_only` line whose inline value the parser refuses (a missing comma, a nested list, a bare scalar) now counts as unresolved even when another key resolves, so missing-file pages are held rather than deleted.' },
+ { since: '0.60.514.0', id: 'company_db_only_keep_8014', text: 'A company-brain source now keeps a live page under a declared `storage.db_only` directory when its file is not in the approved manifest, and keeps every such page while its gbrain.yml storage section is invalid, as other managed sources do; it used to delete them. The decision reads gbrain.yml at the approved commit, never the working tree.' },
+ { since: '0.60.514.0', id: 'redaction_marker_not_credential_7997', text: 'The transcript `labeled_credential` detector no longer reads an importer redaction marker (`login **<REDACTED:user-pattern>**`) as a typed user/password pair, so a correctly redacted page clears `gbrain transcripts audit-secrets`; a password written beside a marker is still found. The audit detector version moves to 3, so `gbrain doctor` asks for a fresh audit once.' },
+ { since: '0.60.525.0', id: 'rows_behind_checkpoint_8071', text: 'New doctor check `sync_rows_behind_checkpoint` and explicit-only repair kind `gbrain repair rows-behind --source <id>` (#8071): on each managed source\'s owner host, doctor compares every live Markdown page with its file read from Git at the sync checkpoint (`sources.last_commit`) and warns about rows that hold an older version with no hold, which no later sync re-imports because the import record names the current file. The repair previews each row with its path, checkpoint blob and action and writes nothing; `--apply --expect <hash>` re-imports the committed file through the managed import (no file is written), or opens the hold sync would have opened when that import is refused or the file is over the read bound. Rows with no import record join only with `--include-ambiguous`. Bounded by `GBRAIN_DOCTOR_ROWS_BEHIND_TIMEOUT_MS` (default 10 s); not applicable on repo-less brains and off the owner host. It never runs on upgrade or automatically.' },
+ { since: '0.60.525.0', id: 'derived_write_through_commits_8073', text: 'Files the dream cycle writes into a source that is a Git checkout are now committed: atom and concept files (with `cycle.extract_atoms.write_through` or `cycle.synthesize_concepts.write_through` on) and the reverse-written synthesis, patterns and cycle-summary pages and their removals. Each batch (an item\'s atoms plus the files of the atoms it retired, the backfill, one concept, or one phase\'s reverse-written pages) is one local commit naming only those files, made through the checkout\'s commit lock (a hardened checkout\'s post-commit hook pushes it; a checkout with a canonical owner marker gets a named-paths-only commit). They used to stay untracked or modified, which made the scheduled sync skip every run. A commit the checkout refuses rolls back the files it wrote and reports `write_through_failed` with a warn status; atoms and concepts are written again on the next run. Each written file is also recorded in the pending write-through ledger, so files a crash left uncommitted go into the next commit gbrain makes in that checkout. Files left uncommitted by earlier versions are not touched; commit them with `gbrain git commit-push -m <msg> -- <paths>`.' },
+ { since: '0.60.525.0', id: 'oversize_hold_unread_8072', text: 'A Markdown file over 24 MiB that sync had to read whole to refuse (segmented storage on, held `file_too_large`, for example for a facts fence) is no longer read again by every sync: it stays held, unread, until it changes, gbrain is upgraded, or `gbrain sources retry-held <source>` schedules it. After changing a setting the hold message names, run `gbrain sources retry-held <source>`. A file held from its size alone still re-checks on every sync.' },
+ { since: '0.60.525.0', id: 'refresh_sync_budget_8072', text: 'The member syncs of one `gbrain sources refresh` run stop starting work after `sources.refresh_sync_budget_ms` (default 5 minutes; `GBRAIN_REFRESH_SYNC_BUDGET_MS`). Each member gets an equal share of what is left. A run past it reports `sync_deferred` with the members it left `deferred` and still completes the refresh, so writes to the checkout are admitted again and the next `gbrain sources refresh <source>` continues them; a member that committed nothing in its share is reported `refresh_sync_timeout` in `sync_blocked`. A stalled sync no longer holds the refresh lock across scheduled runs or starves the other members.' },
+ { since: '0.60.543.0', id: 'member_read_access_gbra218', text: 'A page whose frontmatter names readers (`readable_by: [alice-example, group:team-a]`) is now read remotely only by a token, OAuth client or stdio server bound to a listed member (`gbrain access member add`, `gbrain auth rescope --token <name> --member <id>`, config `mcp.stdio_member`). Every other remote caller gets the same `not_found` as for a missing page, including unbound credentials, a `--private-pages granted-sources` bot and both escape hatches (`GBRAIN_REMOTE_PRIVATE_PAGES=1`, `search.remote_private_pages=visible`), which relax only `visibility: private`. A malformed `readable_by` reads as nobody, and a page derived from a restricted page reads as nobody remotely. Pages that already named `readable_by` before this upgrade read as nobody remotely until `gbrain repair access` (preview, then `--apply`). The local CLI is unchanged; `--as <member>` previews one member\'s view.' },
+ { since: '0.60.543.0', id: 'member_access_hatch_scope_gbra218', text: 'On a brain where any page names readers or any member exists, the escape hatches no longer turn the remote read filter off: remote reads still hide pages the caller\'s member is not listed on, and secondary surfaces that use the identity-free filter (proactive brief, retrieval reflex, entity resolution, known-as-of) hide every restricted page and keep hiding `visibility: private` pages under a hatch. A brain with no restriction keeps the old hatch behaviour exactly. A credential bound to a disabled or removed member is refused at verification (`access_member_disabled`).' },
+ { since: '0.60.543.0', id: 'shared_agent_audience_gbra231', text: 'A shared agent can now read as the people a turn serves: its harness names the audience in the `X-Gbrain-On-Behalf-Of` header or request-level `_meta.on_behalf_of` (member ids, `group:<id>`, `guest`), and the call returns only pages every entry may read, within the agent\'s own source grant; a channel audience (more than one member, a group or a guest) never sees a `visibility: private` page. Each entry must be in the credential\'s `may_act_for` (`gbrain auth rescope --token <name> --may-act-for <list>`; for stdio, config `mcp.stdio_may_act_for`), which earlier releases stored without enforcing. An audience inside tool arguments is refused (`on_behalf_of_in_arguments`). Every remote MCP response now carries `_meta.access` (member, groups, audience, policy revisions, privacy relaxation), and `whoami` returns it as `access.applied`.' },
+ { since: '0.60.543.0', id: 'folder_access_rules_gbra218', text: 'A source can now keep whole folders to named members with folder rules (`gbrain access rule add --prefix partners/alice-example/ --readers alice-example,group:team-a --source <id>`, preview then `--yes`). On a repo-less source the rules live in the database; on a git-backed source they live in `.gbrain/access.yml`, committed through `gbrain git commit-push` and applied on sync. A remote read of a page under a rule needs the caller\'s member to be listed on every rule covering it, on top of the page\'s own `readable_by`; no hatch, grant or `--as` relaxes it. Narrowing applies at once; a change that widens (removing a rule or a reader) is held until `gbrain access apply --source <id>` previews it and `--yes --expect <plan_hash>` approves it. While an apply is unfinished its prefixes read as nobody remotely (`access_policy_pending`, fixed by `gbrain access resume --source <id>`). `gbrain export` carries each source\'s applied rules under `.gbrain/`, and `gbrain import` installs them before any page (`--access-policy <source>` picks one source\'s rules from a multi-source export). Remote callers cannot write `.gbrain/` pages. Nothing changes on a source with no folder rule.' },
+ { since: '0.60.543.0', id: 'folder_access_scoped_role_gbra218', text: 'On Postgres, a database role that neither owns the folder access tables (`access_policy_state`, `access_rules`, `access_pending_coverage`) nor bypasses row-level security, and holds no policy that lets it read them, no longer reads them as "no rule": a page write it makes is refused with `writer_coordinator_required` (`unreadable_state`, naming the table), and its reads treat every page as under a pending folder prefix, so remote reads show nothing. The owner, a role that bypasses RLS and PGLite are unaffected; docs/ENGINES.md ("Folder access tables") lists the four policies a scoped role needs.' },
+ { since: '0.60.546.0', id: 'qm_attested_actor_gst359', text: 'A trusted system can now name the person a call serves: a client-credentials client the brain host grants the attest right (`gbrain auth rescope --client <id> --attest-actor qm`) sends `x-qm-actor: <canonical id>`, and each attested operation runs as the member that id is linked to (`gbrain access member link <member> --qm <id>`), never reading `visibility: private` pages; `capture`, `extract_facts`, take writes and `list_write_conflicts` are not attestable yet. A call that sends `x-qm-actor` or an `acting_user` argument without that right, for an operation outside the credential\'s `--attest-ops`, or with an id that is not 1-256 visible ASCII characters is refused (`actor_not_attested`); an id with no link to an enabled member is refused (`actor_unlinked`). Refusals carry their code in `structuredContent.error`. Every MCP server\'s `serverInfo` now includes a one-line `description`.' },
+ { since: '0.60.546.0', id: 'member_facts_gst359', text: 'A fact a member saves remotely (`remember` attested as a person, or from a credential bound to one member) now goes on that member\'s own page `memory/members/<member>`, created with `readable_by: [member:<id>]`, as a `visibility: private` fact with the entity kept as metadata, instead of on the entity page where every reader of the source recalled it. Only that member recalls it; it never dedups against, supersedes or contests another page\'s fact, never consolidates into a take, and keeps its readers through a fence rebuild and relink. A credential whose `bound_slug_prefixes` do not cover that page is refused (`permission_denied`) by `remember` and `memory_write` for a member instead of writing outside its grant. Under one attest client, hot memory, `delta` cursors, write receipts (`get_write_request`, `list_write_requests`, `cancel_write_request`, replays by `request_id`) and agent jobs (`get_agent_job`) are kept to the person they were made for: another person and the client\'s bare calls get `not_found`. `remember`, `delta`, the receipt operations, `submit_agent` and `get_agent_job` are now attestable.' },
+ { since: '0.60.546.0', id: 'qm_memory_provider_gst359', text: 'QM can now keep per-person memory: `memory_recall` and `memory_write`, the default attested operations of an attest client with `get_write_request` (`gbrain auth rescope --client <id> --attest-actor qm`), read the person\'s own recent facts first and then the facts they may read, and save facts on that person\'s own page `memory/members/<member>`, readable by them alone. `memory_write` needs an attested person (`actor_not_attested` reason `actor_required` otherwise), and a reused `idempotency_key` returns the first receipt for the same person only. `forget` and `forget_fact` are now attestable: for an attested person or a credential bound to a member they withdraw only a fact on that member\'s own page, and only on that page; any other fact is `not_found`. A request carrying `x-qm-audience` is refused (`actor_not_attested` reason `audience_not_supported`) until channel audiences are served. `remember` and `memory_write` accept `valid_from` only as an ISO 8601 date or time in years 0001-9999. The contract QM vendors is `docs/contracts/qm-memory-provider/v1.json`.' },
+ { since: '0.60.516.0', id: 'quoted_fence_marker_8059', text: 'A page that quotes a facts or takes fence marker in prose (text after the marker on its line, or a blockquote line) is now held or refused with the fence reason `quoted_marker` instead of `repeated_marker` or `unclosed_ambiguous_tail`, and `gbrain repair fences`, `gbrain repair content`, `gbrain sync unblock --apply` and the maintenance run repair it by wrapping each mention in backticks, with a receipt per file; readers count fence lines exactly as before. The edit is kept only when every fence row stays where it was and nothing the privacy boundary hid becomes visible. Existing `invalid_fence` holds are screened once more on the next sync. `forget` now locates the facts fence it rewrites with the parser\'s code-aware search, so a marker quoted in code above the fence no longer moves the rewrite.' },
+ // #7199 (re-port of #7228). since is stamped at the merge slot.
+ { since: '0.60.516.0', id: 'classic_drift_rescreen_7199', text: 'A `file_drift` hold with side `unknown` that an older gbrain wrote before sync compared a record-less page with its file at the last synced commit is now compared once more, also with the file\'s last three earlier committed versions, and imports when the page equals one of them; otherwise it stays held and is not re-screened again. Such a hold now names what the page was compared with, and `gbrain sync status` lists it under its own verdict (`file_drift_unknown`, needs a person). A managed sync that holds files a person must decide now reports `reason: held_needs_human` with `held_needs_human: <count>` (JSON) and prints `Synced; N file(s) held for a person (gbrain sync status --source <id>).`; the source still syncs and its status stays `synced`.' },
+ // #7931 parts 2 and 3. since is stamped at the merge slot.
+ { since: '0.60.516.0', id: 'file_drift_agrees_7931', text: 'A managed sync no longer holds a file as `file_drift` when its page agrees with it as `gbrain repair file-drift` reads them (they differ only in how the file writes the page, such as YAML quoting, or in a reserved key an older import kept in the database copy): the file imports. A held file someone asks to re-screen (`gbrain sources retry-held`, or the apply of a `release_hold` preview) whose page has no import record is now screened again instead of staying held, so an agreeing page is released. A `gbrain repair file-drift --apply` refused before it published no longer makes the apply after a fresh preview with the same `--expect` answer `idempotency_conflict`.' },
+ { since: '0.60.516.0', id: 'file_drift_slug_release_7950', text: '`gbrain repair file-drift --slug <s>` now lists a held page whose file agrees with it as `release_hold` (it was `no_drift`, and its printed apply always refused `preview_changed`); the apply releases only the hold the preview observed and answers `changed_since_preview` when that hold was replaced. A preview that finds nothing to apply prints an apply command that now applies nothing instead of refusing `preview_changed`.' },
+ { since: '0.60.516.0', id: 'file_drift_followups_7974', text: 'A page a read-only mirror stored database-only is compared with the file at its slug path the way `gbrain sources reconcile` reads it: one that agrees is listed `release_hold` instead of drifted, and one whose slug path has several spellings is listed unknown (`slug_path_ambiguous`) instead of aborting `gbrain repair file-drift` and the conflict audit. A held file whose page agrees with a different file than the held one is listed unknown instead of `release_hold`. The slug path of a page with no recorded file follows the source\'s slug-root mode and never resolves through a symlink.' },
+ { since: '0.60.516.0', id: 'provenance_repair_held_8009', text: '`gbrain repair provenance` now lists a page whose file sync holds (a `file_drift` hold, for example) as `held`, with the hold\'s code and fix, instead of planning it: the owner page write refuses such a page, so the preview used to count pages the apply could not write and the batch ended with a failed item. The apply also skips a page held after its preview as `held` rather than failing it, so it writes the count the preview printed.' },
+ { since: '0.60.516.0', id: 'pass_transient_streak_7982', text: '`gbrain sync status` and doctor `managed_sync_blocked` now read a managed source `blocked` / `pass_abandoned` (next: `gbrain doctor --json` and a report) when its last two sync passes each ended on a transient stop (a statement timeout, a lost connection, write back-pressure, a worktree refresh), as they already did for passes left open; one such pass still reads `resumable` with the plain sync. The idle-pass and stalled-holder readings compare database timestamps with the database clock, so a host clock running ahead no longer reads a running pass as abandoned or a progressing holder as stalled.' },
+ { since: '0.60.516.0', id: 'plain_directory_sync_7973', text: '`gbrain sync` on a plain directory registered with `gbrain sources add --path <dir> --force` (no Git checkout at or above it) now imports its files into the source the way `gbrain import` does; it used to fail with a raw `git rev-parse` internal_error. There are no commits to diff, so a file removed from the directory keeps its page. A source that has synced from Git and lost its checkout refuses `sync_not_applicable` (`checkout_missing`) instead.' },
+ { since: '0.60.516.0', id: 'former_binding_parked_group_7985', text: 'Doctor `parked_effects` and `gbrain sources writer status` now list parked Git effects recorded under a former canonical binding in their own parked group (`former_binding`: reason, recorded and current worktree, request ids), whose `command` is the `settle-effects` preview instead of the bulk retry that never selects them; doctor\'s per-effect command for them is `settle-effects --request-id`, the exact retry\'s `source_changed` refusal names both bindings with that preview as its fix, and the bulk retries\' `former_worktree` lists the worktree and requests. A tool reading one parked group per source and code can now see two.' },
+ { since: '0.60.516.0', id: 'settle_effects_retire_7985', text: '`gbrain sources writer settle-effects --retire` settles a parked Git effect of a former binding that nothing current owes, on evidence: its source was archived, removed or re-created, or each target\'s page moved to a later revision, was deleted or lost its slug to another page. It is previewed, bound to its plan hash, applied only after the user agrees, never retried, and `--unsettle` reverses it. The parked group for a replaced source now names that preview, and plain settle\'s `source_replaced` refusal points to it.' },
+ { since: '0.60.516.0', id: 'managed_marker_own_directory_7988', text: 'Managed persistence now marks a root that no Git checkout tracks (a connector clone or plain directory under a dotfiles home) in its own directory instead of in the enclosing repository, so legacy writers elsewhere in that repository are no longer refused, and the autopilot HEAD probe no longer reads the enclosing repository\'s HEAD for it. A marker an older release already wrote there stays until `gbrain sources writer deactivate` removes it (preview with `--dry-run --json`; activate again afterwards), and a write it refuses now says so.' },
+ // GST-687 (GBRA-269) quote fence by trust tier. since stamped at the merge slot.
+ { since: '0.60.536.0', id: 'remote_quotes_unverified_text_gst687', text: 'Agents connected over MCP now get text quoted as source material (a line naming its page or fact, then a code fence) when its stored trust tier is below "your notes": text written by an agent, tool data, external text and text of unverified origin. This covers search, query, recall, assemble_evidence, get_page, fetch, get_timeline, get_chunks, search_exact, think\'s extractive answer, get_versions and known_as_of reads, context_pack, delta, hot memory and write receipts; chronicle, takes and page title reads are not quoted yet. A note saved before gbrain tracked trust reads as unverified origin, so it is quoted until the owner claims its source (`gbrain trust claim-sources`) or `gbrain trust backfill` classifies it; `gbrain doctor` names how many pages that is. Conversation pages also come back with tool-call blocks summarized on get_page, fetch, search_exact, get_chunks and think; `get_page` with `include_content` and the markdown view keep the stored text. Local reads, stored text and trust tiers are unchanged.' },
+ // #8377 (GBRA-269) quote fence follow-ups. since stamped at the merge slot.
+ { since: '0.60.538.0', id: 'remote_quotes_followups_8377', text: 'Agents connected over MCP now also get text below "your notes" quoted on the chronicle reads (chronicle_day, chronicle_since, chronicle_on_this_day, volunteer_chronicle), takes_list and takes_search (claim and source), and a quoted page\'s title and frontmatter (put_page of that read stores them unfenced); get_page include_content and fetch text fence the whole markdown, frontmatter included. The context gbrain\'s hooks inject (the per-turn hook and the pushed context pack) quotes facts below the owner\'s tier too, so hook output can hold quote fences. A thin client\'s paged `gbrain get` of a quoted page prints it inside the fence. remember, add_timeline_entry and the takes writes store text copied out of a quoted read without the fence, and put_page admits a conversation round trip whose stored tool call holds a summary in its arguments. Local reads are unchanged.' },
+ // #8384 (GBRA-269) quote fence follow-ups 2. since stamped at the merge slot.
+ { since: '0.60.539.0', id: 'remote_quotes_followups_8384', text: 'Agents connected over MCP now get a timeline entry\'s free-text source quoted with its summary and detail (get_timeline, the chronicle reads, volunteer_chronicle), and ontology values (volunteer_chronicle, ontology_get, ontology_conflicts) quoted by their fact\'s trust tier; add_timeline_entry and ontology_propose store text copied out of those reads without the fence. A remote put_page of a whole-markdown read keeps a code block the agent added inside, in place of or after the read, and keeps the frontmatter when blank lines were added before the marker. A remote get_page or fetch of a page quoted only because its origin is unverified carries a quoted_unverified_origin notice naming gbrain trust claim-sources and gbrain trust backfill, once per session. Local reads are unchanged.' },
+ // #8384 (GBRA-269) quote fence follow-ups 3. since stamped at the merge slot.
+ { since: '0.60.541.0', id: 'remote_quotes_followups_8384b', text: 'Agents connected over MCP now get a quoted page\'s title quoted on search, query, assemble_evidence and recall rows, its tags quoted on get_page, fetch and get_tags (add_tag and remove_tag take a copied tag without the fence), and a chronicle row\'s kind quoted by its event page\'s tier; a context_pack card below "your notes" carries its title under the card\'s trust label. A remote put_page of a whole-markdown read saved with CRLF line endings stores the page, not its fence, and a fenced value pasted into frontmatter leaves the other keys as sent. Facts from a quarantined page, or awaiting re-derivation after a purge, no longer appear in entity-fact reads, local ones included: recall, search and query entity facts, find_trajectory, the entity card\'s fact count and consolidate; standing-question evidence also skips such facts, takes and timeline entries. Other local reads are unchanged.' },
+ // #8424 (GBRA-277) hook launcher. since stamped at the merge slot.
+ { since: '0.60.547.0', id: 'hook_launcher_8424', text: 'The hooks `gbrain setup claude-code|codex` writes, and the per-turn rule hook from `--instructions-only`, `gbrain connect --install` and `gbrain bootstrap harness`, now start gbrain through `<gbrain config dir>/hook-launcher/gbrain-hook`, so a session opened in a cloned repository never runs that repository\'s bunfig.toml preload or loads its .env. `gbrain post-upgrade` moves existing hooks onto it, except `gbrain setup codex`\'s, which the next `gbrain setup codex` rewrites, and doctor `harness_wiring` warns with `hook_session_cwd` on any that still start gbrain in the session directory.' },
+ // #8426, #8428, #8427 (GBRA-279) MCP and lane launcher, hook git fsmonitor. since stamped at the merge slot.
+ { since: '0.60.550.0', id: 'mcp_lane_launcher_8426', text: 'The stdio MCP entry `gbrain setup claude-code|codex` and `gbrain bootstrap hooks` (opencode\'s user-global entry included) register now starts `gbrain serve` through `<gbrain config dir>/hook-launcher/gbrain-hook`, and the hooks from `gbrain bootstrap hooks`, `gbrain bootstrap harness`, the Codex SessionEnd capture and the gbrain plugins start gbrain from the launcher\'s or the plugin\'s own directory, so a session opened in a cloned repository never runs that repository\'s bunfig.toml preload or loads its .env; serve still reads .gbrain-source from the session directory. `gbrain post-upgrade` moves a Claude Code setup MCP entry setup still owns and names the command for every Codex (the turn-rule hook included) and bootstrap entry, doctor `hook_session_cwd` covers them, and `gbrain hook` git probes skip core.fsmonitor and run only in the workspace the install receipt names.' },
+ // GST-927 (GBRA-280) schema-ruled-out empty arguments; release:restamp stamps since at the merge slot.
+ { since: '0.60.553.0', id: 'empty_nonstring_args_gst927', text: 'Read tools now treat an optional argument as not provided when its own schema rules the value out: 0 where the range starts above zero (limit: 0, around_chunk_id: 0, schema_version: 0 and others), [] where the list must not be empty (types, only, traverse_graph hops), {} where the object needs a field (get_page lines and bytes), false on get_versions diff, and get_page context without grep. These calls used to refuse with invalid_params; now they answer as if the argument were left out. get_page known_as_of beside window or view arguments still refuses, and the refusal names the arguments to drop.' },
+ // GBRA-283 Wave A (supersedes #8454): per-engine caches; release:restamp stamps since at the merge slot.
+ { since: '0.60.556.0', id: 'engine_keyed_caches_gbra283', text: 'A process serving several brains (mounts) now keeps each brain\'s search telemetry in that brain\'s own database and reads each brain\'s own search.track_retrieval, admission quotas, mcp.strict_params fallback, publication ceiling, capacity-notice throttle and the two vector-search rollback settings. Before, the first brain to be read decided these for every brain in the process, and every brain\'s search telemetry was written into the first brain\'s database. A process with one brain behaves as before.' },
+ // GBRA-200 (harness ask 6: stamp degraded replies). `since` is stamped at the merge slot.
+ { since: 'TBD', id: 'write_grant_refusal_gbra200', text: 'A `remember` or page write naming a `source_id` outside the connection\'s write grant is still refused `scope_denied`, and the refusal now carries `writable_source_ids`: the sources the connection\'s own grant lets it write, never another source, identical whether the named source exists or not. On `remember` the `fix` repeats the call against that source, so a harness can retry instead of giving up.' },
+ { since: 'TBD', id: 'degraded_stamp_gbra200', text: 'Every degraded or partial read result now carries one stamp naming why with stable codes: an MCP result gets `_meta.degraded: { reasons: [...] }` and one extra text block, `[gbrain degraded: <reasons>] ...`, after the others; a CLI `--json` object gets a `degraded` key, and other CLI output (human text, a bare `--json` array such as search results) gets that line on stderr. It covers search, query, recall, find_experts, context_pack, delta, entity, get_page (`file_held`), think and synthesize, search_exact, open_loops and rank_entities. recall and think no longer drop their page search\'s degraded stages (an embed timeout, a failed arm, the keyword rank bound): recall reports them in `_meta.retrieval.degraded` and its `degraded_recall` notice, think and synthesize as `GATHER_DEGRADED:<stage>` warnings, and a keyword-only search or recall on Postgres reports `keyword_candidates_incomplete` when the rank bound applies. A clean result carries no stamp, and no existing field changed.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --cc src/core/degraded-stamp.ts
index 87d3cf24c7,0000000000..e973f7699e
mode 100644,000000..100644
--- a/src/core/degraded-stamp.ts
+++ b/src/core/degraded-stamp.ts
@@@ -1,96 -1,0 +1,96 @@@
+/**
+ * Harness ask 6 (GBRA-200): one stamp on every degraded or partial read
+ * result, so an agent never relays a degraded answer as "the brain has no
+ * notes on this". The stamp is derived, never produced by a handler: it reads
+ * what a call already reports (its `_meta.retrieval.degraded` stages, the
+ * degraded fields of its result body and the `kind: degraded` notices it
+ * emitted, before any notice dedupe) and names each cause with a stable code.
+ * Pure: callers pass the call's result, its response meta and its notices.
+ *
+ * MCP results carry it as `_meta.degraded` plus one text block
+ * (`degradedStampLine`); CLI `--json` objects carry a `degraded` key and
+ * every other CLI output prints the line on stderr. A clean result carries
+ * nothing. docs/protocol/AGENT_OPERATOR_v1.md, "Degraded stamp".
+ */
+import type { Notice } from './agent-output.ts';
+import type { RetrievalCoverage } from './search/retrieval-coverage.ts';
+import { affectsRecall } from './types.ts';
+
+export interface DegradedStamp {
+ /** Stable reason codes, sorted and unique (the vocabulary is in the doc above). */
+ reasons: string[];
+}
+
+/** Notices of kind `degraded` that say this call's own result is partial; the notice code is the reason. */
+const RESULT_NOTICE_REASONS: ReadonlySet<string> = new Set([
- 'held_files', 'sources_not_readable', 'references_unavailable', 'mention_index',
++ 'held_files', 'references_unavailable', 'mention_index',
+ 'relational_chain', 'graph_walk_truncated', 'pinned_answer_stale', 'facts_unembedded', 'delta_incomplete',
+]);
+
+/** One condition, one code: recall's keyword-only markers name the stage search and query already use. */
+const KEYWORD_ONLY_MARKERS: ReadonlySet<string> = new Set(['keyword_only_no_embedding_provider', 'keyword_only_embedding_disabled']);
+const stageCode = (stage: string): string => (KEYWORD_ONLY_MARKERS.has(stage) ? 'embed_unavailable' : stage);
+
+/** think and synthesize warnings that mean the gathered evidence is partial. */
+const QUESTION_EMBED_WARNINGS: ReadonlySet<string> = new Set(['QUESTION_EMBED_FAILED', 'QUESTION_EMBED_SKIPPED_EMBEDDING_DISABLED']);
+/** think's gather reports a degraded retrieval stage as `GATHER_DEGRADED:<stage>`. */
+export const GATHER_DEGRADED_PREFIX = 'GATHER_DEGRADED:';
+
+/** The marker that opens the one-line text form; `[gbrain degraded: <code>, <code>]`. */
+export const DEGRADED_STAMP_PREFIX = '[gbrain degraded: ';
+
+type Stage = { stage?: unknown; reason?: unknown };
+
+/**
+ * The stamp for one successful call, or null when nothing about it was
+ * degraded. `meta` is the call's response meta (`{ retrieval }` on the CLI);
+ * `notices` are every notice the call produced, before dedupe.
+ */
+export function degradedStampFor(
+ op: string, result: unknown, meta: Record<string, unknown> | null | undefined, notices: readonly Notice[] = [],
+): DegradedStamp | null {
+ const reasons = new Set<string>();
+ const retrieval = (meta?.retrieval ?? null) as { degraded?: Stage[]; coverage?: RetrievalCoverage } | null;
+ const pendingCould = retrieval?.coverage?.could_affect?.pending_projection;
+ for (const d of Array.isArray(retrieval?.degraded) ? retrieval!.degraded : []) {
+ if (typeof d?.stage !== 'string' || !affectsRecall(d as { stage: string })) continue;
+ if (d.stage === 'projection_pending' && pendingCould === 0) continue;
+ reasons.add(stageCode(d.stage));
+ }
+ const r = (result && typeof result === 'object' && !Array.isArray(result) ? result : {}) as Record<string, unknown>;
+ if (typeof r.search_degraded === 'string') reasons.add('embed_unavailable');
+ const facts = r.facts_degraded as { reason?: unknown; unembedded?: unknown } | undefined;
+ if (typeof facts?.reason === 'string') reasons.add(stageCode(facts.reason));
+ if (typeof facts?.unembedded === 'number' && facts.unembedded > 0) reasons.add('facts_unembedded');
+ if (typeof r.degraded_reason === 'string') {
+ if (op === 'delta') reasons.add('delta_incomplete');
+ else for (const part of r.degraded_reason.split(',')) if (part.trim()) reasons.add(part.trim());
+ }
+ if (op === 'get_page' && r.file_held !== undefined && r.file_held !== null) reasons.add('file_held');
+ if (op === 'think' || op === 'synthesize') {
+ for (const w of Array.isArray(r.warnings) ? r.warnings : []) {
+ if (typeof w !== 'string') continue;
+ if (QUESTION_EMBED_WARNINGS.has(w)) reasons.add('embed_unavailable');
+ else if (w.startsWith(GATHER_DEGRADED_PREFIX)) reasons.add(stageCode(w.slice(GATHER_DEGRADED_PREFIX.length)));
+ else if (/^GATHER_[A-Z_]+_FAILED$/.test(w)) reasons.add(w.toLowerCase());
+ }
+ }
+ if (op === 'search_exact' && Array.isArray(r.incomplete_reasons)) {
+ for (const why of r.incomplete_reasons) if (why === 'deadline' || why === 'unreadable_pages') reasons.add(why === 'deadline' ? 'scan_deadline' : why);
+ }
+ if (op === 'open_loops') {
+ if (r.stale === true) reasons.add('source_stale');
+ if (r.completeness === 'partial') reasons.add('held_items');
+ }
+ if (op === 'rank_entities') {
+ const state = (r.coverage as { state?: unknown } | undefined)?.state;
+ if (state === 'behind' || state === 'unread') reasons.add(`link_coverage_${state}`);
+ }
+ for (const n of notices) if (n.kind === 'degraded' && RESULT_NOTICE_REASONS.has(n.code)) reasons.add(n.code);
+ return reasons.size ? { reasons: [...reasons].sort() } : null;
+}
+
+/** The one-line text form an agent can relay; never longer than one line. */
+export function degradedStampLine(stamp: DegradedStamp): string {
+ return `${DEGRADED_STAMP_PREFIX}${stamp.reasons.join(', ')}] This result is partial or degraded: never report "no notes" or "not found" from it.`;
+}
diff --cc src/core/error-registry.ts
index f0ca6b3096,3bfd94f6ea..fe453d7a9d
--- a/src/core/error-registry.ts
+++ b/src/core/error-registry.ts
@@@ -870,7 -918,7 +918,8 @@@ export const NOTICE_CODES =
identity_siblings_capped: { kind: 'info', summary: 'More than three pages share an entity\'s title subject, so the card shows no identity siblings; the fix (for the user) lists them with `gbrain extract mentions --explain`.' },
alias_fanout: { kind: 'info', summary: 'search fanned out over an entity\'s other names and stopped at the per-call cap; the skipped names are listed and can be searched directly.' },
search_filter_hint: { kind: 'info', summary: 'A search or query looked like it wanted a filter it did not pass (the query names a page type or a time, or one type fills the top results); the notice names types, since/until or where and the call to repeat. Results are unchanged.' },
+ graph_walk_truncated: { kind: 'degraded', summary: 'traverse_graph stopped at its walk cap (pages visited or edge rows), so the deepest edges were dropped and the result is not the whole neighborhood; the fix repeats the walk one level shallower, or narrowed with link_type or direction.' },
+ loops_no_google_in_scope: { kind: 'info', summary: 'A remote open_loops call read no google source, so the empty answer is not "inbox clean"; the notice names only the sources the call read, all inside the caller\'s grant (never one outside it) and the fix lists them for source_id.' },
mention_index: { kind: 'degraded', summary: 'The entity mention index is pending, off, failed or does not cover this page type, so references listed for an entity may be incomplete.' },
degraded_recall: { kind: 'degraded', summary: 'A retrieval stage that affects recall did not run; an empty or thin result is not proof of absence. A failed rerank names its reason (timeout, budget, rate_limited, unreachable, auth, provider_error), the fused-order fallback and the session\'s count of reranker-degraded calls; timeout and rate_limited say to repeat the call after a delay, the rest point at doctor\'s reranker_health.' },
source_binding_narrowed: { kind: 'info', summary: "A GBRAIN_SOURCE / .gbrain-source binding narrowed an unqualified read that came back empty; the fix reads another source explicitly." },
diff --cc src/core/notice-ledger.ts
index 01cd71a781,ec8f08542c..5c7ff10fe9
--- a/src/core/notice-ledger.ts
+++ b/src/core/notice-ledger.ts
@@@ -34,7 -34,7 +34,7 @@@ export const COACHING_BUDGET_PER_SESSIO
/** The one muteable `ask`: an unanswered first-run bundle must stay dismissible. Every other ask always shows. */
export const MUTEABLE_ASK_CODES: ReadonlySet<string> = new Set(['first_run_decisions']);
/** Notices that describe THIS call's result (never deduped unless the notice carries a `dedupe_key`): the diagnosis must ride every affected call. */
- export const PER_CALL_NOTICE_CODES: ReadonlySet<string> = new Set(['degraded_recall', 'hidden_tool_content', 'empty_retrieval', 'unknown_param', 'listing_truncated', 'former_relationships_hidden', 'source_binding_narrowed', 'sources_not_readable', 'local_transcripts', 'held_files', 'relational_chain', 'graph_walk_truncated', 'mention_index', 'delta_incomplete', 'identity_siblings_capped', 'references_unavailable', 'record_types_undeclared', 'alias_fanout', 'facts_unembedded']);
-export const PER_CALL_NOTICE_CODES: ReadonlySet<string> = new Set(['degraded_recall', 'hidden_tool_content', 'empty_retrieval', 'unknown_param', 'listing_truncated', 'former_relationships_hidden', 'source_binding_narrowed', 'local_transcripts', 'held_files', 'relational_chain', 'mention_index', 'delta_incomplete', 'identity_siblings_capped', 'references_unavailable', 'record_types_undeclared', 'alias_fanout', 'facts_unembedded', 'loops_no_google_in_scope']);
++export const PER_CALL_NOTICE_CODES: ReadonlySet<string> = new Set(['degraded_recall', 'hidden_tool_content', 'empty_retrieval', 'unknown_param', 'listing_truncated', 'former_relationships_hidden', 'source_binding_narrowed', 'local_transcripts', 'held_files', 'relational_chain', 'graph_walk_truncated', 'mention_index', 'delta_incomplete', 'identity_siblings_capped', 'references_unavailable', 'record_types_undeclared', 'alias_fanout', 'facts_unembedded', 'loops_no_google_in_scope']);
/** How long a shown coverage state (a notice's `escalation`) stays shown. */
export const COVERAGE_NOTICE_WINDOW_MS = 30 * 60 * 1000;
diff --cc src/core/ops/facts.ts
index 26f0df5788,4b6f24f2ab..38ef147115
--- a/src/core/ops/facts.ts
+++ b/src/core/ops/facts.ts
@@@ -520,10 -539,24 +539,10 @@@ const recall: Operation =
// like search/query/get_page/list_pages/resolve_slugs. sourceScopeOpts
// alone pinned this arm to the scalar source, so a `federated: true`
// source was invisible to recall while visible to every sibling read op.
- const searchScope = { ...federatedSearchScope(ctx, sourceIdParam), ...(eligibility.floor ? { minTrust: eligibility.floor } : {}) };
+ const searchScope = { ...scope, ...(eligibility.floor ? { minTrust: eligibility.floor } : {}) };
// #4352 — recall's page-search arm enforces `visibility: private` for
// untrusted callers with the excludePrivate resolved above.
- const keywordOnly = await recallKeywordOnlyReason(ctx);
- if (keywordOnly) {
- searchResults = await keylessRecallRows(ctx, queryText, limit, excludePrivate, searchScope, rankCutOpts);
- searchDegraded = keywordOnly;
- } else {
- searchResults = await hybridSearchCached(ctx.engine, queryText, {
- limit,
- expansion: false,
- excludePrivate,
- requireSafeChunks: ctx.remote !== false,
- takesHoldersAllowList: readHolders(ctx),
- ...searchScope,
- ...rankCutOpts,
- });
- }
+ ({ rows: searchResults, keywordOnly: searchDegraded } = await recallPageRows(ctx, queryText, limit, excludePrivate, searchScope, rankCutOpts));
bumpLastRetrievedAt(ctx.engine, searchResults.map(r => r.page_id));
const applied = recallDeliveryPlan(effectivePlan(evidencePlan, searchResults), p.budget_policy, queryText, budgetTokens, rows);
if (applied) ({ results: searchResults, delivery } = await deliverEvidence(ctx.engine, searchResults, applied, { ...searchScope, excludePrivate, requireSafeChunks: ctx.remote !== false }));
diff --cc src/core/ops/search.ts
index d9bbc122dc,4945166baf..4c29e3cbf7
--- a/src/core/ops/search.ts
+++ b/src/core/ops/search.ts
@@@ -29,9 -29,10 +29,10 @@@ import { expandQuery } from '../search/
import { dedupResults } from '../search/dedup.ts';
import { markKeywordHits } from '../search/evidence.ts';
import { captureEvalCandidate, isEvalCaptureEnabled, isEvalScrubEnabled } from '../eval-capture.ts';
-import type { HybridSearchMeta, SearchResult } from '../types.ts';
+import type { DegradedStageEntry, HybridSearchMeta, SearchResult } from '../types.ts';
import { bumpLastRetrievedAt } from '../last-retrieved.ts';
import { applySnippetCap, DEFAULT_AGENT_SNIPPET_CHARS, resultChunkCap } from '../search/snippet-cap.ts';
+ import { fenceTranscriptRows, neutralizeTranscriptRows, quoteFacts, quoteLabel } from '../search/transcript-quote.ts';
import { scoresFollowRank } from '../search/score-contract.ts';
import { redactRetrievalOutput } from '../search/output-redaction.ts';
import { leanRowsKeepId, projectRows, resultRowsFor } from '../search/lean-rows.ts';
diff --cc src/mcp/dispatch.ts
index aa33ad87dd,c1918c969b..3db3bc52b4
--- a/src/mcp/dispatch.ts
+++ b/src/mcp/dispatch.ts
@@@ -23,10 -28,11 +28,12 @@@ import { hostFix, scopeDeniedError } fr
import { mutedNoticeCodes, processNoticeLedger, __resetProcessNoticeLedgerForTests, type NoticeLedger, type NoticeAudience } from '../core/notice-ledger.ts';
import { logVerbUsage, recordsFiring, type RecordsFiring } from '../core/verbs/usage-log.ts';
import { searchCountLine } from '../core/search/keyword-paging.ts';
+ import { pageCapLine } from '../core/search/remote-page-cap.ts';
import { dateLabelLine } from '../core/search/date-labels.ts';
- import { hiddenTakesNotice, localTranscriptsNotice, recallInteropNotices, wantsTranscriptHint } from '../core/interop-notices.ts';
+ import { emptyRead, hiddenTakesNotice, localTranscriptsNotice, recallInteropNotices, wantsTranscriptHint } from '../core/interop-notices.ts';
+import { degradedStampFor, degradedStampLine, type DegradedStamp } from '../core/degraded-stamp.ts';
- import { unreadableSourcesNotice } from '../core/unreadable-sources-notice.ts';
+ import { assertUnscopedReadReachesPages } from '../core/sources-not-readable.ts';
+ import { accessPolicyNotices } from '../core/access/policy-notice.ts';
import { hiddenToolHint, hiddenToolNext, hiddenToolRoute, type ToolConnection } from './hidden-tool-hint.ts';
import { opAllowedForBoundClient } from '../core/ops/context.ts';
import { takePostUpgradeMcpNotice } from '../core/post-upgrade-notice.ts';
diff --cc test/degraded-stamp.test.ts
index 64f43a00d8,0000000000..a187347ff5
mode 100644,000000..100644
--- a/test/degraded-stamp.test.ts
+++ b/test/degraded-stamp.test.ts
@@@ -1,130 -1,0 +1,130 @@@
+/**
+ * GBRA-200 (harness ask 6): the degraded stamp is one pure derivation over a
+ * call's result, its response meta and the notices it produced. One case per
+ * degradation class, the clean result (no stamp), and the CLI placement.
+ */
+import { describe, expect, test } from 'bun:test';
+import type { Notice } from '../src/core/agent-output.ts';
+import { DEGRADED_STAMP_PREFIX, degradedStampFor, degradedStampLine } from '../src/core/degraded-stamp.ts';
+import { withDegradedStamp } from '../src/cli/op-notices.ts';
+
+const reasons = (op: string, result: unknown, meta: Record<string, unknown> | null = null, notices: Notice[] = []) =>
+ degradedStampFor(op, result, meta, notices)?.reasons ?? null;
+const retrieval = (degraded: Array<{ stage: string; reason?: string }>, extra: Record<string, unknown> = {}) => ({ retrieval: { degraded, ...extra } });
+const notice = (code: string, kind: Notice['kind'] = 'degraded'): Notice => ({ code, kind, why: 'w' });
+
+describe('clean results carry no stamp', () => {
+ test('search with an empty stage list, recall without degraded fields, a plain page', () => {
+ expect(reasons('search', [{ slug: 'a' }], retrieval([]))).toBeNull();
+ expect(reasons('search', [], null)).toBeNull();
+ expect(reasons('recall', { facts: [], results: [], total: 0 }, null)).toBeNull();
+ expect(reasons('get_page', { slug: 'a', compiled_truth: 'x' })).toBeNull();
+ expect(reasons('think', { warnings: ['WINDOW_FROM_QUESTION', 'LLM_OUTPUT_TRUNCATED'] })).toBeNull();
+ });
+
+ test('a ranking-only stage is not a degraded result', () => {
+ expect(reasons('search', [{ slug: 'a' }], retrieval([{ stage: 'reranker_skipped', reason: 'no_key' }]))).toBeNull();
+ });
+
+ test('info notices and degraded notices about something other than this result do not stamp', () => {
+ expect(reasons('search', [], retrieval([]), [notice('search_filter_hint', 'info'), notice('no_worker'), notice('write_capacity_backpressure')])).toBeNull();
+ });
+
+ test('search_exact paging (the caller\'s limit) is not degradation', () => {
+ expect(reasons('search_exact', { complete: false, incomplete_reasons: ['limit'] })).toBeNull();
+ });
+});
+
+describe('every degradation class stamps with a stable code', () => {
+ test('provider down and embed timeout (search, query, recall, find_experts)', () => {
+ for (const op of ['search', 'query', 'recall', 'find_experts']) {
+ expect(reasons(op, [], retrieval([{ stage: 'embed_unavailable', reason: 'provider_error' }]))).toEqual(['embed_unavailable']);
+ expect(reasons(op, [], retrieval([{ stage: 'embed_timeout', reason: 'timeout' }]))).toEqual(['embed_timeout']);
+ }
+ });
+
+ test('the keyword rank bound and a failed or cut arm', () => {
+ expect(reasons('search', [], retrieval([{ stage: 'keyword_candidates_incomplete', reason: 'candidate_budget' }, { stage: 'vector_arm_failed' }])))
+ .toEqual(['keyword_candidates_incomplete', 'vector_arm_failed']);
+ expect(reasons('query', [], retrieval([{ stage: 'vector_candidates_incomplete', reason: 'timeout' }]))).toEqual(['vector_candidates_incomplete']);
+ });
+
+ test('projection_pending stamps only when a pending page could match (the coverage rule)', () => {
+ expect(reasons('search', [], retrieval([{ stage: 'projection_pending' }], { coverage: { pending_projection: 4, could_affect: { pending_projection: 0 } } }))).toBeNull();
+ expect(reasons('search', [], retrieval([{ stage: 'projection_pending' }], { coverage: { pending_projection: 4, could_affect: { pending_projection: 2 } } }))).toEqual(['projection_pending']);
+ expect(reasons('search', [], retrieval([{ stage: 'projection_pending' }]))).toEqual(['projection_pending']);
+ });
+
+ test('recall keyword-only markers and question ranking name the same condition as search', () => {
+ expect(reasons('recall', { search_degraded: 'keyword_only_no_embedding_provider' })).toEqual(['embed_unavailable']);
+ expect(reasons('recall', { search_degraded: 'keyword_only_embedding_disabled' })).toEqual(['embed_unavailable']);
+ expect(reasons('recall', { facts_degraded: { reason: 'keyword_only_embedding_disabled' } })).toEqual(['embed_unavailable']);
+ expect(reasons('recall', { facts_degraded: { reason: 'embed_timeout', unembedded: 3 } })).toEqual(['embed_timeout', 'facts_unembedded']);
+ expect(reasons('recall', { facts_degraded: { reason: 'facts_read_failed' } })).toEqual(['facts_read_failed']);
+ });
+
+ test('context_pack deadline and budget, delta incomplete', () => {
+ expect(reasons('context_pack', { text: '', degraded_reason: 'deadline' })).toEqual(['deadline']);
+ expect(reasons('context_pack', { text: '', degraded_reason: 'budget_trimmed' })).toEqual(['budget_trimmed']);
+ expect(reasons('delta', { degraded_reason: 'deadline,threads' })).toEqual(['delta_incomplete']);
+ });
+
+ test('held and stale files', () => {
+ expect(reasons('get_page', { slug: 'a', file_held: { code: 'invalid_frontmatter' } })).toEqual(['file_held']);
+ expect(reasons('search', [], retrieval([]), [notice('held_files')])).toEqual(['held_files']);
+ });
+
+ test('think and synthesize: question embed, a failed evidence stream, a degraded page search', () => {
+ for (const op of ['think', 'synthesize']) {
+ expect(reasons(op, { warnings: ['QUESTION_EMBED_FAILED'] })).toEqual(['embed_unavailable']);
+ expect(reasons(op, { warnings: ['GATHER_HYBRID_FAILED', 'GATHER_TAKES_VECTOR_FAILED'] })).toEqual(['gather_hybrid_failed', 'gather_takes_vector_failed']);
+ expect(reasons(op, { warnings: ['GATHER_DEGRADED:embed_timeout', 'GATHER_DEGRADED:keyword_candidates_incomplete'] })).toEqual(['embed_timeout', 'keyword_candidates_incomplete']);
+ }
+ });
+
- test('result notices: an empty scope, references, mention index, relational chain, pinned answer, unembedded facts', () => {
- for (const code of ['sources_not_readable', 'references_unavailable', 'mention_index', 'relational_chain', 'pinned_answer_stale', 'facts_unembedded', 'delta_incomplete']) {
++ test('result notices: held files, references, mention index, relational chain, pinned answer, unembedded facts', () => {
++ for (const code of ['held_files', 'references_unavailable', 'mention_index', 'relational_chain', 'pinned_answer_stale', 'facts_unembedded', 'delta_incomplete']) {
+ expect(reasons('list_pages', [], null, [notice(code)])).toEqual([code]);
+ }
+ });
+
+ test('ops that already report partial results in their body', () => {
+ expect(reasons('search_exact', { complete: false, incomplete_reasons: ['deadline', 'limit', 'unreadable_pages'] })).toEqual(['scan_deadline', 'unreadable_pages']);
+ expect(reasons('open_loops', { stale: true, completeness: 'partial' })).toEqual(['held_items', 'source_stale']);
+ expect(reasons('open_loops', { stale: false, completeness: 'complete' })).toBeNull();
+ expect(reasons('rank_entities', { coverage: { state: 'behind' } })).toEqual(['link_coverage_behind']);
+ expect(reasons('rank_entities', { coverage: { state: 'current' } })).toBeNull();
+ });
+
+ test('reasons are sorted and unique across every channel', () => {
+ expect(reasons('recall', { search_degraded: 'keyword_only_no_embedding_provider' },
- retrieval([{ stage: 'keyword_candidates_incomplete' }, { stage: 'embed_unavailable' }]), [notice('sources_not_readable'), notice('sources_not_readable')]))
- .toEqual(['embed_unavailable', 'keyword_candidates_incomplete', 'sources_not_readable']);
++ retrieval([{ stage: 'keyword_candidates_incomplete' }, { stage: 'embed_unavailable' }]), [notice('held_files'), notice('held_files')]))
++ .toEqual(['embed_unavailable', 'held_files', 'keyword_candidates_incomplete']);
+ });
+});
+
+describe('the one-line marker and the CLI placement', () => {
+ const stamp = { reasons: ['embed_timeout', 'held_files'] };
+
+ test('the text form is one line opening with the fixed prefix', () => {
+ const line = degradedStampLine(stamp);
+ expect(line.startsWith(`${DEGRADED_STAMP_PREFIX}embed_timeout, held_files] `)).toBe(true);
+ expect(line).not.toContain('\n');
+ expect(line).toContain('never report "no notes"');
+ });
+
+ test('--json object: a degraded key and no stderr line', () => {
+ expect(withDegradedStamp({ facts: [] }, true, stamp)).toEqual({ result: { facts: [], degraded: stamp } });
+ });
+
+ test('--json array and human output: the body is unchanged and the line goes to stderr', () => {
+ const rows = [{ slug: 'a' }];
+ expect(withDegradedStamp(rows, true, stamp)).toEqual({ result: rows, stderr: degradedStampLine(stamp) + '\n' });
+ expect(withDegradedStamp({ facts: [] }, false, stamp)).toEqual({ result: { facts: [] }, stderr: degradedStampLine(stamp) + '\n' });
+ });
+
+ test('no stamp leaves the output untouched', () => {
+ expect(withDegradedStamp({ facts: [] }, true, null)).toEqual({ result: { facts: [] } });
+ expect(withDegradedStamp([], false, { reasons: [] })).toEqual({ result: [] });
+ });
+});
diff --cc test/fixtures/agent-contract/v1/journey/recall-degraded.json
index 18a5401577,2c5b3ae9c9..696342f0d2
--- a/test/fixtures/agent-contract/v1/journey/recall-degraded.json
+++ b/test/fixtures/agent-contract/v1/journey/recall-degraded.json
@@@ -40,10 -40,12 +40,17 @@@
"contract_version": 1
}
],
+ "degraded": {
+ "reasons": [
+ "embed_unavailable"
+ ]
++ },
+ "access": {
+ "member": null,
+ "groups": [],
+ "audience": null,
+ "policy_rev": null,
+ "relaxation": "none"
}
},
"content": [
diff --cc test/fixtures/goldens/exports/types.json
index 78c19a7eff,97a59e1c9c..ff69ce43bf
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@@ -6499,11 -6733,10 +6733,11 @@@
"stack?: string | undefined",
"suggestion?: string | undefined",
"syncRefusal?: Record<string, unknown> | undefined",
- "toJSON: () => { contract_version?: 1 | undefined; writable_source_ids?: string[] | undefined; withdrawn?: WithdrawnDetail | undefined; fence_issues?: Record<string, unknown>[] | undefined; fence?: Record<string, unknown> | undefined; notices?: unknown[] | undefined; fix?: unknown; why?: string | undefined; reason?: string | undefined; write_error?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | undefined; request_id?: string | undefined; write_request?: WriteReceipt | undefined; error: ErrorCode; code: string; message: string; suggestion: string | undefined; docs: string | undefined; detail: string | undefined; protocol_version: number | undefined; }",
- "toJSON: () => { contract_version?: 1 | undefined; withdrawn?: WithdrawnDetail | undefined; fence_issues?: Record<string, unknown>[] | undefined; fence?: Record<string, unknown> | undefined; notices?: unknown[] | undefined; fix?: unknown; why?: string | undefined; reason?: string | undefined; write_error?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | \"owner_marker_missing\" | undefined; request_id?: string | undefined; write_request?: WriteReceipt | undefined; error: ErrorCode; code: string; message: string; suggestion: string | undefined; docs: string | undefined; detail: string | undefined; protocol_version: number | undefined; }",
++ "toJSON: () => { contract_version?: 1 | undefined; writable_source_ids?: string[] | undefined; withdrawn?: WithdrawnDetail | undefined; fence_issues?: Record<string, unknown>[] | undefined; fence?: Record<string, unknown> | undefined; notices?: unknown[] | undefined; fix?: unknown; why?: string | undefined; reason?: string | undefined; write_error?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | \"owner_marker_missing\" | undefined; request_id?: string | undefined; write_request?: WriteReceipt | undefined; error: ErrorCode; code: string; message: string; suggestion: string | undefined; docs: string | undefined; detail: string | undefined; protocol_version: number | undefined; }",
"why?: string | undefined",
"withdrawn?: WithdrawnDetail | undefined",
+ "writableSourceIds?: string[] | undefined",
- "writeError?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | undefined",
+ "writeError?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | \"owner_marker_missing\" | undefined",
"writeRequest?: WriteReceipt | undefined"
],
"name": "OperationError",
diff --cc test/fixtures/goldens/search-c5/notices.json
index 805a984234,7f7595cdd3..f2f4cbaadf
--- a/test/fixtures/goldens/search-c5/notices.json
+++ b/test/fixtures/goldens/search-c5/notices.json
@@@ -192,11 -189,10 +192,11 @@@
},
"search renewal quote": {
"content": [
- "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain search] Rows are a ranked top-K, not proof of coverage. Keyword matches: 1 page (pages matching the query's keywords, not a count of these rows). List every keyword match with match: \"keyword\".",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 1,
@@@ -227,11 -223,10 +227,11 @@@
},
"query Numbat Labs payment terms": {
"content": [
- "[{\"slug\":\"contracts/numbat-labs-msa\",\"title\":\"MSA: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Master services agreement with Numbat Labs (account code NULA). Payment terms: Net 45.\",\"chunk_id\":2,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Account code: NULA. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5949,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"contracts/amendment-one\",\"title\":\"Amendment No. 1: NULA\",\"type\":\"note\",\"chunk_text\":\"Executed amendment for NULA: payment terms change to Net 30.\",\"chunk_id\":3,\"score\":0.1459,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"matched_alias\":\"NULA\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL2FtZW5kbWVudC1vbmUiXQ\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"contracts/numbat-labs-msa\",\"title\":\"MSA: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Master services agreement with Numbat Labs (account code NULA). Payment terms: Net 45.\",\"chunk_id\":2,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Account code: NULA. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5949,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"contracts/amendment-one\",\"title\":\"Amendment No. 1: NULA\",\"type\":\"note\",\"chunk_text\":\"Executed amendment for NULA: payment terms change to Net 30.\",\"chunk_id\":3,\"score\":0.1459,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"matched_alias\":\"NULA\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL2FtZW5kbWVudC1vbmUiXQ\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"Other names in these results (documents may use either; search the one you have not tried): NULA = Numbat Labs (declared in crm/numbat-labs).",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 3,
@@@ -285,11 -280,10 +285,11 @@@
},
"query OCFR renewal owner": {
"content": [
- "[{\"slug\":\"crm/ocelot-freight\",\"title\":\"CRM record: Ocelot Freight\",\"type\":\"note\",\"chunk_text\":\"Account record for Ocelot Freight, also known as OCFR. Renewal owner: the platform team.\",\"chunk_id\":4,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL29jZWxvdC1mcmVpZ2h0Il0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"crm/ocelot-freight\",\"title\":\"CRM record: Ocelot Freight\",\"type\":\"note\",\"chunk_text\":\"Account record for Ocelot Freight, also known as OCFR. Renewal owner: the platform team.\",\"chunk_id\":4,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL29jZWxvdC1mcmVpZ2h0Il0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"Other names in these results (documents may use either; search the one you have not tried): OCFR = Ocelot Freight (declared in crm/ocelot-freight).",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 2,
@@@ -345,11 -339,10 +345,11 @@@
"without": {
"search NULA billing contact": {
"content": [
- "[{\"slug\":\"contracts/amendment-one\",\"title\":\"Amendment No. 1: NULA\",\"type\":\"note\",\"chunk_text\":\"Executed amendment for NULA: payment terms change to Net 30.\",\"chunk_id\":3,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL2FtZW5kbWVudC1vbmUiXQ\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5082,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":0.4999,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"contracts/amendment-one\",\"title\":\"Amendment No. 1: NULA\",\"type\":\"note\",\"chunk_text\":\"Executed amendment for NULA: payment terms change to Net 30.\",\"chunk_id\":3,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL2FtZW5kbWVudC1vbmUiXQ\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5082,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":0.4999,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain search] Rows are a ranked top-K, not proof of coverage. Keyword matches: 0 pages (pages matching the query's keywords, not a count of these rows). List every keyword match with match: \"keyword\".",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 3,
@@@ -380,11 -373,10 +380,11 @@@
},
"search Numbat Labs payment terms": {
"content": [
- "[{\"slug\":\"contracts/numbat-labs-msa\",\"title\":\"MSA: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Master services agreement with Numbat Labs . Payment terms: Net 45.\",\"chunk_id\":2,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5949,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"contracts/numbat-labs-msa\",\"title\":\"MSA: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Master services agreement with Numbat Labs . Payment terms: Net 45.\",\"chunk_id\":2,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5949,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain search] Rows are a ranked top-K, not proof of coverage. Keyword matches: 1 page (pages matching the query's keywords, not a count of these rows). List every keyword match with match: \"keyword\".",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 2,
@@@ -415,11 -407,10 +415,11 @@@
},
"search OCFR renewal": {
"content": [
- "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"crm/ocelot-freight\",\"title\":\"CRM record: Ocelot Freight\",\"type\":\"note\",\"chunk_text\":\"Account record for Ocelot Freight. Renewal owner: the platform team.\",\"chunk_id\":4,\"score\":0.5041,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL29jZWxvdC1mcmVpZ2h0Il0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"crm/ocelot-freight\",\"title\":\"CRM record: Ocelot Freight\",\"type\":\"note\",\"chunk_text\":\"Account record for Ocelot Freight. Renewal owner: the platform team.\",\"chunk_id\":4,\"score\":0.5041,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL29jZWxvdC1mcmVpZ2h0Il0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain search] Rows are a ranked top-K, not proof of coverage. Keyword matches: 0 pages (pages matching the query's keywords, not a count of these rows). List every keyword match with match: \"keyword\".",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 2,
@@@ -450,11 -441,10 +450,11 @@@
},
"search renewal quote": {
"content": [
- "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain search] Rows are a ranked top-K, not proof of coverage. Keyword matches: 1 page (pages matching the query's keywords, not a count of these rows). List every keyword match with match: \"keyword\".",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 1,
@@@ -485,10 -475,9 +485,10 @@@
},
"query Numbat Labs payment terms": {
"content": [
- "[{\"slug\":\"contracts/numbat-labs-msa\",\"title\":\"MSA: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Master services agreement with Numbat Labs . Payment terms: Net 45.\",\"chunk_id\":2,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5949,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"contracts/numbat-labs-msa\",\"title\":\"MSA: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Master services agreement with Numbat Labs . Payment terms: Net 45.\",\"chunk_id\":2,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"crm/numbat-labs\",\"title\":\"CRM record: Numbat Labs\",\"type\":\"note\",\"chunk_text\":\"Account record. Segment: mid-market. Billing contact: Old Person.\",\"chunk_id\":1,\"score\":0.5949,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL251bWJhdC1sYWJzIl0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 2,
@@@ -522,10 -511,9 +522,10 @@@
},
"query OCFR renewal owner": {
"content": [
- "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"},{\"slug\":\"crm/ocelot-freight\",\"title\":\"CRM record: Ocelot Freight\",\"type\":\"note\",\"chunk_text\":\"Account record for Ocelot Freight. Renewal owner: the platform team.\",\"chunk_id\":4,\"score\":0.5041,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL29jZWxvdC1mcmVpZ2h0Il0\",\"trust_tier\":\"unknown\",\"origin\":\"legacy\"}]",
+ "[{\"slug\":\"notes/renewal-playbook\",\"title\":\"Renewal playbook\",\"type\":\"note\",\"chunk_text\":\"Confirm the billing contact, check payment terms, send the renewal quote 60 days before the term ends.\",\"chunk_id\":5,\"score\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcmVuZXdhbC1wbGF5Ym9vayJd\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"},{\"slug\":\"crm/ocelot-freight\",\"title\":\"CRM record: Ocelot Freight\",\"type\":\"note\",\"chunk_text\":\"Account record for Ocelot Freight. Renewal owner: the platform team.\",\"chunk_id\":4,\"score\":0.5041,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"weak_semantic\",\"create_safety\":\"unknown\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY3JtL29jZWxvdC1mcmVpZ2h0Il0\",\"trust_tier\":\"operator_curated\",\"origin\":\"sync\"}]",
"[gbrain dates] effective_date by effective_date_source: fallback = fallback (page created/imported, not from its text). Never a contract's effective or validity date (read the text).",
- "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are."
+ "[gbrain notice degraded_recall kind=degraded]\nwhy: Recall was degraded (embed_unavailable): semantic (vector) search did not run, so matches phrased differently from the query can be missing. Treat a thin or empty result as \"not found with a degraded search\", never as \"the brain has nothing on this\".\nfix: gbrain init --force --embedding-model voyage:voyage-4 --embedding-dimensions 1024\nnext: tell_user_to_run\nuser_message: Semantic search needs an embedding API key. Voyage AI works with this brain; if you add a key (<provider key>), I can turn it on. Embedding costs a little per page; your notes and facts stay as they are.",
+ "[gbrain degraded: embed_unavailable] This result is partial or degraded: never report \"no notes\" or \"not found\" from it."
],
"retrieval": {
"returned_count": 2,
diff --cc test/helpers/evidence-delivery-fixture.ts
index 45f0cedf94,4e79882a4d..d2bfe65110
--- a/test/helpers/evidence-delivery-fixture.ts
+++ b/test/helpers/evidence-delivery-fixture.ts
@@@ -13,7 -13,7 +13,8 @@@ import { prepareMarkdownChunks } from '
import { installFixtureChunks } from './page-projection.ts';
import { withEnv } from './with-env.ts';
import { leanRow } from '../../src/core/search/lean-rows.ts';
+import { degradedStampFor, degradedStampLine } from '../../src/core/degraded-stamp.ts';
+ import { fenceTranscriptText } from '../../src/core/search/transcript-quote.ts';
export const OFF_PATH_PAGES: Array<{ slug: string; body: string; timeline?: string; frontmatter?: Record<string, unknown> }> = [
{
@@@ -124,11 -135,12 +136,14 @@@ function quotedRow(row: Record<string,
* The cost wave changes remote output on purpose: C1 projects remote
* search/query rows to lean rows (and reports `rows: "lean"` in the retrieval
* meta), and C2 serializes MCP content[0] as compact JSON. Recall's question
- * ranking adds `facts_order` to every recall response. GBRA-200 appends the
- * degraded stamp (a last text block and `_meta.degraded`) to an MCP reply whose
- * frozen meta names a recall-affecting stage. The frozen pre-feature
- * bytes stay as captured; this applies exactly those declared transforms to
- * them, so every other byte of the capture is still compared.
+ * ranking adds `facts_order` to every recall response. GST-687 quotes text
+ * below the owner's trust tier for remote readers, and this fixture's pages
+ * carry no trust declaration (`unknown`), so every remote row comes back
- * fenced and marked `quoted`. The frozen pre-feature bytes stay as captured;
++ * fenced and marked `quoted`. GBRA-200 appends the degraded stamp (a last
++ * text block and `_meta.degraded`) to an MCP reply whose frozen meta names a
++ * recall-affecting stage. The frozen pre-feature bytes stay as captured;
+ * this applies exactly those declared transforms to them, so every other byte
+ * of the capture is still compared.
*/
export function withCostWave(key: string, frozen: string): string {
const base = key.replace(/:chunk$/, '');
@@@ -147,13 -159,9 +162,14 @@@
const res = JSON.parse(frozen) as { content: Array<{ type: string; text: string }>; _meta?: Record<string, Record<string, unknown>> };
const body = JSON.parse(res.content[0].text);
const lean = base === 'mcp-search' || base === 'mcp-query';
- res.content[0].text = JSON.stringify(lean ? (body as Record<string, unknown>[]).map(r => leanRow(r)) : base === 'mcp-recall' ? withFactsOrder(body) : body);
+ res.content[0].text = JSON.stringify(lean ? (body as Record<string, unknown>[]).map(r => quotedRow(leanRow(r), 'chunk_text'))
+ : base === 'mcp-recall' ? { ...withFactsOrder(body), results: (body.results as Record<string, unknown>[]).map(r => quotedRow(r, 'chunk')) } : body);
if (lean && res._meta?.retrieval) res._meta.retrieval = leanRetrieval(res._meta.retrieval);
+ const stamp = degradedStampFor(base.slice('mcp-'.length), body, res._meta ?? {}, []);
+ if (stamp) {
+ res.content.push({ type: 'text', text: degradedStampLine(stamp) });
+ res._meta = { ...res._meta, degraded: stamp as unknown as Record<string, unknown> };
+ }
return JSON.stringify(res);
}