Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
core_memory doctor check, gbrain core help line, goldens; core CLI/notice/sensitivity/batch integration tests
garrytan3c0f1ec36c59
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsvindex f1b9abd622..e40abe7c4e 100644--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@ -3,7 +3,7 @@# Raising a ceiling is a conscious, reviewer-visible act. Lower ceilings in# the same commit as any peel (the guard fails on >50 lines of stale slack).# Columns: path max_lines policy note-src/cli.ts 3199 ratchet +3 agent operator gate fixes: repair-failed connect wrapper (logic in cli/cli-error.ts exitOnRepairFailed), transcripts recent through a live serve (logic in commands/transcripts.ts), pre-connect status reason (logic in commands/serve-status.ts); +23 merged from the collector (Lanes B/E/F: thin-client token reason, status-only serve hand-off, jobs/sync readiness wiring); +9 agent operator wave D3/D4: curated --help short-circuit (renderer in cli/help/render.ts), curated flag-value validation call (cli/help/validate.ts), table-dispatched SELF_HELP_WITHOUT_ENGINE entries for the selfHelp flips; +5 agent operator wave C10 (merged from the collector): serve --fail-fast in the connect-failure path; +31 #5950 (D6): connectEngine thin-client backstop, engine-free MCP-twin dispatch, recall/advisor/export refusal hints, refusal fix subcommand (lowered to 3131 by D1's renderCliError seam first); +2 agent operator wave A4: observational startup (probe-only connect for startup:observational commands; completeEngineStartup split out of connectEngine, exposed as ctx.completeStartup); +2 fix wave 5 (#5401): projections drain help line and thin-client hint; +2 (#5137) key-shadow warning seam, logic in ai/key-warnings.ts; +2 System One v1: decide help line + thin-client refusal hint; refactor wave 1 split target (W4 cli); ceiling rationale: docs/architecture/key-files/entrypoints-and-docs.md entry for src/cli.ts; evidence delivery: thin-client return_unit version-skew warning (+3; logic in search/evidence-delivery.ts); put stdin recovery (#5700): stdin hint in the --content requires-a-value error and stdin usage/required text in printOpHelp (+7); logic in persistence/deactivation.ts); +36 #5827: link-command help examples, local --source vs --source-id/--all-sources conflict check, ambient-binding return from applyThinClientSourceScope (logic in cli/source-scope.ts); +4 #5232: write-wait import, reporter-owned verdict in the op catch, thin-client writeWaitMs, ctx.writeWaitMs (logic in persistence/write-wait.ts); +1 #4768: serve --access help line; +4 #5433: list_pages TSV cell escaping in formatResult; +2 #lane-h pricing: help line + thin-client refusal hint for `gbrain pricing`; +2 fix wave 5 (#5401): projections drain help line and thin-client hint; +2 (#5137) key-shadow warning seam, logic in ai/key-warnings.ts; +2 System One v1: decide help line + thin-client refusal hint; refactor wave 1 split target (W4 cli); ceiling rationale: docs/architecture/key-files/entrypoints-and-docs.md entry for src/cli.ts; evidence delivery: thin-client return_unit version-skew warning (+3; logic in search/evidence-delivery.ts); put stdin recovery (#5700): stdin hint in the --content requires-a-value error and stdin usage/required text in printOpHelp (+7); logic in persistence/deactivation.ts); +36 #5827: link-command help examples, local --source vs --source-id/--all-sources conflict check, ambient-binding return from applyThinClientSourceScope (logic in cli/source-scope.ts); +4 #5433: list_pages TSV cell escaping in formatResult; +1 #5984: a strict run deadline when no progress window is set; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (3199 measured)+src/cli.ts 3200 ratchet +3 agent operator gate fixes: repair-failed connect wrapper (logic in cli/cli-error.ts exitOnRepairFailed), transcripts recent through a live serve (logic in commands/transcripts.ts), pre-connect status reason (logic in commands/serve-status.ts); +23 merged from the collector (Lanes B/E/F: thin-client token reason, status-only serve hand-off, jobs/sync readiness wiring); +9 agent operator wave D3/D4: curated --help short-circuit (renderer in cli/help/render.ts), curated flag-value validation call (cli/help/validate.ts), table-dispatched SELF_HELP_WITHOUT_ENGINE entries for the selfHelp flips; +5 agent operator wave C10 (merged from the collector): serve --fail-fast in the connect-failure path; +31 #5950 (D6): connectEngine thin-client backstop, engine-free MCP-twin dispatch, recall/advisor/export refusal hints, refusal fix subcommand (lowered to 3131 by D1's renderCliError seam first); +2 agent operator wave A4: observational startup (probe-only connect for startup:observational commands; completeEngineStartup split out of connectEngine, exposed as ctx.completeStartup); +2 fix wave 5 (#5401): projections drain help line and thin-client hint; +2 (#5137) key-shadow warning seam, logic in ai/key-warnings.ts; +2 System One v1: decide help line + thin-client refusal hint; refactor wave 1 split target (W4 cli); ceiling rationale: docs/architecture/key-files/entrypoints-and-docs.md entry for src/cli.ts; evidence delivery: thin-client return_unit version-skew warning (+3; logic in search/evidence-delivery.ts); put stdin recovery (#5700): stdin hint in the --content requires-a-value error and stdin usage/required text in printOpHelp (+7); logic in persistence/deactivation.ts); +36 #5827: link-command help examples, local --source vs --source-id/--all-sources conflict check, ambient-binding return from applyThinClientSourceScope (logic in cli/source-scope.ts); +4 #5232: write-wait import, reporter-owned verdict in the op catch, thin-client writeWaitMs, ctx.writeWaitMs (logic in persistence/write-wait.ts); +1 #4768: serve --access help line; +4 #5433: list_pages TSV cell escaping in formatResult; +2 #lane-h pricing: help line + thin-client refusal hint for `gbrain pricing`; +2 fix wave 5 (#5401): projections drain help line and thin-client hint; +2 (#5137) key-shadow warning seam, logic in ai/key-warnings.ts; +2 System One v1: decide help line + thin-client refusal hint; refactor wave 1 split target (W4 cli); ceiling rationale: docs/architecture/key-files/entrypoints-and-docs.md entry for src/cli.ts; evidence delivery: thin-client return_unit version-skew warning (+3; logic in search/evidence-delivery.ts); put stdin recovery (#5700): stdin hint in the --content requires-a-value error and stdin usage/required text in printOpHelp (+7); logic in persistence/deactivation.ts); +36 #5827: link-command help examples, local --source vs --source-id/--all-sources conflict check, ambient-binding return from applyThinClientSourceScope (logic in cli/source-scope.ts); +4 #5433: list_pages TSV cell escaping in formatResult; +1 #5984: a strict run deadline when no progress window is set; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (3199 measured); +1 core memory help linesrc/commands/autopilot.ts 1642 ratchet refactor wave 1 split target (W4 autopilot, cut line); ceiling rationale: docs/architecture/key-files/commands-1.md entry for src/commands/autopilot.ts; +2 fix wave 5: nosemgrep justifications on the per-brain job launchctl/systemctl calls (#5195); +2 #5813: boot reconcile names attempted and running versions in log + audit; +2 #5855: Bun floor gate before the swap and the swap-refusal hold (logic in core/bun-floor.ts); +3 agent operator wave E9: --dry-run and the persistent_install consent gate before anything is written (logic in autopilot/install-consent.ts)src/commands/doctor.ts 667 ratchet +1 agent operator gate fixes: --probe consent gate (logic in doctor/probe-consent.ts); refactor wave 1 split target (W4 doctor); ceiling rationale: docs/architecture/key-files/commands-2.md entry for src/commands/doctor.tssrc/commands/embed.ts 2219 ratchet +2 agent operator wave D2: --json failure envelope via writeCliError; lowered v0.46.26.0: embedBatchWithBackoff + retry cluster peeled to core/embed-retry.ts (core/commands layering fix); grown wave-g (#4530): per-model input-limit wiring; wave-k #3622 reimpl: --stale zero-progress failure quarantine; +29 #4668 (#4530): oversize-heal call sites in both --stale drains — kept low by peeling the healed-row remap to core/embed-oversize-heal.ts (shared with embed-stale.ts); +35 #4647 (refs #4599): per-tick timeout+abort on the single-flight lock heartbeat refresh (interval deliberately NOT unref'd); +122 refs #4599: stall-watchdog race around the drain + shared idempotent flushAndRelease + CLI stall exit mapping (watchdog machinery itself lives in core/embed-stall.ts); +12: adversarial-review hardening (healed_splits progress key + heal-tick comment); #5105: guarded derived projection preparation and read seals; #5105: conditional embedding installer wiring; archived eligibility: active-only dispatch with honest stranded-work reporting; explicit archived admission: live-source snapshots and honest refused-installation failures; +2 fw3: embed --stale --images dispatch (sweep lives in core/embed-stale-images.ts); +5 #5289: dry run reports restamp-only chunks apart from chunks to embed (count lives in core/embedding-invalidation.ts); +6 #4616: keep a partially refused batch in embedPageTexts and name the recovery command in failure samples (guard lives in core/ai/embedding-guard.ts); +5 #5226: embed summary counts distinct pages; +3 #5804: null projection snapshot counted as a failure with one batch summary in embed --stale; +18 wave 8 lane D1: #5527 mixed-space warning subtracts current-model chunks (+4), #5885 takes option/result fields and the stale-drain takes call (pass lives in core/embed-takes.ts); +9 Foundations 1 F4d: time-budget stop result fields, stdout verdict and stop recording in embed --stale (logic in core/embed-budget-stop.ts)diff --git a/src/cli.ts b/src/cli.tsindex ad39bb129f..fac0c34c74 100755--- a/src/cli.ts+++ b/src/cli.ts@@ -3058,6 +3058,7 @@ OPEN LOOPS (Gmail/Calendar/Contacts connector — v0.47)google connect|status|disconnect Connect/inspect/remove a Google account (idempotent; --json)waiting [--top N] [--json] Who is waiting on you, what you promised, context to respondloops list|show|done|drop|mute Inspect and manage open loops (mute sender <email>)+ core list|show|status|add|remove Always-loaded core memory (also diff|ack|init|suggest)creds list|remove|export|import Generic credential vault (redacted output; encrypted bundles)BRAIN (capture / ideate / explore — v0.37/v0.38)diff --git a/src/commands/doctor/checks/core-memory.ts b/src/commands/doctor/checks/core-memory.tsnew file mode 100644index 0000000000..354edd241d--- /dev/null+++ b/src/commands/doctor/checks/core-memory.ts@@ -0,0 +1,85 @@+/**+ * core_memory: always-loaded core memory health (docs/guides/core-memory.md).+ * Warns when core is over its brain-wide budget (owner git edits may push it+ * there), when a stored core/pressure setting is out of range (the readers+ * fall back to the default), when the delivery sensitivity policy withholds a+ * core page, when remote edits wait for review, and when core pages exist but+ * no session-start delivered them in the last week.+ */+import type { BrainEngine } from '../../../core/engine.ts';+import type { Check } from '../../doctor.ts';+import { connectedEngine, type DoctorContext, type DoctorEntry } from '../context.ts';+import { agentFix } from '../check-fix.ts';+import {+ CORE_CONFIG_KEYS, CORE_DOCS, coreUsage, loadCoreBlock, pendingCoreNotices, readCoreSettings, validateCoreConfigValue,+} from '../../../core/core-memory.ts';+import { PRESSURE_CONFIG_KEYS, validatePressureConfigValue } from '../../../core/context/pressure.ts';+import { readHeartbeatTail } from '../../../core/context/hook-heartbeat.ts';++const DELIVERY_WINDOW_MS = 7 * 24 * 60 * 60 * 1000;++export async function coreMemoryCheck(engine: BrainEngine): Promise<Omit<Check, 'name'>> {+ const settings = await readCoreSettings(engine);+ const usage = await coreUsage(engine);+ const problems: string[] = [];+ const badConfig: string[] = [];+ for (const key of [...Object.values(CORE_CONFIG_KEYS), ...Object.values(PRESSURE_CONFIG_KEYS)]) {+ const value = await engine.getConfig(key).catch(() => null);+ if (value == null) continue;+ const problem = validateCoreConfigValue(key, value) ?? validatePressureConfigValue(key, value);+ if (problem) badConfig.push(`${key}=${value} is ignored (${problem})`);+ }+ if (usage.pages.length === 0) {+ return {+ status: badConfig.length ? 'warn' : 'ok',+ message: badConfig.length ? `No core pages. ${badConfig.join('; ')}.` : 'No core pages. Start one with gbrain core init, then fill it in with the user.',+ details: { pages: 0, chars_used: 0, chars_limit: settings.maxChars, enabled: settings.enabled, bad_config: badConfig, docs: CORE_DOCS },+ };+ }+ const block = await loadCoreBlock(engine, { excludePrivate: true, settings });+ const withheld = block.omitted.filter(o => o.reason === 'withheld');+ const notices = await pendingCoreNotices(engine);+ const over = usage.chars - settings.maxChars;+ const largest = [...usage.pages].sort((a, b) => b.chars - a.chars)[0]!;+ if (over > 0) problems.push(`core is ${usage.chars} chars, over the ${settings.maxChars}-char budget by ${over}, so sessions get a truncated block; shorten the largest page (${largest.source_id}:${largest.slug}, ${largest.chars} chars) or raise memory.core.max_chars`);+ problems.push(...badConfig);+ if (withheld.length) problems.push(`${withheld.length} core page(s) withheld from delivery for sensitive content: ${withheld.map(w => `${w.source_id}:${w.slug}`).join(', ')}`);+ if (notices.length) problems.push(`${notices.length} remote edit(s) to core pages await the user's review (gbrain core diff, then gbrain core ack)`);+ let delivered: boolean | null = null;+ if (settings.enabled) {+ try {+ const cutoff = Date.now() - DELIVERY_WINDOW_MS;+ const tail = await readHeartbeatTail(2000);+ delivered = tail.some(e => e.event === 'session-start' && typeof e.core_chars === 'number' && Date.parse(e.ts) >= cutoff);+ // Only hook-wired installs write heartbeats; with none at all, delivery is unknown rather than missing.+ if (!tail.some(e => e.event === 'session-start' && Date.parse(e.ts) >= cutoff)) delivered = null;+ } catch { delivered = null; }+ if (delivered === false) problems.push('session-start hooks ran this week but none delivered core; restart the gbrain MCP server so the hook gets the core-aware serve');+ }+ const details = {+ enabled: settings.enabled, pages: usage.pages.length, chars_used: usage.chars, chars_limit: settings.maxChars, remote_edit: settings.remoteEdit,+ revision: block.revision, withheld, pending_notices: notices.length, delivered_last_7d: delivered, bad_config: badConfig, docs: CORE_DOCS,+ };+ if (!problems.length) {+ return { status: 'ok', message: `Core memory ${settings.enabled ? 'on' : 'off'}: ${usage.pages.length} page(s), ${usage.chars}/${settings.maxChars} chars.`, details };+ }+ return {+ status: 'warn', details,+ message: `Core memory: ${problems.join('; ')}.`,+ fix: agentFix(['gbrain', 'core', 'status', '--json'], 'Shows core usage, withheld pages and pending remote edits, read-only.', 'core_memory'),+ };+}++async function runCoreMemory(ctx: DoctorContext): Promise<Check[]> {+ const engine = connectedEngine(ctx);+ const checks: Check[] = [];+ ctx.progress.heartbeat('core_memory');+ try {+ checks.push({ name: 'core_memory', ...await coreMemoryCheck(engine) });+ } catch (err) {+ checks.push({ name: 'core_memory', status: 'warn', message: `Core memory could not be checked: ${err instanceof Error ? err.message : String(err)}. Health is unknown.` });+ }+ return checks;+}++export const coreMemoryEntry: DoctorEntry = { name: 'core_memory', emits: ['core_memory'], run: runCoreMemory };diff --git a/src/commands/doctor/registry.ts b/src/commands/doctor/registry.tsindex c20b98d777..0007156d1a 100644--- a/src/commands/doctor/registry.ts+++ b/src/commands/doctor/registry.ts@@ -86,6 +86,7 @@ import { autoChronicleEntry } from './checks/auto-chronicle.ts';import { factTakeVectorsEntry } from './checks/vector-coverage.ts';import { decideHealthEntry } from './checks/decide.ts';import { unlinkedFactsEntry } from './checks/unlinked-facts.ts';+import { coreMemoryEntry } from './checks/core-memory.ts';import { plannerStatsEntry } from './checks/planner-stats.ts';import { harnessWiringDoctorEntry } from './checks/harness-wiring.ts';import { agentContractEntry } from './checks/agent-contract.ts';@@ -154,6 +155,7 @@ export const DOCTOR_CHECK_REGISTRY: readonly DoctorEntry[] = [autoChronicleEntry,factTakeVectorsEntry,plannerStatsEntry,+ coreMemoryEntry,searchModeEntry,];diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.tsindex 2d5e29ccc5..fab81a6e62 100644--- a/src/core/cli-flag-registry.generated.ts+++ b/src/core/cli-flag-registry.generated.ts@@ -47,7 +47,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'creds': ['--allow-create-db', '--allow-docker', '--brain', '--chat-model', '--content-root', '--db-only', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--ids', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--out', '--passphrase-env', '--path', '--pglite', '--prefer-postgres', '--provenance', '--provider', '--query', '--schema-pack', '--scopes', '--skip-embed-check', '--source', '--status', '--supabase', '--to', '--url', '--version'],'db-repair': ['--accept-pending', '--apply', '--apply-rewrites', '--background', '--brain', '--break-lock', '--db-url', '--dry-run', '--explain', '--filter', '--follow', '--force', '--force-retry', '--format', '--help', '--http', '--json', '--locks', '--name', '--no-accept-pending', '--path', '--prefer-postgres', '--probe', '--progress-interval', '--progress-json', '--quiet', '--remediate', '--restart', '--skip-verify', '--source', '--supabase', '--timeout', '--undo-last-rewrite', '--url', '--version', '--wait', '--yes'],'decide': ['--all', '--all-from', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--from', '--help', '--input', '--json', '--limit', '--min', '--out', '--provider', '--query', '--recommended', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--what-if-threshold', '--yes'],- 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--client', '--concurrency', '--confidence', '--confirm', '--content-audit', '--count', '--dataset', '--db-url', '--delete-brain', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--gbrain-bin', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--hard', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-cron', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-migrate', '--no-pull', '--no-renames', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--older-than', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--remediate', '--remediation-plan', '--remove', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--restore-only', '--resume', '--retry-failed', '--review-lower', '--scope', '--scopes', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-token', '--show-toplevel', '--since', '--skills', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-name', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--what-if-threshold', '--window', '--workers', '--working-tree', '--yes'],+ 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--client', '--concurrency', '--confidence', '--confirm', '--content-audit', '--count', '--dataset', '--db-url', '--delete-brain', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--gbrain-bin', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--hard', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-cron', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-migrate', '--no-pull', '--no-renames', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--older-than', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--remediate', '--remediation-plan', '--remove', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--restore-only', '--resume', '--retry-failed', '--review-lower', '--revision', '--scope', '--scopes', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-token', '--show-toplevel', '--since', '--skills', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-name', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--what-if-threshold', '--window', '--workers', '--working-tree', '--yes'],'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--force-retry', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--help', '--http', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-facts', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--pace', '--pace-max-concurrency', '--path', '--priority', '--progress-interval', '--progress-json', '--quiet', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--wait', '--yes'],diff --git a/src/core/doctor-categories.ts b/src/core/doctor-categories.tsindex a3d3ec27b3..294afca845 100644--- a/src/core/doctor-categories.ts+++ b/src/core/doctor-categories.ts@@ -113,6 +113,7 @@ export const BRAIN_CHECK_NAMES: ReadonlySet<string> = new Set(['frontmatter_repairable','malformed_path_pages','memory_writeback',+ 'core_memory','grade_confidence_drift','graph_coverage','graph_signals_coverage',diff --git a/test/cli-dispatch-phase.test.ts b/test/cli-dispatch-phase.test.tsindex 2a6e5666b5..8c130b07ff 100644--- a/test/cli-dispatch-phase.test.ts+++ b/test/cli-dispatch-phase.test.ts@@ -89,7 +89,7 @@ describe('CLI dispatch shape (master AST)', () => {const shape = await expectNormalizerStable(extractCliDispatch, astNormalizer);expect(shape.sets.CLI_ONLY).toEqual([...CLI_ONLY].sort());expect(shape.sets.THIN_CLIENT_REFUSED_COMMANDS).toEqual([...THIN_CLIENT_REFUSED_COMMANDS].sort());- expect(shape.switchCases.length).toBe(63);+ expect(shape.switchCases.length).toBe(64);expect(Object.keys(shape.commands).length).toBeGreaterThanOrEqual(shape.sets.CLI_ONLY.length);});diff --git a/test/core-cli.test.ts b/test/core-cli.test.tsnew file mode 100644index 0000000000..107e8f54c6--- /dev/null+++ b/test/core-cli.test.ts@@ -0,0 +1,164 @@+/**+ * Always-loaded core memory surfaces over the real write path: the+ * `gbrain core` CLI (add/remove/status/diff/ack), notices and the delivery+ * sensitivity policy in the rendered block, the core_memory doctor check,+ * and `remember` with items[]. PGLite in-memory ($0).+ */+import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test as bunTest } from 'bun:test';+import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';+import { randomUUID } from 'node:crypto';+import { PGLiteEngine } from '../src/core/pglite-engine.ts';+import { resetPgliteState } from './helpers/reset-pglite.ts';+import { withEnv } from './helpers/with-env.ts';+import { dispatchToolCall } from '../src/mcp/dispatch.ts';+import { registerLocalWriter, withVerifiedLocalRegistration, type LocalRegistration } from '../src/core/persistence/identity.ts';+import { disposePersistenceConsumer } from '../src/core/persistence/service.ts';+import { _resetWriteThroughCacheForTest } from '../src/core/write-through.ts';+import { listCorePages, loadCoreBlock } from '../src/core/core-memory.ts';+import { runCore } from '../src/commands/core.ts';+import { coreMemoryCheck } from '../src/commands/doctor/checks/core-memory.ts';++let engine: PGLiteEngine;+let fixture: string;+let remoteRegistration: LocalRegistration;+let cliRegistration: LocalRegistration;+const remoteAuth = { token: 'fixture', clientId: 'fixture-client', scopes: ['read', 'write'], sourceId: 'default' };++beforeAll(async () => { engine = new PGLiteEngine(); await engine.connect({}); await engine.initSchema(); }, 120_000);+afterAll(async () => { await engine.disconnect(); });+beforeEach(async () => {+ await disposePersistenceConsumer(engine);+ await resetPgliteState(engine);+ _resetWriteThroughCacheForTest();+ fixture = mkdtempSync(join(tmpdir(), 'gb-core-cli-'));+ mkdirSync(join(fixture, 'brain'));+ await engine.setConfig('sync.repo_path', join(fixture, 'brain'));+});+afterEach(async () => { await disposePersistenceConsumer(engine); rmSync(fixture, { recursive: true, force: true }); });++function test(name: string, run: () => Promise<void>, timeout = 30_000) {+ bunTest(name, () => withEnv({ GBRAIN_HOME: join(fixture, 'home') }, async () => {+ remoteRegistration = await registerLocalWriter(engine, 'stdio', { sourceIds: ['*'], operations: null, scopes: ['read', 'write'], slugPrefixes: null });+ cliRegistration = await registerLocalWriter(engine, 'cli');+ try { await run(); } finally { await disposePersistenceConsumer(engine); }+ }), timeout);+}++async function call(name: string, params: Record<string, unknown>, remote = true) {+ const response = await withVerifiedLocalRegistration(engine, remote ? remoteRegistration : cliRegistration, () => dispatchToolCall(engine, name, params, {+ remote, config: { engine: 'pglite' }, sourceId: 'default', ...(remote ? { auth: remoteAuth } : {}),+ logger: { info() {}, warn() {}, error() {} },+ }));+ const text = (response.content[0] as { text: string }).text;+ return { isError: response.isError === true, body: JSON.parse(text), text };+}+const page = (title: string, body: string, fm: Record<string, unknown> = {}) =>+ `---\ntitle: ${title}\ntype: note\n${Object.entries(fm).map(([k, v]) => `${k}: ${v}`).join('\n')}${Object.keys(fm).length ? '\n' : ''}---\n\n${body}\n`;+async function put(slug: string, content: string, remote: boolean, extra: Record<string, unknown> = {}) {+ return call('put_page', { slug, content, request_id: randomUUID(), ...extra }, remote);+}+async function revision(slug: string) {+ const r = await call('get_page', { slug, include_content: true }, false);+ return r.body.revision as string;+}+const corePages = async () => (await listCorePages(engine)).map(p => p.slug).sort();++async function cli(args: string[]): Promise<{ out: string; err: string }> {+ const out: string[] = [];+ const err: string[] = [];+ const log = console.log, error = console.error;+ console.log = (...a: unknown[]) => { out.push(a.join(' ')); };+ console.error = (...a: unknown[]) => { err.push(a.join(' ')); };+ try { await withVerifiedLocalRegistration(engine, cliRegistration, () => runCore(engine, args)); }+ finally { console.log = log; console.error = error; }+ return { out: out.join('\n'), err: err.join('\n') };+}++describe('gbrain core CLI', () => {+ test('add, list, status, remove round-trip through put_page as the owner', async () => {+ await put('notes/prefs', page('Working preferences', 'Prefers short answers.'), false);+ expect((await cli(['add', 'notes/prefs', '--priority', '5'])).out).toContain('Now in core: default:notes/prefs');+ expect(await corePages()).toEqual(['notes/prefs']);+ const listed = JSON.parse((await cli(['list', '--json'])).out);+ expect(listed.pages).toEqual([expect.objectContaining({ slug: 'notes/prefs', priority: 5 })]);+ const status = JSON.parse((await cli(['status', '--json'])).out);+ expect(status).toMatchObject({ enabled: true, pages: 1, chars_limit: 4000, over_budget: false });+ expect((await cli(['add', 'notes/prefs', '--priority', '5'])).out).toContain('Already in core');+ expect((await cli(['remove', 'notes/prefs'])).out).toContain('Now out of core');+ expect(await corePages()).toEqual([]);+ expect((await cli(['add', 'notes/missing'])).err).toContain('No live page default:notes/missing');+ });++ test('init creates a marked starter page; the owner add is held to the budget', async () => {+ expect((await cli(['init'])).out).toContain('Created default:core/about-the-user');+ expect(await corePages()).toEqual(['core/about-the-user']);+ await engine.setConfig('memory.core.max_chars', '500');+ await put('notes/long', page('Long', 'x'.repeat(400)), false);+ expect((await cli(['add', 'notes/long'])).err).toContain('over the 500-char budget');+ expect(await corePages()).toEqual(['core/about-the-user']);+ });++ test('a remote edit shows a notice in the block until diff + ack', async () => {+ await put('people/alice-example', page('Alice Example', 'Prefers tea.', { always_load: true }), false);+ const rev = await revision('people/alice-example');+ await put('people/alice-example', page('Alice Example', 'Prefers coffee.'), true, { expected_revision: rev });+ const block = await loadCoreBlock(engine, { sessionSourceId: 'default' });+ expect(block.text).toContain('Core page default:people/alice-example was edited remotely');+ const diff = (await cli(['diff', 'people/alice-example'])).out;+ expect(diff).toContain('- Prefers tea.');+ expect(diff).toContain('+ Prefers coffee.');+ const current = await revision('people/alice-example');+ expect((await cli(['ack', 'people/alice-example', '--revision', current])).out).toContain('Acknowledged 1 edit');+ expect((await loadCoreBlock(engine, { sessionSourceId: 'default' })).text).not.toContain('edited remotely');+ });+});++describe('delivery sensitivity policy', () => {+ test('contact details are redacted in place; a credential withholds the page with a visible line', async () => {+ await put('notes/contact', page('Contact', 'Reach the user at [email protected].', { always_load: true }), false);+ await put('notes/key', page('Key', `Deploy key ghp_${'a1B2c3D4e5F6g7H8i9J0'.repeat(2)}`, { always_load: true }), false);+ const block = await loadCoreBlock(engine, { sessionSourceId: 'default' });+ expect(block.text).toContain('[redacted email]');+ expect(block.text).not.toContain('[email protected]');+ expect(block.text).toContain('[core page default:notes/key withheld: secret:');+ expect(block.text).not.toContain('ghp_');+ });+});++describe('core_memory doctor check', () => {+ test('ok when empty; warns over budget and on bad stored config', async () => {+ expect((await coreMemoryCheck(engine)).status).toBe('ok');+ await put('notes/a', page('A', 'y'.repeat(700), { always_load: true }), false);+ await engine.setConfig('memory.core.max_chars', '500');+ await engine.setConfig('memory.pressure.warn_ratio', '2');+ const check = await coreMemoryCheck(engine);+ expect(check.status).toBe('warn');+ expect(check.message).toContain('over the 500-char budget');+ expect(check.message).toContain('memory.pressure.warn_ratio=2 is ignored');+ });+});++describe('remember items[]', () => {+ test('saves each item, and a replay with the same request_id writes nothing new', async () => {+ const request_id = randomUUID();+ const params = { request_id, provenance: 'user said, 2026-10-04', items: [{ fact: 'Prefers tea over coffee', entity: 'people/alice-example' }, { fact: 'Ships on Fridays' }] };+ const first = await call('remember', params, true);+ expect({ isError: first.isError, text: first.text }).toMatchObject({ isError: false });+ expect(first.body).toMatchObject({ saved: 2, failed: 0, partial: false });+ const [{ n }] = await engine.executeRaw<{ n: number }>(`SELECT count(*)::int AS n FROM facts`);+ const replay = await call('remember', params, true);+ expect(replay.body.items.map((i: { request_id: string }) => i.request_id)).toEqual(first.body.items.map((i: { request_id: string }) => i.request_id));+ const [{ n: after }] = await engine.executeRaw<{ n: number }>(`SELECT count(*)::int AS n FROM facts`);+ expect(after).toBe(n);+ });++ test('one invalid item refuses the batch before any write', async () => {+ const bad = await call('remember', { provenance: 'p', items: [{ fact: 'ok' }, { fact: '' }] }, true);+ expect(bad.isError).toBe(true);+ expect(bad.text).toContain('items[1]');+ const [{ n }] = await engine.executeRaw<{ n: number }>(`SELECT count(*)::int AS n FROM facts`);+ expect(n).toBe(0);+ });+});diff --git a/test/fixtures/goldens/cli/dispatch-phase.json b/test/fixtures/goldens/cli/dispatch-phase.jsonindex 384db9576e..c09a030a1d 100644--- a/test/fixtures/goldens/cli/dispatch-phase.json+++ b/test/fixtures/goldens/cli/dispatch-phase.json@@ -456,6 +456,13 @@"thinClient": "none","thinClientRoutedSubcommands": []},+ "core": {+ "hasSwitchCase": true,+ "phase": "post-connect",+ "preConnectRules": [],+ "thinClient": "none",+ "thinClientRoutedSubcommands": []+ },"creds": {"hasSwitchCase": false,"phase": "pre-connect",diff --git a/test/fixtures/goldens/cli/help-and-errors.json b/test/fixtures/goldens/cli/help-and-errors.jsonindex 2dd82bd490..fd987de7bf 100644--- a/test/fixtures/goldens/cli/help-and-errors.json+++ b/test/fixtures/goldens/cli/help-and-errors.json@@ -118,6 +118,7 @@" google connect|status|disconnect Connect/inspect/remove a Google account (idempotent; --json)"," waiting [--top N] [--json] Who is waiting on you, what you promised, context to respond"," loops list|show|done|drop|mute Inspect and manage open loops (mute sender <email>)",+ " core list|show|status|add|remove Always-loaded core memory (also diff|ack|init|suggest)"," creds list|remove|export|import Generic credential vault (redacted output; encrypted bundles)","","BRAIN (capture / ideate / explore — v0.37/v0.38)",@@ -328,6 +329,7 @@" google connect|status|disconnect Connect/inspect/remove a Google account (idempotent; --json)"," waiting [--top N] [--json] Who is waiting on you, what you promised, context to respond"," loops list|show|done|drop|mute Inspect and manage open loops (mute sender <email>)",+ " core list|show|status|add|remove Always-loaded core memory (also diff|ack|init|suggest)"," creds list|remove|export|import Generic credential vault (redacted output; encrypted bundles)","","BRAIN (capture / ideate / explore — v0.37/v0.38)",@@ -538,6 +540,7 @@" google connect|status|disconnect Connect/inspect/remove a Google account (idempotent; --json)"," waiting [--top N] [--json] Who is waiting on you, what you promised, context to respond"," loops list|show|done|drop|mute Inspect and manage open loops (mute sender <email>)",+ " core list|show|status|add|remove Always-loaded core memory (also diff|ack|init|suggest)"," creds list|remove|export|import Generic credential vault (redacted output; encrypted bundles)","","BRAIN (capture / ideate / explore — v0.37/v0.38)",diff --git a/test/fixtures/goldens/cli/literal-imports.json b/test/fixtures/goldens/cli/literal-imports.jsonindex 12ad2b1202..adb41bc725 100644--- a/test/fixtures/goldens/cli/literal-imports.json+++ b/test/fixtures/goldens/cli/literal-imports.json@@ -46,6 +46,9 @@"conversation-parser": ["./commands/conversation-parser.ts"],+ "core": [+ "./commands/core.ts"+ ],"edges-backfill": ["./commands/edges-backfill.ts"],diff --git a/test/fixtures/goldens/cli/membership-sets.json b/test/fixtures/goldens/cli/membership-sets.jsonindex ac1c17b308..68142f4af1 100644--- a/test/fixtures/goldens/cli/membership-sets.json+++ b/test/fixtures/goldens/cli/membership-sets.json@@ -113,6 +113,7 @@"connect","connectors","conversation-parser",+ "core","creds","db-repair","decide",@@ -222,6 +223,7 @@"connect","connectors","conversation-parser",+ "core","creds","db-repair","decide",diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.jsonindex 8c613f7b27..b449b5cba0 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": 196835,- "stdoutSha256": "7c6a8f58d1ecf9152a0bef45fe6b85d84ea6bc81c4610fc65b2a65eeec68370a",+ "stdoutBytes": 198663,+ "stdoutSha256": "f4ab69309b217f6abb19b58b29d9d39cc5ee4b486b2f9b43d887f7dde7bf9d9e","toolNames": ["remember","entity",@@ -164,7 +164,7 @@],"tools": [{- "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.",+ "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.","idempotent": true,"local_only": false,"mutating": true,@@ -172,9 +172,10 @@"parameters": {"entity": "string?","expected_revision": "string?",- "fact": "string",+ "fact": "string?","force": "boolean?","infer_entity": "boolean?",+ "items": "array?","kind": "string?","provenance": "string","request_id": "string?",@@ -194,7 +195,7 @@"type": "string"},"fact": {- "description": "One claim.",+ "description": "One claim (or use items).","type": "string"},"force": {@@ -205,6 +206,58 @@"description": "Default true.","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.",+ "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"+ },"kind": {"description": "Default fact.","enum": [@@ -242,7 +295,6 @@}},"required": [- "fact","provenance"],"type": "object"@@ -5163,14 +5215,14 @@"scope": "read"},{- "description": "MEMORY VERB (v1): budget-packed cards, open threads and hot facts for up to 8 entities, zero LLM. Call at session start and after compaction.",+ "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.","idempotent": true,"local_only": false,"mutating": false,"name": "context_pack","parameters": {"budget_tokens": "number?",- "entities": "string",+ "entities": "string?","include_private": "boolean?","session_id": "string?","since": "string?"@@ -5183,7 +5235,7 @@"type": "number"},"entities": {- "description": "Comma-separated names or slugs (max 8).",+ "description": "Comma-separated names or slugs (max 8); omit for the core block only.","type": "string"},"include_private": {@@ -5199,9 +5251,7 @@"type": "string"}},- "required": [- "entities"- ],+ "required": [],"type": "object"},"scope": "read"diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex 22c4a12451..d406488d43 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -507,13 +507,13 @@},{"category": "meta",- "message": "Version 200 (latest: 200)",+ "message": "Version 201 (latest: 201)","name": "schema_version","status": "ok"},{"category": "meta",- "message": "853 column(s) verified against live schema",+ "message": "863 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1520,6 +1520,20 @@"name": "planner_stats_stale","status": "ok"},+ {+ "category": "brain",+ "details": {+ "bad_config": [],+ "chars_limit": 4000,+ "chars_used": 0,+ "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/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 153d996111..7c60f5b35c 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -510,13 +510,13 @@},{"category": "meta",- "message": "Version 200 (latest: 200)",+ "message": "Version 201 (latest: 201)","name": "schema_version","status": "ok"},{"category": "meta",- "message": "853 column(s) verified against live schema",+ "message": "863 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1597,6 +1597,20 @@"name": "planner_stats_stale","status": "ok"},+ {+ "category": "brain",+ "details": {+ "bad_config": [],+ "chars_limit": 4000,+ "chars_used": 0,+ "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/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.jsonindex ff1428fea1..08c268d23e 100644--- a/test/fixtures/goldens/doctor/registry-build-checks.json+++ b/test/fixtures/goldens/doctor/registry-build-checks.json@@ -629,6 +629,10 @@"category": "ops","name": "planner_stats_stale"},+ {+ "category": "brain",+ "name": "core_memory"+ },{"category": "ops","name": "chat_fallback_chain_inert"