Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Revert "D: recall max_chars, acting_user on a member-bound credential, unknown-param warnings in _meta only (HARN-1, HARN-15)"
garrytan6272521a6764
diff --git a/docs/contracts/qm-memory-provider/v1.json b/docs/contracts/qm-memory-provider/v1.jsonindex 3ef5010a9e..3051fda069 100644--- a/docs/contracts/qm-memory-provider/v1.json+++ b/docs/contracts/qm-memory-provider/v1.json@@ -5,13 +5,12 @@"protocol": "mcp","session": "stateless","session_header_issued": false,- "success_codes_in": "structuredContent",- "unknown_arguments": "an argument a read tool does not declare is ignored and reported only in _meta.warnings ([{code: \"unknown_param\", param, suggestion?}]), never in content; a write tool refuses it with invalid_params"+ "success_codes_in": "structuredContent"},"actor": {"header": "x-qm-actor","argument": "acting_user",- "argument_rule": "optional; on an attested call it must equal the header; with no header it is accepted only from a credential bound to a member and only naming that member (its member id or a canonical id linked to it), and the call then runs exactly as the credential; never chooses the person on its own",+ "argument_rule": "optional; must equal the header; never chooses the person on its own","actor_id": {"pattern": "^[\\x21-\\x7e]{1,256}$","case_folding": false@@ -251,7 +250,7 @@{"code": "actor_not_attested","class": "host_only",- "summary": "A call named the person it serves (the x-qm-actor header or the acting_user argument) in a way gbrain does not honour: the credential holds no attest right, the operation is not in its attested operations, the argument differs from the header, names anyone but a member-bound credential's own member, or comes without an attested header from a credential bound to no member, or the id is not 1-256 visible ASCII characters; or a write that saves only as an attested person (memory_write) named none; or the request carries x-qm-audience, a channel audience gbrain does not serve yet. Nothing was read or written.",+ "summary": "A call named the person it serves (the x-qm-actor header or the acting_user argument) in a way gbrain does not honour: the credential holds no attest right, the operation is not in its attested operations, the argument differs from the header or comes without an attested header, or the id is not 1-256 visible ASCII characters; or a write that saves only as an attested person (memory_write) named none; or the request carries x-qm-audience, a channel audience gbrain does not serve yet. Nothing was read or written.","suggestion": "Read reason: no_attest_right and op_not_attested are the brain operator's call (gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]); argument_mismatch, argument_without_attestation, invalid_actor_id, actor_required and audience_not_supported are fixed in the calling harness.","docs": "docs/guides/write-refusals.md#actor_not_attested","reasons": [@@ -268,12 +267,12 @@{"reason": "argument_mismatch","fixed_by": "calling_harness",- "fix": "Send acting_user equal to the x-qm-actor header (with no header, on a credential bound to a member: that member id or a canonical id linked to it), or omit it."+ "fix": "Send acting_user equal to the x-qm-actor header, or omit it."},{"reason": "argument_without_attestation","fixed_by": "calling_harness",- "fix": "Remove acting_user, or send the x-qm-actor header from a credential holding the attest right; a credential bound to no member never sends acting_user alone."+ "fix": "Remove acting_user, or send the x-qm-actor header from a credential holding the attest right."},{"reason": "invalid_actor_id",diff --git a/docs/guides/error-codes.md b/docs/guides/error-codes.mdindex d3e71c3211..21909f6df7 100644--- a/docs/guides/error-codes.md+++ b/docs/guides/error-codes.md@@ -165,7 +165,7 @@ More: [docs/guides/write-refusals.md#access_rule_invalid](../../docs/guides/writ| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable ||---|---|---|---|---|---|---|-| A call named the person it serves (the x-qm-actor header or the acting_user argument) in a way gbrain does not honour: the credential holds no attest right, the operation is not in its attested operations, the argument differs from the header, names anyone but a member-bound credential's own member, or comes without an attested header from a credential bound to no member, or the id is not 1-256 visible ASCII characters; or a write that saves only as an attested person (memory_write) named none; or the request carries x-qm-audience, a channel audience gbrain does not serve yet. Nothing was read or written. | Naming a person decides whose notes are read and written as; only a credential the brain operator granted the attest right may do it, only for the operations it lists, and text in a conversation never chooses it. | Read reason: no_attest_right and op_not_attested are the brain operator's call (gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]); argument_mismatch, argument_without_attestation, invalid_actor_id, actor_required and audience_not_supported are fixed in the calling harness. | user | `gbrain doctor --json` | 1 | no |+| A call named the person it serves (the x-qm-actor header or the acting_user argument) in a way gbrain does not honour: the credential holds no attest right, the operation is not in its attested operations, the argument differs from the header or comes without an attested header, or the id is not 1-256 visible ASCII characters; or a write that saves only as an attested person (memory_write) named none; or the request carries x-qm-audience, a channel audience gbrain does not serve yet. Nothing was read or written. | Naming a person decides whose notes are read and written as; only a credential the brain operator granted the attest right may do it, only for the operations it lists, and text in a conversation never chooses it. | Read reason: no_attest_right and op_not_attested are the brain operator's call (gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]); argument_mismatch, argument_without_attestation, invalid_actor_id, actor_required and audience_not_supported are fixed in the calling harness. | user | `gbrain doctor --json` | 1 | no |Reasons: `no_attest_right`, `op_not_attested`, `argument_mismatch`, `argument_without_attestation`, `invalid_actor_id`, `actor_required`, `audience_not_supported`.diff --git a/docs/guides/write-refusals.md b/docs/guides/write-refusals.mdindex 4c523a4f75..37ef60eb28 100644--- a/docs/guides/write-refusals.md+++ b/docs/guides/write-refusals.md@@ -984,7 +984,7 @@ Links and the right live in the database, so they are the same on a repo-less br| Code | What happened | What to do ||---|---|---|-| <a id="actor_not_attested"></a>`actor_not_attested` | The call named a person in a way gbrain does not honour. `reason` says which: `no_attest_right` (the credential holds no attest right, or the token of an attest client was issued before the upgrade or by another grant: the message then says to take a new client-credentials token), `op_not_attested` (the operation is not in the credential's attested operations, or is not attestable yet: `list_write_conflicts`, `capture`, `extract_facts` and `takes_add|update|resolve|supersede`; also when a queued write or agent job tool call runs after its operation was removed from the list), `argument_mismatch` (the `acting_user` argument differs from the header, or, with no header on a credential bound to a member, names anyone but that member; its own member id or a canonical id linked to it is dropped and the call runs exactly as the credential), `argument_without_attestation` (`acting_user` came without an attested header from a credential bound to no member, over stdio, or beside an `on_behalf_of` audience), `invalid_actor_id` (the header or argument is not 1-256 visible ASCII characters), `actor_required` (`memory_write` named no attested person) or `audience_not_supported` (the request carries `x-qm-audience`, QM's channel audience, which is refused on every call until wave 2). Nothing was read or written. | `no_attest_right` and `op_not_attested` are the brain operator's call: `fix` carries `gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]`. The other five are fixed in the calling harness: send the canonical id unchanged in the header from the attest credential, the same value or nothing in `acting_user` (on a member-bound credential with no header: its own member id, a canonical id linked to it, or nothing), and no `x-qm-audience`. |+| <a id="actor_not_attested"></a>`actor_not_attested` | The call named a person in a way gbrain does not honour. `reason` says which: `no_attest_right` (the credential holds no attest right, or the token of an attest client was issued before the upgrade or by another grant: the message then says to take a new client-credentials token), `op_not_attested` (the operation is not in the credential's attested operations, or is not attestable yet: `list_write_conflicts`, `capture`, `extract_facts` and `takes_add|update|resolve|supersede`; also when a queued write or agent job tool call runs after its operation was removed from the list), `argument_mismatch` (the `acting_user` argument differs from the header), `argument_without_attestation` (`acting_user` came without an attested header), `invalid_actor_id` (the header or argument is not 1-256 visible ASCII characters), `actor_required` (`memory_write` named no attested person) or `audience_not_supported` (the request carries `x-qm-audience`, QM's channel audience, which is refused on every call until wave 2). Nothing was read or written. | `no_attest_right` and `op_not_attested` are the brain operator's call: `fix` carries `gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]`. The other five are fixed in the calling harness: send the canonical id unchanged in the header from the attest credential, the same value or nothing in `acting_user`, and no `x-qm-audience`. || <a id="actor_unlinked"></a>`actor_unlinked` | The id is not linked to an enabled member: never linked, unlinked, or the member is disabled or removed. Ids compare exactly, with no case folding. Nothing was read or written. A queued write or agent job made for the person is refused the same way when its link is gone or now names another member. `memory_recall` answers it as an empty success instead (`structuredContent: {facts: [], truncated: false, code: "actor_unlinked"}`), so a person not yet linked reads nothing. | The brain operator links it: `gbrain access member link <member> --qm <id>` (or `gbrain access member enable <member>`). |## Relateddiff --git a/docs/protocol/AGENT_OPERATOR_v1.md b/docs/protocol/AGENT_OPERATOR_v1.mdindex b86da7d548..4894ad3bd7 100644--- a/docs/protocol/AGENT_OPERATOR_v1.md+++ b/docs/protocol/AGENT_OPERATOR_v1.md@@ -753,7 +753,7 @@ except the notices that describe one call's result. HTTP is stateless, sodedupe is per authenticated client and session, and `degraded` and `safety`notices ride every affected call. At most 2 `coaching` notices per session.Notices that describe one call's result (`degraded_recall`, `empty_retrieval`,-`listing_truncated`, `delta_incomplete`, `facts_unembedded`)+`unknown_param`, `listing_truncated`, `delta_incomplete`, `facts_unembedded`)are never deduped on any transport, with one exception: a `degraded_recall`whose only stages come from the brain's configuration (`embed_unavailable` ona keyless brain, which degrades every search the same way) shows once perdiff --git a/docs/protocol/MCP_META_CHANNELS.md b/docs/protocol/MCP_META_CHANNELS.mdindex f28c2b1707..3d8ef593ca 100644--- a/docs/protocol/MCP_META_CHANNELS.md+++ b/docs/protocol/MCP_META_CHANNELS.md@@ -33,7 +33,7 @@ shape for it.| `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)) || `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?}]`: a parameter a read ignored. This is the only place the warning appears; no content block or notice carries it, so a harness that stores tool output in its turns never stores it (writes refuse unknown parameters instead). |+| `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. |## `brain_hot_memory`diff --git a/llms-full.txt b/llms-full.txtindex 04b6e9ef6c..0068d07d6a 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -4293,7 +4293,7 @@ except the notices that describe one call's result. HTTP is stateless, sodedupe is per authenticated client and session, and `degraded` and `safety`notices ride every affected call. At most 2 `coaching` notices per session.Notices that describe one call's result (`degraded_recall`, `empty_retrieval`,-`listing_truncated`, `delta_incomplete`, `facts_unembedded`)+`unknown_param`, `listing_truncated`, `delta_incomplete`, `facts_unembedded`)are never deduped on any transport, with one exception: a `degraded_recall`whose only stages come from the brain's configuration (`embed_unavailable` ona keyless brain, which degrades every search the same way) shows once perdiff --git a/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md b/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.mdindex 06d446ed92..650011bb05 100644--- a/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md+++ b/plugin-variants/gbrain-coding/skills/conventions/agent-operator-protocol.md@@ -755,7 +755,7 @@ except the notices that describe one call's result. HTTP is stateless, sodedupe is per authenticated client and session, and `degraded` and `safety`notices ride every affected call. At most 2 `coaching` notices per session.Notices that describe one call's result (`degraded_recall`, `empty_retrieval`,-`listing_truncated`, `delta_incomplete`, `facts_unembedded`)+`unknown_param`, `listing_truncated`, `delta_incomplete`, `facts_unembedded`)are never deduped on any transport, with one exception: a `degraded_recall`whose only stages come from the brain's configuration (`embed_unavailable` ona keyless brain, which degrades every search the same way) shows once perdiff --git a/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md b/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.mdindex 06d446ed92..650011bb05 100644--- a/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md+++ b/plugin-variants/gbrain-daily/skills/conventions/agent-operator-protocol.md@@ -755,7 +755,7 @@ except the notices that describe one call's result. HTTP is stateless, sodedupe is per authenticated client and session, and `degraded` and `safety`notices ride every affected call. At most 2 `coaching` notices per session.Notices that describe one call's result (`degraded_recall`, `empty_retrieval`,-`listing_truncated`, `delta_incomplete`, `facts_unembedded`)+`unknown_param`, `listing_truncated`, `delta_incomplete`, `facts_unembedded`)are never deduped on any transport, with one exception: a `degraded_recall`whose only stages come from the brain's configuration (`embed_unavailable` ona keyless brain, which degrades every search the same way) shows once perdiff --git a/plugin/skills/conventions/agent-operator-protocol.md b/plugin/skills/conventions/agent-operator-protocol.mdindex 06d446ed92..650011bb05 100644--- a/plugin/skills/conventions/agent-operator-protocol.md+++ b/plugin/skills/conventions/agent-operator-protocol.md@@ -755,7 +755,7 @@ except the notices that describe one call's result. HTTP is stateless, sodedupe is per authenticated client and session, and `degraded` and `safety`notices ride every affected call. At most 2 `coaching` notices per session.Notices that describe one call's result (`degraded_recall`, `empty_retrieval`,-`listing_truncated`, `delta_incomplete`, `facts_unembedded`)+`unknown_param`, `listing_truncated`, `delta_incomplete`, `facts_unembedded`)are never deduped on any transport, with one exception: a `degraded_recall`whose only stages come from the brain's configuration (`embed_unavailable` ona keyless brain, which degrades every search the same way) shows once perdiff --git a/scripts/build-qm-memory-contract.ts b/scripts/build-qm-memory-contract.tsindex 725917fe04..4229b61eb2 100644--- a/scripts/build-qm-memory-contract.ts+++ b/scripts/build-qm-memory-contract.ts@@ -20,8 +20,8 @@ export const QM_CONTRACT_PATH = join(import.meta.dir, '..', 'docs', 'contracts',export const ACTOR_REASON_FIXES: Record<string, { fixed_by: 'brain_operator' | 'calling_harness'; fix: string }> = {no_attest_right: { fixed_by: 'brain_operator', fix: 'gbrain auth rescope --client <id> --attest-actor qm on the brain host; a client that already holds the right takes a new token with grant_type=client_credentials.' },op_not_attested: { fixed_by: 'brain_operator', fix: 'gbrain auth rescope --client <id> --attest-actor qm --attest-ops <list>; a deferred operation cannot be attested yet.' },- argument_mismatch: { fixed_by: 'calling_harness', fix: 'Send acting_user equal to the x-qm-actor header (with no header, on a credential bound to a member: that member id or a canonical id linked to it), or omit it.' },- argument_without_attestation: { fixed_by: 'calling_harness', fix: 'Remove acting_user, or send the x-qm-actor header from a credential holding the attest right; a credential bound to no member never sends acting_user alone.' },+ argument_mismatch: { fixed_by: 'calling_harness', fix: 'Send acting_user equal to the x-qm-actor header, or omit it.' },+ argument_without_attestation: { fixed_by: 'calling_harness', fix: 'Remove acting_user, or send the x-qm-actor header from a credential holding the attest right.' },invalid_actor_id: { fixed_by: 'calling_harness', fix: 'Send the canonical id unchanged: 1-256 visible ASCII characters, no spaces.' },actor_required: { fixed_by: 'calling_harness', fix: 'memory_write saves only as an attested person: send x-qm-actor from a credential holding the attest right.' },audience_not_supported: { fixed_by: 'calling_harness', fix: 'Send the call without x-qm-audience; channel turns are refused until wave 2 and nothing is read or written.' },@@ -55,10 +55,9 @@ export function buildQmMemoryContract(): Record<string, unknown> {const unlinked = unlinkedRecallResult();return {contract: 'gbrain.qm-memory-provider', version: 1,- transport: { protocol: 'mcp', session: 'stateless', session_header_issued: false, success_codes_in: 'structuredContent',- unknown_arguments: 'an argument a read tool does not declare is ignored and reported only in _meta.warnings ([{code: "unknown_param", param, suggestion?}]), never in content; a write tool refuses it with invalid_params' },+ transport: { protocol: 'mcp', session: 'stateless', session_header_issued: false, success_codes_in: 'structuredContent' },actor: {- header: ACTOR_HEADER, argument: ACTOR_ARGUMENT, argument_rule: 'optional; on an attested call it must equal the header; with no header it is accepted only from a credential bound to a member and only naming that member (its member id or a canonical id linked to it), and the call then runs exactly as the credential; never chooses the person on its own',+ header: ACTOR_HEADER, argument: ACTOR_ARGUMENT, argument_rule: 'optional; must equal the header; never chooses the person on its own',actor_id: { pattern: EXTERNAL_ID_RE.source, case_folding: false },system: 'qm', default_attest_ops: [...DEFAULT_ATTEST_OPS], deferred_ops: [...ACTOR_DEFERRED_OPS].sort(),audit: 'the audit trail and stored writes record the canonical external id as sent, with its linked member',diff --git a/scripts/function-size-baseline.tsv b/scripts/function-size-baseline.tsvindex 25f939c0ad..e3b557861c 100644--- a/scripts/function-size-baseline.tsv+++ b/scripts/function-size-baseline.tsv@@ -46,7 +46,7 @@ src/core/minions/handlers/subagent.ts runSubagentViaGateway 329 seed: W5 baselinsrc/core/minions/queue.ts MinionQueue.add 498 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1)src/core/minions/queue.ts MinionQueue.add>result=this.engine.transaction(#0) 359 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1)src/core/minions/worker.ts MinionWorker.start 470 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1)-src/core/ops/facts.ts recall.handler 358 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +3 #4830 (W14 PR3): every hit names its source_id, falling back to the scope's single source (the federated case stays absent); +3 W5: recall threads the page-unit ranking cut into its hybrid page arm (logic in search/page-rank-cut.ts; delivery reports it); +3 #7043: copies of one claim collapse before the limit cut (the collapse lives in facts/capture-dedup.ts collapseFactReads) and the row names its entity_slugs/collapsed_count; +1 HARN-15: max_chars is parsed before any read (the bound lives in boundRecallChars)+src/core/ops/facts.ts recall.handler 357 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +3 #4830 (W14 PR3): every hit names its source_id, falling back to the scope's single source (the federated case stays absent); +3 W5: recall threads the page-unit ranking cut into its hybrid page arm (logic in search/page-rank-cut.ts; delivery reports it); +3 #7043: copies of one claim collapse before the limit cut (the collapse lives in facts/capture-dedup.ts collapseFactReads) and the row names its entity_slugs/collapsed_countsrc/core/ops/search.ts query.handler 338 +5 GBRA-81 item 5 per-stage search timings: the request's SearchTimings and setup-stage binding, the image branch's limit read hoisted out of the timed vector call, and its response stage wrapper (collector logic in search/stage-timings.ts); seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +2 GBRA-49 explain_target: one TargetTrace prep line and its HybridSearchOpts thread (diagnosis/meta live in prepareExplainTarget/finishExplainTarget); +1 W5 (#6445): query passes the page-unit ranking cut to hybrid search (logic in search/page-rank-cut.ts), merged with master growthsrc/core/persistence/page-prepare.ts prepareInlineOrSegmentedMutation 303 +3 #7841: a put_page that asks for visibility: private is kept or refused (visibility_not_applied), checked before the no-op test and after the trust stamp (logic in persistence/visibility-request.ts)src/core/progressive-batch/orchestrator.ts runProgressiveBatch 348 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1)diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsvindex 34ad885aa4..81049eec46 100644--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@ -47,4 +47,4 @@ src/commands/doctor/checks/extraction-sync.ts 1500 ratchet +7 GBRA-130 A-1: linksrc/core/search/evidence-delivery.ts 1755 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)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 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 1579 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); +1 GBRA-156 #7593: private_pages_granted_sources row; +2 GBRA-218 A1: member_read_access_gbra218 and member_access_hatch_scope_gbra218 rows (re-summed at the #7593 merge: 1571 + 2); +1 GBRA-218 A2: folder_access_rules_gbra218 row (1574 measured); +1 GBRA-231: shared_agent_audience_gbra231 row (1575 measured); +2 GST-359 C1: attested-actor and member-link rows (1576 measured); +1 GST-359 C2: the member_facts_gst359 row (1577 measured); +1 GST-359 D: the qm_memory_provider_gst359 row (1578 measured); +1 HARN-15: the unknown_param_meta_only_harn15 row+src/core/behavior-change-notice.ts 1578 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); +1 GBRA-156 #7593: private_pages_granted_sources row; +2 GBRA-218 A1: member_read_access_gbra218 and member_access_hatch_scope_gbra218 rows (re-summed at the #7593 merge: 1571 + 2); +1 GBRA-218 A2: folder_access_rules_gbra218 row (1574 measured); +1 GBRA-231: shared_agent_audience_gbra231 row (1575 measured); +2 GST-359 C1: attested-actor and member-link rows (1576 measured); +1 GST-359 C2: the member_facts_gst359 row (1577 measured); +1 GST-359 D: the qm_memory_provider_gst359 row (1578 measured)diff --git a/skills/conventions/agent-operator-protocol.md b/skills/conventions/agent-operator-protocol.mdindex 06d446ed92..650011bb05 100644--- a/skills/conventions/agent-operator-protocol.md+++ b/skills/conventions/agent-operator-protocol.md@@ -755,7 +755,7 @@ except the notices that describe one call's result. HTTP is stateless, sodedupe is per authenticated client and session, and `degraded` and `safety`notices ride every affected call. At most 2 `coaching` notices per session.Notices that describe one call's result (`degraded_recall`, `empty_retrieval`,-`listing_truncated`, `delta_incomplete`, `facts_unembedded`)+`unknown_param`, `listing_truncated`, `delta_incomplete`, `facts_unembedded`)are never deduped on any transport, with one exception: a `degraded_recall`whose only stages come from the brain's configuration (`embed_unavailable` ona keyless brain, which degrades every search the same way) shows once perdiff --git a/skills/skills.lock.json b/skills/skills.lock.jsonindex cae7844949..c0581d2b4d 100644--- a/skills/skills.lock.json+++ b/skills/skills.lock.json@@ -44,7 +44,7 @@"concept-synthesis/routing-eval.jsonl": "96dbd7d9c1b606e9e06262d0c06282399741e2bccb8eeb7b9ca88c20f44cda0e","context-audit/SKILL.md": "6d786629d40544ddaab4f4e6e333569d270bcb8b581589dc16fb9f8bcb4f6207","context-audit/routing-eval.jsonl": "fb1832e24cc1b04163a74c5cde72bca53050a66246ca902e1a5f40303f52b5ab",- "conventions/agent-operator-protocol.md": "323790042bceafb108b4028bac6581be24f375b5c9bc4f357d5084faf5a81ae3",+ "conventions/agent-operator-protocol.md": "86ed21dfdd5e4b34cb7d5eb88532966c4e64a07d0401123421a9b33bd643c0a2","conventions/brain-first.md": "e0e4d7c4b760213325dffd286baf934720816a0b6aac5338538a0463e8fe77d2","conventions/brain-routing.md": "f11c3e7c4f98163aa6c68aa7d8f09a7acb7b6a8695f42eb7d92d4ee5787d428a","conventions/calibration.md": "500dc26bd7c8400f50dc4c16fd83f1a588f3e7e68c59050a21fd8a0f69e4d198",diff --git a/src/core/access/actor.ts b/src/core/access/actor.tsindex 2eb5889db6..a16efa1779 100644--- a/src/core/access/actor.ts+++ b/src/core/access/actor.ts@@ -20,7 +20,7 @@ import type { CallerAccess } from '../search/private-visibility.ts';import { identityFor } from './principals.ts';import { isUndefinedColumnError, isUndefinedTableError } from '../utils.ts';import { memberIdentity } from './members.ts';-import { folderAccessFor, memberIdentityFor } from './caller.ts';+import { folderAccessFor } from './caller.ts';import { ACTOR_ARGUMENT, ACTOR_DEFERRED_OPS, ACTOR_HEADER, attestRightFrom, DEFAULT_ATTEST_OPS, EXTERNAL_ID_RE, QM_AUDIENCE_HEADER, type AttestedActor, type AttestRight } from './actor-model.ts';export * from './actor-model.ts';@@ -100,7 +100,7 @@ function credentialArgv(caller: ActorCaller): string[] {const transportOf = (transport?: string) => ({ remote: true, transport: transport === 'stdio' ? 'stdio' as const : 'http' as const });/** actor_not_attested with its reason, remedy and (where the operator can fix it) the rescope command. */-export function actorNotAttested(reason: ActorReason, caller: ActorCaller, ctx: { op: string; transport?: string; right?: AttestRight | null; reissue?: boolean; memberBound?: boolean }): OperationError {+export function actorNotAttested(reason: ActorReason, caller: ActorCaller, ctx: { op: string; transport?: string; right?: AttestRight | null; reissue?: boolean }): OperationError {const docs = ERROR_CATALOGUE.actor_not_attested.docs;const rescope = (extra: string[]) => ['gbrain', 'auth', 'rescope', ...credentialArgv(caller), ...extra];const hostOnly = (message: string, argv: string[], why: string, suggestion: string) =>@@ -124,10 +124,6 @@ export function actorNotAttested(reason: ActorReason, caller: ActorCaller, ctx:'Lets an attested call run this operation as the person it names. Widening what a trusted system may do as a person is the brain operator\'s decision.',`An attested call runs only the operations the operator listed (default ${DEFAULT_ATTEST_OPS.join(', ')}); admin and membership operations never.`);case 'argument_mismatch':- if (ctx.memberBound) {- return opError('actor_not_attested', `The ${ACTOR_ARGUMENT} argument names someone other than this credential's member, so nothing was read or written.`,- `Leave ${ACTOR_ARGUMENT} out, or send this credential's own member id or a canonical id linked to it. A credential bound to a member reads only as that member; text in a conversation never chooses whose notes are read.`, { reason, docs });- }return opError('actor_not_attested', `The ${ACTOR_ARGUMENT} argument names someone other than the ${ACTOR_HEADER} header, so nothing was read or written.`,`The header decides whom the call serves; send ${ACTOR_ARGUMENT} equal to it, or leave it out. Text in a conversation never chooses whose notes are read.`, { reason, docs });case 'argument_without_attestation':@@ -230,7 +226,7 @@ export interface ActorChannels { header?: string | null; audience?: string | nulexport async function resolveAttestedActor(engine: Pick<BrainEngine, 'executeRaw'>, input: {channels?: ActorChannels; params: Record<string, unknown> | undefined; op: string; opShape: AttestableOpShape | undefined;auth?: ActorCaller['auth']; transport?: string; audienceAsserted: boolean;-}): Promise<{ actor?: AttestedActor; access?: Partial<CallerAccess>; params: Record<string, unknown> } | null> {+}): Promise<{ actor: AttestedActor; access: Partial<CallerAccess>; params: Record<string, unknown> } | null> {const header = input.channels?.header ?? undefined;const hasArgument = !!input.params && Object.prototype.hasOwnProperty.call(input.params, ACTOR_ARGUMENT);const caller: ActorCaller = { auth: input.auth };@@ -241,7 +237,7 @@ export async function resolveAttestedActor(engine: Pick<BrainEngine, 'executeRawif ((header !== undefined && !EXTERNAL_ID_RE.test(header)) || (hasArgument && (typeof argument !== 'string' || !EXTERNAL_ID_RE.test(argument)))) {throw actorNotAttested('invalid_actor_id', caller, ctx);}- if (header === undefined) return ownMemberArgument(engine, input, argument as string, caller, ctx);+ if (header === undefined) throw actorNotAttested('argument_without_attestation', caller, ctx);if (input.audienceAsserted) {throw catalogueError('on_behalf_of_invalid_audience', `The call names its person twice (${ACTOR_HEADER} and an on_behalf_of audience). Nothing was read.`,`Send one: ${ACTOR_HEADER} from an attest credential, or X-Gbrain-On-Behalf-Of / request-level _meta.on_behalf_of from a shared agent.`);@@ -260,22 +256,6 @@ export async function resolveAttestedActor(engine: Pick<BrainEngine, 'executeRawreturn { actor, access: await attestedCallerAccess(engine, actor, covered.identity), params };}-/**- * HARN-1: acting_user with no header, on a credential bound to a member (no stdio, no on_behalf_of audience). The- * member id, or a canonical id linked to it, is stripped and the call runs exactly as the credential; any other value- * is argument_mismatch, so the argument never widens or switches whose notes are read, and never tells an existing id- * from an unknown one. Every other caller is refused argument_without_attestation as before.- */-async function ownMemberArgument(engine: Pick<BrainEngine, 'executeRaw'>, input: { params?: Record<string, unknown>; auth?: ActorCaller['auth']; transport?: string; audienceAsserted: boolean },- argument: string, caller: ActorCaller, ctx: { op: string; transport?: string }): Promise<{ params: Record<string, unknown> }> {- const own = input.transport === 'stdio' || input.audienceAsserted || !input.auth ? null- : (await memberIdentityFor(engine, input.auth)).find(p => p.startsWith('member:'))?.slice('member:'.length) ?? null;- if (!own) throw actorNotAttested('argument_without_attestation', caller, ctx);- if (argument !== own && (await linkedMember(engine, 'qm', argument))?.member !== own) throw actorNotAttested('argument_mismatch', caller, { ...ctx, memberBound: true });- const { [ACTOR_ARGUMENT]: _stripped, ...params } = input.params ?? {};- return { params };-}-export interface MemberLink { system: string; external_id: string; member_id: string; created_at: string | null }function linkInvalid(message: string, reason: string, suggestion: string): OperationError {diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex dd185ab480..b6ee26c8b3 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -1376,10 +1376,9 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;{ since: 'TBD', 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: 'TBD', 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: 'TBD', 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: 'TBD', 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`), except that a credential bound to a member may send `acting_user` with no header: its own member id or a canonical id linked to it is dropped and the call runs exactly as the credential, and any other value is refused (`actor_not_attested` reason `argument_mismatch`); 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: 'TBD', 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: 'TBD', 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. 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: 'TBD', 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. `recall` now takes `max_chars` (a whole number from 200 to 12000, as `memory_recall`): it keeps the whole facts, then results, whose text fits, adds no marker and returns `truncated`; without it `recall` is unchanged. The contract QM vendors is `docs/contracts/qm-memory-provider/v1.json`.' },- { since: 'TBD', id: 'unknown_param_meta_only_harn15', text: 'A read that ignores a parameter the tool does not declare (`mcp.strict_params` `warn`, the default) no longer adds a `[gbrain notice unknown_param kind=info]` text block to the result: the warning is only in `_meta.warnings` (`{code: \'unknown_param\', param, suggestion?}`), so a harness that stores tool output in its turns never stores it. Writes still refuse unknown parameters, and `reject` mode is unchanged.' },+ { since: 'TBD', 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: 'TBD', 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.' },];diff --git a/src/core/error-registry.ts b/src/core/error-registry.tsindex a4409e66cd..f6ce937506 100644--- a/src/core/error-registry.ts+++ b/src/core/error-registry.ts@@ -68,7 +68,7 @@ export const CODES = {on_behalf_of_invalid_audience: { class: 'caller', summary: "A shared agent's request named its audience (the X-Gbrain-On-Behalf-Of header or request-level _meta.on_behalf_of) in a form gbrain does not accept: empty, more than 50 entries, an entry that is not a member id, group:<id> or guest, or a header and _meta that name different audiences. Nothing was read.", why: 'The audience decides whose notes the agent may read, so an audience gbrain cannot read exactly is refused instead of guessed.', docs: 'docs/guides/write-refusals.md#on_behalf_of_invalid_audience', suggestion: 'Fix the harness code that sets the audience: 1-50 entries, each a member id, group:<id> or guest, the same in the header and _meta when both are sent.' },on_behalf_of_unknown_member: { class: 'caller', summary: "A shared agent's audience names a member who is not enabled on this brain, or a group that does not exist, so nothing was read.", why: 'An unknown or disabled entry is refused rather than read as a guest, so a typo or a removed person never quietly changes what the agent reads.', docs: 'docs/guides/write-refusals.md#on_behalf_of_unknown_member', suggestion: 'Name enabled members and existing groups only (gbrain access member list --all, gbrain access group list on the brain host); a person who is not a member joins the audience as guest.' },on_behalf_of_not_permitted: { class: 'host_only', actor: 'user', summary: "A shared agent asserted an audience its credential's may_act_for does not list (for a stdio server, config mcp.stdio_may_act_for), so nothing was read.", why: 'A shared agent acts only for the people the brain operator approved for its credential; widening that list is the operator\'s decision, never the agent\'s.', docs: 'docs/guides/write-refusals.md#on_behalf_of_not_permitted', suggestion: 'The brain operator decides whether to approve the audience: gbrain auth rescope --token <name>|--client <id> --may-act-for <list> on the brain host. Until then, call without the audience.' },- actor_not_attested: { class: 'host_only', actor: 'user', reasons: ['no_attest_right', 'op_not_attested', 'argument_mismatch', 'argument_without_attestation', 'invalid_actor_id', 'actor_required', 'audience_not_supported'], summary: "A call named the person it serves (the x-qm-actor header or the acting_user argument) in a way gbrain does not honour: the credential holds no attest right, the operation is not in its attested operations, the argument differs from the header, names anyone but a member-bound credential's own member, or comes without an attested header from a credential bound to no member, or the id is not 1-256 visible ASCII characters; or a write that saves only as an attested person (memory_write) named none; or the request carries x-qm-audience, a channel audience gbrain does not serve yet. Nothing was read or written.", why: 'Naming a person decides whose notes are read and written as; only a credential the brain operator granted the attest right may do it, only for the operations it lists, and text in a conversation never chooses it.', docs: 'docs/guides/write-refusals.md#actor_not_attested', suggestion: 'Read reason: no_attest_right and op_not_attested are the brain operator\'s call (gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]); argument_mismatch, argument_without_attestation, invalid_actor_id, actor_required and audience_not_supported are fixed in the calling harness.' },+ actor_not_attested: { class: 'host_only', actor: 'user', reasons: ['no_attest_right', 'op_not_attested', 'argument_mismatch', 'argument_without_attestation', 'invalid_actor_id', 'actor_required', 'audience_not_supported'], summary: "A call named the person it serves (the x-qm-actor header or the acting_user argument) in a way gbrain does not honour: the credential holds no attest right, the operation is not in its attested operations, the argument differs from the header or comes without an attested header, or the id is not 1-256 visible ASCII characters; or a write that saves only as an attested person (memory_write) named none; or the request carries x-qm-audience, a channel audience gbrain does not serve yet. Nothing was read or written.", why: 'Naming a person decides whose notes are read and written as; only a credential the brain operator granted the attest right may do it, only for the operations it lists, and text in a conversation never chooses it.', docs: 'docs/guides/write-refusals.md#actor_not_attested', suggestion: 'Read reason: no_attest_right and op_not_attested are the brain operator\'s call (gbrain auth rescope --client <id> --attest-actor qm [--attest-ops <list>]); argument_mismatch, argument_without_attestation, invalid_actor_id, actor_required and audience_not_supported are fixed in the calling harness.' },actor_unlinked: { class: 'host_only', actor: 'user', summary: 'An attested call named a person whose canonical id is not linked to an enabled member of this brain (never linked, unlinked, or the member is disabled or removed), so nothing was read or written.', why: 'An attested call reads and writes as exactly one member; an unknown person is refused rather than read as a guest, and unlinking or disabling takes effect on the next call.', docs: 'docs/guides/write-refusals.md#actor_unlinked', suggestion: 'The brain operator links the id to its member: gbrain access member link <member> --qm <id> (or enables the member).' },on_behalf_of_in_arguments: { class: 'caller', summary: 'A tool call carried on_behalf_of inside its arguments, where conversation text could set it, so it was refused and nothing was read.', why: 'Only harness code may name whose notes a shared agent reads: the X-Gbrain-On-Behalf-Of header or request-level _meta.on_behalf_of, never tool arguments.', docs: 'docs/guides/write-refusals.md#on_behalf_of_in_arguments', suggestion: 'Remove on_behalf_of from the tool arguments. Harness code sends it as the X-Gbrain-On-Behalf-Of header or request-level _meta.on_behalf_of; other stdio clients use a credential bound to one member or config mcp.stdio_member.' },access_policy_invalid: { class: 'host_only', actor: 'user', docs: 'docs/guides/write-refusals.md#access_policy_invalid', summary: "A source's folder-rule policy (the committed .gbrain/access.yml, or a file given to gbrain access rule import) does not validate, so it was not applied: the last applied rules stay in force and every prefix the bad file names reads as nobody (the whole source when its prefixes cannot be read).", why: 'A typo in an access file must never open a folder: an unreadable revision keeps the previous rules and hides what it touches until it is fixed.', suggestion: 'Show each problem with its line (gbrain access rule list --source <id>), fix the file, commit it with gbrain git commit-push and sync the source (gbrain sync --source <id> --no-pull).', fix: { argv: ['gbrain', 'access', 'rule', 'list', '--source', '{source_id}', '--json'], consent: [], actor: 'agent', requires_exclusive: false, why: 'Lists the applied rules and each problem in the policy file with its line; changes nothing.' } },diff --git a/src/core/operation-manifest.generated.ts b/src/core/operation-manifest.generated.tsindex b3c55d8ade..0c85e0295d 100644--- a/src/core/operation-manifest.generated.ts+++ b/src/core/operation-manifest.generated.ts@@ -5762,10 +5762,6 @@ export const OPERATION_MANIFEST: OperationMeta[] = [],"description": "Lowest trust tier to return (the connection floor still applies).","fullSurfaceOnly": true- },- "max_chars": {- "type": "integer",- "description": "Cap on fact (then results) text, 200-12000; whole items only, truncated says if cut."}},"scope": "read",diff --git a/src/core/ops/facts.ts b/src/core/ops/facts.tsindex 73bca733d7..409a982b51 100644--- a/src/core/ops/facts.ts+++ b/src/core/ops/facts.ts@@ -54,7 +54,6 @@ import type { TrustTier } from '../trust/tier.ts';import { AUDIT_ROW_SOURCES } from '../facts/audit-sources.ts';import { parseSinceParam } from '../facts/since-parse.ts';import { callerSessionKey } from '../access/member-facts.ts';-import { boundFactLines, MEMORY_RECALL_MAX_CHARS, parseMaxChars } from './qm-memory.ts';import { parseQuestionParam, questionRecallNotices, rankFactsByQuestion, recallHintNotice, unlinkedNamesakes, type EntityCandidate, type QuestionRecall } from '../facts/question-recall.ts';// ============================================================@@ -308,13 +307,11 @@ const recall: Operation = {return_unit: { type: 'string', enum: ['chunk', 'window', 'section', 'page', 'auto'], description: 'results[] unit (see search).', fullSurfaceOnly: true },return_window: { type: 'number', description: 'Window 1-3.', fullSurfaceOnly: true },min_trust: MIN_TRUST_PARAM,- max_chars: { type: 'integer', description: `Cap on fact (then results) text, ${MEMORY_RECALL_MAX_CHARS.min}-${MEMORY_RECALL_MAX_CHARS.max}; whole items only, truncated says if cut.` },},scope: 'read',verb: true,annotations: { title: 'recall (memory read)', readOnlyHint: true },handler: async (ctx, p) => {- const maxChars = p.max_chars === undefined ? null : parseMaxChars(p.max_chars);const sourceId = ctx.sourceId ?? 'default';const limit = clampRecallLimit(p.limit);const includeExpired = p.include_expired === true;@@ -669,22 +666,10 @@ const recall: Operation = {...(delivery ? { delivery } : {}),};recordRecallOutcome(out);- return maxChars === null ? out : boundRecallChars(out, maxChars);+ return out;},};-/**- * GST-359 HARN-15: recall's max_chars, memory_recall's bound on recall's text: the fact texts, then the results' chunk- * texts, one per line, keep the whole items that fit; the first item that would cross the cap ends both lists, with- * no marker. `truncated` says whether anything was cut and `total` counts the facts kept.- */-function boundRecallChars<T extends { facts: Array<{ fact: string }>; total: number; results?: Array<{ chunk?: unknown }> }>(out: T, maxChars: number): T & { truncated: boolean } {- const lines = [...out.facts.map(f => f.fact), ...(out.results ?? []).map(r => String(r.chunk ?? ''))];- const { kept } = boundFactLines(lines, maxChars);- const facts = out.facts.slice(0, kept);- return { ...out, facts, total: facts.length, ...(out.results ? { results: out.results.slice(0, Math.max(0, kept - out.facts.length)) } : {}), truncated: kept < lines.length };-}-/*** One source's facts about an entity, read under every slug they may be saved* under (the page, its identity siblings and its bare subject slug,diff --git a/src/core/ops/qm-memory.ts b/src/core/ops/qm-memory.tsindex 2fee285590..0fe2d209f0 100644--- a/src/core/ops/qm-memory.ts+++ b/src/core/ops/qm-memory.ts@@ -86,7 +86,7 @@ export function isoDate(value: Date | string | null | undefined): string {const invalid = (message: string, suggestion: string): OperationError => opError('invalid_params', message, suggestion);-export function parseMaxChars(raw: unknown): number {+function parseMaxChars(raw: unknown): number {if (raw === undefined || raw === null) return MEMORY_RECALL_MAX_CHARS.default;const { min, max } = MEMORY_RECALL_MAX_CHARS;if (typeof raw !== 'number' || !Number.isInteger(raw) || raw < min || raw > max) {diff --git a/src/mcp/dispatch.ts b/src/mcp/dispatch.tsindex f252187478..d79c654683 100644--- a/src/mcp/dispatch.ts+++ b/src/mcp/dispatch.ts@@ -47,6 +47,7 @@ import {findInvalidParam,schemaInvalidParams,findUnknownParams,+ buildUnknownParamWarnBlock,resolveStrictParamsMode,} from './validate-params.ts';import { backupCheckDisabled, backupNagGate, backupNoticeText, loadBackupStatus } from '../core/backup/status-file.ts';@@ -924,7 +925,7 @@ export async function dispatchToolCall(const header = opts.actor?.header ?? undefined;const actorNamed = header !== undefined || opts.actor?.audience != null || (!!params && Object.prototype.hasOwnProperty.call(params, ACTOR_ARGUMENT));const assertion = (outcome: AudienceAuditEvent['outcome'], reason?: string) => logAudienceAssertion({ outcome, op: name,- audience: [...(attested?.access?.audience ?? audience ?? [])], transport: opts.transport ?? 'unknown',+ audience: [...(attested?.access.audience ?? audience ?? [])], transport: opts.transport ?? 'unknown',principal: opts.auth?.principal ? `${opts.auth.principal.kind}:${opts.auth.principal.id}` : opts.transport === 'stdio' ? 'local_stdio' : 'unknown',...(actorNamed ? { actor: { system: 'qm', ...(header && EXTERNAL_ID_RE.test(header) ? { external_id: header } : {}), ...(reason ? { reason } : {}) } } : {}) });try {@@ -932,13 +933,13 @@ export async function dispatchToolCall(audience = parseAudience(opts.onBehalfOf);attested = await resolveAttestedActor(engine, { channels: opts.actor, params, op: name, opShape: operations.find(o => o.name === name),auth: opts.auth, transport: opts.transport, audienceAsserted: audience !== null });- access = attested?.access ?? await remoteCallerAccess(engine, opts.auth, privateSources, opts.transport, audience);+ access = attested ? attested.access : await remoteCallerAccess(engine, opts.auth, privateSources, opts.transport, audience);} catch (e) {if (!(e instanceof OperationError) || !/^(on_behalf_of_|actor_)/.test(String(e.code))) throw e;assertion(e.code as AudienceAuditEvent['outcome'], e.reason);return qmMemoryToolResult(name, actorNamed ? actorRefusal(e, opts, name, header, params) : errorResult(e, opts, { op: name }));}- if (audience || attested?.actor) assertion('accepted');+ if (audience || attested) assertion('accepted');const callParams = attested ? attested.params : params;return withCallerAccess(access, async () => {const out = await withRequestIdentityMemo(() => dispatchResolvedCall(engine, name, callParams, resolved));@@ -1220,6 +1221,12 @@ async function dispatchResolvedCall(// Cat 40 (#5932) evidence blocks (type-filter notice, other names, saved facts) are retrieval// data, not advice: they stay plain extra text blocks right after content[0], as measured.const evidenceBlocks = retrievalNoticeBlocks(result, responseMeta.retrieval).slice(emptyBlock ? 1 : 0);+ // WP3/D8: warn-mode unknown-param notices ride the same channel, so the+ // grace period actually corrects clients (old thin-clients read content[0]+ // only — skew-safe). One notice per ignored parameter.+ for (const w of unknownParamWarnings) {+ notices.push({ code: 'unknown_param', kind: 'info', why: buildUnknownParamWarnBlock([w]) });+ }// Lane F (F3): degraded recall and a source binding that narrowed an empty read.const rerankDegradedCalls = recordRerankDegradation(responseMeta, opts);notices.push(...recallInteropNotices(name, result, responseMeta, safeParams,diff --git a/src/mcp/validate-params.ts b/src/mcp/validate-params.tsindex 751e485ef9..43c5157463 100644--- a/src/mcp/validate-params.ts+++ b/src/mcp/validate-params.ts@@ -204,10 +204,10 @@ export function findUnknownParams(op: Operation, params: Record<string, unknown>}/**- * The warn-mode notice lines (one per unknown key) hosts before HARN-15 appended- * as an extra content block. Dispatch no longer sends it (the warning lives in- * `_meta.warnings` only, so harnesses never store it in a turn); it stays the- * reference for the old-host block `ignoredRemoteParams` still parses.+ * Render the model-visible warn-mode notice lines (one per unknown key) that+ * dispatch appends as an extra text content block on the RESULT — the same+ * D8 second-block mechanism that carries empty-retrieval loudness, so the+ * grace period actually corrects clients instead of warning into a void.*/export function buildUnknownParamWarnBlock(warnings: UnknownParamWarning[]): string {return warningsdiff --git a/test/access-qm-actor.test.ts b/test/access-qm-actor.test.tsindex 8243279fec..dd58088d71 100644--- a/test/access-qm-actor.test.ts+++ b/test/access-qm-actor.test.ts@@ -97,7 +97,7 @@ for (const kind of testBackends()) {const text = out.content.map(c => c.text).join('\n');let json: Record<string, unknown> = {};try { json = JSON.parse(text); } catch { /* prose */ }- return { isError: out.isError === true, text, first: out.content[0]?.text, json, meta: out._meta, structured: out.structuredContent as { error?: Record<string, unknown> } | undefined };+ return { isError: out.isError === true, text, json, meta: out._meta, structured: out.structuredContent as { error?: Record<string, unknown> } | undefined };}const qm = () => clients.qm!.token;const getAs = (actor: string | undefined, key: Key, bearer = qm(), extra: Record<string, unknown> = {}) =>@@ -128,12 +128,7 @@ for (const kind of testBackends()) {await register('plain');await bindCredential(engine, { kind: 'client', id: await register('defaults') }, { attestActor: 'qm' });await register('code', ['authorization_code']);- await bindCredential(engine, { kind: 'client', id: await register('alice') }, { member: 'alice-example' });- await bindCredential(engine, { kind: 'client', id: await register('agent') }, { mayActFor: ['member:alice-example', 'member:bob-example'] });- for (const name of ['qm', 'plain', 'defaults', 'alice', 'agent']) await issue(name);- const aliceLegacy = await mintLegacyToken(engine, { name: 'qm-alice-legacy', scopes: ['read', 'write'], takesHolders: ['world'], sourceGrant: [SRC] });- tokens.aliceLegacy = { id: aliceLegacy.id, token: aliceLegacy.token };- await bindCredential(engine, { kind: 'token', id: aliceLegacy.id }, { member: 'alice-example' });+ for (const name of ['qm', 'plain', 'defaults']) await issue(name);await engine.executeRaw("UPDATE oauth_clients SET private_pages = 'granted_sources' WHERE client_id = $1", [clients.qm!.id]);const minted = await mintLegacyToken(engine, { name: 'qm-legacy', scopes: ['read', 'write'], takesHolders: ['world'], sourceGrant: [SRC] });tokens.legacy = { id: minted.id, token: minted.token };@@ -224,43 +219,6 @@ for (const kind of testBackends()) {await refused(getAs(ALICE_ID, 'alice', qm(), { acting_user: 7 }), 'actor_not_attested', 'invalid_actor_id');}, 120_000);- test('HARN-1: on a member-bound credential, acting_user naming its own member runs exactly as the token; anyone else is argument_mismatch', async () => {- const canaries = (text: string) => (Object.keys(PAGES) as Key[]).filter(k => text.includes(PAGES[k].canary));- for (const bearer of [clients.alice!.token, tokens.aliceLegacy!.token]) {- expect((await getAs(undefined, 'alice', bearer)).text).toContain(PAGES.alice.canary);- for (const key of Object.keys(PAGES) as Key[]) {- const plain = await getAs(undefined, key, bearer);- for (const id of ['alice-example', ALICE_ID, OIDC_ID]) {- const named = await getAs(undefined, key, bearer, { acting_user: id });- expect({ isError: named.isError, first: named.first }).toEqual({ isError: plain.isError, first: plain.first });- expect(named.meta?.access).toEqual(plain.meta?.access);- expect(named.text).not.toContain('acting_user');- expect(JSON.stringify(named.meta?.warnings ?? [])).not.toContain('acting_user');- }- }- const search = (extra: Record<string, unknown>) => call(bearer, 'search', { query: 'harbor ledger qm notes', match: 'keyword', fields: 'full', limit: 30, ...extra });- const own = canaries((await search({})).text);- expect(own).toEqual(expect.arrayContaining(['alice', 'both', 'open']));- expect(own).not.toContain('bob');- expect(canaries((await search({ acting_user: 'alice-example' })).text)).toEqual(own);- expect(canaries((await search({ acting_user: ALICE_ID })).text)).toEqual(own);- for (const id of ['bob-example', BOB_ID, 'dan-example', 'nobody-example', 'U0NOBODY']) {- for (const key of ['bob', 'alice'] as Key[]) await refused(getAs(undefined, key, bearer, { acting_user: id }), 'actor_not_attested', 'argument_mismatch');- await refused(search({ acting_user: id }), 'actor_not_attested', 'argument_mismatch');- }- await refused(getAs(ALICE_ID, 'alice', bearer, { acting_user: ALICE_ID }), 'actor_not_attested', 'argument_without_attestation');- await refused(call(bearer, 'get_page', { slug: PAGES.alice.slug, acting_user: 'alice-example' }, { obo: 'alice-example' }), 'actor_not_attested', 'argument_without_attestation');- }- }, 120_000);-- test('HARN-1: acting_user never widens a credential bound to no member: a may_act_for credential, a bare credential and stdio are refused', async () => {- for (const id of ['alice-example', ALICE_ID, 'bob-example']) {- for (const bearer of [clients.agent!.token, clients.plain!.token, null]) {- await refused(call(bearer, 'get_page', { slug: PAGES.alice.slug, acting_user: id }), 'actor_not_attested', 'argument_without_attestation');- }- }- }, 60_000);-test('the right follows the token\'s grant: an authorization-code token of an attest client is not attested', async () => {const hash = createHash('sha256').update(qm()).digest('hex');await engine.executeRaw("UPDATE oauth_tokens SET grant_type = 'authorization_code' WHERE token_hash = $1", [hash]);diff --git a/test/e2e/serve-http-oauth.test.ts b/test/e2e/serve-http-oauth.test.tsindex d6f831f107..449a27e2f2 100644--- a/test/e2e/serve-http-oauth.test.ts+++ b/test/e2e/serve-http-oauth.test.ts@@ -1662,9 +1662,9 @@ describeE2E('serve-http OAuth 2.1 E2E (v0.26.1 + v0.26.2 + v0.26.3)', () => {const warnings = warned._meta?.warnings;expect(Array.isArray(warnings)).toBe(true);expect(warnings.some((w: any) => w.code === 'unknown_param' && w.param === 'bogus_unknown_param')).toBe(true);- // HARN-15: the warning lives in _meta.warnings only; no content block names it.- expect(JSON.stringify(warned.content)).not.toContain('bogus_unknown_param');- expect(JSON.stringify(warned.content)).not.toContain('unknown_param');+ // The model-visible warn notice rides as an extra content block (D8).+ expect(warned.content.some((c: any) => typeof c.text === 'string'+ && c.text.includes('unknown parameter "bogus_unknown_param"'))).toBe(true);// Control (anti-vacuity): same op with only declared params.const clean = await mcpToolResult(token, 'tools/call', {diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.jsonindex 44d445752a..c217697263 100644--- a/test/fixtures/goldens/cli/tools-json.json+++ b/test/fixtures/goldens/cli/tools-json.json@@ -2,8 +2,8 @@"golden": {"exitCode": 0,"stderr": "",- "stdoutBytes": 267766,- "stdoutSha256": "8b3611e7dedd6b96b2a04c29f1ad7e7b4e9a05b4a65464f184f3afd82d00e28a",+ "stdoutBytes": 267560,+ "stdoutSha256": "25f870be62f4c5b6726a56665a8c684939ac62aa6cbf6daed7ebfc97d6bbf413","toolNames": ["remember","entity",@@ -6650,7 +6650,6 @@"include_expired": "boolean?","include_pending": "boolean?","limit": "number?",- "max_chars": "integer?","min_trust": "string?","query": "string?","question": "string?",@@ -6696,10 +6695,6 @@"description": "Per-arm max (default 50, cap 100).","type": "number"},- "max_chars": {- "description": "Cap on fact (then results) text, 200-12000; whole items only, truncated says if cut.",- "type": "integer"- },"min_trust": {"description": "Lowest trust tier to return (the connection floor still applies).","enum": [diff --git a/test/qm-memory-tools.test.ts b/test/qm-memory-tools.test.tsindex 29e50d4a85..f0cd0cc506 100644--- a/test/qm-memory-tools.test.ts+++ b/test/qm-memory-tools.test.ts@@ -371,45 +371,6 @@ for (const kind of testBackends()) {}}, 120_000);- test('generic recall takes max_chars: whole facts in order, no marker, structured truncated, invalid values refused; without it recall is unchanged (HARN-15)', async () => {- const ENTITY = 'companies/harn-recall-example';- for (let i = 0; i < 12; i++) {- await engine.insertFact({ fact: 'Harn recall world fact ' + String(i).padStart(2, '0') + ' ' + 'ledger detail '.repeat(6) + 'canaryharnrecall', kind: 'fact', entity_slug: ENTITY, source: 'test', visibility: 'world' }, { source_id: SRC });- }- const recallAll = (args: Record<string, unknown> = {}) => call({ token: 'plain' }, 'recall', { entity: ENTITY, ...args });- const base = await recallAll();- expect(base.isError).toBe(false);- expect(base.json.facts.length).toBe(12);- expect('truncated' in base.json).toBe(false);- expect(base.json.total).toBe(12);- const again = await recallAll();- expect(Object.keys(again.json).sort()).toEqual(Object.keys(base.json).sort());- const baseIds = base.json.facts.map((f: { id: number }) => f.id);- for (const max_chars of [MEMORY_RECALL_MAX_CHARS.min, 500, 1000]) {- const out = await recallAll({ max_chars });- expect(out.isError).toBe(false);- const facts = out.json.facts as Array<{ id: number; fact: string }>;- expect(facts.length).toBeGreaterThan(0);- expect(facts.length).toBeLessThan(12);- expect(facts.map(f => f.fact).join('\n').length).toBeLessThanOrEqual(max_chars);- expect(facts.map(f => f.id)).toEqual(baseIds.slice(0, facts.length));- const next = base.json.facts[facts.length].fact as string;- expect(facts.map(f => f.fact).join('\n').length + 1 + next.length).toBeGreaterThan(max_chars);- expect(out.json.truncated).toBe(true);- expect(out.json.total).toBe(facts.length);- expect(out.text).not.toMatch(/\d+ more|truncated at/i);- }- const roomy = await recallAll({ max_chars: MEMORY_RECALL_MAX_CHARS.max });- expect(roomy.json.truncated).toBe(false);- expect(roomy.json.facts.map((f: { id: number }) => f.id)).toEqual(baseIds);- for (const max_chars of [199, 12_001, 500.5, '600']) {- const out = await recallAll({ max_chars });- expect(out.isError).toBe(true);- expect(out.json.code ?? out.json.error).toBe('invalid_params');- expect(out.text).not.toContain('canaryharnrecall');- }- }, 120_000);-test('an unlinked person gets an empty success whose code rides structuredContent only', async () => {const out = await recall({ token: 'qm', actor: 'U0NOBODY' }, 'budget ledger');expect(out.isError).toBe(false);diff --git a/test/truthful-catalog.e2e-lite.test.ts b/test/truthful-catalog.e2e-lite.test.tsindex 391c5f4970..d9c47563ba 100644--- a/test/truthful-catalog.e2e-lite.test.ts+++ b/test/truthful-catalog.e2e-lite.test.ts@@ -462,9 +462,9 @@ describe('E5 truthful catalog — legacy bearer transport (real HTTP, PGLite)',const meta = result._meta as { warnings?: Array<{ code: string; param: string }> } | undefined;expect(meta?.warnings?.[0]?.code).toBe('unknown_param');expect(meta?.warnings?.[0]?.param).toBe('e5_garbage_probe');- // HARN-15: the warning lives in _meta.warnings only; no content block names it.+ // The model-visible grace-period notice rides the second content block.const blocks = result.content.map(c => c.text);- expect(blocks.some(t => t.includes('e5_garbage_probe'))).toBe(false);+ expect(blocks.some(t => t.includes('unknown parameter "e5_garbage_probe"'))).toBe(true);} finally {await engine.setConfig('mcp.strict_params', 'reject');}diff --git a/test/validate-params.test.ts b/test/validate-params.test.tsindex 72cae64491..9b55768cdd 100644--- a/test/validate-params.test.ts+++ b/test/validate-params.test.ts@@ -88,7 +88,7 @@ describe('normalize→validate order (absence idioms are not unknown keys)', ()// 2. warn mode// ----------------------------------------------------------------------------describe('warn mode (default) — accept + _meta.warnings only, never a content block', () => {+describe('warn mode (default) — accept + _meta.warnings + model-visible block', () => {test('unknown key collected with amendment-13 shape and nearest-declared suggestion', async () => {const out = await dispatchToolCall(stubEngine('warn'), 'resolve_slugs', {partial: 'alice-ex',@@ -98,10 +98,12 @@ describe('warn mode (default) — accept + _meta.warnings only, never a contentexpect(out._meta?.warnings).toEqual([{ code: 'unknown_param', param: 'partal', suggestion: 'partial' },]);- // HARN-15: the warning rides _meta.warnings alone; harnesses store content in the turn, so no block is added.- expect(out.content.length).toBe(1);- expect(JSON.stringify(out.content)).not.toContain('partal');- expect(out._meta?.gbrain_notices).toBeUndefined();+ // D8 second-block mechanism carries the grace-period notice.+ expect(out.content.length).toBe(2);+ // Agent contract v1: the block rides the notice channel (prefix line), its text kept as `why:`.+ expect(out.content[1].text).toBe(+ '[gbrain notice unknown_param kind=info]\nwhy: warning: unknown parameter "partal" ignored — did you mean "partial"? A future release rejects unknown parameters.',+ );});test('unresolved (absent) config defaults to warn', async () => {@@ -115,8 +117,9 @@ describe('warn mode (default) — accept + _meta.warnings only, never a contentexpect(warnings[0].param).toBe('totally_unrelated_key');// Nothing within edit distance → no suggestion key at all.expect('suggestion' in warnings[0]).toBe(false);- expect(out.content.length).toBe(1);- expect(JSON.stringify(out.content)).not.toContain('totally_unrelated_key');+ expect(out.content[1].text).toBe(+ '[gbrain notice unknown_param kind=info]\nwhy: warning: unknown parameter "totally_unrelated_key" ignored. A future release rejects unknown parameters.',+ );});test('suggestion candidates are the op\'s DECLARED params only', () => {@@ -439,12 +442,6 @@ describe('write operations reject unknown parameters even in warn mode (#5970)',expect(out.isError ?? false).toBe(false);expect(handlerCalls).toBe(1);expect(out._meta?.warnings).toEqual([{ code: 'unknown_param', param: 'limt', suggestion: 'limit' }]);- // HARN-15 regression: a read's content carries no notice text for an ignored parameter.- const text = out.content.map(c => c.text).join('\n');- expect(text).not.toContain('limt');- expect(text).not.toContain('unknown_param');- expect(text).not.toContain('unknown parameter');- expect(text).not.toContain('[gbrain notice');} finally {searchOp.handler = original;}