Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

GST-687: close the remaining remote fence gaps and fix the tests the quoting change moved

garrytanaa047e3e3f83
diff --git a/src/core/ops/admin.ts b/src/core/ops/admin.ts
index 1b5f78efbe..b665a2e6d5 100644
--- a/src/core/ops/admin.ts
+++ b/src/core/ops/admin.ts
@@ -238,6 +238,8 @@ const get_versions: Operation = {
const versions = canReadWriteAttribution(ctx) ? await attributeVersions(ctx.engine, plain) : plain;
// Wave B: a segmented version's body is never returned whole; body_ref names its size and the windowed read.
const out = [];
+ const snapshotTiers = ctx.remote === false || versions.length === 0 ? new Map<number, unknown>() : new Map((await ctx.engine.executeRaw<{ id: number | string; trust_tier: string | null }>(
+ 'SELECT id, trust_tier FROM page_versions WHERE id = ANY($1::bigint[])', [versions.map(v => Number(v.id))])).map(r => [Number(r.id), r.trust_tier] as const));
for (const v of versions) {
if (isSegmentedPage(v)) {
const sized = await remoteVersionSize(ctx, v);
@@ -249,7 +251,7 @@ const get_versions: Operation = {
if (ctx.remote === false) { out.push(v); continue; }
// #8042: a third-party page's version reaches an untrusted reader quoted, as get_page's current body does;
// GST-687: so does one whose snapshot tier is below the owner's (a version with no snapshot reads as unknown).
- const quote = quotesStored(v.type, (v as { trust_tier?: unknown }).trust_tier);
+ const quote = quotesStored(v.type, snapshotTiers.get(Number(v.id)));
const body = (text: string) => { const clean = sanitizeRemoteBody(text); return quote && clean ? fenceTranscriptText(clean, String(p.slug)) : clean; };
out.push({ ...v, compiled_truth: body(v.compiled_truth),
...(typeof v.timeline === 'string' ? { timeline: body(v.timeline) } : {}), ...(quote ? { quoted: 'transcript' } : {}) });
diff --git a/src/core/ops/pages.ts b/src/core/ops/pages.ts
index 0d59e6b59d..dcdd943b95 100644
--- a/src/core/ops/pages.ts
+++ b/src/core/ops/pages.ts
@@ -23,6 +23,7 @@ import { isSegmentedPage } from '../page-body/page-shape.ts';
import { MIN_TRUST_PARAM } from '../eligibility/policy.ts';
import { getPageKnownAsOf, KNOWN_AS_OF_PARAM } from './known-as-of.ts';
import { stampRowTrust } from '../eligibility/stamp.ts';
+import { quoteTimelineRows } from './timeline.ts';
import { isAutoLinkEnabled } from '../link-extraction.ts';
import { sanitizeRemoteBody } from '../remote-body.ts';
import { getContentFlag } from '../quarantine.ts';
@@ -223,7 +224,7 @@ const get_page: Operation = {
// `content` roughly duplicates compiled_truth + timeline — always emitting
// it would double every reader's payload for the round-trip minority.
const timelineEntries = includeTimelineEntries
- ? await stampRowTrust(ctx.engine, 'timeline_entries', await ctx.engine.getTimeline(page.slug, { ...await readPolicyOpts(ctx, { sourceId: page.source_id }), eligibility: readable.eligibility }), e => e.id) : undefined;
+ ? await quoteTimelineRows(ctx, page.slug, await stampRowTrust(ctx.engine, 'timeline_entries', await ctx.engine.getTimeline(page.slug, { ...await readPolicyOpts(ctx, { sourceId: page.source_id }), eligibility: readable.eligibility }), e => e.id)) : undefined;
// Read-only, over the same visibility-filtered body the reader gets.
const lineGrammar = p.grammar_diagnostics !== true ? undefined : await (await import('../line-grammar-report.ts')).grammarDiagnosticsForPage(ctx.engine, page, visibleBody);
const quarantined = readQuarantined(ctx, page, p.include_quarantined === true); // #6259
diff --git a/src/core/ops/timeline.ts b/src/core/ops/timeline.ts
index d9e87ef4d8..00b067d362 100644
--- a/src/core/ops/timeline.ts
+++ b/src/core/ops/timeline.ts
@@ -8,7 +8,7 @@ import { MERGE_PRECONDITION_PARAMS, WRITE_REQUEST_PARAM } from '../persistence/p
* (cycle).
*/
-import { opError, type Operation } from './contract.ts';
+import { opError, type Operation, type OperationContext } from './contract.ts';
import { opTransport } from './op-fix.ts';
import { readPolicyOpts } from './context.ts';
import { MIN_TRUST_PARAM, resolveReadEligibility } from '../eligibility/policy.ts';
@@ -21,6 +21,20 @@ import {
// --- Timeline ---
+/** GST-687: an untrusted reader gets an entry of a chat page, or one below the owner's tier, quoted like get_page's timeline. */
+export async function quoteTimelineRows<T extends { page_id: number; summary: string; detail?: string | null; trust_tier: string | null }>(
+ ctx: OperationContext, slug: string, rows: T[],
+): Promise<Array<T | (T & { quoted: 'transcript' })>> {
+ if (ctx.remote === false || rows.length === 0) return rows;
+ const types = await pageTypesById(ctx.engine, rows.map(e => e.page_id));
+ return rows.map(e => {
+ const type = types.get(e.page_id);
+ if (!quotesStored(type, e.trust_tier)) return e;
+ const quote = (text: string) => quotePageText(text, slug, type);
+ return { ...e, summary: quote(e.summary), ...(e.detail ? { detail: quote(e.detail) } : {}), quoted: 'transcript' as const };
+ });
+}
+
const add_timeline_entry: Operation = {
name: 'add_timeline_entry',
idempotent: true,
@@ -101,16 +115,7 @@ const get_timeline: Operation = {
...(limit !== undefined ? { limit } : {}),
eligibility,
});
- const stamped = await stampRowTrust(ctx.engine, 'timeline_entries', entries, e => (e as { id: number }).id);
- if (ctx.remote === false || stamped.length === 0) return stamped;
- // GST-687: an untrusted reader gets an entry of a chat page, or one below the owner's tier, quoted like get_page's timeline.
- const types = await pageTypesById(ctx.engine, stamped.map(e => e.page_id));
- return stamped.map(e => {
- const type = types.get(e.page_id);
- if (!quotesStored(type, e.trust_tier)) return e;
- const quote = (text: string) => quotePageText(text, p.slug as string, type);
- return { ...e, summary: quote(e.summary), ...(e.detail ? { detail: quote(e.detail) } : {}), quoted: 'transcript' as const };
- });
+ return quoteTimelineRows(ctx, p.slug as string, await stampRowTrust(ctx.engine, 'timeline_entries', entries, e => (e as { id: number }).id));
},
scope: 'read',
cliHints: { name: 'timeline', positional: ['slug'] },
diff --git a/src/mcp/dispatch.ts b/src/mcp/dispatch.ts
index fa81958b8d..bc92eeba3a 100644
--- a/src/mcp/dispatch.ts
+++ b/src/mcp/dispatch.ts
@@ -411,7 +411,7 @@ export function retrievalNoticeBlocks(result: unknown, retrieval: unknown): stri
const r = retrieval as {
type_filter_notice?: unknown;
other_names?: Array<{ name: string; alias: string; slug: string }>;
- saved_facts?: Array<{ fact: string; entity_slug: string | null; valid_from: string; source: string; linked_from?: string; corrected_by?: number }>;
+ saved_facts?: Array<{ fact: string; entity_slug: string | null; valid_from: string; source: string; linked_from?: string; corrected_by?: number; quoted?: string }>;
answer_id?: unknown;
feedback?: { rateable?: boolean; how_to_rate?: string };
};
@@ -424,7 +424,7 @@ export function retrievalNoticeBlocks(result: unknown, retrieval: unknown): stri
}
if (r.saved_facts?.length) {
const { text, more } = wholeItemsWithin('Saved facts (remember): about the entity this query names (newest first), then facts those point to, then matches for its words; recall returns more:\n',
- r.saved_facts.map(f => `- ${f.fact} [entity: ${f.entity_slug ?? 'none'}; saved ${String(f.valid_from).slice(0, 10)}; provenance: ${f.source}${f.linked_from ? `; named in a saved fact about ${f.linked_from}` : ''}${f.corrected_by ? '; corrected by a newer saved fact above' : ''}]`),
+ r.saved_facts.map(f => `- ${f.fact}${f.quoted ? '\n' : ''} [entity: ${f.entity_slug ?? 'none'}; saved ${String(f.valid_from).slice(0, 10)}; provenance: ${f.source}${f.linked_from ? `; named in a saved fact about ${f.linked_from}` : ''}${f.corrected_by ? '; corrected by a newer saved fact above' : ''}]`),
'\n', SAVED_FACTS_NOTICE_MAX_CHARS);
blocks.push(more ? `${text}\n(+${more} more; recall returns them)` : text);
}
diff --git a/test/capture-dedup.test.ts b/test/capture-dedup.test.ts
index 02fb841fd4..34d61de54e 100644
--- a/test/capture-dedup.test.ts
+++ b/test/capture-dedup.test.ts
@@ -29,6 +29,7 @@ import { acquireWorktree, claimWorktree, getWorktreeBinding, MANAGED_WRITER_PROB
import { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';
import { testBackends } from './helpers/test-backends.ts';
import { withEnv } from './helpers/with-env.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { configureGateway, resetGateway, __setChatTransportForTests, __setEmbedTransportForTests } from '../src/core/ai/gateway.ts';
import { runFactsPipeline, type FactsBackstopCtx } from '../src/core/facts/backstop.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
@@ -304,7 +305,7 @@ for (const mode of ['unmanaged', 'managed'] as const) {
}
describe('hot memory collapse (V2)', () => {
- const insert = (fact: string, entity_slug: string) => engine.insertFact({ fact, entity_slug, source: 'fixture', visibility: 'world' }, { source_id: sourceId });
+ const insert = (fact: string, entity_slug: string) => asOwner(engine, tx => tx.insertFact({ fact, entity_slug, source: 'fixture', visibility: 'world' }, { source_id: sourceId }));
test('an identical claim on two entities that names one of them injects once with both labels; distinct facts still fill topK', () => withEnv({ GBRAIN_HOME: home }, async () => {
await freshSource('unmanaged');
diff --git a/test/context-pack-entity-facts.test.ts b/test/context-pack-entity-facts.test.ts
index 5f79b9290f..d86cc72a6c 100644
--- a/test/context-pack-entity-facts.test.ts
+++ b/test/context-pack-entity-facts.test.ts
@@ -17,6 +17,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { operationsByName, type OperationContext } from '../src/core/operations.ts';
import { estimateTokens } from '../src/core/search/token-budget.ts';
import { __resetHotMemoryCacheForTests } from '../src/core/facts/meta-hook.ts';
+import { fenceTranscriptText } from '../src/core/search/transcript-quote.ts';
let engine: PGLiteEngine;
const noop = { info() {}, warn() {}, error() {} };
@@ -62,7 +63,8 @@ describe('#6724 context_pack entity_facts', () => {
const legacy = await pack(ctx(true), { entities: 'Bob Example' });
expect(res.facts.map((f: any) => f.fact_id)).toEqual(legacy.facts.map((f: any) => f.fact_id));
expect(res.text).toContain('## Entity facts');
- expect(res.text).toMatch(/\(assistant said\) .*Alice Example chairs the ALICE-OLD-SENTINEL/);
+ const quotedOld = fenceTranscriptText('Alice Example chairs the ALICE-OLD-SENTINEL review board.', `fact ${aliceOld}`);
+ expect(res.text).toMatch(new RegExp(`\\(assistant said\\) .*${RegExp.escape(quotedOld)}\\n \\[people/alice-example\\]`));
expect(res.text.indexOf('ALICE-OLD-SENTINEL')).toBeLessThan(res.text.indexOf('## Hot memory'));
});
diff --git a/test/context-pack-fact-traceability.test.ts b/test/context-pack-fact-traceability.test.ts
index f8a1f76081..f356fe9100 100644
--- a/test/context-pack-fact-traceability.test.ts
+++ b/test/context-pack-fact-traceability.test.ts
@@ -15,6 +15,7 @@ import { operationsByName, type OperationContext } from '../src/core/operations.
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { __resetHotMemoryCacheForTests } from '../src/core/facts/meta-hook.ts';
import type { GBrainConfig } from '../src/core/config.ts';
+import { asOwner } from './helpers/owner-tier.ts';
const ALNUM = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const rand = (n: number) => [...randomBytes(n)].map(b => ALNUM[b % ALNUM.length]).join('');
@@ -32,8 +33,10 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await engine.insertFact({ fact: 'Project Boreal uses the colour green.', entity_slug: 'projects/boreal-example', source: 'POC-CORRECTION-2026-10-06', visibility: 'world', embedding: null } as never, { source_id: 'default' });
- await engine.insertFact({ fact: 'Project Atlas uses the colour blue.', entity_slug: null, source: `test:${KEY}`, visibility: 'world', embedding: null } as never, { source_id: 'default' });
+ await asOwner(engine, async tx => {
+ await tx.insertFact({ fact: 'Project Boreal uses the colour green.', entity_slug: 'projects/boreal-example', source: 'POC-CORRECTION-2026-10-06', visibility: 'world', embedding: null } as never, { source_id: 'default' });
+ await tx.insertFact({ fact: 'Project Atlas uses the colour blue.', entity_slug: null, source: `test:${KEY}`, visibility: 'world', embedding: null } as never, { source_id: 'default' });
+ });
}, 120_000);
afterAll(async () => {
diff --git a/test/e2e/evidence-delivery-parity.test.ts b/test/e2e/evidence-delivery-parity.test.ts
index aa796833ac..76f3eea499 100644
--- a/test/e2e/evidence-delivery-parity.test.ts
+++ b/test/e2e/evidence-delivery-parity.test.ts
@@ -36,11 +36,19 @@ import { operations, type OperationContext } from '../../src/core/operations.ts'
import { AUTO_PACKINGS, assembleEvidenceForHits, countEvidenceTokens, evidenceFingerprint, pageEvidenceText } from '../../src/core/search/evidence-delivery.ts';
import { isolatedPersistencePostgres } from '../helpers/persistence-postgres.ts';
import { captureOffPath, seedOffPath, withCostWave } from '../helpers/evidence-delivery-fixture.ts';
+import { fenceTranscriptText } from '../../src/core/search/transcript-quote.ts';
import { configureGateway } from '../../src/core/ai/gateway.ts';
import { LEGACY_EMBEDDING_CONFIG } from '../helpers/legacy-embedding-config.ts';
import { PROVIDER_ENV_KEYS } from '../helpers/provider-env.ts';
import { emptyHome, withEnv } from '../helpers/with-env.ts';
+/** GST-687: the fixture pages carry no owner tier, so a remote reader gets each one's evidence fenced as a quote of its slug. */
+function asRead(remote: boolean, row: SearchResult, text: string): string {
+ if (!remote) return text;
+ expect((row as SearchResult & { quoted?: string }).quoted).toBe('transcript');
+ return fenceTranscriptText(text, row.slug);
+}
+
const FIXTURE = join(import.meta.dir, '../fixtures/goldens/evidence-delivery/off-path.json');
const backends = process.env.DATABASE_URL ? ['pglite', 'postgres'] as const : ['pglite'] as const;
const UNITS = ['window', 'section', 'page', 'auto'] as const;
@@ -136,7 +144,7 @@ describe('evidence delivery parity', () => {
for (const r of chat) {
const [page] = await engine.executeRaw<{ compiled_truth: string; timeline: string }>('SELECT compiled_truth, timeline FROM pages WHERE id = $1', [r.page_id]);
expect(r.delivered).toMatchObject({ unit: 'page', reason: 'conversation_slug' });
- expect(r.chunk_text).toBe(pageEvidenceText(page, true).text.trimEnd());
+ expect(r.chunk_text).toBe(asRead(remote, r, pageEvidenceText(page, true).text.trimEnd()));
expanded++;
}
}
@@ -188,7 +196,7 @@ describe('evidence delivery parity', () => {
expect(rows.length).toBeGreaterThan(0);
for (const r of rows) {
const [page] = await engine.executeRaw<{ compiled_truth: string; timeline: string }>('SELECT compiled_truth, timeline FROM pages WHERE id = $1', [r.page_id]);
- expect(r.chunk_text).toBe(pageEvidenceText(page, true).text.trimEnd());
+ expect(r.chunk_text).toBe(asRead(remote, r, pageEvidenceText(page, true).text.trimEnd()));
}
}
}, 120_000);
diff --git a/test/evidence-result-caps.test.ts b/test/evidence-result-caps.test.ts
index 796a6f658e..f6a53f7932 100644
--- a/test/evidence-result-caps.test.ts
+++ b/test/evidence-result-caps.test.ts
@@ -10,6 +10,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { RESULT_CHUNK_CHARS } from '../src/core/search/snippet-cap.ts';
import { installFixtureChunks } from './helpers/page-projection.ts';
import { mcpCall } from './helpers/long-page-fixture.ts';
+import { asOwner } from './helpers/owner-tier.ts';
const BIG_CHUNK = 'Old export. ' + 'The harbor ledger lists every pallet, the berth, the crane and the tally clerk for the shift. '.repeat(120);
@@ -18,7 +19,7 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await engine.putPage('notes/harbor-ledger', { type: 'note', title: 'Harbor ledger', compiled_truth: BIG_CHUNK, timeline: '', frontmatter: {} });
+ await asOwner(engine, tx => tx.putPage('notes/harbor-ledger', { type: 'note', title: 'Harbor ledger', compiled_truth: BIG_CHUNK, timeline: '', frontmatter: {} }));
await installFixtureChunks(engine, 'notes/harbor-ledger', [{ chunk_index: 0, chunk_text: BIG_CHUNK, chunk_source: 'compiled_truth' as const }]);
}, 240_000);
afterAll(async () => { await engine?.disconnect(); }, 120_000);
diff --git a/test/facts-context-injection.serial.test.ts b/test/facts-context-injection.serial.test.ts
index ac9265a300..f824c02c9c 100644
--- a/test/facts-context-injection.serial.test.ts
+++ b/test/facts-context-injection.serial.test.ts
@@ -18,6 +18,7 @@ import {
getBrainHotMemoryMeta,
__resetHotMemoryCacheForTests,
} from '../src/core/facts/meta-hook.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
@@ -25,14 +26,14 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await engine.insertFact(
+ await asOwner(engine, tx => tx.insertFact(
{ fact: 'world fact', kind: 'fact', entity_slug: 'meta-test', visibility: 'world', source: 'test' },
{ source_id: 'default' },
- );
- await engine.insertFact(
+ ));
+ await asOwner(engine, tx => tx.insertFact(
{ fact: 'private fact', kind: 'fact', entity_slug: 'meta-test', visibility: 'private', source: 'test' },
{ source_id: 'default' },
- );
+ ));
});
afterAll(async () => {
diff --git a/test/facts-recall-audit-rows.test.ts b/test/facts-recall-audit-rows.test.ts
index dec05f75c2..a45de67b87 100644
--- a/test/facts-recall-audit-rows.test.ts
+++ b/test/facts-recall-audit-rows.test.ts
@@ -34,6 +34,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { runRecall } from '../src/commands/recall.ts';
import { withEnv, emptyHome } from './helpers/with-env.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { TERMINAL_AUDIT_SOURCE, NON_EXTRACTABLE_AUDIT_SOURCE, LEGACY_TERMINAL_AUDIT_SOURCE, AUDIT_ROW_SOURCES } from '../src/core/facts/audit-sources.ts';
let engine: PGLiteEngine;
@@ -53,7 +54,7 @@ beforeAll(async () => {
// audit rows before the real fact, as an earlier draft of this test did,
// makes the real fact newest and the test passes even without the SQL-
// level fix — non-discriminative.)
- await engine.insertFact(
+ await asOwner(engine, tx => tx.insertFact(
{
fact: 'the user prefers oat milk in their coffee',
kind: 'preference',
@@ -62,13 +63,13 @@ beforeAll(async () => {
visibility: 'world',
},
{ source_id: 'default' },
- );
+ ));
// A genuine user fact whose TEXT happens to be exactly the audit marker
// string, but written by a normal (non-audit) source. This is the case
// the OLD `fact NOT IN ('EXTRACTION_COMPLETE', ...)` predicate got wrong
// — it matched on fact TEXT and hid this real content. The fix keys the
// predicate on `source` instead, so this row must survive exclusion.
- await engine.insertFact(
+ await asOwner(engine, tx => tx.insertFact(
{
fact: 'EXTRACTION_COMPLETE',
kind: 'fact',
@@ -77,7 +78,7 @@ beforeAll(async () => {
visibility: 'world',
},
{ source_id: 'default' },
- );
+ ));
for (let i = 0; i < 5; i++) {
await engine.insertFact(
{
diff --git a/test/facts-visibility.test.ts b/test/facts-visibility.test.ts
index 1f0f9c455e..982f934ad9 100644
--- a/test/facts-visibility.test.ts
+++ b/test/facts-visibility.test.ts
@@ -20,6 +20,7 @@ import {
__resetShortLivedCliForTests,
} from '../src/core/facts/cli-process-mode.ts';
import type { BrainEngine } from '../src/core/engine.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
@@ -27,14 +28,14 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await engine.insertFact(
+ await asOwner(engine, tx => tx.insertFact(
{ fact: 'world-visible', kind: 'fact', entity_slug: 'vis-test', source: 'test', visibility: 'world' },
{ source_id: 'default' },
- );
- await engine.insertFact(
+ ));
+ await asOwner(engine, tx => tx.insertFact(
{ fact: 'private-only', kind: 'fact', entity_slug: 'vis-test', source: 'test', visibility: 'private' },
{ source_id: 'default' },
- );
+ ));
});
afterAll(async () => {
diff --git a/test/fence-write-verbs.test.ts b/test/fence-write-verbs.test.ts
index b1b27c56d2..dd04f1b687 100644
--- a/test/fence-write-verbs.test.ts
+++ b/test/fence-write-verbs.test.ts
@@ -27,6 +27,7 @@ import { assertExportProjectionRoundtrip } from '../src/core/shared-skills/migra
import { parseMarkdown } from '../src/core/markdown.ts';
import { verifyAndRepairDreamPages } from '../src/core/cycle/synthesize-verify.ts';
import { FENCE_TREND_OP } from '../src/core/fence-repair/census-store.ts';
+import { unquoteTranscriptText } from '../src/core/search/transcript-quote.ts';
import { withEnv } from './helpers/with-env.ts';
import { TEST_WRITE_ATTRIBUTION } from './helpers/write-attribution.ts';
@@ -124,8 +125,11 @@ describe('put_page', () => {
await put(slug, page('E7', factsFence(fact(1, 'Public claim'), fact(2, 'PRIVATE_E7_FACT', { vis: 'private' }))));
const view = await op('get_page').handler(ctx({ remote: true }), { slug, include_content: true }) as { content: string };
expect(view.content).not.toContain('PRIVATE_E7_FACT');
+ // GST-687: the agent-written page reaches the remote caller quoted; it edits the content inside the quote fence.
+ const content = unquoteTranscriptText(view.content, slug);
+ expect(content).not.toBe(view.content);
// The remote caller appends a row with an invented kind and leaves the end marker off: both are fixable.
- const edited = view.content.replace(fact(1, 'Public claim'), `${fact(1, 'Public claim')}\n${fact(3, 'Remote claim', { kind: 'partnership' })}`).replace(`\n${FE}`, '\n');
+ const edited = content.replace(fact(1, 'Public claim'), `${fact(1, 'Public claim')}\n${fact(3, 'Remote claim', { kind: 'partnership' })}`).replace(`\n${FE}`, '\n');
expect(parseFactsFence(edited).warnings.length).toBeGreaterThan(0);
const notices: Notice[] = [];
const result = await put(slug, edited, { remote: true, notices });
diff --git a/test/fetch-large-page.test.ts b/test/fetch-large-page.test.ts
index c9cbca3fd2..702c13712c 100644
--- a/test/fetch-large-page.test.ts
+++ b/test/fetch-large-page.test.ts
@@ -11,6 +11,7 @@ import { importFromContent } from '../src/core/import-file.ts';
import { serializeMarkdown } from '../src/core/markdown.ts';
import { pageDocument } from '../src/core/page-window/document.ts';
import { decodeDeepResearchAnchor, decodeDeepResearchId, encodeDeepResearchId } from '../src/core/deep-research-id.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
const fetchOp = operations.find(o => o.name === 'fetch')!;
@@ -23,7 +24,7 @@ function log(lines: number, marker: (i: number) => string = () => ''): string {
return ['# Planning log', '', ...Array.from({ length: lines }, (_, i) => `- 2026-05-${String(1 + (i % 28)).padStart(2, '0')} entry ${i} about the acme-example widget plan${marker(i)}`)].join('\n');
}
async function put(slug: string, body: string) {
- const r = await importFromContent(engine, slug, serializeMarkdown({}, body, '', { type: 'note', title: slug, tags: [] }), { sourceId: 'default', noEmbed: true, forceRechunk: true });
+ const r = await asOwner(engine, tx => importFromContent(tx, slug, serializeMarkdown({}, body, '', { type: 'note', title: slug, tags: [] }), { sourceId: 'default', noEmbed: true, forceRechunk: true }));
expect(r.status).toBe('imported');
}
diff --git a/test/fixtures/goldens/evidence-delivery/long-page-on-path.json b/test/fixtures/goldens/evidence-delivery/long-page-on-path.json
index 36ac57756f..79970671fc 100644
--- a/test/fixtures/goldens/evidence-delivery/long-page-on-path.json
+++ b/test/fixtures/goldens/evidence-delivery/long-page-on-path.json
@@ -1,5 +1,5 @@
{
- "mcp-search:window": "{\"content\":[{\"type\":\"text\",\"text\":\"[{\\\"slug\\\":\\\"contracts/msa-example\\\",\\\"title\\\":\\\"contracts/msa-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Definitions\\\\n\\\\nThe renewal fee means the amount stated in the order form. Clause 1 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 2 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 3 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 4 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 5 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 6 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 7 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 8 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 9 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 10 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 11 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 12 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 13 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 14 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 15 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 16 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 17 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 18 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 19 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 20 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 21 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 22 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 23 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 24 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 25 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 26 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 27 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 28 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 29 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 30 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 31 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 32 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 33 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 34 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 35 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 36 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 37 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 38 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 39 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 40 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 41 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 42 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 43 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 44 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 45 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 46 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 47 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 48 on definitions restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Fees\\\\n\\\\nNo renewal fee applies to trial seats, and the renewal fee is invoiced in advance. Clause 1 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 2 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 3 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 4 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 5 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 6 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 7 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 8 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 9 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 10 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 11 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 12 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 13 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 14 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 15 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 16 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 17 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 18 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 19 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 20 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 21 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 22 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 23 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 24 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 25 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 26 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 27 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 28 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 29 on\\\",\\\"chunk_id\\\":2,\\\"score\\\":0.9202,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL21zYS1leGFtcGxlIix7ImMiOjJ9XQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"delivered\\\":{\\\"unit\\\":\\\"window\\\",\\\"reason\\\":\\\"long_page\\\"},\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/policy-example\\\",\\\"title\\\":\\\"notes/policy-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewal policy\\\\n\\\\nThe renewal fee policy is reviewed once a year. Clause 1 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 2 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 3 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 4 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 5 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 6 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 7 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 8 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 9 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 10 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 11 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 12 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 13 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 14 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 15 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 16 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 17 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 18 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 19 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 20 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 21 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 22 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 23 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 24 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 25 on policy restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":10,\\\"score\\\":0.6264,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcG9saWN5LWV4YW1wbGUiXQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/handbook-example\\\",\\\"title\\\":\\\"notes/handbook-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewals\\\\n\\\\nThe handbook describes how a renewal fee is quoted. Clause 1 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 2 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 3 on handbook restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":14,\\\"score\\\":0.5803,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvaGFuZGJvb2stZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/short-example\\\",\\\"title\\\":\\\"notes/short-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"A short note: ask about the renewal fee before the call.\\\",\\\"chunk_id\\\":9,\\\"score\\\":0.3964,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvc2hvcnQtZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"}]\"}],\"_meta\":{\"retrieval\":{\"returned_count\":4,\"retrieved_count\":4,\"projection_readiness\":{\"status\":\"ready\",\"ready\":true},\"delivery\":{\"requested_unit\":\"auto\",\"applied_unit\":\"auto\",\"return_window\":1,\"budget_tokens\":24000,\"budget_used\":2236,\"tokens_delivered\":2219,\"tokenizer\":\"cl100k\",\"coordinates\":\"utf16\",\"blocks\":4,\"dropped\":0,\"dropped_reasons\":{},\"fallbacks\":[]},\"rows\":\"lean\"}}}",
- "mcp-search:section": "{\"content\":[{\"type\":\"text\",\"text\":\"[{\\\"slug\\\":\\\"contracts/msa-example\\\",\\\"title\\\":\\\"contracts/msa-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Definitions\\\\n\\\\nThe renewal fee means the amount stated in the order form. Clause 1 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 2 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 3 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 4 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 5 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 6 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 7 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 8 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 9 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 10 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 11 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 12 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 13 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 14 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 15 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 16 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 17 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 18 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 19 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 20 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 21 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 22 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 23 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 24 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 25 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 26 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 27 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 28 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 29 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 30 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 31 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 32 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 33 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 34 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 35 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 36 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 37 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 38 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 39 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 40 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 41 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 42 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 43 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 44 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 45 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 46 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 47 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 48 on definitions restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Fees\\\\n\\\\nNo renewal fee applies to trial seats, and the renewal fee is invoiced in advance. Clause 1 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 2 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 3 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 4 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 5 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 6 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 7 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 8 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 9 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 10 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 11 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 12 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 13 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 14 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 15 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 16 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 17 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 18 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 19 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 20 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 21 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 22 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 23 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 24 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 25 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 26 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 27 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 28 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 29 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 30 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 31 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 32 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 33 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 34 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 35 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 36 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 37 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 38 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 39 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 40 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 41 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 42 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 43 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 44 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 45 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 46 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 47 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 48 on fees restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":2,\\\"score\\\":0.9202,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL21zYS1leGFtcGxlIix7ImMiOjJ9XQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"delivered\\\":{\\\"unit\\\":\\\"section\\\",\\\"reason\\\":\\\"long_page\\\"},\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/policy-example\\\",\\\"title\\\":\\\"notes/policy-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewal policy\\\\n\\\\nThe renewal fee policy is reviewed once a year. Clause 1 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 2 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 3 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 4 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 5 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 6 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 7 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 8 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 9 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 10 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 11 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 12 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 13 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 14 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 15 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 16 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 17 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 18 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 19 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 20 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 21 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 22 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 23 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 24 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 25 on policy restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":10,\\\"score\\\":0.6264,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcG9saWN5LWV4YW1wbGUiXQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/handbook-example\\\",\\\"title\\\":\\\"notes/handbook-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewals\\\\n\\\\nThe handbook describes how a renewal fee is quoted. Clause 1 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 2 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 3 on handbook restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":14,\\\"score\\\":0.5803,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvaGFuZGJvb2stZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/short-example\\\",\\\"title\\\":\\\"notes/short-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"A short note: ask about the renewal fee before the call.\\\",\\\"chunk_id\\\":9,\\\"score\\\":0.3964,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvc2hvcnQtZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"}]\"}],\"_meta\":{\"retrieval\":{\"returned_count\":4,\"retrieved_count\":4,\"projection_readiness\":{\"status\":\"ready\",\"ready\":true},\"delivery\":{\"requested_unit\":\"auto\",\"applied_unit\":\"auto\",\"return_window\":1,\"budget_tokens\":24000,\"budget_used\":2644,\"tokens_delivered\":2627,\"tokenizer\":\"cl100k\",\"coordinates\":\"utf16\",\"blocks\":4,\"dropped\":0,\"dropped_reasons\":{},\"fallbacks\":[]},\"rows\":\"lean\"}}}",
- "mcp-search:page": "{\"content\":[{\"type\":\"text\",\"text\":\"[{\\\"slug\\\":\\\"contracts/msa-example\\\",\\\"title\\\":\\\"contracts/msa-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Definitions\\\\n\\\\nThe renewal fee means the amount stated in the order form. Clause 1 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 2 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 3 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 4 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 5 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 6 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 7 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 8 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 9 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 10 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 11 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 12 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 13 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 14 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 15 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 16 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 17 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 18 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 19 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 20 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 21 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 22 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 23 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 24 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 25 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 26 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 27 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 28 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 29 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 30 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 31 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 32 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 33 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 34 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 35 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 36 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 37 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 38 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 39 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 40 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 41 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 42 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 43 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 44 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 45 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 46 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 47 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 48 on definitions restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Fees\\\\n\\\\nNo renewal fee applies to trial seats, and the renewal fee is invoiced in advance. Clause 1 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 2 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 3 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 4 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 5 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 6 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 7 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 8 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 9 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 10 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 11 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 12 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 13 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 14 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 15 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 16 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 17 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 18 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 19 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 20 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 21 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 22 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 23 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 24 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 25 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 26 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 27 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 28 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 29 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 30 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 31 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 32 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 33 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 34 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 35 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 36 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 37 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 38 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 39 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 40 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 41 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 42 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 43 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 44 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 45 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 46 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 47 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 48 on fees restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Term and renewal\\\\n\\\\nThe agreement renews each year; a renewal fee change needs written notice. Clause 1 on term restates the general obligations of both parties and the notice address for correspondence. Clause 2 on term restates the general obligations of both parties and the notice address for correspondence. Clause 3 on term restates the general obligations of both parties and the notice address for correspondence. Clause 4 on term restates the general obligations of both parties and the notice address for correspondence. Clause 5 on term restates the general obligations of both parties and the notice address for correspondence. Clause 6 on term restates the general obligations of both parties and the notice address for correspondence. Clause 7 on term restates the general obligations of both parties and the notice address for correspondence. Clause 8 on term restates the general obligations of both parties and the notice address for correspondence. Clause 9 on term restates the general obligations of both parties and the notice address for correspondence. Clause 10 on term restates the general obligations of both parties and the notice address for correspondence. Clause 11 on term restates the general obligations of both parties and the notice address for correspondence. Clause 12 on term restates the general obligations of both parties and the notice address for correspondence. Clause 13 on term restates the general obligations of both parties and the notice address for correspondence. Clause 14 on term restates the general obligations of both parties and the notice address for correspondence. Clause 15 on term restates the general obligations of both parties and the notice address for correspondence. Clause 16 on term restates the general obligations of both parties and the notice address for correspondence. Clause 17 on term restates the general obligations of both parties and the notice address for correspondence. Clause 18 on term restates the general obligations of both parties and the notice address for correspondence. Clause 19 on term restates the general obligations of both parties and the notice address for correspondence. Clause 20 on term restates the general obligations of both parties and the notice address for correspondence. Clause 21 on term restates the general obligations of both parties and the notice address for correspondence. Clause 22 on term restates the general obligations of both parties and the notice address for correspondence. Clause 23 on term restates the general obligations of both parties and the notice address for correspondence. Clause 24 on term restates the general obligations of both parties and the notice address for correspondence. Clause 25 on term restates the general obligations of both parties and the notice address for correspondence. Clause 26 on term restates the general obligations of both parties and the notice address for correspondence. Clause 27 on term restates the general obligations of both parties and the notice address for correspondence. Clause 28 on term restates the general obligations of both parties and the notice address for correspondence. Clause 29 on term restates the general obligations of both parties and the notice address for correspondence. Clause 30 on term restates the general obligations of both parties and the notice address for correspondence. Clause 31 on term restates the general obligations of both parties and the notice address for correspondence. Clause 32 on term restates the general obligations of both parties and the notice address for correspondence. Clause 33 on term restates the general obligations of both parties and the notice address for correspondence. Clause 34 on term restates the general obligations of both parties and the notice address for correspondence. Clause 35 on term restates the general obligations of both parties and the notice address for correspondence. Clause 36 on term restates the general obligations of both parties and the notice address for correspondence. Clause 37 on term restates the general obligations of both parties and the notice address for correspondence. Clause 38 on term restates the general obligations of both parties and the notice address for correspondence. Clause 39 on term restates the general obligations of both parties and the notice address for correspondence. Clause 40 on term restates the general obligations of both parties and the notice address for correspondence. Clause 41 on term restates the general obligations of both parties and the notice address for correspondence. Clause 42 on term restates the general obligations of both parties and the notice address for correspondence. Clause 43 on term restates the general obligations of both parties and the notice address for correspondence. Clause 44 on term restates the general obligations of both parties and the notice address for correspondence. Clause 45 on term restates the general obligations of both parties and the notice address for correspondence. Clause 46 on term restates the general obligations of both parties and the notice address for correspondence. Clause 47 on term restates the general obligations of both parties and the notice address for correspondence. Clause 48 on term restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Amendment 2\\\\n\\\\nEffective 2026-03-01 the annual renewal fee for acme-example is 4,200 USD. Clause 1 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 2 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 3 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 4 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 5 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 6 on amendment restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Notices\\\\n\\\\nClause 1 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 2 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 3 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 4 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 5 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 6 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 7 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 8 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 9 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 10 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 11 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 12 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 13 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 14 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 15 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 16 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 17 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 18 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 19 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 20 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 21 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 22 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 23 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 24 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 25 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 26 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 27 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 28 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 29 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 30 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 31 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 32 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 33 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 34 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 35 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 36 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 37 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 38 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 39 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 40 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 41 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 42 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 43 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 44 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 45 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 46 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 47 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 48 on notices restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":2,\\\"score\\\":0.9202,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL21zYS1leGFtcGxlIix7ImMiOjJ9XQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"delivered\\\":{\\\"unit\\\":\\\"page\\\",\\\"reason\\\":\\\"long_page\\\"},\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/policy-example\\\",\\\"title\\\":\\\"notes/policy-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewal policy\\\\n\\\\nThe renewal fee policy is reviewed once a year. Clause 1 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 2 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 3 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 4 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 5 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 6 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 7 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 8 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 9 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 10 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 11 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 12 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 13 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 14 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 15 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 16 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 17 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 18 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 19 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 20 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 21 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 22 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 23 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 24 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 25 on policy restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":10,\\\"score\\\":0.6264,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcG9saWN5LWV4YW1wbGUiXQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/handbook-example\\\",\\\"title\\\":\\\"notes/handbook-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewals\\\\n\\\\nThe handbook describes how a renewal fee is quoted. Clause 1 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 2 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 3 on handbook restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":14,\\\"score\\\":0.5803,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvaGFuZGJvb2stZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"},{\\\"slug\\\":\\\"notes/short-example\\\",\\\"title\\\":\\\"notes/short-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"A short note: ask about the renewal fee before the call.\\\",\\\"chunk_id\\\":9,\\\"score\\\":0.3964,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvc2hvcnQtZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"unknown\\\",\\\"origin\\\":\\\"legacy\\\"}]\"}],\"_meta\":{\"retrieval\":{\"returned_count\":4,\"retrieved_count\":4,\"projection_readiness\":{\"status\":\"ready\",\"ready\":true},\"delivery\":{\"requested_unit\":\"auto\",\"applied_unit\":\"auto\",\"return_window\":1,\"budget_tokens\":24000,\"budget_used\":4779,\"tokens_delivered\":4762,\"tokenizer\":\"cl100k\",\"coordinates\":\"utf16\",\"blocks\":4,\"dropped\":0,\"dropped_reasons\":{},\"fallbacks\":[]},\"rows\":\"lean\"}}}"
+ "mcp-search:window": "{\"content\":[{\"type\":\"text\",\"text\":\"[{\\\"slug\\\":\\\"contracts/msa-example\\\",\\\"title\\\":\\\"contracts/msa-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Definitions\\\\n\\\\nThe renewal fee means the amount stated in the order form. Clause 1 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 2 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 3 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 4 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 5 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 6 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 7 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 8 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 9 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 10 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 11 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 12 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 13 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 14 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 15 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 16 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 17 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 18 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 19 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 20 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 21 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 22 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 23 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 24 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 25 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 26 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 27 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 28 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 29 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 30 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 31 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 32 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 33 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 34 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 35 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 36 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 37 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 38 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 39 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 40 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 41 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 42 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 43 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 44 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 45 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 46 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 47 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 48 on definitions restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Fees\\\\n\\\\nNo renewal fee applies to trial seats, and the renewal fee is invoiced in advance. Clause 1 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 2 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 3 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 4 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 5 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 6 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 7 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 8 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 9 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 10 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 11 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 12 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 13 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 14 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 15 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 16 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 17 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 18 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 19 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 20 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 21 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 22 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 23 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 24 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 25 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 26 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 27 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 28 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 29 on\\\",\\\"chunk_id\\\":2,\\\"score\\\":0.9202,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL21zYS1leGFtcGxlIix7ImMiOjJ9XQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"delivered\\\":{\\\"unit\\\":\\\"window\\\",\\\"reason\\\":\\\"long_page\\\"},\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/policy-example\\\",\\\"title\\\":\\\"notes/policy-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewal policy\\\\n\\\\nThe renewal fee policy is reviewed once a year. Clause 1 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 2 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 3 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 4 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 5 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 6 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 7 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 8 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 9 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 10 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 11 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 12 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 13 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 14 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 15 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 16 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 17 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 18 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 19 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 20 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 21 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 22 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 23 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 24 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 25 on policy restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":10,\\\"score\\\":0.6264,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcG9saWN5LWV4YW1wbGUiXQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/handbook-example\\\",\\\"title\\\":\\\"notes/handbook-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewals\\\\n\\\\nThe handbook describes how a renewal fee is quoted. Clause 1 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 2 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 3 on handbook restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":14,\\\"score\\\":0.5803,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvaGFuZGJvb2stZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/short-example\\\",\\\"title\\\":\\\"notes/short-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"A short note: ask about the renewal fee before the call.\\\",\\\"chunk_id\\\":9,\\\"score\\\":0.3964,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvc2hvcnQtZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"}]\"}],\"_meta\":{\"retrieval\":{\"returned_count\":4,\"retrieved_count\":4,\"projection_readiness\":{\"status\":\"ready\",\"ready\":true},\"delivery\":{\"requested_unit\":\"auto\",\"applied_unit\":\"auto\",\"return_window\":1,\"budget_tokens\":24000,\"budget_used\":2236,\"tokens_delivered\":2219,\"tokenizer\":\"cl100k\",\"coordinates\":\"utf16\",\"blocks\":4,\"dropped\":0,\"dropped_reasons\":{},\"fallbacks\":[]},\"rows\":\"lean\"}}}",
+ "mcp-search:section": "{\"content\":[{\"type\":\"text\",\"text\":\"[{\\\"slug\\\":\\\"contracts/msa-example\\\",\\\"title\\\":\\\"contracts/msa-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Definitions\\\\n\\\\nThe renewal fee means the amount stated in the order form. Clause 1 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 2 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 3 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 4 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 5 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 6 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 7 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 8 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 9 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 10 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 11 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 12 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 13 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 14 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 15 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 16 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 17 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 18 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 19 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 20 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 21 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 22 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 23 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 24 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 25 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 26 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 27 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 28 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 29 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 30 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 31 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 32 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 33 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 34 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 35 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 36 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 37 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 38 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 39 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 40 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 41 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 42 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 43 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 44 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 45 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 46 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 47 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 48 on definitions restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Fees\\\\n\\\\nNo renewal fee applies to trial seats, and the renewal fee is invoiced in advance. Clause 1 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 2 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 3 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 4 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 5 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 6 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 7 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 8 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 9 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 10 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 11 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 12 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 13 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 14 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 15 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 16 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 17 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 18 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 19 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 20 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 21 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 22 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 23 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 24 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 25 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 26 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 27 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 28 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 29 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 30 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 31 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 32 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 33 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 34 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 35 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 36 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 37 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 38 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 39 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 40 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 41 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 42 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 43 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 44 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 45 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 46 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 47 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 48 on fees restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":2,\\\"score\\\":0.9202,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL21zYS1leGFtcGxlIix7ImMiOjJ9XQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"delivered\\\":{\\\"unit\\\":\\\"section\\\",\\\"reason\\\":\\\"long_page\\\"},\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/policy-example\\\",\\\"title\\\":\\\"notes/policy-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewal policy\\\\n\\\\nThe renewal fee policy is reviewed once a year. Clause 1 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 2 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 3 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 4 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 5 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 6 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 7 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 8 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 9 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 10 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 11 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 12 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 13 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 14 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 15 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 16 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 17 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 18 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 19 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 20 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 21 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 22 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 23 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 24 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 25 on policy restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":10,\\\"score\\\":0.6264,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcG9saWN5LWV4YW1wbGUiXQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/handbook-example\\\",\\\"title\\\":\\\"notes/handbook-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewals\\\\n\\\\nThe handbook describes how a renewal fee is quoted. Clause 1 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 2 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 3 on handbook restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":14,\\\"score\\\":0.5803,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvaGFuZGJvb2stZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/short-example\\\",\\\"title\\\":\\\"notes/short-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"A short note: ask about the renewal fee before the call.\\\",\\\"chunk_id\\\":9,\\\"score\\\":0.3964,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvc2hvcnQtZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"}]\"}],\"_meta\":{\"retrieval\":{\"returned_count\":4,\"retrieved_count\":4,\"projection_readiness\":{\"status\":\"ready\",\"ready\":true},\"delivery\":{\"requested_unit\":\"auto\",\"applied_unit\":\"auto\",\"return_window\":1,\"budget_tokens\":24000,\"budget_used\":2644,\"tokens_delivered\":2627,\"tokenizer\":\"cl100k\",\"coordinates\":\"utf16\",\"blocks\":4,\"dropped\":0,\"dropped_reasons\":{},\"fallbacks\":[]},\"rows\":\"lean\"}}}",
+ "mcp-search:page": "{\"content\":[{\"type\":\"text\",\"text\":\"[{\\\"slug\\\":\\\"contracts/msa-example\\\",\\\"title\\\":\\\"contracts/msa-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Definitions\\\\n\\\\nThe renewal fee means the amount stated in the order form. Clause 1 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 2 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 3 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 4 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 5 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 6 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 7 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 8 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 9 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 10 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 11 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 12 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 13 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 14 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 15 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 16 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 17 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 18 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 19 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 20 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 21 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 22 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 23 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 24 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 25 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 26 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 27 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 28 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 29 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 30 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 31 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 32 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 33 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 34 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 35 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 36 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 37 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 38 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 39 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 40 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 41 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 42 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 43 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 44 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 45 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 46 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 47 on definitions restates the general obligations of both parties and the notice address for correspondence. Clause 48 on definitions restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Fees\\\\n\\\\nNo renewal fee applies to trial seats, and the renewal fee is invoiced in advance. Clause 1 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 2 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 3 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 4 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 5 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 6 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 7 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 8 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 9 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 10 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 11 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 12 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 13 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 14 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 15 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 16 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 17 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 18 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 19 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 20 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 21 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 22 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 23 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 24 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 25 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 26 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 27 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 28 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 29 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 30 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 31 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 32 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 33 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 34 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 35 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 36 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 37 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 38 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 39 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 40 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 41 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 42 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 43 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 44 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 45 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 46 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 47 on fees restates the general obligations of both parties and the notice address for correspondence. Clause 48 on fees restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Term and renewal\\\\n\\\\nThe agreement renews each year; a renewal fee change needs written notice. Clause 1 on term restates the general obligations of both parties and the notice address for correspondence. Clause 2 on term restates the general obligations of both parties and the notice address for correspondence. Clause 3 on term restates the general obligations of both parties and the notice address for correspondence. Clause 4 on term restates the general obligations of both parties and the notice address for correspondence. Clause 5 on term restates the general obligations of both parties and the notice address for correspondence. Clause 6 on term restates the general obligations of both parties and the notice address for correspondence. Clause 7 on term restates the general obligations of both parties and the notice address for correspondence. Clause 8 on term restates the general obligations of both parties and the notice address for correspondence. Clause 9 on term restates the general obligations of both parties and the notice address for correspondence. Clause 10 on term restates the general obligations of both parties and the notice address for correspondence. Clause 11 on term restates the general obligations of both parties and the notice address for correspondence. Clause 12 on term restates the general obligations of both parties and the notice address for correspondence. Clause 13 on term restates the general obligations of both parties and the notice address for correspondence. Clause 14 on term restates the general obligations of both parties and the notice address for correspondence. Clause 15 on term restates the general obligations of both parties and the notice address for correspondence. Clause 16 on term restates the general obligations of both parties and the notice address for correspondence. Clause 17 on term restates the general obligations of both parties and the notice address for correspondence. Clause 18 on term restates the general obligations of both parties and the notice address for correspondence. Clause 19 on term restates the general obligations of both parties and the notice address for correspondence. Clause 20 on term restates the general obligations of both parties and the notice address for correspondence. Clause 21 on term restates the general obligations of both parties and the notice address for correspondence. Clause 22 on term restates the general obligations of both parties and the notice address for correspondence. Clause 23 on term restates the general obligations of both parties and the notice address for correspondence. Clause 24 on term restates the general obligations of both parties and the notice address for correspondence. Clause 25 on term restates the general obligations of both parties and the notice address for correspondence. Clause 26 on term restates the general obligations of both parties and the notice address for correspondence. Clause 27 on term restates the general obligations of both parties and the notice address for correspondence. Clause 28 on term restates the general obligations of both parties and the notice address for correspondence. Clause 29 on term restates the general obligations of both parties and the notice address for correspondence. Clause 30 on term restates the general obligations of both parties and the notice address for correspondence. Clause 31 on term restates the general obligations of both parties and the notice address for correspondence. Clause 32 on term restates the general obligations of both parties and the notice address for correspondence. Clause 33 on term restates the general obligations of both parties and the notice address for correspondence. Clause 34 on term restates the general obligations of both parties and the notice address for correspondence. Clause 35 on term restates the general obligations of both parties and the notice address for correspondence. Clause 36 on term restates the general obligations of both parties and the notice address for correspondence. Clause 37 on term restates the general obligations of both parties and the notice address for correspondence. Clause 38 on term restates the general obligations of both parties and the notice address for correspondence. Clause 39 on term restates the general obligations of both parties and the notice address for correspondence. Clause 40 on term restates the general obligations of both parties and the notice address for correspondence. Clause 41 on term restates the general obligations of both parties and the notice address for correspondence. Clause 42 on term restates the general obligations of both parties and the notice address for correspondence. Clause 43 on term restates the general obligations of both parties and the notice address for correspondence. Clause 44 on term restates the general obligations of both parties and the notice address for correspondence. Clause 45 on term restates the general obligations of both parties and the notice address for correspondence. Clause 46 on term restates the general obligations of both parties and the notice address for correspondence. Clause 47 on term restates the general obligations of both parties and the notice address for correspondence. Clause 48 on term restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Amendment 2\\\\n\\\\nEffective 2026-03-01 the annual renewal fee for acme-example is 4,200 USD. Clause 1 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 2 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 3 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 4 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 5 on amendment restates the general obligations of both parties and the notice address for correspondence. Clause 6 on amendment restates the general obligations of both parties and the notice address for correspondence.\\\\n\\\\n## Notices\\\\n\\\\nClause 1 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 2 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 3 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 4 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 5 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 6 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 7 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 8 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 9 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 10 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 11 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 12 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 13 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 14 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 15 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 16 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 17 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 18 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 19 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 20 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 21 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 22 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 23 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 24 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 25 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 26 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 27 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 28 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 29 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 30 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 31 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 32 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 33 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 34 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 35 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 36 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 37 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 38 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 39 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 40 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 41 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 42 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 43 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 44 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 45 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 46 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 47 on notices restates the general obligations of both parties and the notice address for correspondence. Clause 48 on notices restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":2,\\\"score\\\":0.9202,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL21zYS1leGFtcGxlIix7ImMiOjJ9XQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"delivered\\\":{\\\"unit\\\":\\\"page\\\",\\\"reason\\\":\\\"long_page\\\"},\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/policy-example\\\",\\\"title\\\":\\\"notes/policy-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewal policy\\\\n\\\\nThe renewal fee policy is reviewed once a year. Clause 1 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 2 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 3 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 4 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 5 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 6 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 7 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 8 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 9 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 10 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 11 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 12 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 13 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 14 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 15 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 16 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 17 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 18 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 19 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 20 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 21 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 22 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 23 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 24 on policy restates the general obligations of both parties and the notice address for correspondence. Clause 25 on policy restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":10,\\\"score\\\":0.6264,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvcG9saWN5LWV4YW1wbGUiXQ\\\",\\\"evidence\\\":\\\"keyword_exact\\\",\\\"create_safety\\\":\\\"probable\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/handbook-example\\\",\\\"title\\\":\\\"notes/handbook-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"## Renewals\\\\n\\\\nThe handbook describes how a renewal fee is quoted. Clause 1 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 2 on handbook restates the general obligations of both parties and the notice address for correspondence. Clause 3 on handbook restates the general obligations of both parties and the notice address for correspondence.\\\",\\\"chunk_id\\\":14,\\\"score\\\":0.5803,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvaGFuZGJvb2stZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"},{\\\"slug\\\":\\\"notes/short-example\\\",\\\"title\\\":\\\"notes/short-example\\\",\\\"type\\\":\\\"note\\\",\\\"chunk_text\\\":\\\"A short note: ask about the renewal fee before the call.\\\",\\\"chunk_id\\\":9,\\\"score\\\":0.3964,\\\"source_id\\\":\\\"default\\\",\\\"effective_date\\\":null,\\\"id\\\":\\\"gbrain-page:v1:WyJkZWZhdWx0Iiwibm90ZXMvc2hvcnQtZXhhbXBsZSJd\\\",\\\"evidence\\\":\\\"weak_semantic\\\",\\\"create_safety\\\":\\\"unknown\\\",\\\"trust_tier\\\":\\\"operator_curated\\\",\\\"origin\\\":\\\"sync\\\"}]\"}],\"_meta\":{\"retrieval\":{\"returned_count\":4,\"retrieved_count\":4,\"projection_readiness\":{\"status\":\"ready\",\"ready\":true},\"delivery\":{\"requested_unit\":\"auto\",\"applied_unit\":\"auto\",\"return_window\":1,\"budget_tokens\":24000,\"budget_used\":4779,\"tokens_delivered\":4762,\"tokenizer\":\"cl100k\",\"coordinates\":\"utf16\",\"blocks\":4,\"dropped\":0,\"dropped_reasons\":{},\"fallbacks\":[]},\"rows\":\"lean\"}}}"
}
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 7ce0728642..ef58c1d3dc 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -7740,7 +7740,7 @@
"kind": "function",
"name": "capEvidenceToBudget",
"signature": [
- "<T extends SearchResult & { delivered?: DeliveredEvidence; }>(results: T[], delivery: DeliveryMeta, quote?: boolean) => T[]"
+ "<T extends SearchResult & { delivered?: DeliveredEvidence; }>(results: T[], delivery: DeliveryMeta, quote?: boolean, untrusted?: boolean) => T[]"
]
},
{
@@ -8462,7 +8462,7 @@
"kind": "function",
"name": "composeExtractiveFallback",
"signature": [
- "(pages: SearchResult[], question: string) => ExtractiveFallback | null"
+ "(pages: SearchResult[], question: string, untrusted?: boolean) => ExtractiveFallback | null"
]
},
{
diff --git a/test/fixtures/goldens/search-c5/notices.json b/test/fixtures/goldens/search-c5/notices.json
index 213d60a407..7f7595cdd3 100644
--- a/test/fixtures/goldens/search-c5/notices.json
+++ b/test/fixtures/goldens/search-c5/notices.json
@@ -2,7 +2,7 @@
"with": {
"search NULA billing contact": {
"content": [
- "[{\"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\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"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\":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\":\"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\":0.1459,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"matched_alias\":\"Numbat Labs\",\"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\":1,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"evidence\":\"keyword_exact\",\"create_safety\":\"probable\",\"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\":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\":\"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\":0.1459,\"source_id\":\"default\",\"effective_date\":\"DATE\",\"effective_date_source\":\"fallback\",\"matched_alias\":\"Numbat Labs\",\"id\":\"gbrain-page:v1:WyJkZWZhdWx0IiwiY29udHJhY3RzL251bWJhdC1sYWJzLW1zYSJd\",\"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 contracts/numbat-labs-msa).",
"Saved facts (remember): about the entity this query names (newest first), then facts those point to, then matches for its words; recall returns more:\n- The billing contact for Numbat Labs is New Person. [entity: numbat-labs; saved 2026-09-01; provenance: user update]",
"[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\".",
@@ -68,7 +68,7 @@
},
"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 (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 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).",
@@ -123,7 +123,7 @@
},
"search OCFR renewal": {
"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).",
"Saved facts (remember): about the entity this query names (newest first), then facts those point to, then matches for its words; recall returns more:\n- Ocelot Freight renewal moves to the platform team. [entity: ocelot-freight; saved 2026-09-02; provenance: user update]",
"[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\".",
@@ -189,7 +189,7 @@
},
"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."
@@ -223,7 +223,7 @@
},
"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."
@@ -280,7 +280,7 @@
},
"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."
@@ -339,7 +339,7 @@
"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."
@@ -373,7 +373,7 @@
},
"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."
@@ -407,7 +407,7 @@
},
"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."
@@ -441,7 +441,7 @@
},
"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."
@@ -475,7 +475,7 @@
},
"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."
],
@@ -511,7 +511,7 @@
},
"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."
],
diff --git a/test/get-page-body-modes.test.ts b/test/get-page-body-modes.test.ts
index 1d8cf295dd..19647ca8cb 100644
--- a/test/get-page-body-modes.test.ts
+++ b/test/get-page-body-modes.test.ts
@@ -16,6 +16,7 @@ import { pageDocument } from '../src/core/page-window/document.ts';
import { decodeCursor } from '../src/core/page-window/window.ts';
import { encodedFrameBytes } from '../src/core/egress-budget.ts';
import { normalizeLoweredClaim } from '../src/core/facts/withdrawal-schema.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
const get_page = operations.find(o => o.name === 'get_page')!;
@@ -27,8 +28,8 @@ function ctx(overrides: Partial<OperationContext> = {}): OperationContext {
const local = () => ctx({ remote: false, transport: undefined });
async function put(slug: string, body: string, timeline = '', frontmatter: Record<string, unknown> = {}) {
- const r = await importFromContent(engine, slug, serializeMarkdown(frontmatter, body, timeline, { type: 'note', title: slug, tags: [] }),
- { sourceId: 'default', noEmbed: true, forceRechunk: true });
+ const r = await asOwner(engine, tx => importFromContent(tx, slug, serializeMarkdown(frontmatter, body, timeline, { type: 'note', title: slug, tags: [] }),
+ { sourceId: 'default', noEmbed: true, forceRechunk: true }));
expect(r.status).toBe('imported');
}
diff --git a/test/get-page-federated-scope.test.ts b/test/get-page-federated-scope.test.ts
index 8372a0138e..37a97d4007 100644
--- a/test/get-page-federated-scope.test.ts
+++ b/test/get-page-federated-scope.test.ts
@@ -29,6 +29,7 @@ import { operations, OperationError, type OperationContext } from '../src/core/o
import { importFromContent } from '../src/core/import-file.ts';
import { serializeMarkdown } from '../src/core/markdown.ts';
import { surfaceFileSource } from './helpers/source-surface.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
const get_page = operations.find(o => o.name === 'get_page')!;
@@ -53,9 +54,9 @@ function ctxOf(overrides: Partial<OperationContext> = {}): OperationContext {
}
async function importPage(slug: string, sourceId: string, title: string, body: string, timeline = '') {
- const result = await importFromContent(engine, slug,
+ const result = await asOwner(engine, tx => importFromContent(tx, slug,
serializeMarkdown({}, body, timeline, { type: 'note', title, tags: [] }),
- { sourceId, noEmbed: true, forceRechunk: true });
+ { sourceId, noEmbed: true, forceRechunk: true }));
expect(result.status).toBe('imported');
}
@@ -122,9 +123,9 @@ beforeEach(async () => {
// (origin) page is out-of-grant ('default'). origin_slug must NOT leak that slug.
await engine.addLink('secret/beta-doc', 'secret/beta-target', 'origin-leak ctx', 'mentions', 'frontmatter', 'default/only-doc', 'related', { fromSourceId: 'beta', toSourceId: 'beta', originSourceId: 'default' });
// Timeline entry on the beta page.
- await engine.addTimelineEntry('secret/beta-doc', {
+ await asOwner(engine, tx => tx.addTimelineEntry('secret/beta-doc', {
date: '2026-01-01', source: 'test', summary: 'beta event', detail: 'beta detail',
- }, { sourceId: 'beta' });
+ }, { sourceId: 'beta' }));
// D3A union: same slug in BOTH alpha and beta with distinct tags.
await engine.putPage('shared/dup', {
type: 'note', title: 'Dup alpha', compiled_truth: 'a', frontmatter: {},
diff --git a/test/get-page-slices.test.ts b/test/get-page-slices.test.ts
index ea99ac8be8..69443b6449 100644
--- a/test/get-page-slices.test.ts
+++ b/test/get-page-slices.test.ts
@@ -33,6 +33,7 @@ import { parseOpArgs } from '../src/cli/main.ts';
import { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';
import { testBackends } from './helpers/test-backends.ts';
import { PRIVATE, importSegmented, privacyFacts, privacyTakes, privateTokensIn } from './helpers/segmented-privacy-fixture.ts';
+import { asOwner } from './helpers/owner-tier.ts';
const getPage = operations.find(o => o.name === 'get_page')!;
let engine: BrainEngine;
@@ -48,8 +49,8 @@ async function refusal(p: Promise<unknown>): Promise<OperationError> {
}
async function put(slug: string, body: string, timeline = '', frontmatter: Record<string, unknown> = {}) {
- const r = await importFromContent(engine, slug, serializeMarkdown(frontmatter, body, timeline, { type: 'note', title: slug, tags: [] }),
- { sourceId: 'default', noEmbed: true, forceRechunk: true });
+ const r = await asOwner(engine, tx => importFromContent(tx, slug, serializeMarkdown(frontmatter, body, timeline, { type: 'note', title: slug, tags: [] }),
+ { sourceId: 'default', noEmbed: true, forceRechunk: true }));
expect(r.status).toBe('imported');
}
@@ -111,7 +112,7 @@ for (const kind of testBackends()) {
}
await importSegmented(engine, 'logs/days-segmented', dayLog(240));
await engine.setConfig('pages.segmented_storage', 'off');
- await importFromContent(engine, 'logs/days-inline', dayLog(240), { sourceId: 'default', noEmbed: true });
+ await asOwner(engine, tx => importFromContent(tx, 'logs/days-inline', dayLog(240), { sourceId: 'default', noEmbed: true }));
await put('notes/sections', SECTIONS, '- 2024-01-02: timeline entry about the widget');
await put('notes/paras', PARAGRAPHS);
await put('notes/many-headings', Array.from({ length: 30 }, (_, i) => `## H${i + 1}\n\nbody ${i + 1}`).join('\n\n'));
diff --git a/test/get-page-timeline-entries.test.ts b/test/get-page-timeline-entries.test.ts
index bd00cf76ef..a83bb7815c 100644
--- a/test/get-page-timeline-entries.test.ts
+++ b/test/get-page-timeline-entries.test.ts
@@ -14,6 +14,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { importFromContent } from '../src/core/import-file.ts';
import { operationsByName } from '../src/core/operations.ts';
import type { OperationContext } from '../src/core/ops/contract.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
const ctxOf = (remote: boolean) => ({
@@ -27,9 +28,11 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await importFromContent(engine, 'notes/example', '---\ntype: note\ntitle: Example\n---\n\nAn example note.\n', { noEmbed: true });
- await engine.addTimelineEntry('notes/example', { date: '2026-09-01', source: 'meeting', summary: 'Kickoff held' });
- await engine.addTimelineEntry('notes/example', { date: '2026-09-15', source: 'email', summary: 'Plan approved' });
+ await asOwner(engine, async tx => {
+ await importFromContent(tx, 'notes/example', '---\ntype: note\ntitle: Example\n---\n\nAn example note.\n', { noEmbed: true });
+ await tx.addTimelineEntry('notes/example', { date: '2026-09-01', source: 'meeting', summary: 'Kickoff held' });
+ await tx.addTimelineEntry('notes/example', { date: '2026-09-15', source: 'email', summary: 'Plan approved' });
+ });
}, 60_000);
afterAll(async () => {
diff --git a/test/helpers/evidence-delivery-fixture.ts b/test/helpers/evidence-delivery-fixture.ts
index fcae34f52e..88eff568c8 100644
--- a/test/helpers/evidence-delivery-fixture.ts
+++ b/test/helpers/evidence-delivery-fixture.ts
@@ -13,6 +13,7 @@ import { prepareMarkdownChunks } from '../../src/core/markdown-chunks.ts';
import { installFixtureChunks } from './page-projection.ts';
import { withEnv } from './with-env.ts';
import { leanRow } from '../../src/core/search/lean-rows.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> }> = [
{
@@ -119,13 +120,25 @@ function withFactsOrder(payload: Record<string, unknown>): Record<string, unknow
return Object.fromEntries(Object.entries(payload).flatMap(([k, v]) => k === 'total' ? [[k, v], ['facts_order', 'newest']] : [[k, v]]));
}
+/** GST-687's remote quote of one row: its text fenced as an excerpt of its slug and `quoted` set (recall places it before `trust_tier`). */
+function quotedRow(row: Record<string, unknown>, field: 'chunk_text' | 'chunk'): Record<string, unknown> {
+ const text = row[field];
+ if (row.quoted !== undefined || typeof text !== 'string' || text.length === 0) return row;
+ const fenced = { ...row, [field]: fenceTranscriptText(text, row.slug as string) };
+ if (field === 'chunk_text') return { ...fenced, quoted: 'transcript' };
+ return Object.fromEntries(Object.entries(fenced).flatMap(([k, v]) => k === 'trust_tier' ? [['quoted', 'transcript'], [k, v]] : [[k, v]]));
+}
+
/**
* 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. 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;
+ * 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$/, '');
@@ -136,7 +149,7 @@ export function withCostWave(key: string, frozen: string): string {
if (base === 'search-remote') {
const v = JSON.parse(frozen) as { result: Record<string, unknown>[]; meta: Array<{ key: string; value: Record<string, unknown> }> };
return JSON.stringify({
- result: v.result.map(r => leanRow(r)),
+ result: v.result.map(r => quotedRow(leanRow(r), 'chunk_text')),
meta: v.meta.map(m => m.key === 'retrieval' ? { key: m.key, value: leanRetrieval(m.value) } : m),
});
}
@@ -144,7 +157,8 @@ export function withCostWave(key: string, frozen: string): string {
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);
return JSON.stringify(res);
}
diff --git a/test/helpers/long-page-fixture.ts b/test/helpers/long-page-fixture.ts
index bf50c0035c..0a278d4b83 100644
--- a/test/helpers/long-page-fixture.ts
+++ b/test/helpers/long-page-fixture.ts
@@ -16,6 +16,7 @@ import { operations, type OperationContext } from '../../src/core/operations.ts'
import { dispatchToolCall } from '../../src/mcp/dispatch.ts';
import { prepareMarkdownChunks } from '../../src/core/markdown-chunks.ts';
import { installFixtureChunks } from './page-projection.ts';
+import { asOwner } from './owner-tier.ts';
import { offPathMcpBytes } from './evidence-delivery-fixture.ts';
import { withEnv } from './with-env.ts';
@@ -49,7 +50,7 @@ export const CONVERSATION_PAGE = {
export async function seedLongPages(engine: BrainEngine, pages = LONG_PAGE_CORPUS): Promise<void> {
for (const p of pages) {
- await engine.putPage(p.slug, { type: p.type as never, title: p.slug, compiled_truth: p.body, timeline: '', frontmatter: {} });
+ await asOwner(engine, tx => tx.putPage(p.slug, { type: p.type as never, title: p.slug, compiled_truth: p.body, timeline: '', frontmatter: {} }));
await installFixtureChunks(engine, p.slug, await prepareMarkdownChunks({ compiled_truth: p.body, timeline: '' }));
}
await engine.setConfig('search.mcp_keyword_only', 'true');
diff --git a/test/hot-memory-session-only-7026.test.ts b/test/hot-memory-session-only-7026.test.ts
index e266d675f5..52abf23ec3 100644
--- a/test/hot-memory-session-only-7026.test.ts
+++ b/test/hot-memory-session-only-7026.test.ts
@@ -20,6 +20,7 @@ import { getBrainHotMemoryMeta, __resetHotMemoryCacheForTests } from '../src/cor
import { turnContextWithBrief } from '../src/mcp/resolve-ipc-binding.ts';
import { makeContextPackIpcHandler } from '../src/mcp/context-pack-handler.ts';
import { testBackends } from './helpers/test-backends.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { persistencePostgresTemplate } from './helpers/persistence-postgres.ts';
const KEY = 'context.hot_memory.session_only';
@@ -59,10 +60,10 @@ beforeEach(async () => {
});
async function seedFact(engine: BrainEngine, fact: string, session: string): Promise<void> {
- await engine.insertFact(
+ await asOwner(engine, tx => tx.insertFact(
{ fact, kind: 'fact', entity_slug: 'people/alice-example', source: 'test', visibility: 'world', source_session: session },
{ source_id: 'default' },
- );
+ ));
}
function metaCtx(engine: BrainEngine, sessionId: string): OperationContext {
diff --git a/test/large-pages/pinned-segmented-reads.test.ts b/test/large-pages/pinned-segmented-reads.test.ts
index 47275fd131..95665a9ebe 100644
--- a/test/large-pages/pinned-segmented-reads.test.ts
+++ b/test/large-pages/pinned-segmented-reads.test.ts
@@ -33,6 +33,7 @@ import { readCardIdentity } from '../../src/core/verbs/entity-card-identity.ts';
import { isolatedPersistencePostgres } from '../helpers/persistence-postgres.ts';
import { testBackends } from '../helpers/test-backends.ts';
import { importSegmented } from '../helpers/segmented-privacy-fixture.ts';
+import { asOwner } from '../helpers/owner-tier.ts';
import { existsSync, mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
@@ -66,8 +67,8 @@ const content = (body: string, extra = '') => `---\ntitle: Pinned probe\ntype: n
/** The authorized page becomes private with a new body generation whose lead holds SECRET. */
const privateRewrite = (slug: string) => async () => {
- await importFromContent(engine, slug, content(`Codename: ${SECRET} Alpha\n\n${SECRET} is the private body now.\n\n${filler(1_300_000, 'private')}`, 'visibility: private\n'),
- { sourceId: 'default', noEmbed: true });
+ await asOwner(engine, tx => importFromContent(tx, slug, content(`Codename: ${SECRET} Alpha\n\n${SECRET} is the private body now.\n\n${filler(1_300_000, 'private')}`, 'visibility: private\n'),
+ { sourceId: 'default', noEmbed: true }));
};
const visibilityOnly = (slug: string) => async () => {
await engine.executeRaw(`UPDATE pages SET frontmatter = frontmatter || '{"visibility":"private"}'::jsonb WHERE source_id='default' AND slug=$1`, [slug]);
diff --git a/test/mcp-backup-nag.serial.test.ts b/test/mcp-backup-nag.serial.test.ts
index c6a513bea8..303534c72a 100644
--- a/test/mcp-backup-nag.serial.test.ts
+++ b/test/mcp-backup-nag.serial.test.ts
@@ -27,6 +27,7 @@ import { tmpdir } from 'node:os';
import * as realHybrid from '../src/core/search/hybrid.ts';
import type { BrainEngine } from '../src/core/engine.ts';
import { encodeDeepResearchId } from '../src/core/deep-research-id.ts';
+import { fenceTranscriptText } from '../src/core/search/transcript-quote.ts';
let nextResults: unknown[] = [{ id: encodeDeepResearchId('default', 'a'), page_id: 1, source_id: 'default', slug: 'a', chunk_text: 'x' }];
@@ -117,9 +118,11 @@ type CallOpts = { remote?: boolean; transport?: 'stdio' | 'http' };
*/
function leanResults({ fetchCallable = true } = {}): unknown[] {
// The search op labels every hit with its trust tier and origin (#5575 A6); the stub rows carry neither, so unknown/unrecorded.
+ // An unknown-tier row reaches a remote reader quoted (GST-687).
return nextResults.map(r => {
const { page_id: _p, id, ...lean } = r as Record<string, unknown>;
- return { ...lean, ...(fetchCallable && id !== undefined ? { id } : {}), trust_tier: 'unknown', origin: 'unrecorded' };
+ return { ...lean, chunk_text: fenceTranscriptText(lean.chunk_text as string, lean.slug as string), quoted: 'transcript',
+ ...(fetchCallable && id !== undefined ? { id } : {}), trust_tier: 'unknown', origin: 'unrecorded' };
});
}
diff --git a/test/mcp-hot-memory-opt-out.test.ts b/test/mcp-hot-memory-opt-out.test.ts
index 8c582ee226..b2fb038aee 100644
--- a/test/mcp-hot-memory-opt-out.test.ts
+++ b/test/mcp-hot-memory-opt-out.test.ts
@@ -21,6 +21,7 @@ import { mintLegacyToken } from '../src/core/token-mint.ts';
import { dispatchToolCall, hotMemoryOffIn } from '../src/mcp/dispatch.ts';
import { getBrainHotMemoryMeta, __resetHotMemoryCacheForTests } from '../src/core/facts/meta-hook.ts';
import { callTool, rpc, startServeHttp, type LiveServeHttp, type ToolResultWire } from './helpers/live-mcp-servers.ts';
+import { asOwner } from './helpers/owner-tier.ts';
const MEMBER_SOURCE = 'hm-private-alice-example';
const CHANNEL_SOURCE = 'hm-channel-a';
@@ -35,7 +36,7 @@ beforeAll(async () => {
await engine.connect({ engine: 'pglite' } as never);
await engine.initSchema();
for (const id of [MEMBER_SOURCE, CHANNEL_SOURCE]) await engine.executeRaw('INSERT INTO sources (id, name) VALUES ($1, $1) ON CONFLICT (id) DO NOTHING', [id]);
- await engine.insertFact({ fact: FACT, kind: 'preference', entity_slug: 'people/alice-example', visibility: 'world', source: 'test' }, { source_id: MEMBER_SOURCE });
+ await asOwner(engine, tx => tx.insertFact({ fact: FACT, kind: 'preference', entity_slug: 'people/alice-example', visibility: 'world', source: 'test' }, { source_id: MEMBER_SOURCE }));
token = (await mintLegacyToken(engine, { name: 'hm-member-alice', scopes: ['read'], takesHolders: ['world'], sourceGrant: [MEMBER_SOURCE, CHANNEL_SOURCE] })).token;
app = await startServeHttp(engine);
}, 60_000);
diff --git a/test/mcp-result-size-ceiling.test.ts b/test/mcp-result-size-ceiling.test.ts
index 2503fcd1e2..70751be084 100644
--- a/test/mcp-result-size-ceiling.test.ts
+++ b/test/mcp-result-size-ceiling.test.ts
@@ -23,6 +23,7 @@ import { importFromContent } from '../src/core/import-file.ts';
import { serializeMarkdown } from '../src/core/markdown.ts';
import { dispatchToolCall, type ToolResult } from '../src/mcp/dispatch.ts';
import { withEnv } from './helpers/with-env.ts';
+import { asOwner } from './helpers/owner-tier.ts';
/**
* ceil(measured x 1.05) on the fixture below. search 2540 -> 2754 (2622
@@ -67,12 +68,14 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- for (const [slug, title, body] of PAGES) {
- await importFromContent(engine, slug, serializeMarkdown({}, body, '', { type: 'note', title, tags: [] }), { noEmbed: true, forceRechunk: true });
- }
- await engine.executeRaw(`INSERT INTO facts (source_id, entity_slug, fact, kind, visibility, source, valid_from) VALUES
- ('default', 'numbat-labs', 'The billing contact for Numbat Labs is New Person.', 'fact', 'world', 'user update', '2026-09-01'),
- ('default', 'numbat-labs', 'Numbat Labs renewal quote goes to the billing contact.', 'fact', 'world', 'user update', '2026-09-02')`);
+ await asOwner(engine, async tx => {
+ for (const [slug, title, body] of PAGES) {
+ await importFromContent(tx, slug, serializeMarkdown({}, body, '', { type: 'note', title, tags: [] }), { noEmbed: true, forceRechunk: true });
+ }
+ await tx.executeRaw(`INSERT INTO facts (source_id, entity_slug, fact, kind, visibility, source, valid_from) VALUES
+ ('default', 'numbat-labs', 'The billing contact for Numbat Labs is New Person.', 'fact', 'world', 'user update', '2026-09-01'),
+ ('default', 'numbat-labs', 'Numbat Labs renewal quote goes to the billing contact.', 'fact', 'world', 'user update', '2026-09-02')`);
+ });
}, 120_000);
afterAll(async () => { await engine?.disconnect(); });
diff --git a/test/recall-budget-policy-thin-cli.test.ts b/test/recall-budget-policy-thin-cli.test.ts
index 3a76e86952..2b9ef58f57 100644
--- a/test/recall-budget-policy-thin-cli.test.ts
+++ b/test/recall-budget-policy-thin-cli.test.ts
@@ -8,6 +8,7 @@ import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { configureGateway, resetGateway } from '../src/core/ai/gateway.ts';
import { LEGACY_EMBEDDING_CONFIG } from './helpers/legacy-embedding-config.ts';
import { installFixtureChunks } from './helpers/page-projection.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { ERROR_SCHEMA } from '../src/core/verbs.ts';
import { validateAgainstSchema } from '../src/core/verbs/conformance.ts';
@@ -151,9 +152,11 @@ describe('actual remote source selection', () => {
for (const source of ['default', 'peer', 'denied']) {
if (source !== 'default') await remote.executeRaw('INSERT INTO sources(id,name) VALUES($1,$1)', [source]);
const text = `Telescope evidence from ${source}.`;
- await remote.putPage('notes/telescope', { type: 'note', title: 'Telescope', compiled_truth: text }, { sourceId: source });
- await installFixtureChunks(remote, 'notes/telescope', [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: text }], { sourceId: source });
- await remote.insertFact({ fact: text, source: 'synthetic', visibility: 'world' }, { source_id: source });
+ await asOwner(remote, async tx => {
+ await tx.putPage('notes/telescope', { type: 'note', title: 'Telescope', compiled_truth: text }, { sourceId: source });
+ await installFixtureChunks(tx, 'notes/telescope', [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: text }], { sourceId: source });
+ await tx.insertFact({ fact: text, source: 'synthetic', visibility: 'world' }, { source_id: source });
+ });
}
await remote.executeRaw("INSERT INTO sources(id,name,archived) VALUES('archived-example','archived-example',true)");
const dispatch = (args: Record<string, unknown>) => dispatchToolCall(remote, 'recall', args, {
@@ -221,8 +224,8 @@ describe('actual remote source selection', () => {
['older thin session match', 'wanted-session', '2020-01-01'],
['newer thin unrelated fact', 'other-session', '2024-01-01'],
]) {
- await remote.insertFact({ fact, source: 'synthetic', entity_slug: entity,
- source_session: session, valid_from: new Date(date), visibility: 'world' }, { source_id: 'default' });
+ await asOwner(remote, tx => tx.insertFact({ fact, source: 'synthetic', entity_slug: entity,
+ source_session: session, valid_from: new Date(date), visibility: 'world' }, { source_id: 'default' }));
}
const dispatch = (args: Record<string, unknown>) => dispatchToolCall(remote, 'recall', args, {
remote: true, sourceId: 'default', config: { engine: 'pglite' },
diff --git a/test/recall-budget-policy-transports.test.ts b/test/recall-budget-policy-transports.test.ts
index 99dcd58de8..9ac618ae3c 100644
--- a/test/recall-budget-policy-transports.test.ts
+++ b/test/recall-budget-policy-transports.test.ts
@@ -10,6 +10,7 @@ import { configureGateway, resetGateway } from '../src/core/ai/gateway.ts';
import { LEGACY_EMBEDDING_CONFIG } from './helpers/legacy-embedding-config.ts';
import { keylessBrainEnv } from './helpers/provider-env.ts';
import { installFixtureChunks } from './helpers/page-projection.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { ERROR_SCHEMA } from '../src/core/verbs.ts';
import { validateAgainstSchema } from '../src/core/verbs/conformance.ts';
@@ -35,20 +36,24 @@ beforeAll(async () => {
await engine.initSchema();
await engine.setConfig('search.track_retrieval', 'false');
const text = 'The zebra telescope calibration code is QX-17. Store it in the blue case.';
- await engine.putPage('notes/telescope', { type: 'note', title: 'Zebra telescope', compiled_truth: text });
- await installFixtureChunks(engine, 'notes/telescope', [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: text }]);
- for (let i = 0; i < 4; i++) {
- await engine.insertFact({
- fact: `Garden observation ${i}: `.padEnd(144, 'x'), source: 'synthetic', visibility: 'world',
- entity_slug: 'topics/garden', source_session: `garden-session-${i}`, valid_from: new Date(`2026-09-01T00:00:0${i}Z`),
- }, { source_id: 'default' });
- }
+ await asOwner(engine, async tx => {
+ await tx.putPage('notes/telescope', { type: 'note', title: 'Zebra telescope', compiled_truth: text });
+ await installFixtureChunks(tx, 'notes/telescope', [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: text }]);
+ for (let i = 0; i < 4; i++) {
+ await tx.insertFact({
+ fact: `Garden observation ${i}: `.padEnd(144, 'x'), source: 'synthetic', visibility: 'world',
+ entity_slug: 'topics/garden', source_session: `garden-session-${i}`, valid_from: new Date(`2026-09-01T00:00:0${i}Z`),
+ }, { source_id: 'default' });
+ }
+ });
await engine.executeRaw("INSERT INTO sources(id,name) VALUES('peer','peer'),('archived-example','archived-example')");
await engine.executeRaw("UPDATE sources SET config=jsonb_build_object('federated',false) WHERE id='peer'");
await engine.executeRaw("UPDATE sources SET archived=true, archived_at=now() WHERE id='archived-example'");
- await engine.putPage('notes/telescope', { type: 'note', title: 'Zebra telescope', compiled_truth: 'Peer telescope evidence.' }, { sourceId: 'peer' });
- await installFixtureChunks(engine, 'notes/telescope', [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: 'Peer telescope evidence.' }], { sourceId: 'peer' });
- await engine.insertFact({ fact: 'Peer source fact.', source: 'synthetic', visibility: 'world' }, { source_id: 'peer' });
+ await asOwner(engine, async tx => {
+ await tx.putPage('notes/telescope', { type: 'note', title: 'Zebra telescope', compiled_truth: 'Peer telescope evidence.' }, { sourceId: 'peer' });
+ await installFixtureChunks(tx, 'notes/telescope', [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: 'Peer telescope evidence.' }], { sourceId: 'peer' });
+ await tx.insertFact({ fact: 'Peer source fact.', source: 'synthetic', visibility: 'world' }, { source_id: 'peer' });
+ });
await engine.disconnect();
});
diff --git a/test/recall-budget-policy.test.ts b/test/recall-budget-policy.test.ts
index ef1ab6ac9f..ed3383e5e9 100644
--- a/test/recall-budget-policy.test.ts
+++ b/test/recall-budget-policy.test.ts
@@ -9,6 +9,7 @@ import { buildToolDefs } from '../src/mcp/tool-defs.ts';
import { estimateTokens } from '../src/core/search/token-budget.ts';
import type { SearchResult } from '../src/core/types.ts';
import { resetPgliteState } from './helpers/reset-pglite.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { installFixtureChunks } from './helpers/page-projection.ts';
import { LEGACY_EMBEDDING_CONFIG } from './helpers/legacy-embedding-config.ts';
import { ERROR_SCHEMA, RESPONSE_SCHEMAS } from '../src/core/verbs.ts';
@@ -47,12 +48,14 @@ async function recall(params: Record<string, unknown>, overrides: Partial<Operat
}
async function fact(text: string, extra: Partial<NewFact> = {}, sourceId = 'default') {
- return engine.insertFact({ fact: text, source: 'synthetic-budget-test', visibility: 'world', ...extra }, { source_id: sourceId });
+ return asOwner(engine, tx => tx.insertFact({ fact: text, source: 'synthetic-budget-test', visibility: 'world', ...extra }, { source_id: sourceId }));
}
async function page(slug: string, title: string, text: string, sourceId = 'default', frontmatter = {}) {
- await engine.putPage(slug, { type: 'note', title, compiled_truth: text, frontmatter }, { sourceId });
- await installFixtureChunks(engine, slug, [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: text }], { sourceId });
+ await asOwner(engine, async tx => {
+ await tx.putPage(slug, { type: 'note', title, compiled_truth: text, frontmatter }, { sourceId });
+ await installFixtureChunks(tx, slug, [{ chunk_index: 0, chunk_source: 'compiled_truth', chunk_text: text }], { sourceId });
+ });
}
async function seedStarvation() {
diff --git a/test/recall-collapse-duplicates-7043.test.ts b/test/recall-collapse-duplicates-7043.test.ts
index 3d7a55b0ea..a94cfd1161 100644
--- a/test/recall-collapse-duplicates-7043.test.ts
+++ b/test/recall-collapse-duplicates-7043.test.ts
@@ -14,6 +14,7 @@ import type { BrainEngine } from '../src/core/engine.ts';
import { persistencePostgresTemplate } from './helpers/persistence-postgres.ts';
import { requirePostgresTestDatabase, testBackends } from './helpers/test-backends.ts';
import { resetPgliteState } from './helpers/reset-pglite.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { configureGateway, resetGateway, __setEmbedTransportForTests } from '../src/core/ai/gateway.ts';
import { LEGACY_EMBEDDING_CONFIG } from './helpers/legacy-embedding-config.ts';
@@ -27,8 +28,8 @@ async function call(name: string, params: Record<string, unknown>, remote = fals
}
async function fact(text: string, entity: string, day: string, visibility: 'world' | 'private' = 'world') {
- await engine.executeRaw(`INSERT INTO facts (source_id, entity_slug, fact, kind, visibility, source, valid_from, created_at)
- VALUES ('default', $1, $2, 'preference', $3, 'test', $4::timestamptz, $4::timestamptz)`, [entity, text, visibility, `${day}T12:00:00Z`]);
+ await asOwner(engine, tx => tx.executeRaw(`INSERT INTO facts (source_id, entity_slug, fact, kind, visibility, source, valid_from, created_at)
+ VALUES ('default', $1, $2, 'preference', $3, 'test', $4::timestamptz, $4::timestamptz)`, [entity, text, visibility, `${day}T12:00:00Z`]));
}
const EMAIL = 'Alice Example prefers email.';
diff --git a/test/recall-entity-session-6938.test.ts b/test/recall-entity-session-6938.test.ts
index 99adc22ec4..1f073aa8c1 100644
--- a/test/recall-entity-session-6938.test.ts
+++ b/test/recall-entity-session-6938.test.ts
@@ -5,6 +5,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { runRecall } from '../src/commands/recall.ts';
import { testBackends } from './helpers/test-backends.ts';
+import { asOwner } from './helpers/owner-tier.ts';
const ENTITY = 'people/session-example';
const SESSION = "wanted-'%_session";
@@ -25,8 +26,8 @@ for (const backend of testBackends()) describe(`entity/session intersection (${b
}
await engine.executeRaw("INSERT INTO sources (id, name) VALUES ('other-source', 'Other source')");
const seed = (fact: string, session: string, date: string, extra: Partial<NewFact> = {}, source = 'default') =>
- engine.insertFact({ fact, kind: 'fact', entity_slug: ENTITY, source: 'test', source_session: session,
- valid_from: new Date(date), visibility: 'world', ...extra }, { source_id: source });
+ asOwner(engine, tx => tx.insertFact({ fact, kind: 'fact', entity_slug: ENTITY, source: 'test', source_session: session,
+ valid_from: new Date(date), visibility: 'world', ...extra }, { source_id: source }));
await seed(WANTED, SESSION, '2020-01-01');
await seed(OTHER, 'other-session', '2026-01-01');
await seed('wanted session but another entity', SESSION, '2025-01-01', { entity_slug: 'people/someone-else' });
diff --git a/test/recall-federated-namesakes.test.ts b/test/recall-federated-namesakes.test.ts
index 238fa25478..4ac45c030e 100644
--- a/test/recall-federated-namesakes.test.ts
+++ b/test/recall-federated-namesakes.test.ts
@@ -13,6 +13,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { importFromContent } from '../src/core/import-file.ts';
import { operations } from '../src/core/operations.ts';
import { linkEntityIdentity } from '../src/core/entity-identity.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
const recall = operations.find(o => o.name === 'recall')!;
@@ -26,13 +27,13 @@ beforeAll(async () => {
// Two different people who share a name and slug, one per source.
await importFromContent(engine, 'people/sam-example',
`---\ntitle: Sam Example\ntype: person\n---\n\n# Sam Example\n\nThe ${source} Sam.\n`, { noEmbed: true, sourceId: source });
- await engine.insertFact({ fact: `fact about the ${source} Sam`, entity_slug: 'people/sam-example', source: 'note', visibility: 'world', embedding: null }, { source_id: source });
+ await asOwner(engine, tx => tx.insertFact({ fact: `fact about the ${source} Sam`, entity_slug: 'people/sam-example', source: 'note', visibility: 'world', embedding: null }, { source_id: source }));
// One person with a page in each source, linked by an identity group.
await importFromContent(engine, 'people/theo-example',
`---\ntitle: Theo Example\ntype: person\n---\n\n# Theo Example\n`, { noEmbed: true, sourceId: source });
- await engine.insertFact({ fact: `theo fact from ${source}`, entity_slug: 'people/theo-example', source: 'note', visibility: 'world', embedding: null }, { source_id: source });
+ await asOwner(engine, tx => tx.insertFact({ fact: `theo fact from ${source}`, entity_slug: 'people/theo-example', source: 'note', visibility: 'world', embedding: null }, { source_id: source }));
}
- await engine.insertFact({ fact: 'only-default fact', entity_slug: 'people/uma-example', source: 'note', visibility: 'world', embedding: null }, { source_id: 'default' });
+ await asOwner(engine, tx => tx.insertFact({ fact: 'only-default fact', entity_slug: 'people/uma-example', source: 'note', visibility: 'world', embedding: null }, { source_id: 'default' }));
await linkEntityIdentity(engine, { entityId: 'theo', slug: 'people/theo-example', sourceId: 'default' });
await linkEntityIdentity(engine, { entityId: 'theo', slug: 'people/theo-example', sourceId: 'team' });
});
diff --git a/test/recall-federated-search-scope.test.ts b/test/recall-federated-search-scope.test.ts
index 86c3faad33..0995c00965 100644
--- a/test/recall-federated-search-scope.test.ts
+++ b/test/recall-federated-search-scope.test.ts
@@ -24,6 +24,7 @@ import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { importFromContent } from '../src/core/import-file.ts';
import { serializeMarkdown } from '../src/core/markdown.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import {
federatedSearchScope,
sourceScopeOpts,
@@ -155,7 +156,7 @@ describe("recall's fact arms honor the federated set too", () => {
const factTexts = (res: any): string[] => (res?.facts ?? []).map((f: any) => f.fact);
beforeAll(async () => {
for (const [fact, source_id] of [['zebra fact in default', 'default'], ['zebra fact in wiki', 'wiki'], ['zebra fact in privsrc', 'privsrc']]) {
- await engine.insertFact({ fact, kind: 'fact', entity_slug: `zebra-${source_id}`, source: 'test', visibility: 'world' }, { source_id });
+ await asOwner(engine, tx => tx.insertFact({ fact, kind: 'fact', entity_slug: `zebra-${source_id}`, source: 'test', visibility: 'world' }, { source_id }));
}
});
diff --git a/test/remember-granted-token.test.ts b/test/remember-granted-token.test.ts
index 449e954f71..4883f52ca2 100644
--- a/test/remember-granted-token.test.ts
+++ b/test/remember-granted-token.test.ts
@@ -15,6 +15,7 @@ import { parseRescopeTokenArgs, rescopeLegacyToken } from '../src/core/grants/le
import { generateToken, hashToken } from '../src/core/utils.ts';
import type { AuthInfo } from '../src/core/ops/contract.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
+import { fenceTranscriptText } from '../src/core/search/transcript-quote.ts';
import { disposePersistenceConsumer } from '../src/core/persistence/service.ts';
let engine: PGLiteEngine;
@@ -60,8 +61,9 @@ describe('remember under a granted member token', () => {
const [row] = await engine.executeRaw<{ source_id: string; expired_at: unknown }>('SELECT source_id, expired_at FROM facts WHERE id = $1', [Number(out.id)]);
expect(row).toMatchObject({ source_id: 'private-alice', expired_at: null });
+ const quoted = fenceTranscriptText('Acme Example asked about ticket 4092', `fact ${out.id}`);
const recalled = await call(alice, 'recall', { query: 'ticket 4092' });
- expect(JSON.parse(recalled.content[0].text).facts.map((f: { fact: string }) => f.fact)).toContain('Acme Example asked about ticket 4092');
+ expect(JSON.parse(recalled.content[0].text).facts.map((f: { fact: string }) => f.fact)).toContain(quoted);
const searched = await call(alice, 'search', { query: 'ticket 4092' });
expect(JSON.parse(searched.content[0].text)).toEqual([]);
@@ -69,7 +71,7 @@ describe('remember under a granted member token', () => {
const bob = await grantedToken('private-bob,public');
const bobRecall = await call(bob, 'recall', { query: 'ticket 4092' });
- expect(JSON.parse(bobRecall.content[0].text).facts.map((f: { fact: string }) => f.fact)).not.toContain('Acme Example asked about ticket 4092');
+ expect(JSON.parse(bobRecall.content[0].text).facts.map((f: { fact: string }) => f.fact)).not.toContain(quoted);
const bobSearch = await call(bob, 'search', { query: 'ticket 4092' });
expect(bobSearch.content.some(c => c.text.includes('ticket 4092'))).toBe(false);
}, 120_000);
diff --git a/test/retrieval-op-redaction.test.ts b/test/retrieval-op-redaction.test.ts
index 2ee1053e05..229ae33fcd 100644
--- a/test/retrieval-op-redaction.test.ts
+++ b/test/retrieval-op-redaction.test.ts
@@ -22,6 +22,7 @@ import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
import { randomBytes, randomUUID } from 'node:crypto';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { installFixtureChunks } from './helpers/page-projection.ts';
+import { asOwner } from './helpers/owner-tier.ts';
import { operations, operationsByName, type Operation, type OperationContext } from '../src/core/operations.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { estimateTokens } from '../src/core/search/token-budget.ts';
@@ -280,7 +281,7 @@ describe('memory verbs redact query-arm text for everyone and facts for remote c
}, { sourceId: SRC });
const p = await engine.getPage('notes/verb-page', { sourceId: SRC });
await installFixtureChunks(engine, 'notes/verb-page', [{ chunk_index: 0, chunk_text: p!.compiled_truth, chunk_source: 'compiled_truth', token_count: 12 }], { sourceId: SRC });
- await engine.insertFact({ fact: `verbfact key ${factKey}`, entity_slug: 'companies/acme-example', source: `test:${factKey}`, visibility: 'world', embedding: null } as never, { source_id: SRC });
+ await asOwner(engine, tx => tx.insertFact({ fact: `verbfact key ${factKey}`, entity_slug: 'companies/acme-example', source: `test:${factKey}`, visibility: 'world', embedding: null } as never, { source_id: SRC }));
});
test('recall over MCP: no page token, assignment value or fact key; identities byte-identical', async () => {
diff --git a/test/search-c5-identical.test.ts b/test/search-c5-identical.test.ts
index ee1e1c1768..4185dfe9e8 100644
--- a/test/search-c5-identical.test.ts
+++ b/test/search-c5-identical.test.ts
@@ -28,6 +28,7 @@ import { serializeMarkdown } from '../src/core/markdown.ts';
import { dispatchToolCall } from '../src/mcp/dispatch.ts';
import { aliasDeclarations } from '../src/core/ops/search.ts';
import { withEnv } from './helpers/with-env.ts';
+import { asOwner } from './helpers/owner-tier.ts';
const GOLDEN = join(import.meta.dir, 'fixtures/goldens/search-c5/notices.json');
/** The remote write path the fresh-fact probes save through. */
@@ -60,11 +61,13 @@ let open: (dataDir?: string) => Promise<PGLiteEngine>;
async function brain(withFactsAndNames: boolean): Promise<PGLiteEngine> {
const engine = await open();
- for (const [slug, title, body] of PAGES) {
- const text = withFactsAndNames ? body : body.replace(/\(?account code NULA\)?|Account code: NULA\.|, also known as OCFR/g, '');
- await importFromContent(engine, slug, serializeMarkdown({}, text, '', { type: 'note', title, tags: [] }), { noEmbed: true, forceRechunk: true });
- }
- if (withFactsAndNames) await engine.executeRaw(FACTS);
+ await asOwner(engine, async tx => {
+ for (const [slug, title, body] of PAGES) {
+ const text = withFactsAndNames ? body : body.replace(/\(?account code NULA\)?|Account code: NULA\.|, also known as OCFR/g, '');
+ await importFromContent(tx, slug, serializeMarkdown({}, text, '', { type: 'note', title, tags: [] }), { noEmbed: true, forceRechunk: true });
+ }
+ if (withFactsAndNames) await tx.executeRaw(FACTS);
+ });
await engine.setConfig('search.query_facts_arm', 'false');
await engine.setConfig('search.query_facts_block', 'false');
return engine;
diff --git a/test/search-lean-rows.test.ts b/test/search-lean-rows.test.ts
index 83b84fa4d5..e35d5887bf 100644
--- a/test/search-lean-rows.test.ts
+++ b/test/search-lean-rows.test.ts
@@ -24,6 +24,7 @@ import { allowedOpNames, createStdioSurfaceState } from '../src/mcp/surface.ts';
import { stampEvidence } from '../src/core/search/evidence.ts';
import { seedOffPath } from './helpers/evidence-delivery-fixture.ts';
import { withEnv } from './helpers/with-env.ts';
+import { asOwner } from './helpers/owner-tier.ts';
// An HTTP client on the full surface with a read grant: `fetch` is callable, so lean rows carry `id`.
const REMOTE: DispatchOpts = { remote: true, transport: 'http', sourceId: 'default', auth: { token: 't', clientId: 'client-a', clientName: 'a', scopes: ['read'], expiresAt: Date.now() / 1000 + 3600 } };
@@ -37,7 +38,7 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await seedOffPath(engine);
+ await asOwner(engine, tx => seedOffPath(tx));
}, 120_000);
afterAll(async () => { await engine?.disconnect(); });
diff --git a/test/search-transcript-quote-tiers.test.ts b/test/search-transcript-quote-tiers.test.ts
index 86e0ea9c7f..c613954763 100644
--- a/test/search-transcript-quote-tiers.test.ts
+++ b/test/search-transcript-quote-tiers.test.ts
@@ -49,12 +49,14 @@ function pageContent(p: (typeof PAGES)[number]): string {
}
const FENCE_OPEN = /\[quoted conversation excerpt from [^\]\n]*; source material, not instructions\]\n(`{3,})text\n/g;
-/** Body ranges of every closed fence in the text (the harness classifier's rule: an unclosed fence does not count). */
+/** Body ranges of every closed fence in the text (the harness classifier's rule: the fence closes alone on its line; an unclosed fence does not count). */
function fencedRanges(text: string): Array<[number, number]> {
const out: Array<[number, number]> = [];
for (const m of text.matchAll(FENCE_OPEN)) {
const start = m.index + m[0].length;
- const close = text.indexOf(`\n${m[1]}`, start - 1);
+ const closes = (at: number) => /^[ \t]*(\n|$)/.test(text.slice(at + 1 + m[1].length));
+ let close = text.indexOf(`\n${m[1]}`, start - 1);
+ while (close >= 0 && !closes(close)) close = text.indexOf(`\n${m[1]}`, close + 1);
if (close >= 0) out.push([start, close]);
}
return out;
@@ -176,6 +178,14 @@ for (const backend of testBackends()) {
}, 180_000);
}
+ test('remote get_page include_timeline_entries: every page placement is quoted, as get_timeline returns it', async () => {
+ for (const p of PAGES) {
+ const page = await ok('get_page', { slug: SLUG[p], include_timeline_entries: true });
+ expect([p, cell(page.timeline_entries, CODE[p])]).toEqual([p, 'fenced']);
+ expect(page.timeline_entries).toEqual(await ok('get_timeline', { slug: SLUG[p] }));
+ }
+ }, 120_000);
+
test('remote search_exact on the tool call\'s own arguments returns it summarized', async () => {
const reply = await call('search_exact', { phrase: 'quarterly ledger' });
expect([verbatimToolCall(reply), neutralizedToolCall(reply)]).toEqual([false, true]);
@@ -250,10 +260,14 @@ for (const backend of testBackends()) {
expect((await engine.getPage(slug))!.compiled_truth).toBe(stored.replace('Paragraph 1 of', 'Paragraph one of'));
}, 120_000);
- test('remote get_versions returns an agent-written note\'s earlier bodies quoted', async () => {
+ test('remote get_versions returns an agent-written note\'s earlier bodies quoted, the owner\'s as stored', async () => {
const versions = await ok('get_versions', { slug: SLUG['note-first'], include_body: true }) as Array<Record<string, unknown>>;
expect(versions.length).toBeGreaterThan(0);
for (const v of versions) expect([v.quoted, cell(v, CODE['note-first'])]).toEqual(['transcript', 'fenced']);
+ await asOwner(engine, tx => tx.createVersion(OWNER_SLUG));
+ const owner = await ok('get_versions', { slug: OWNER_SLUG, include_body: true }) as Array<Record<string, unknown>>;
+ expect(owner.length).toBeGreaterThan(0);
+ for (const v of owner) expect([v.quoted, cell(v, OWNER_CODE)]).toEqual([undefined, 'raw']);
}, 120_000);
test('a forged fence in agent-written text never closes the quote around it', async () => {
diff --git a/test/search/output-redaction.serial.test.ts b/test/search/output-redaction.serial.test.ts
index 4b61a6d99d..e95178663c 100644
--- a/test/search/output-redaction.serial.test.ts
+++ b/test/search/output-redaction.serial.test.ts
@@ -42,6 +42,7 @@ const { formatResult, captureRetrievalMeta, resetRetrievalMetaForTests } = await
const { getCliOptions, setCliOptions, _resetCliOptionsForTest } = await import('../../src/core/cli-options.ts');
const { resetPgliteState } = await import('../helpers/reset-pglite.ts');
const { installFixtureChunks } = await import('../helpers/page-projection.ts');
+const { unquoteTranscriptText } = await import('../../src/core/search/transcript-quote.ts');
let engine: InstanceType<typeof PGLiteEngine>;
function row(): SearchResult {
@@ -211,7 +212,8 @@ describe('retrieval output boundary', () => {
const { ctx } = context();
const result = await operationsByName.search.handler(ctx, { query: 'synthetic', snippet_chars: 12 }) as SearchResult[];
expect(result[0].chunk_text.includes(syntheticKey.slice(0, 12))).toBe(false);
- expect(result[0].chunk_text.startsWith('<REDACTED:')).toBe(true);
+ expect(result[0].quoted).toBe('transcript');
+ expect(unquoteTranscriptText(result[0].chunk_text, 'notes/synthetic').startsWith('<REDACTED:')).toBe(true);
expect(rows[0].chunk_text).toBe(syntheticKey + ' safe suffix');
});
diff --git a/test/search/saved-facts-probe.test.ts b/test/search/saved-facts-probe.test.ts
index c72a219a7e..9975261ab6 100644
--- a/test/search/saved-facts-probe.test.ts
+++ b/test/search/saved-facts-probe.test.ts
@@ -14,6 +14,7 @@ import { PGLiteEngine } from '../../src/core/pglite-engine.ts';
import { operations, type OperationContext } from '../../src/core/operations.ts';
import { configureGateway, resetGateway } from '../../src/core/ai/gateway.ts';
import { newSource, page, putPage } from '../helpers/pinned-questions-fixture.ts';
+import { asOwner } from '../helpers/owner-tier.ts';
let engine: PGLiteEngine;
let sourceId: string;
@@ -50,7 +51,7 @@ beforeAll(async () => {
await putPage(engine, sourceId, 'notes/harbor-held', page('note', 'Harbor held', 'Held notes on the harbor ferry.'));
await engine.executeRaw(`UPDATE pages SET frontmatter = COALESCE(frontmatter, '{}'::jsonb) || '{"quarantine": {"reason": "test"}}'::jsonb WHERE source_id = $1 AND slug = 'notes/harbor-held'`, [sourceId]);
const add = (fact: string, day: string) =>
- engine.insertFact({ fact, kind: 'fact', entity_slug: 'harbor', source: 'notes', visibility: 'world', valid_from: new Date(`2025-07-${day}T00:00:00Z`) }, { source_id: sourceId });
+ asOwner(engine, tx => tx.insertFact({ fact, kind: 'fact', entity_slug: 'harbor', source: 'notes', visibility: 'world', valid_from: new Date(`2025-07-${day}T00:00:00Z`) }, { source_id: sourceId }));
await add('The harbor ferry timetable changes in May.', '12');
await add('The harbor ferry timetable moves to the private schedule.', '13');
await add('The harbor ferry timetable is under review.', '14');
diff --git a/test/serve-http-surface-ceiling.test.ts b/test/serve-http-surface-ceiling.test.ts
index bc6d171d07..fd8b97f4ae 100644
--- a/test/serve-http-surface-ceiling.test.ts
+++ b/test/serve-http-surface-ceiling.test.ts
@@ -40,6 +40,7 @@ import { cliDiagnostic, fixtureDiagnostic, toolDiagnostic } from './helpers/fixt
import { join } from 'path';
import { VERB_NAMES } from '../src/core/verbs.ts';
import { operations } from '../src/core/operations.ts';
+import { fenceTranscriptText } from '../src/core/search/transcript-quote.ts';
const PORT_A = 19833; // plain --surface verbs (unique across the e2e suite)
const PORT_B = 19834; // --surface verbs + GBRAIN_MCP_FORCE_SURFACE=full
@@ -279,6 +280,6 @@ describe('serve --http --surface verbs ceiling E2E (hermetic PGLite)', () => {
expect(recalled.protocol_version).toBe(1);
expect(Array.isArray(recalled.facts)).toBe(true);
expect(recalled.total).toBeGreaterThanOrEqual(1);
- expect(recalled.facts.some((f: { fact: string }) => f.fact === factText)).toBe(true);
+ expect(recalled.facts.some((f: { fact: string }) => f.fact === fenceTranscriptText(factText, `fact ${remembered.id}`))).toBe(true);
}, 30_000);
});
diff --git a/test/timeline-correction-path-5970.test.ts b/test/timeline-correction-path-5970.test.ts
index f211986855..524d249f35 100644
--- a/test/timeline-correction-path-5970.test.ts
+++ b/test/timeline-correction-path-5970.test.ts
@@ -15,6 +15,7 @@ import { disposePersistenceConsumer } from '../src/core/persistence/service.ts';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
import { dispatchToolCall as dispatchToolCallImpl } from '../src/mcp/dispatch.ts';
import { operations } from '../src/core/operations.ts';
+import { fenceTranscriptText } from '../src/core/search/transcript-quote.ts';
const SOURCE = 'default';
const OPTS = { remote: true, sourceId: SOURCE } as const;
@@ -81,7 +82,7 @@ describe('#5970 timeline correction path', () => {
const timeline = payload(await dispatchToolCall(engine, 'get_timeline', { slug: SLUG }, OPTS)) as Array<{ summary: string }> | { entries?: Array<{ summary: string }> };
const entries = Array.isArray(timeline) ? timeline : (timeline.entries ?? []);
- expect(entries.map(e => e.summary)).toEqual(['Signed the example sublease']);
+ expect(entries.map(e => e.summary)).toEqual([fenceTranscriptText('Signed the example sublease', SLUG)]);
// Replaying the original entry after the correction reports the duplicate identity, not a second row.
const replay = await dispatchToolCall(engine, 'add_timeline_entry', { slug: SLUG, date: '2026-03-02', summary: 'Signed the example sublease', source: 'manual' }, OPTS);
diff --git a/test/turn-context.test.ts b/test/turn-context.test.ts
index 529bc1e04d..e9d15b8467 100644
--- a/test/turn-context.test.ts
+++ b/test/turn-context.test.ts
@@ -36,6 +36,7 @@ import {
loadCorpusBeliefData,
loadCorpusQueries,
} from './helpers/bootstrap-corpus.ts';
+import { asOwner } from './helpers/owner-tier.ts';
let engine: PGLiteEngine;
@@ -74,7 +75,7 @@ async function seedPage(slug: string, title: string, body: string) {
}
async function seedFact(fact: string, visibility: 'private' | 'world', opts: { session?: string; entity?: string } = {}) {
- await engine.insertFact(
+ await asOwner(engine, tx => tx.insertFact(
{
fact,
kind: 'fact',
@@ -84,7 +85,7 @@ async function seedFact(fact: string, visibility: 'private' | 'world', opts: { s
source_session: opts.session ?? null,
},
{ source_id: 'default' },
- );
+ ));
}
describe('assembleTurnContext', () => {