Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

CI fixes: core help without a brain, schema budgets (remember budget 1370->1500 for the additive items param; served starter list stays under 25,000), write-refusals rows, e2e map, snapshot classification, regenerated goldens and generated docs

garrytan62ef8c0531f9
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.md
index caa228b80d..df9f28edbe 100644
--- a/docs/TOOL_CATALOG.md
+++ b/docs/TOOL_CATALOG.md
@@ -138,12 +138,12 @@ Every non-localOnly operation on the MCP surface: 137 tools across 23 areas. **S
| Tool | Description | Scope | Starter | Gate |
|---|---|---|---|---|
-| `context_pack` | MEMORY VERB (v1): the always-loaded core block plus budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. | read | yes | |
+| `context_pack` | MEMORY VERB (v1): core memory plus budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. | read | yes | |
| `delta` | MEMORY VERB (v1): what changed since a time (pages, facts, thread events), zero LLM. | read | yes | |
| `entity` | MEMORY VERB (v1): one known person/company/project card, zero LLM. | read | yes | |
| `forget` | MEMORY VERB (v1): expire a remembered fact by its fact_id (never a page slug). | write | yes | |
| `recall` | MEMORY VERB (v1): read saved facts by entity, since or session_id; `query` also searches pages. | read | yes | |
-| `remember` | MEMORY VERB (v1): save one fact (or up to 20 with items); provenance required. | write | yes | |
+| `remember` | MEMORY VERB (v1): save one fact; provenance required. | write | yes | |
| `synthesize` | [EXPENSIVE / SLOW: LLM calls, costs money] MEMORY VERB (v1): answer a broad question across pages with citations. | read | yes | |
## ontology
diff --git a/docs/guides/write-refusals.md b/docs/guides/write-refusals.md
index a7bcc998ab..417a37ad1e 100644
--- a/docs/guides/write-refusals.md
+++ b/docs/guides/write-refusals.md
@@ -104,6 +104,10 @@ a receipt can report has a row here.
| `source_writeback_required` | `source_writeback_required` | The write needs a correction to the source's repository files, and this caller or profile never writes them. | Make the correction in the source repository, then sync. |
| `writer_upgrade_required` | `writer_upgrade_required` | The brain's schema is older than this operation needs. | Run `gbrain upgrade` (or `gbrain apply-migrations --yes`) on the brain host. |
| `skill_bundle_required` | `skill_bundle_required` | The write targets a shared-skill path, which only the shared skill publisher may write. | Publish the skill through the shared skill publisher instead. |
+| `core_budget_exceeded` | `invalid_params` (detail `core_budget_exceeded`) | The write would make always-loaded core memory larger than `memory.core.max_chars`, or add a 51st core page. The message names the projected size, how far over it is and the largest core pages the caller can see. Nothing was written; writes that shrink core always pass. | Move detail into a linked non-core page and keep a one-line pointer, or ask the user to raise the budget. `gbrain core status --json` shows where the characters go. See [core memory budget](core-memory.md#budget). |
+| `core_mark_owner_only` | `invalid_params` (detail `core_mark_owner_only`) | A remote caller tried to add or remove `always_load` or change `core_priority`. Only the owner designates core pages. Nothing was written. | Resubmit without changing those keys (omitted keys keep their stored values). If the marking itself should change, ask the user to run the `gbrain core add` or `remove` command the message names. See [owner only](core-memory.md#owner-only). |
+| `core_delete_owner_only` | `invalid_params` (detail `core_delete_owner_only`) | A remote caller tried to delete a core page. Nothing was deleted. | Ask the user to run `gbrain core remove <slug>` first; the page can then be deleted. See [owner only](core-memory.md#owner-only). |
+| `core_remote_edit_refused` | `invalid_params` (detail `core_remote_edit_refused`) | `memory.core.remote_edit` is `refuse`, so remote edits to core pages are refused. Nothing was written. | Ask the user to make the edit on the brain host, or to allow remote edits with notices (`gbrain config set memory.core.remote_edit notify`). See [remote edits](core-memory.md#remote-edits). |
`gbrain doctor` reports parked targets as the `parked_effects` check with the
exact `retry-effects` command per request. It reports `persistence_capacity`
diff --git a/llms-full.txt b/llms-full.txt
index edf49a510b..47375332c2 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -8829,6 +8829,26 @@ Optional response fields; clients must ignore any they do not know.
caller is never told about an entity it cannot read: that case is `NO_ENTITY`.
- `hint: string` — present with `warnings`; names the `entity` input.
+#### remember items: several facts in one call (additive)
+
+`items` (1 to 20 objects) replaces `fact` for a batch, typically right before
+context compaction. Each item takes `fact` plus optional `entity`, `kind`,
+`ttl`, `visibility`, `provenance` and `infer_entity`; top-level `provenance`,
+`kind`, `ttl`, `visibility` and `infer_entity` are the defaults. Passing both
+`fact` and `items` is `invalid_params`.
+
+Every item is validated before any is written: one invalid item refuses the
+whole call with `items[<i>]` in the message. Each item is then saved as its own
+write with a child `request_id` derived from the call's `request_id` and the
+item index, so replaying the same `request_id` replays each child's outcome and
+writes nothing twice.
+
+Response: `{ protocol_version, request_id, items[], saved, failed, partial,
+next? }`. Each `items[]` entry is the single-fact response plus `index` and its
+child `request_id`, or `{ index, request_id, status: "failed", error: { code,
+message } }`. `partial: true` means some items saved and some failed; resend
+only the failed items, in a new call with a new `request_id`.
+
### entity(name) — read, zero LLM, p99 < 100ms
One known person/company/project card. NEVER errors on a miss.
@@ -9085,10 +9105,18 @@ lockstep, and is honored ONLY for trusted-local callers (`remote === false`); a
remote caller never widens (fail-closed).
Response: `{ protocol_version, entities, cards[], open_threads[], facts[], text,
-degraded_reason?, budget_tokens?, budget_used?, dropped_count? }`. `text` is the
+degraded_reason?, budget_tokens?, budget_used?, dropped_count?, core? }`. `text` is the
pre-rendered, envelope-wrapped injectable block; with `budget_tokens` it is
rendered from the packed sets and never exceeds the declared budget.
+#### context_pack core memory (additive)
+
+`core: { text, revision, chars_used, chars_limit, pages, truncated }` carries the
+always-loaded core block (owner-designated pages loaded in every session,
+[core memory](../guides/core-memory.md)) when core memory is on and not empty.
+`text` starts with the core block, and core tokens count inside
+`budget_tokens`. `entities` may be omitted to fetch core alone.
+
### delta(since?, entities?, budget_tokens?, session_id?, include_private?) — read, zero LLM
"What changed since T" for heartbeats — pages updated after
diff --git a/scripts/e2e-test-map.ts b/scripts/e2e-test-map.ts
index 722f3dd6f3..ccbdaa243a 100644
--- a/scripts/e2e-test-map.ts
+++ b/scripts/e2e-test-map.ts
@@ -519,7 +519,8 @@ export const E2E_TEST_MAP: Record<string, string[]> = {
"src/core/persistence/database-write.ts": ["test/e2e/managed-ontology-propose-postgres.test.ts", "test/e2e/managed-writers-w3.test.ts"],
"src/core/schema-migrations/v188-facts-ontology-stint-dedup.ts": ["test/e2e/ontology-merge-parity.test.ts", "test/e2e/schema-drift.test.ts"],
"src/core/persistence/memory-mutations.ts": ["test/e2e/withdrawal-followup-writes-postgres.test.ts"],
- "src/core/persistence/coordinator.ts": ["test/e2e/withdrawal-followup-writes-postgres.test.ts"],
+ "src/core/persistence/coordinator.ts": ["test/e2e/withdrawal-followup-writes-postgres.test.ts", "test/e2e/core-memory-locks-postgres.test.ts"],
+ "src/core/persistence/core-guard.ts": ["test/e2e/core-memory-locks-postgres.test.ts"],
"src/core/repair/failed-writes.ts": ["test/e2e/repair-failed-writes-5983-postgres.test.ts"],
"src/core/persistence/writer-guard-schema.ts": ["test/e2e/managed-writer-guard-null-source-5983-postgres.test.ts", "test/e2e/schema-drift.test.ts", "test/e2e/schema-catalog-golden.test.ts"],
"src/core/schema-migrations/v197-managed-guard-null-source-fallback.ts": ["test/e2e/managed-writer-guard-null-source-5983-postgres.test.ts", "test/e2e/schema-drift.test.ts", "test/e2e/schema-catalog-golden.test.ts"],
diff --git a/src/cli.ts b/src/cli.ts
index fac0c34c74..fe2009f38f 100755
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -153,7 +153,7 @@ const SELF_HELP_WITHOUT_ENGINE: Record<string, true | (() => Promise<(engine: ne
// D3: post-connect records whose handler answers --help before the engine; run through the table.
advisor: true, anomalies: true, backfill: true, 'book-mirror': true, 'edges-backfill': true, embed: true, features: true,
founder: true, 'graph-query': true, orphans: true, salience: true, think: true,
- brainstorm: true, lsd: true, migrate: true, pages: true, pricing: true, 'retrieval-upgrade': true, whoknows: true,
+ brainstorm: true, lsd: true, migrate: true, pages: true, pricing: true, 'retrieval-upgrade': true, whoknows: true, core: true,
};
/** Returns true when the command's own help was printed. */
diff --git a/src/cli/command-table.ts b/src/cli/command-table.ts
index ce411ee273..488eca6183 100644
--- a/src/cli/command-table.ts
+++ b/src/cli/command-table.ts
@@ -363,7 +363,7 @@ export const CLI_COMMANDS: readonly CliCommandRecord[] = [ // Pre-connect: disp
{ name: 'waiting', phase: 'post-connect', thinClient: 'none', selfHelp: true, routes_source: true, load: () => import('./commands/waiting.ts') },
{ name: 'loops', phase: 'post-connect', thinClient: 'none', selfHelp: true, routes_source: true, load: () => import('./commands/loops.ts') },
// selfHelp: core prints its own usage (commands/core.ts). Always-loaded core memory, docs/guides/core-memory.md.
- { name: 'core', phase: 'post-connect', thinClient: 'none', selfHelp: true, jsonSubcommands: { list: 'document', show: 'document', status: 'document', diff: 'document', suggest: 'document' }, load: () => import('./commands/core.ts') },
+ { name: 'core', phase: 'post-connect', thinClient: 'none', selfHelp: true, load: () => import('./commands/core.ts') },
// selfHelp: connectors ships its own printHelp (commands/connectors/index.ts) with the
// per-subcommand usage; keep the generic short-circuit from hiding it.
{ name: 'connectors', phase: 'post-connect', thinClient: 'none', selfHelp: true, load: () => import('./commands/connectors.ts') },
diff --git a/src/core/ops/facts.ts b/src/core/ops/facts.ts
index bf78775914..640da93f56 100644
--- a/src/core/ops/facts.ts
+++ b/src/core/ops/facts.ts
@@ -612,9 +612,9 @@ const context_pack: Operation = {
mutating: false,
idempotent: true,
outputRedaction: { retrieval: { localVerbatim: ['facts'] } },
- description: 'MEMORY VERB (v1): the always-loaded core block plus budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction; omit entities for core only.',
+ description: 'MEMORY VERB (v1): core memory plus budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.',
params: {
- entities: { type: 'string', description: 'Comma-separated names or slugs (max 8); omit for the core block only.' },
+ entities: { type: 'string', description: 'Comma-separated names or slugs (max 8); omit for core only.' },
budget_tokens: { type: 'number', description: 'Token budget; cards pack first.' },
since: { type: 'string', description: 'Only open-thread events after this ISO time.' },
session_id: { type: 'string', description: 'Opaque session id.' },
diff --git a/src/core/persistence/page-prepare.ts b/src/core/persistence/page-prepare.ts
index 017b02e4e6..bab7f9d9e8 100644
--- a/src/core/persistence/page-prepare.ts
+++ b/src/core/persistence/page-prepare.ts
@@ -408,7 +408,7 @@ export async function preparePageMutation(engine: BrainEngine, row: WriteRequest
const core = noop ? null : await prepareCoreGuard(engine, { row, snapshot, incoming: targetDeleted ? null : ready.parsedPage });
return { observedRevision, noop, additionalPageKeys:links?.pageKeys, file, ...await pageDatabaseOnlyPublication(engine, row, file),
...(core ? { exclusiveSources: core.exclusiveSources } : {}),
- validate: core ? async tx => { await ready.validate?.(tx); await core.validate(tx); } : ready.validate, apply: async tx => {
+ validate: async tx => { await ready.validate(tx); await core?.validate(tx); }, apply: async tx => {
let autoLinks: Awaited<ReturnType<NonNullable<typeof links>['apply']>> | undefined;
if (!noop) {
await ready.apply(tx);
diff --git a/src/core/snapshot-schema-inputs.ts b/src/core/snapshot-schema-inputs.ts
index ec4fc5d952..be1bfa80a3 100644
--- a/src/core/snapshot-schema-inputs.ts
+++ b/src/core/snapshot-schema-inputs.ts
@@ -48,6 +48,7 @@ export const SNAPSHOT_DYNAMIC_IMPORTS_NOT_HASHED: Readonly<Record<string, string
'embedding.ts': 'verbs.ts request-time verb handlers',
'model-pricing.ts': 'verbs.ts request-time verb handlers',
'interop-notices.ts': 'verbs.ts request-time verb handlers (agent contract notices)',
+ 'remember-batch.ts': 'verbs.ts request-time verb handlers (remember items[])',
};
const STATIC_SPECIFIER =
diff --git a/src/core/verbs.ts b/src/core/verbs.ts
index ecdbcfb316..83328ba78e 100644
--- a/src/core/verbs.ts
+++ b/src/core/verbs.ts
@@ -62,22 +62,14 @@ const remember: Operation = {
name: 'remember',
idempotent: true,
outputRedaction: 'no_stored_text',
- description: 'MEMORY VERB (v1): save one fact (or up to 20 with items); provenance required. Set `entity` when the fact has a subject, or entity-scoped recall misses it. Branch on `status` (inserted|duplicate|superseded). write_pending carries a receipt: poll get_write_request.',
+ description: 'MEMORY VERB (v1): save one fact; provenance required. Set `entity` when the fact has a subject, or entity-scoped recall misses it. Branch on `status` (inserted|duplicate|superseded). write_pending carries a receipt: poll get_write_request.',
params: {
...PAGE_MUTATION_PARAMS,
- fact: { type: 'string', description: 'One claim (or use items).' },
+ fact: { type: 'string', description: 'One claim.' },
items: {
type: 'array',
- description: 'Save up to 20 facts in one call (e.g. before context compaction); each item takes fact plus optional entity, kind, ttl, visibility, provenance (defaults to the top-level provenance). Use instead of fact.',
- items: { type: 'object', properties: {
- fact: { type: 'string', required: true, description: 'One claim.' },
- entity: { type: 'string', description: 'Who or what it is about.' },
- kind: { type: 'string', enum: ['event', 'preference', 'commitment', 'belief', 'fact'], description: 'Default fact.' },
- ttl: { type: 'string', description: '"30d", "12h" or ISO time.' },
- visibility: { type: 'string', enum: ['world', 'private'], description: 'Default world.' },
- provenance: { type: 'string', description: 'Overrides the top-level provenance.' },
- infer_entity: { type: 'boolean', description: 'Default true.' },
- } },
+ description: 'Up to 20 facts in one call (e.g. before compaction) instead of fact: [{fact, entity?, kind?, ttl?, provenance?}].',
+ items: { type: 'object' },
},
provenance: {
type: 'string',
diff --git a/test/cli-help-without-brain.serial.test.ts b/test/cli-help-without-brain.serial.test.ts
index ad1c153d43..63b4809aec 100644
--- a/test/cli-help-without-brain.serial.test.ts
+++ b/test/cli-help-without-brain.serial.test.ts
@@ -51,6 +51,8 @@ const HELP_WITHOUT_BRAIN = [
'brainstorm', 'lsd', 'migrate', 'pages', 'pricing', 'whoknows',
// Agent operator gate fixes: embed's usage (incl. its consent flags) prints before the engine.
'embed',
+ // Core memory: runCore prints its usage for --help before reading the engine.
+ 'core',
];
/**
diff --git a/test/cli-thin-client-refusal-matrix.test.ts b/test/cli-thin-client-refusal-matrix.test.ts
index f641dc3d40..db835460e8 100644
--- a/test/cli-thin-client-refusal-matrix.test.ts
+++ b/test/cli-thin-client-refusal-matrix.test.ts
@@ -12,7 +12,7 @@
* against a remote brain), routes a host-bound subcommand, changes a hint or
* exit code, or moves a check across the connectEngine terminator.
* Why new: test/cli-dispatch-thin-client.test.ts asserts refusal for a
- * hand-picked subset by substring; nothing pins all 63 cases or the full
+ * hand-picked subset by substring; nothing pins all 64 cases or the full
* text. Seam: none.
*
* Nothing leaves the machine: issuer and MCP URLs point at 127.0.0.1:1
@@ -104,8 +104,8 @@ describe('A16b thin-client refusal matrix', () => {
routing = await run(ROUTING_ROWS);
}, 300_000);
- test('the matrix covers all 63 handleCliOnly cases', () => {
- expect(CASES.length).toBe(63);
+ test('the matrix covers all 64 handleCliOnly cases', () => {
+ expect(CASES.length).toBe(64);
});
test('every handleCliOnly case, run bare on a thin client, matches the golden', () => {
diff --git a/test/core-guard.test.ts b/test/core-guard.test.ts
index a98fbb4b51..b2da2a03b4 100644
--- a/test/core-guard.test.ts
+++ b/test/core-guard.test.ts
@@ -115,7 +115,7 @@ describe('budget', () => {
const big = await put('notes/big', page('Big', 'b'.repeat(400), { always_load: true }), false);
expect(big.body).toMatchObject({ error: 'core_budget_exceeded' });
expect(big.body.message).toContain('over the 600-char budget');
- expect(big.body.fix?.argv).toEqual(['gbrain', 'core', 'status', '--json']);
+ expect(big.body.fix?.argv.slice(0, 4)).toEqual(['gbrain', 'core', 'status', '--json']);
expect(await corePages()).toEqual(['people/alice-example']);
// Lower the limit below current usage: growth refused, shrinking passes.
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
index a64d38b44d..95dc66de3b 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
@@ -1270,9 +1270,10 @@
"4 page_id bigint/int8 NULL",
"5 revision text/text NULL",
"6 base_revision text/text NULL",
- "7 actor text/text NOT NULL",
- "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "9 acked_at timestamp with time zone/timestamptz NULL"
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
index 35fa3949c2..9e6f9b9390 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
@@ -1270,9 +1270,10 @@
"4 page_id bigint/int8 NULL",
"5 revision text/text NULL",
"6 base_revision text/text NULL",
- "7 actor text/text NOT NULL",
- "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "9 acked_at timestamp with time zone/timestamptz NULL"
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
index 42e0af5401..a077f71550 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
@@ -1266,9 +1266,10 @@
"4 page_id bigint/int8 NULL",
"5 revision text/text NULL",
"6 base_revision text/text NULL",
- "7 actor text/text NOT NULL",
- "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "9 acked_at timestamp with time zone/timestamptz NULL"
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json b/test/fixtures/goldens/catalog/pglite-schema-blob-default.json
index 54aced48de..29e2567022 100644
--- a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json
+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-default.json
@@ -925,9 +925,10 @@
"4 page_id bigint/int8 NULL",
"5 revision text/text NULL",
"6 base_revision text/text NULL",
- "7 actor text/text NOT NULL",
- "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "9 acked_at timestamp with time zone/timestamptz NULL"
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json
index 64a94e15d3..5425a62258 100644
--- a/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json
@@ -925,9 +925,10 @@
"4 page_id bigint/int8 NULL",
"5 revision text/text NULL",
"6 base_revision text/text NULL",
- "7 actor text/text NOT NULL",
- "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "9 acked_at timestamp with time zone/timestamptz NULL"
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json b/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json
index dd961c3b56..b2e2917192 100644
--- a/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json
@@ -924,9 +924,10 @@
"4 page_id bigint/int8 NULL",
"5 revision text/text NULL",
"6 base_revision text/text NULL",
- "7 actor text/text NOT NULL",
- "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "9 acked_at timestamp with time zone/timestamptz NULL"
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/fixtures/goldens/catalog/postgres-db-initschema.json b/test/fixtures/goldens/catalog/postgres-db-initschema.json
index 49158bae10..f6479905cc 100644
--- a/test/fixtures/goldens/catalog/postgres-db-initschema.json
+++ b/test/fixtures/goldens/catalog/postgres-db-initschema.json
@@ -26,6 +26,7 @@
"content_chunks.content_chunks_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",
"content_chunks.content_chunks_pkey": "p PRIMARY KEY (id)",
"context_volunteer_events.context_volunteer_events_pkey": "p PRIMARY KEY (id)",
+ "core_edit_notices.core_edit_notices_pkey": "p PRIMARY KEY (id)",
"decide_calibrations.decide_calibrations_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_sweep_id_pair_index_key": "u UNIQUE (sweep_id, pair_index)",
@@ -295,6 +296,9 @@
"context_volunteer_events": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "core_edit_notices": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"decide_calibrations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -538,6 +542,8 @@
"context_volunteer_events_pkey": "CREATE UNIQUE INDEX context_volunteer_events_pkey ON public.context_volunteer_events USING btree (id)",
"context_volunteer_events_src_slug_idx": "CREATE INDEX context_volunteer_events_src_slug_idx ON public.context_volunteer_events USING btree (source_id, slug)",
"context_volunteer_events_src_time_idx": "CREATE INDEX context_volunteer_events_src_time_idx ON public.context_volunteer_events USING btree (source_id, volunteered_at DESC)",
+ "core_edit_notices_pending_idx": "CREATE INDEX core_edit_notices_pending_idx ON public.core_edit_notices USING btree (source_id, slug, id) WHERE (acked_at IS NULL)",
+ "core_edit_notices_pkey": "CREATE UNIQUE INDEX core_edit_notices_pkey ON public.core_edit_notices USING btree (id)",
"decide_calibrations_lookup_idx": "CREATE INDEX decide_calibrations_lookup_idx ON public.decide_calibrations USING btree (slot, provider, model_resolved, created_at DESC)",
"decide_calibrations_pkey": "CREATE UNIQUE INDEX decide_calibrations_pkey ON public.decide_calibrations USING btree (id)",
"decide_proposals_pkey": "CREATE UNIQUE INDEX decide_proposals_pkey ON public.decide_proposals USING btree (id)",
@@ -767,6 +773,7 @@
"code_edges_symbol_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_symbol.id",
"content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id",
"context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id",
+ "core_edit_notices_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=core_edit_notices.id",
"decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
@@ -964,6 +971,21 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "core_edit_notices": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('core_edit_notices_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 slug text/text NOT NULL",
+ "4 page_id bigint/int8 NULL",
+ "5 revision text/text NULL",
+ "6 base_revision text/text NULL",
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"decide_calibrations": {
"columns": [
"1 id bigint/int8 NOT NULL DEFAULT nextval('decide_calibrations_id_seq'::regclass)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index 65013754c1..f98900468a 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -32,6 +32,7 @@
"context_volunteer_events.context_volunteer_events_pkey": "p PRIMARY KEY (id)",
"conversation_parser_llm_cache.conversation_parser_llm_cache_call_shape_check": "c CHECK ((call_shape = ANY (ARRAY['polish'::text, 'fallback'::text])))",
"conversation_parser_llm_cache.conversation_parser_llm_cache_pkey": "p PRIMARY KEY (content_sha256, model_id, call_shape)",
+ "core_edit_notices.core_edit_notices_pkey": "p PRIMARY KEY (id)",
"decide_calibrations.decide_calibrations_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_sweep_id_pair_index_key": "u UNIQUE (sweep_id, pair_index)",
@@ -373,6 +374,9 @@
"conversation_parser_llm_cache": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "core_edit_notices": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"decide_calibrations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -673,6 +677,8 @@
"context_volunteer_events_src_slug_idx": "CREATE INDEX context_volunteer_events_src_slug_idx ON public.context_volunteer_events USING btree (source_id, slug)",
"context_volunteer_events_src_time_idx": "CREATE INDEX context_volunteer_events_src_time_idx ON public.context_volunteer_events USING btree (source_id, volunteered_at DESC)",
"conversation_parser_llm_cache_pkey": "CREATE UNIQUE INDEX conversation_parser_llm_cache_pkey ON public.conversation_parser_llm_cache USING btree (content_sha256, model_id, call_shape)",
+ "core_edit_notices_pending_idx": "CREATE INDEX core_edit_notices_pending_idx ON public.core_edit_notices USING btree (source_id, slug, id) WHERE (acked_at IS NULL)",
+ "core_edit_notices_pkey": "CREATE UNIQUE INDEX core_edit_notices_pkey ON public.core_edit_notices USING btree (id)",
"decide_calibrations_lookup_idx": "CREATE INDEX decide_calibrations_lookup_idx ON public.decide_calibrations USING btree (slot, provider, model_resolved, created_at DESC)",
"decide_calibrations_pkey": "CREATE UNIQUE INDEX decide_calibrations_pkey ON public.decide_calibrations USING btree (id)",
"decide_proposals_pkey": "CREATE UNIQUE INDEX decide_proposals_pkey ON public.decide_proposals USING btree (id)",
@@ -991,6 +997,7 @@
"code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",
"content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id",
"context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id",
+ "core_edit_notices_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=core_edit_notices.id",
"decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
@@ -1256,6 +1263,21 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "core_edit_notices": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('core_edit_notices_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 slug text/text NOT NULL",
+ "4 page_id bigint/int8 NULL",
+ "5 revision text/text NULL",
+ "6 base_revision text/text NULL",
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"decide_calibrations": {
"columns": [
"1 id bigint/int8 NOT NULL DEFAULT nextval('decide_calibrations_id_seq'::regclass)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
index ecdff86800..46dfb169f6 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -32,6 +32,7 @@
"context_volunteer_events.context_volunteer_events_pkey": "p PRIMARY KEY (id)",
"conversation_parser_llm_cache.conversation_parser_llm_cache_call_shape_check": "c CHECK ((call_shape = ANY (ARRAY['polish'::text, 'fallback'::text])))",
"conversation_parser_llm_cache.conversation_parser_llm_cache_pkey": "p PRIMARY KEY (content_sha256, model_id, call_shape)",
+ "core_edit_notices.core_edit_notices_pkey": "p PRIMARY KEY (id)",
"decide_calibrations.decide_calibrations_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_sweep_id_pair_index_key": "u UNIQUE (sweep_id, pair_index)",
@@ -373,6 +374,9 @@
"conversation_parser_llm_cache": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "core_edit_notices": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"decide_calibrations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -673,6 +677,8 @@
"context_volunteer_events_src_slug_idx": "CREATE INDEX context_volunteer_events_src_slug_idx ON public.context_volunteer_events USING btree (source_id, slug)",
"context_volunteer_events_src_time_idx": "CREATE INDEX context_volunteer_events_src_time_idx ON public.context_volunteer_events USING btree (source_id, volunteered_at DESC)",
"conversation_parser_llm_cache_pkey": "CREATE UNIQUE INDEX conversation_parser_llm_cache_pkey ON public.conversation_parser_llm_cache USING btree (content_sha256, model_id, call_shape)",
+ "core_edit_notices_pending_idx": "CREATE INDEX core_edit_notices_pending_idx ON public.core_edit_notices USING btree (source_id, slug, id) WHERE (acked_at IS NULL)",
+ "core_edit_notices_pkey": "CREATE UNIQUE INDEX core_edit_notices_pkey ON public.core_edit_notices USING btree (id)",
"decide_calibrations_lookup_idx": "CREATE INDEX decide_calibrations_lookup_idx ON public.decide_calibrations USING btree (slot, provider, model_resolved, created_at DESC)",
"decide_calibrations_pkey": "CREATE UNIQUE INDEX decide_calibrations_pkey ON public.decide_calibrations USING btree (id)",
"decide_proposals_pkey": "CREATE UNIQUE INDEX decide_proposals_pkey ON public.decide_proposals USING btree (id)",
@@ -991,6 +997,7 @@
"code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",
"content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id",
"context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id",
+ "core_edit_notices_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=core_edit_notices.id",
"decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
@@ -1256,6 +1263,21 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "core_edit_notices": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('core_edit_notices_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 slug text/text NOT NULL",
+ "4 page_id bigint/int8 NULL",
+ "5 revision text/text NULL",
+ "6 base_revision text/text NULL",
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"decide_calibrations": {
"columns": [
"1 id bigint/int8 NOT NULL DEFAULT nextval('decide_calibrations_id_seq'::regclass)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
index a815cd1c99..ee7b0a522d 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -32,6 +32,7 @@
"context_volunteer_events.context_volunteer_events_pkey": "p PRIMARY KEY (id)",
"conversation_parser_llm_cache.conversation_parser_llm_cache_call_shape_check": "c CHECK ((call_shape = ANY (ARRAY['polish'::text, 'fallback'::text])))",
"conversation_parser_llm_cache.conversation_parser_llm_cache_pkey": "p PRIMARY KEY (content_sha256, model_id, call_shape)",
+ "core_edit_notices.core_edit_notices_pkey": "p PRIMARY KEY (id)",
"decide_calibrations.decide_calibrations_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_sweep_id_pair_index_key": "u UNIQUE (sweep_id, pair_index)",
@@ -373,6 +374,9 @@
"conversation_parser_llm_cache": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "core_edit_notices": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"decide_calibrations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -673,6 +677,8 @@
"context_volunteer_events_src_slug_idx": "CREATE INDEX context_volunteer_events_src_slug_idx ON public.context_volunteer_events USING btree (source_id, slug)",
"context_volunteer_events_src_time_idx": "CREATE INDEX context_volunteer_events_src_time_idx ON public.context_volunteer_events USING btree (source_id, volunteered_at DESC)",
"conversation_parser_llm_cache_pkey": "CREATE UNIQUE INDEX conversation_parser_llm_cache_pkey ON public.conversation_parser_llm_cache USING btree (content_sha256, model_id, call_shape)",
+ "core_edit_notices_pending_idx": "CREATE INDEX core_edit_notices_pending_idx ON public.core_edit_notices USING btree (source_id, slug, id) WHERE (acked_at IS NULL)",
+ "core_edit_notices_pkey": "CREATE UNIQUE INDEX core_edit_notices_pkey ON public.core_edit_notices USING btree (id)",
"decide_calibrations_lookup_idx": "CREATE INDEX decide_calibrations_lookup_idx ON public.decide_calibrations USING btree (slot, provider, model_resolved, created_at DESC)",
"decide_calibrations_pkey": "CREATE UNIQUE INDEX decide_calibrations_pkey ON public.decide_calibrations USING btree (id)",
"decide_proposals_pkey": "CREATE UNIQUE INDEX decide_proposals_pkey ON public.decide_proposals USING btree (id)",
@@ -987,6 +993,7 @@
"code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",
"content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id",
"context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id",
+ "core_edit_notices_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=core_edit_notices.id",
"decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
@@ -1252,6 +1259,21 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "core_edit_notices": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('core_edit_notices_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 slug text/text NOT NULL",
+ "4 page_id bigint/int8 NULL",
+ "5 revision text/text NULL",
+ "6 base_revision text/text NULL",
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"decide_calibrations": {
"columns": [
"1 id bigint/int8 NOT NULL DEFAULT nextval('decide_calibrations_id_seq'::regclass)",
diff --git a/test/fixtures/goldens/cli/membership-sets.json b/test/fixtures/goldens/cli/membership-sets.json
index 68142f4af1..699583be1e 100644
--- a/test/fixtures/goldens/cli/membership-sets.json
+++ b/test/fixtures/goldens/cli/membership-sets.json
@@ -301,6 +301,7 @@
"brainstorm",
"compile-context",
"connectors",
+ "core",
"dream",
"edges-backfill",
"embed",
diff --git a/test/fixtures/goldens/cli/thin-client-cases.json b/test/fixtures/goldens/cli/thin-client-cases.json
index babd5f0455..4af5a03305 100644
--- a/test/fixtures/goldens/cli/thin-client-cases.json
+++ b/test/fixtures/goldens/cli/thin-client-cases.json
@@ -656,6 +656,16 @@
],
"stdout": []
},
+ {
+ "argv": "core",
+ "exitCode": 1,
+ "stderr": [
+ "Error [requires_local_engine]: `gbrain core` requires a local engine. This install is a thin client of http://127.0.0.1:1/mcp.",
+ "Fix: gbrain core",
+ "Docs: https://github.com/garrytan/gbrain/blob/master/docs/guides/error-codes.md#requires_local_engine"
+ ],
+ "stdout": []
+ },
{
"argv": "connectors",
"exitCode": 1,
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index b449b5cba0..5cb0ff7ef2 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 198663,
- "stdoutSha256": "f4ab69309b217f6abb19b58b29d9d39cc5ee4b486b2f9b43d887f7dde7bf9d9e",
+ "stdoutBytes": 197118,
+ "stdoutSha256": "ce99e077240ea4576ae5892cf07f8af2e7a5b37fec963ab6bdaf1d06e4abf122",
"toolNames": [
"remember",
"entity",
@@ -164,7 +164,7 @@
],
"tools": [
{
- "description": "MEMORY VERB (v1): save one fact (or up to 20 with items); provenance required. Set `entity` when the fact has a subject, or entity-scoped recall misses it. Branch on `status` (inserted|duplicate|superseded). write_pending carries a receipt: poll get_write_request.",
+ "description": "MEMORY VERB (v1): save one fact; provenance required. Set `entity` when the fact has a subject, or entity-scoped recall misses it. Branch on `status` (inserted|duplicate|superseded). write_pending carries a receipt: poll get_write_request.",
"idempotent": true,
"local_only": false,
"mutating": true,
@@ -195,7 +195,7 @@
"type": "string"
},
"fact": {
- "description": "One claim (or use items).",
+ "description": "One claim.",
"type": "string"
},
"force": {
@@ -207,53 +207,8 @@
"type": "boolean"
},
"items": {
- "description": "Save up to 20 facts in one call (e.g. before context compaction); each item takes fact plus optional entity, kind, ttl, visibility, provenance (defaults to the top-level provenance). Use instead of fact.",
+ "description": "Up to 20 facts in one call (e.g. before compaction) instead of fact: [{fact, entity?, kind?, ttl?, provenance?}].",
"items": {
- "additionalProperties": false,
- "properties": {
- "entity": {
- "description": "Who or what it is about.",
- "type": "string"
- },
- "fact": {
- "description": "One claim.",
- "type": "string"
- },
- "infer_entity": {
- "description": "Default true.",
- "type": "boolean"
- },
- "kind": {
- "description": "Default fact.",
- "enum": [
- "event",
- "preference",
- "commitment",
- "belief",
- "fact"
- ],
- "type": "string"
- },
- "provenance": {
- "description": "Overrides the top-level provenance.",
- "type": "string"
- },
- "ttl": {
- "description": "\"30d\", \"12h\" or ISO time.",
- "type": "string"
- },
- "visibility": {
- "description": "Default world.",
- "enum": [
- "world",
- "private"
- ],
- "type": "string"
- }
- },
- "required": [
- "fact"
- ],
"type": "object"
},
"type": "array"
@@ -5215,7 +5170,7 @@
"scope": "read"
},
{
- "description": "MEMORY VERB (v1): the always-loaded core block plus budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction; omit entities for core only.",
+ "description": "MEMORY VERB (v1): core memory plus budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.",
"idempotent": true,
"local_only": false,
"mutating": false,
@@ -5235,7 +5190,7 @@
"type": "number"
},
"entities": {
- "description": "Comma-separated names or slugs (max 8); omit for the core block only.",
+ "description": "Comma-separated names or slugs (max 8); omit for core only.",
"type": "string"
},
"include_private": {
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index d406488d43..387cf55e1b 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -1526,6 +1526,7 @@
"bad_config": [],
"chars_limit": 4000,
"chars_used": 0,
+ "compiled": [],
"docs": "docs/guides/core-memory.md",
"enabled": true,
"pages": 0
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 7c60f5b35c..a074b7510a 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -1603,6 +1603,7 @@
"bad_config": [],
"chars_limit": 4000,
"chars_used": 0,
+ "compiled": [],
"docs": "docs/guides/core-memory.md",
"enabled": true,
"pages": 0
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 9ebd3e303b..26fc0e66aa 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -497,19 +497,19 @@
},
{
"category": "ops",
- "message": "RLS enabled on 103/103 public tables",
+ "message": "RLS enabled on 104/104 public tables",
"name": "rls",
"status": "ok"
},
{
"category": "meta",
- "message": "Version 200 (latest: 200)",
+ "message": "Version 201 (latest: 201)",
"name": "schema_version",
"status": "ok"
},
{
"category": "meta",
- "message": "859 column(s) verified against live schema",
+ "message": "869 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
@@ -1589,6 +1589,21 @@
"name": "planner_stats_stale",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "bad_config": [],
+ "chars_limit": 4000,
+ "chars_used": 0,
+ "compiled": [],
+ "docs": "docs/guides/core-memory.md",
+ "enabled": true,
+ "pages": 0
+ },
+ "message": "No core pages. Start one with gbrain core init, then fill it in with the user.",
+ "name": "core_memory",
+ "status": "ok"
+ },
{
"category": "ops",
"message": "Mode: conservative (no per-key overrides — mode bundle is canonical).",
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index fb4aa5732c..8331cfd024 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -5542,7 +5542,7 @@
"kind": "type",
"name": "ErrorCode",
"signature": [
- "\"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | (string & {})"
+ "\"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | (string & {})"
]
},
{
@@ -5625,7 +5625,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
+ "canonical?: \"unknown\" | \"projection_pending\" | \"timeout\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"rate_limited\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"ambiguous_id\" | \"ambiguous_skill\" | \"api_not_enabled\" | \"approval_required\" | \"autopilot_job_owned_by_other_brain\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"consent_timeout\" | \"content_rejected\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cycle_failed\" | \"d_sel_too_small\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"dirty_tree\" | \"effect_not_failed\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_disabled\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"facts_absorb_write_refused\" | \"facts_payload_expired\" | \"fetch_failed\" | \"file_too_large\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"git_index_locked\" | \"git_index_stale\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"graph_incomplete\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_client\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"local_conflict\" | \"lock_busy\" | \"managed_pull_skipped\" | \"method_not_allowed\" | \"migration_failed\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"parse_error\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"pending_writes\" | \"pglite_busy\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"publication_pending\" | \"redirect_uri_mismatch\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"resume_spec_mismatch\" | \"revision_unavailable\" | \"scope_missing\" | \"serve_port_in_use\" | \"serve_status_only\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"source_binding_required\" | \"source_id_taken\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_in_progress\" | \"sync_parser_regression\" | \"target_escape\" | \"topology_change_required\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"upstream\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_provenance\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
@@ -5641,9 +5641,9 @@
"receiptFields?: { operation: string; source_id: string; slug: string | null; principal_kind: string; principal_id: string; } | undefined",
"stack?: string | undefined",
"suggestion?: string | undefined",
- "toJSON: () => { contract_version?: 1 | undefined; notices?: unknown[] | undefined; fix?: unknown; why?: string | undefined; reason?: string | undefined; write_error?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | undefined; write_request?: WriteReceipt | undefined; error: ErrorCode; code: string; message: string; suggestion: string | undefined; docs: string | undefined; detail: string | undefined; protocol_version: number | undefined; }",
+ "toJSON: () => { contract_version?: 1 | undefined; notices?: unknown[] | undefined; fix?: unknown; why?: string | undefined; reason?: string | undefined; write_error?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | undefined; write_request?: WriteReceipt | undefined; error: ErrorCode; code: string; message: string; suggestion: string | undefined; docs: string | undefined; detail: string | undefined; protocol_version: number | undefined; }",
"why?: string | undefined",
- "writeError?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | undefined",
+ "writeError?: \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | undefined",
"writeRequest?: WriteReceipt | undefined"
],
"name": "OperationError",
diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.json
index cf2a1f2cdc..b23f6ec864 100644
--- a/test/fixtures/goldens/migrations/records.json
+++ b/test/fixtures/goldens/migrations/records.json
@@ -2974,8 +2974,8 @@
"idempotent": true,
"name": "core_edit_notices",
"sql": {
- "length": 697,
- "sha256": "f58ea30f1ad5cb36a8953d7b5bde21b068e0207a3a32045a129571687ae356f9"
+ "length": 721,
+ "sha256": "d025431d38cc094b0f5ea0b852fa2a8c288a67c10c61cdb5a16c72bee8e7dd1f"
},
"sqlFor": "absent",
"transaction": "absent",
diff --git a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
index 40df5ecbfd..7681b8f54b 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -32,6 +32,7 @@
"context_volunteer_events.context_volunteer_events_pkey": "p PRIMARY KEY (id)",
"conversation_parser_llm_cache.conversation_parser_llm_cache_call_shape_check": "c CHECK ((call_shape = ANY (ARRAY['polish'::text, 'fallback'::text])))",
"conversation_parser_llm_cache.conversation_parser_llm_cache_pkey": "p PRIMARY KEY (content_sha256, model_id, call_shape)",
+ "core_edit_notices.core_edit_notices_pkey": "p PRIMARY KEY (id)",
"decide_calibrations.decide_calibrations_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_pkey": "p PRIMARY KEY (id)",
"decide_proposals.decide_proposals_sweep_id_pair_index_key": "u UNIQUE (sweep_id, pair_index)",
@@ -369,6 +370,9 @@
"conversation_parser_llm_cache": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "core_edit_notices": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"decide_calibrations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -672,6 +676,8 @@
"context_volunteer_events_src_slug_idx": "CREATE INDEX context_volunteer_events_src_slug_idx ON public.context_volunteer_events USING btree (source_id, slug)",
"context_volunteer_events_src_time_idx": "CREATE INDEX context_volunteer_events_src_time_idx ON public.context_volunteer_events USING btree (source_id, volunteered_at DESC)",
"conversation_parser_llm_cache_pkey": "CREATE UNIQUE INDEX conversation_parser_llm_cache_pkey ON public.conversation_parser_llm_cache USING btree (content_sha256, model_id, call_shape)",
+ "core_edit_notices_pending_idx": "CREATE INDEX core_edit_notices_pending_idx ON public.core_edit_notices USING btree (source_id, slug, id) WHERE (acked_at IS NULL)",
+ "core_edit_notices_pkey": "CREATE UNIQUE INDEX core_edit_notices_pkey ON public.core_edit_notices USING btree (id)",
"decide_calibrations_lookup_idx": "CREATE INDEX decide_calibrations_lookup_idx ON public.decide_calibrations USING btree (slot, provider, model_resolved, created_at DESC)",
"decide_calibrations_pkey": "CREATE UNIQUE INDEX decide_calibrations_pkey ON public.decide_calibrations USING btree (id)",
"decide_proposals_pkey": "CREATE UNIQUE INDEX decide_proposals_pkey ON public.decide_proposals USING btree (id)",
@@ -989,6 +995,7 @@
"code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",
"content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id",
"context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id",
+ "core_edit_notices_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=core_edit_notices.id",
"decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
@@ -1255,6 +1262,21 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "core_edit_notices": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('core_edit_notices_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 slug text/text NOT NULL",
+ "4 page_id bigint/int8 NULL",
+ "5 revision text/text NULL",
+ "6 base_revision text/text NULL",
+ "7 base_text text/text NULL",
+ "8 actor text/text NOT NULL",
+ "9 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "10 acked_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"decide_calibrations": {
"columns": [
"1 id bigint/int8 NOT NULL DEFAULT nextval('decide_calibrations_id_seq'::regclass)",
diff --git a/test/mcp-schema-budget.test.ts b/test/mcp-schema-budget.test.ts
index 4a7eff8069..b37f6768f3 100644
--- a/test/mcp-schema-budget.test.ts
+++ b/test/mcp-schema-budget.test.ts
@@ -47,14 +47,18 @@ const INSTRUCTIONS_MAX_CHARS = 4_628;
const DESCRIPTION_HARD_CAP = 1_200;
const PARAM_DESCRIPTION_HARD_CAP = 200;
-/** Per-tool budget: JSON.stringify of the served tool definition. */
+/**
+ * Per-tool budget: JSON.stringify of the served tool definition.
+ * remember 1370 -> 1500: the additive `items` batch param (save up to 20 facts
+ * before compaction), measured at 1,499; the served starter list stays under 25,000.
+ */
const TOOL_BUDGETS: Record<string, number> = {
add_timeline_entry: 640, cancel_job: 270, cancel_write_request: 350, capture: 1250, context_pack: 760,
delete_skill: 810, delta: 830, edit_page: 1090, entity: 460, find_anomalies: 520, forget: 560, get_agent_job: 270,
get_backlinks: 430, get_ingest_log: 280, get_page: 810, get_recent_salience: 660, get_skill: 910,
get_skill_asset: 790, get_write_request: 330, join_brain: 560, leave_brain: 540, list_brain_skillpack: 230,
list_link_sources: 220, list_pages: 1090, list_skills: 670, list_write_requests: 450, put_page: 1320,
- put_skill: 1420, query: 3250, recall: 1590, remember: 1370, request_tools: 560, resolve_slugs: 410, search: 1760,
+ put_skill: 1420, query: 3250, recall: 1590, remember: 1500, request_tools: 560, resolve_slugs: 410, search: 1760,
submit_agent: 750, sync_brain_skills: 770, synthesize: 550, traverse_graph: 680, whoami: 230,
};