Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
large pages: refuse an over-ceiling put_page/capture body before journal admission (N14); move ceiling-sized test fixtures above the new 24 MiB limit; goldens, guards and registry
garrytanedbaf4556936
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsvindex 6dd512a660..902c07ef34 100644--- a/docs/architecture/canonical-writers.tsv+++ b/docs/architecture/canonical-writers.tsv@@ -237,3 +237,4 @@ src/core/trust/page-handlers.ts 1 coordinator Owner page confirm/revert: a managsrc/core/trust/supersede-handlers.ts 3 filesystem_guard Trust-guard supersession accept/undo raise or restore only trust_tier on the proposal's facts/takes row through the S9 decide_proposals checked accept/undo path (proposal-supersede.ts): source filesystem and page locks unmanaged, the decide_proposal coordinator mutation managed.src/core/trust/timeline-projection.ts 2 engine_guard gbrain extract's timeline projection inserts gate-allowed rows stamped with the page tier inside an attributed maintenanceTransaction; on a managed brain the canonical table trigger refuses it outside the coordinator.src/eval/brainbench/trust-scenario.ts 2 isolated_eval BrainBench trust suites register their fixture sources in the scenario's own isolated benchmark brain (persistence disabled for the registration, re-enabled after); never opened against the active managed brain.+src/core/oversized-backfill.ts 1 coordinator The oversized-page backfill (gbrain reindex --oversized, the post-upgrade pass) rewrites a size-skipped page without its gate markers through importFromContent on unmanaged brains (assertUnmanagedCanonicalWriter applies) and through submitPageMutation put_page (managed_quarantine_clear, expected_revision) on managed brains; its only direct write is the page_embedding_budget hold row, which is derived spend state, not canonical content.diff --git a/scripts/serial-files.tsv b/scripts/serial-files.tsvindex d60c1bf25a..1aa6b0a610 100644--- a/scripts/serial-files.tsv+++ b/scripts/serial-files.tsv@@ -107,13 +107,13 @@ test/decide/eval-flags.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_test/decide/evidence-copack-calibration.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gateway; spyOn console.log, console.errortest/decide/grounding-slot.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gatewaytest/decide/judge-agreement-cli.serial.test.ts R1 R1: mutates process.env (TYPESAFE_API_KEY, JEV_TYPESAFE_API_KEY)+test/decide/newer-ref-hint-6497.serial.test.ts global-state global-state: patches process stdout/stderr/consoletest/decide/quickstart-doc.serial.test.ts R2 R2: mock.module(../../src/core/interaction.ts) replaces modules for every file in the processtest/decide/retrieval-search.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/decide/retrieval-think.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/decide/review-duplicate-kinds.serial.test.ts global-state global-state: replaces the process-wide gateway decide transport (__setDecideTransportForTests) and gateway configtest/decide/review-withdraw.serial.test.ts global-state global-state: replaces the process-wide gateway decide and embed transports (__setDecideTransportForTests, __setEmbedTransportForTests) and gateway configtest/decide/search-slots.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)-test/decide/newer-ref-hint-6497.serial.test.ts global-state global-state: patches process stdout/stderr/consoletest/decide/status-no-entity.serial.test.ts global-state global-state: patches process stdout/stderr/consoletest/decide/triage-slot.serial.test.ts global-state global-state: process-wide test seams __setDecideTransportForTests, __setChatTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gatewaytest/decide/turn-context-s6.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)@@ -121,6 +121,7 @@ test/decide/writepath-datasets.serial.test.ts global-state global-state: processtest/decide/writepath-phase.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests, __setDecideTransportForTests, __resetDecideStoreForTests; configureGateway changes the process-wide AI gatewaytest/dispatch-response-meta.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the processtest/dispatch-vector-incomplete.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the process+test/divergence-safe-pull-5429.serial.test.ts R1 R1: mutates process.env (GBRAIN_GIT_ALLOW_FILE_TRANSPORT) and spies on node:child_processtest/doctor-autopilot-fanout-concurrency.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)test/doctor-backup-coverage.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)test/doctor-connection-classified.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)@@ -144,13 +145,15 @@ test/embed-exit-code-3037.serial.test.ts global-state global-state: binds localtest/embed-input-type-wire.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gatewaytest/embed-lock-skipped.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/embed-max-usd-metered.serial.test.ts global-state global-state: configureGateway and __setEmbedTransportForTests change the process-wide AI gateway; replaces globalThis.fetch for the Voyage multimodal stub-test/embed-overlength-drain.serial.test.ts R2 R2: mock.module(src/core/embedding.ts) fake embedder; R1: mutates process.env (GBRAIN_MAX_CHUNK_TOKENS)test/embed-null-signature-warning-5527.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway; spyOn console.error+test/embed-overlength-drain.serial.test.ts R2 R2: mock.module(src/core/embedding.ts) fake embedder; R1: mutates process.env (GBRAIN_MAX_CHUNK_TOKENS)test/embed-oversize-heal-drain.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process+test/embed-page-cap.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process; also mutates process.env (GBRAIN_EMBED_CONCURRENCY)test/embed-partial-failure-3037.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the processtest/embed-quarantine.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the processtest/embed-stale-chunkless-pages.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gatewaytest/embed-stale-dry-run-restamp-5289.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway+test/embed-stale-progress-5968.serial.test.ts R1 R1: mutates process.env (GBRAIN_MAX_CHUNK_TOKENS)test/embed-stale-signature-pagination.serial.test.ts R1 R1: mutates process.env (GBRAIN_EMBED_CONCURRENCY)test/embed-stale-unavailable-snapshot.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gatewaytest/embed.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process@@ -165,6 +168,7 @@ test/eval-brainbench-decide.serial.test.ts R1 R1: mutates process.env (GBRAIN_DEtest/eval-longmemeval-call-plan.serial.test.ts R1 R1: mutates process.env (GBRAIN_CONTEXTUAL_SYNOPSIS_MODEL); process-wide gateway transports (__setChatTransportForTests, __setEmbedTransportForTests, __setRerankTransportForTests)test/eval-longmemeval-decide.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_SLOTS)test/eval-longmemeval-synopsis-tier.serial.test.ts R1 R1: mutates process.env (GBRAIN_CONTEXTUAL_SYNOPSIS_MODEL)+test/eval-longmemeval-via-operation.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; process-wide test seams __setEmbedTransportForTests, __setGenerateObjectTransportForTests, __setRerankTransportForTests; process.chdir to prove the summary names gbrain's own treetest/eval-retrieval-quality-decide.serial.test.ts R1 R1: mutates process.env (GBRAIN_DECIDE_SLOTS)test/eval-run-all-outcome.serial.test.ts R2 R2: mock.module(../src/commands/eval-brainbench.ts) replaces modules for every file in the process; spyOn process.stderr.writetest/eval-takes-quality-runner.serial.test.ts R2 R2: mock.module(../src/core/ai/gateway.ts) replaces modules for every file in the process@@ -204,6 +208,7 @@ test/guarded-http-tls.serial.test.ts global-state global-state: binds local servtest/harness-delivery-recovery.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnecttest/hook-backup-notice.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)test/hook-command.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_HOOKS, GBRAIN_HOOK_LANE, GBRAIN_SOURCE (+3 more))+test/hook-push-banner-superseded.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)test/hook-session-start-serve-wait.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, CLAUDE_CONFIG_DIR, CODEX_HOME)test/hook-writeback-stop.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_SOURCE)test/hybrid-adaptive-dedup-cache-plane.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process@@ -225,6 +230,7 @@ test/import-configured-root-guard.serial.test.ts global-state global-state: spyOtest/import-connection-budget.serial.test.ts R2 R2: mock.module(../src/core/postgres-engine.ts) replaces modules for every file in the processtest/import-signature-stamp.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gatewaytest/import-source-cr-mode.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests; configureGateway changes the process-wide AI gateway+test/init-search-mode.serial.test.ts global-state global-state: spawns real gbrain init/config CLI children against PGLite datastores in temp homes (180 s budget each)test/internal-breadth-callers.serial.test.ts R2 R2: mock.module(../src/core/search/hybrid.ts) replaces modules for every file in the processtest/jobs-child-readiness.serial.test.ts global-state global-state: spyOn console.errortest/jobs-embed-background-dryrun.serial.test.ts R2 R2: mock.module(../src/core/embedding.ts) replaces modules for every file in the process@@ -280,6 +286,7 @@ test/openai-latest.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAItest/openclaw-compact-transcript-runtime.serial.test.ts global-state global-state: swaps the context engine's module-level transcript-runtime loader and SDK load statetest/openclaw-context-engine-native.serial.test.ts global-state global-state: binds local servers/portstest/ops-run-onboard-scope-gate.serial.test.ts R2 R2: mock.module(../src/core/onboard/checks.ts, ../src/core/remediation/index.ts, ../src/core/onboard/render.ts) replaces modules for every file in the process+test/oversized-backfill.serial.test.ts global-state global-state: installs the process-global embedding transport seam (__setEmbedTransportForTests) and gateway config (configureGateway); swaps GBRAIN_HOME through withEnvtest/page-summary-length.serial.test.ts R1 R1: mutates process.env (GBRAIN_AUDIT_DIR)test/pending-write-exit.serial.test.ts global-state global-state: binds local servers/portstest/persistence-drain-latency.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; patches process stdout/stderr/console; times event-loop gaps against a bound, so a parallel neighbour would distort the measurement@@ -332,8 +339,10 @@ test/search/crag-escalation-limit.serial.test.ts R2 R2: mock.module(dynamic spectest/search/crag-think-source-scope.serial.test.ts R2 R2: mock.module(../../src/core/search/hybrid.ts, ../../src/core/think/index.ts) replaces modules for every file in the processtest/search/diverse-pool-hybrid.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME); stubs the process-wide gateway embed transporttest/search/hybrid-reranker-integration.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_AUDIT_DIR)+test/search/mode-receipt.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; process-wide test seams __setEmbedTransportForTests, __setRerankTransportForTests, __setChatTransportForTests, __setGenerateTextTransportForTests, __setGenerateObjectTransportForTests; R3: constructs PGLiteEngine outside beforeAlltest/search/operation-expansion-contract.serial.test.ts global-state global-state: spyOn hybrid.hybridSearchCached, console.logtest/search/output-redaction.serial.test.ts R2 R2: mock.module(../../src/core/eval-capture.ts, ../../src/core/search/hybrid.ts, ../../src/core/ai/gateway.ts, ../../src/core/think/index.ts) replaces modules for every file in the process+test/search/query-expand-capture-replay.serial.test.ts global-state global-state: spyOn replaces the hybridSearch module export process-widetest/search/relational-rerank-pin-hybrid.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/seed-pglite.serial.test.ts global-state global-state: R3: constructs PGLiteEngine outside beforeAll; R4: PGLiteEngine without an afterAll disconnecttest/self-upgrade-checkonly.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)@@ -359,6 +368,7 @@ test/skillopt/models-four-paths.serial.test.ts R2 R2: mock.module(../../src/coretest/skillopt/models-plan.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; patches process stdout/stderr/consoletest/skillopt/run-skillopt-op.serial.test.ts R2 R2: mock.module(../../src/core/skillopt/orchestrator.ts, ../../src/core/repo-root.ts) replaces modules for every file in the processtest/sources-push-cli.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_HOME, GBRAIN_GIT_ALLOW_FILE_TRANSPORT)+test/spawn-seam-batch1-4992.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GIT_DIR) and spies on node:child_processtest/stdio-stderr-redirect.serial.test.ts global-state global-state: patches process stdout/stderr/consoletest/subagent-put-page-rejection.serial.test.ts global-state global-state: process-wide test seams __setChatTransportForTests; configureGateway changes the process-wide AI gateway; spyOn putPage.handlertest/sync-convergence.serial.test.ts global-state global-state: binds local servers/ports (two latency proxies) and spawns serve/sync/put processes against one shared brain; its oracle tests read the single chaos scenario that beforeAll ran, across it() boundaries@@ -367,6 +377,7 @@ test/sync-default-write-guard.serial.test.ts global-state global-state: spyOn cotest/sync-delete-trailing-hyphen.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/sync-failure-ledger.serial.test.ts R1 R1: mutates process.env (HOME, GBRAIN_SYNC_AUTOSKIP_AFTER)test/sync-index-matches-tree.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)+test/sync-managed-implied-no-pull-6543.serial.test.ts global-state global-state: patches process stdout/stderr/console to keep the notice off stdout and traps process.exit for the --all path; R1: mutates process.env (GBRAIN_HOME, GBRAIN_SYNC_NO_DELEGATE)test/sync-pull-failed-anchor.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/sync-rename-reconcile.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/sync-resumable-import.serial.test.ts R1 R1: mutates process.env (GBRAIN_SYNC_CHECKPOINT_EVERY, GBRAIN_MAX_CONNECTIONS)@@ -397,12 +408,3 @@ test/write-path-no-egress.serial.test.ts global-state global-state: binds a locatest/write-path-zero-llm.serial.test.ts R1 R1: mutates process.env (ANTHROPIC_API_KEY, OPENAI_API_KEY) so gated chat and embedding paths are livetest/writeback-nudge.serial.test.ts global-state global-state: patches process stdout/stderr/consoletest/writeback-review-fixes.serial.test.ts global-state global-state: process-wide test seams __resetCheckpointHarvestForTests; patches process stdout/stderr/console-test/hook-push-banner-superseded.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_BACKUP_CHECK)-test/spawn-seam-batch1-4992.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GIT_DIR) and spies on node:child_process-test/divergence-safe-pull-5429.serial.test.ts R1 R1: mutates process.env (GBRAIN_GIT_ALLOW_FILE_TRANSPORT) and spies on node:child_process-test/embed-stale-progress-5968.serial.test.ts R1 R1: mutates process.env (GBRAIN_MAX_CHUNK_TOKENS)-test/eval-longmemeval-via-operation.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; process-wide test seams __setEmbedTransportForTests, __setGenerateObjectTransportForTests, __setRerankTransportForTests; process.chdir to prove the summary names gbrain's own tree-test/init-search-mode.serial.test.ts global-state global-state: spawns real gbrain init/config CLI children against PGLite datastores in temp homes (180 s budget each)-test/search/mode-receipt.serial.test.ts global-state global-state: configureGateway changes the process-wide AI gateway; process-wide test seams __setEmbedTransportForTests, __setRerankTransportForTests, __setChatTransportForTests, __setGenerateTextTransportForTests, __setGenerateObjectTransportForTests; R3: constructs PGLiteEngine outside beforeAll-test/search/query-expand-capture-replay.serial.test.ts global-state global-state: spyOn replaces the hybridSearch module export process-wide-test/sync-managed-implied-no-pull-6543.serial.test.ts global-state global-state: patches process stdout/stderr/console to keep the notice off stdout and traps process.exit for the --all path; R1: mutates process.env (GBRAIN_HOME, GBRAIN_SYNC_NO_DELEGATE)diff --git a/src/commands/doctor/registry.ts b/src/commands/doctor/registry.tsindex 254edf38a6..36d55cd13f 100644--- a/src/commands/doctor/registry.ts+++ b/src/commands/doctor/registry.ts@@ -197,8 +197,8 @@ export const DOCTOR_CHECK_REGISTRY: readonly DoctorEntry[] = [managedSyncMovementEntry,persistenceConsumersEntry,atomHeldFailedEntry,- fenceIntegrityEntry,extractionInputTruncatedEntry,+ fenceIntegrityEntry,searchModeEntry,];diff --git a/src/commands/embed.ts b/src/commands/embed.tsindex 53cf105455..9a5b3d507f 100644--- a/src/commands/embed.ts+++ b/src/commands/embed.ts@@ -900,7 +900,7 @@ export async function runEmbed(engine: BrainEngine, args: string[], selectedConfif (isKeylessStaleRefusal(args, keylessConfig?.embedding_disabled)) {const enable = (await import('../core/readiness.ts')).embeddingEnablement(keylessConfig!).argv ?? ['gbrain', 'init', '--force', '--embedding-model', '<provider:model>'];process.stderr.write('[embed] Embeddings are disabled on this brain (keyless install), so there are no vectors to compute. Keyword search covers every chunked page; '- + 'pages an older gbrain skipped for size become keyword-searchable with gbrain reindex --oversized (free). '+ + 'pages an older version skipped for size become keyword-searchable with gbrain reindex --oversized (free). '+ `Turn on semantic search (pages and facts are kept): ${(await import('../core/agent-output.ts')).shellQuote(enable)}\n`);return {embedded: 0, skipped: 0, would_embed: 0, total_chunks: 0,diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex a72bb692d2..a6199d9323 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -567,7 +567,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText }{ since: 'TBD', text: '`gbrain extract-conversation-facts` now checks a `raw_transcript` sidecar\'s size before reading it: a sidecar over the 25 MiB cap is skipped without being read (before, it was read whole and bypassed the cap), and the cap now applies to the text the parser reads, so a sidecar page whose own body is over the cap but whose sidecar is under it is no longer skipped. The cap is derived from the page ceiling and never sits below it. A size skip now leaves a durable receipt as well as the stderr line.' },{ since: 'TBD', text: 'Doctor has a new `extraction_input_truncated` check listing pages whose last extraction read only part of their input (facts from the head or the newest window of a long append, atoms cut at the input cap, conversation pages skipped for size), with sample slugs and the remedy. It warns when atoms or conversation-facts receipts exist (naming `gbrain config set cycle.extract_atoms.max_input_chars <n>`, a paid change for the user to decide); facts-only receipts are reported as info.' },// Large pages A6/A9/T33/T3/F10 (Lane 3). `since` is set at the merge-slot stamp.- { since: 'TBD', text: 'Pages up to 24 MiB are now stored, chunked and keyword-searchable: `content_sanity.bytes_block` defaults to the 24 MiB page ceiling (was 500 KB), so a page between 500 KB and 24 MiB is no longer stored with `embed_skip` and zero chunks. Import, sync, the managed sync read, CLI stdin (`gbrain put`, was 5 MB) and the MCP stdio message limit (was the SDK\'s 10 MiB) all admit a page at the ceiling; one byte more is refused with the limit named. Code files keep their 5 MB limit. Size refusals no longer tell agents to split pages under the ceiling. An operator who set a lower `bytes_block` keeps the old behavior above it.' },+ { since: 'TBD', text: 'Pages up to 24 MiB are now stored, chunked and keyword-searchable: `content_sanity.bytes_block` defaults to the 24 MiB page ceiling (was 500 KB), so a page between 500 KB and 24 MiB is no longer stored with `embed_skip` and zero chunks. Import, sync, the managed sync read, CLI stdin (`gbrain put`, was 5 MB) and the MCP stdio message limit (was the SDK\'s 10 MiB) all admit a page at the ceiling; one byte more is refused with the limit named. Code files keep their 5 MB limit. Size refusals no longer tell agents to split pages under the ceiling. An operator who set a lower `bytes_block` keeps the old behavior above it. A `put_page` or `capture` body over the ceiling is refused as `request_too_large` before journal admission, so no write request is recorded for it and a body over the journal\'s intent-byte cap no longer returns retryable `queue_capacity`.' },{ since: 'TBD', text: 'A page over 1 MiB now commits with its chunks keyword-searchable and no vectors, and is embedded after the write by the stale sweep, `gbrain embed` or the post-write embedding job, instead of embedding every chunk inline before the write commits. Each such page spends at most `embed.max_usd_per_page` (default $2; unlimited under `spend.posture tokenmax` when unset; `off` disables it) over its lifetime per embedding model, newest chunks first; the run caps still apply and the lowest cap wins. A page the cap stopped, or one held for approval, leaves the stale queue, and doctor\'s new `partial_embedding` check names it with the approval command (`gbrain embed --held --max-usd N`, or `gbrain embed --slugs <slug> --max-usd N`). Before embedding, a large page whose head, middle and tail samples are all markup, or two of them match junk patterns, is held instead. Large pages use the free title context tier, never paid per-chunk synopses.' },{ since: 'TBD', text: '`gbrain upgrade` now re-indexes pages an older gbrain stored without chunks because they were over 500 KB (`embed_skip: oversized`) when they fit under the effective `bytes_block`: for up to two minutes in its post-upgrade step, then `gbrain reindex --oversized` (new; `--dry-run`, `--source`, `--limit`, `--json`) finishes. It is CPU-only, works with embeddings off, makes those pages keyword-searchable at once and prints a receipt. It removes only the gate-written marker and its `content_flag: oversized`. Pages over 1 MiB are held for embedding approval; the post-upgrade notice shows their count and estimated cost and asks before anything is spent.' },{ since: 'TBD', text: 'A page over 1 MiB keeps only its newest 5 large version snapshots in `page_versions` (each snapshot is a full copy of the body); its snapshots at or under 1 MiB, and every snapshot of a smaller page, are kept as before. The persistence journal now admits 64 MiB of outstanding write intent per principal (was 32 MiB), so a second ceiling-size write can wait behind the first. Write-through never writes a canonical file over the 25 MiB pre-push secret-scan limit: it skips with `over_push_scan_cap`, and a managed write that would produce one is refused with `request_too_large`.' },diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.tsindex f30331446a..faed2dae6d 100644--- a/src/core/cli-flag-registry.generated.ts+++ b/src/core/cli-flag-registry.generated.ts@@ -47,11 +47,11 @@ 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', '--plan', '--prefer-postgres', '--provenance', '--provider', '--query', '--schema-pack', '--scopes', '--search-mode', '--skip-embed-check', '--source', '--status', '--supabase', '--surface', '--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': ['--accept-all', '--all', '--all-from', '--apply', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--expect', '--from', '--help', '--include-withdrawals', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-usd', '--min', '--non-interactive', '--out', '--provenance', '--provider', '--query', '--rate', '--reason', '--reason-family', '--recommended', '--remove', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--trust', '--undo', '--uri-prefix', '--version', '--what-if-threshold', '--yes'],- 'doctor': ['--abandon', '--abbrev-ref', '--accept-pending', '--access', '--acknowledge-managed', '--add', '--admin-intent', '--adopt', '--adopt-columns', '--adopt-permissions', '--all', '--all-drifted', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--allowed-operations', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--auto-fix', '--autostash', '--background', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-usd', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--class', '--client', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--confirm-relocated-root', '--conflicts', '--contacts-dir', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delegated-namespace', '--delegated-slug-prefixes', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--disable', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--enable', '--end-of-options', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--expand', '--expect', '--expect-remote', '--expected-epoch', '--expected-revision', '--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-meetings', '--from-pages', '--full', '--get', '--git-common-dir', '--git-dir', '--git-path', '--group', '--group-by', '--hard', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--if-version', '--ignore-env-override', '--images', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--keep', '--lanes', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--list', '--local', '--local-env-vars', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--migration', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-autostash', '--no-capture', '--no-confirm', '--no-cron', '--no-delegate', '--no-edit', '--no-embed', '--no-embedding', '--no-expand', '--no-extract', '--no-hooks', '--no-lanes', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--profile', '--progress-interval', '--progress-json', '--project', '--provider', '--providers', '--prune-orphans', '--pull', '--pure', '--purge', '--push-only', '--query', '--question', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--replace', '--repo', '--request', '--request-id', '--require-clean', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--resolve', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--search-mode', '--seat', '--section', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--stdin', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--warn-only', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],+ 'doctor': ['--abandon', '--abbrev-ref', '--accept-pending', '--access', '--acknowledge-managed', '--add', '--admin-intent', '--adopt', '--adopt-columns', '--adopt-permissions', '--all', '--all-drifted', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--allowed-operations', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--auto-fix', '--autostash', '--background', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-usd', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--class', '--client', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--confirm-relocated-root', '--conflicts', '--contacts-dir', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delegated-namespace', '--delegated-slug-prefixes', '--delete-brain', '--dest', '--detach', '--diff-filter', '--dim', '--dir', '--disable', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--enable', '--end-of-options', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--expand', '--expect', '--expect-remote', '--expected-epoch', '--expected-revision', '--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-meetings', '--from-pages', '--full', '--get', '--git-common-dir', '--git-dir', '--git-path', '--group', '--group-by', '--hard', '--hard-deadline', '--harness', '--held', '--help', '--home', '--http', '--id', '--if-version', '--ignore-env-override', '--images', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--keep', '--lanes', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--list', '--local', '--local-env-vars', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--migration', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-autostash', '--no-capture', '--no-confirm', '--no-cron', '--no-delegate', '--no-edit', '--no-embed', '--no-embedding', '--no-expand', '--no-extract', '--no-hooks', '--no-lanes', '--no-llm', '--no-migrate', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--non-interactive', '--once', '--only', '--operations', '--others', '--out', '--output', '--oversized', '--overwrite', '--page', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--profile', '--progress-interval', '--progress-json', '--project', '--provider', '--providers', '--prune-orphans', '--pull', '--pure', '--purge', '--push-only', '--query', '--question', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--reference-date', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--replace', '--repo', '--request', '--request-id', '--require-clean', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--resolve', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--scope', '--scopes', '--search-mode', '--seat', '--section', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--stdin', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--warn-only', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--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'],'edge-proposals': ['--access', '--add', '--all-applied', '--all-held', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--purge', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--status', '--surface', '--to', '--updated-after', '--url', '--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', '--client', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--full', '--group', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-null-signature', '--json', '--max-cost', '--max-cost-usd', '--max-facts', '--max-usd', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--no-embed', '--no-embedding', '--no-hooks', '--only', '--pace', '--pace-max-concurrency', '--path', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--scopes', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--surface', '--timeout', '--to', '--wait', '--yes'],+ 'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--client', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--full', '--group', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-null-signature', '--json', '--max-cost', '--max-cost-usd', '--max-facts', '--max-usd', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--no-embed', '--no-embedding', '--no-hooks', '--only', '--oversized', '--pace', '--pace-max-concurrency', '--path', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--scopes', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--surface', '--timeout', '--to', '--wait', '--yes'],'embeddings': ['--accept-pending', '--background', '--brain', '--db-url', '--dim', '--embedding-dimensions', '--embedding-model', '--explain', '--follow', '--force', '--help', '--json', '--no-accept-pending', '--no-embedding', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--wait', '--yes'],'engine': ['--apply-rewrites', '--brain', '--break-lock', '--db-url', '--help', '--http', '--json', '--path', '--prefer-postgres', '--probe', '--source', '--supabase', '--url', '--yes'],'enrich': ['--accept-pending', '--access', '--add', '--allowed-operations', '--apply', '--asof', '--audit', '--background', '--bound-slug-prefixes', '--brain', '--client', '--concurrency', '--confirm-destructive', '--conflicts', '--date', '--dated-since', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--expect', '--explain', '--federated-read', '--follow', '--force', '--full', '--fuzzy', '--group', '--help', '--http', '--id', '--include-deleted', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--non-interactive', '--order', '--output', '--page', '--params', '--path', '--phase', '--prefer', '--progress-interval', '--progress-json', '--purge', '--quiet', '--rate', '--recent', '--reenrich-after', '--refresh-operations', '--resume', '--row', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--surface', '--thin', '--thin-threshold', '--timeout', '--to', '--trust', '--types', '--updated-after', '--url', '--wait', '--workers', '--yes'],@@ -61,7 +61,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'extract': ['--accept-pending', '--admin-intent', '--after-slug', '--apply', '--apply-preview', '--background', '--backup-verified', '--brain', '--break-lock', '--by-mention', '--catch-up', '--checkpoint', '--client', '--concurrency', '--confirm', '--confirm-relocated-root', '--db-url', '--dir', '--dry-run', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--from-meetings', '--help', '--http', '--id', '--include-frontmatter', '--infer-dates', '--json', '--kind', '--limit', '--manifest', '--ner', '--no-accept-pending', '--pack', '--page', '--path', '--progress-interval', '--progress-json', '--prune-orphans', '--quiet', '--rebuild', '--repair-attendance', '--scopes', '--self-transfer', '--since', '--source', '--source-id', '--stale', '--timeout', '--type', '--verbose', '--wait', '--workers', '--yes'],'extract-conversation-facts': ['--accept-pending', '--admin-intent', '--background', '--brain', '--concurrency', '--confirm-destructive', '--confirm-relocated-root', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--help', '--input', '--json', '--limit', '--manifest', '--max-cost', '--max-cost-usd', '--max-runtime', '--no-accept-pending', '--no-autopilot-install', '--no-embedding', '--output', '--override-disabled', '--path', '--progress-interval', '--progress-json', '--quiet', '--rate', '--segment-limit', '--self-transfer', '--since', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--types', '--url', '--wait', '--workers', '--yes'],'facts': ['--admin-intent', '--after-id', '--brain', '--dry-run', '--entity', '--examples', '--expected-state', '--help', '--include-private', '--json', '--limit', '--max-cost-usd', '--max-usd', '--no-conflict-queue', '--no-llm', '--path', '--retry-model', '--since', '--slug', '--source'],- 'features': ['--all', '--apply', '--auto', '--auto-fix', '--background', '--batch-size', '--brain', '--by-mention', '--catch-up', '--concurrency', '--dir', '--embedding-model', '--expect', '--explain', '--facts', '--force', '--from-meetings', '--held', '--help', '--images', '--include-frontmatter', '--include-null-signature', '--infer-dates', '--json', '--kind', '--max-cost', '--max-usd', '--ner', '--non-interactive', '--only', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--path', '--priority', '--probe', '--prune-orphans', '--rebuild', '--refresh', '--repo', '--save', '--since', '--slugs', '--source', '--source-id', '--stale', '--target', '--trust', '--type', '--verbose', '--workers', '--yes'],+ 'features': ['--all', '--apply', '--auto', '--auto-fix', '--background', '--batch-size', '--brain', '--by-mention', '--catch-up', '--concurrency', '--dir', '--embedding-model', '--expect', '--explain', '--facts', '--force', '--from-meetings', '--held', '--help', '--images', '--include-frontmatter', '--include-null-signature', '--infer-dates', '--json', '--kind', '--max-cost', '--max-usd', '--ner', '--non-interactive', '--only', '--oversized', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--path', '--priority', '--probe', '--prune-orphans', '--rebuild', '--refresh', '--repo', '--save', '--since', '--slugs', '--source', '--source-id', '--stale', '--target', '--trust', '--type', '--verbose', '--workers', '--yes'],'feedback': ['--brain', '--help', '--json', '--page', '--source'],'files': ['--accept-pending', '--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--no-pointer', '--page', '--progress-interval', '--progress-json', '--quiet', '--retry-failed', '--source', '--timeout', '--type', '--wait', '--yes'],'forget': ['--all-subjects', '--brain', '--dry-run', '--help', '--json', '--match', '--purge', '--reason', '--request-id', '--source', '--status', '--vacuum', '--yes'],@@ -73,16 +73,16 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'graph-query': ['--brain', '--depth', '--direction', '--help', '--hop', '--include-foreign', '--json', '--mcp-only', '--source', '--type'],'hook': ['--allow-unverified-remote', '--auto', '--brain', '--branch', '--cached', '--count', '--diff-filter', '--enable', '--end-of-options', '--env', '--get', '--harness', '--help', '--jq', '--json', '--limit', '--name-only', '--others', '--pat-file', '--path', '--porcelain', '--pure', '--quiet', '--remove', '--seat', '--session', '--show-current', '--show-toplevel', '--since', '--source', '--yes'],'import': ['--accept-pending', '--admin-intent', '--allow-empty', '--allow-noncanonical-root', '--apply', '--background', '--brain', '--cached', '--confirm-relocated-root', '--diff-filter', '--dim', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--format', '--fresh', '--help', '--include-gitignored', '--is-shallow-repository', '--json', '--log-noop', '--manifest', '--name-only', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-gpg-sign', '--no-pull', '--no-renames', '--no-verify', '--only', '--others', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--self-transfer', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--url', '--verify', '--wait', '--workers'],- 'init': ['--access', '--acknowledge-managed', '--adopt', '--all', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--audit', '--auto', '--background', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--budget-usd', '--chat-model', '--check', '--confirm-relocated-root', '--conflicts', '--content-root', '--db-only', '--dest', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--expand', '--expansion-model', '--expect', '--expect-remote', '--facts', '--fast', '--fix', '--force', '--from-meetings', '--full', '--git', '--grant-types', '--group-by', '--harness', '--help', '--http', '--id', '--images', '--issuer-url', '--json', '--keep', '--key', '--lanes', '--limit', '--list', '--local-postgres', '--markdown', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-git', '--no-llm', '--no-pull', '--no-repair', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--providers', '--pull', '--purge', '--push-only', '--query', '--question', '--quiet', '--rebase', '--reference-date', '--remediate', '--remove', '--reset', '--resolve', '--resume', '--retry-failed', '--save', '--schema-pack', '--scope', '--scopes', '--search-mode', '--section', '--self-transfer', '--show-toplevel', '--skip-embed-check', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--warn-only', '--workspace', '--yes'],+ 'init': ['--access', '--acknowledge-managed', '--adopt', '--all', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--audit', '--auto', '--background', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--budget-usd', '--chat-model', '--check', '--confirm-relocated-root', '--conflicts', '--content-root', '--db-only', '--dest', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--expand', '--expansion-model', '--expect', '--expect-remote', '--facts', '--fast', '--fix', '--force', '--from-meetings', '--full', '--git', '--grant-types', '--group-by', '--harness', '--held', '--help', '--http', '--id', '--images', '--issuer-url', '--json', '--keep', '--key', '--lanes', '--limit', '--list', '--local-postgres', '--markdown', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-git', '--no-llm', '--no-pull', '--no-repair', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--once', '--only', '--oversized', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--providers', '--pull', '--purge', '--push-only', '--query', '--question', '--quiet', '--rebase', '--reference-date', '--remediate', '--remove', '--reset', '--resolve', '--resume', '--retry-failed', '--save', '--schema-pack', '--scope', '--scopes', '--search-mode', '--section', '--self-transfer', '--show-toplevel', '--skip-embed-check', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--wait', '--warn-only', '--workspace', '--yes'],'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],'integrity': ['--accept-pending', '--auto', '--backend', '--background', '--brain', '--confidence', '--cost', '--dry-run', '--explain', '--follow', '--fresh', '--help', '--json', '--limit', '--no-accept-pending', '--probe', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--supabase', '--timeout', '--type', '--url', '--wait'],'jobs': ['--abbrev-ref', '--access', '--acknowledge-managed', '--add', '--admin-intent', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--check', '--cli-path', '--client', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--confirm-quiesced', '--cost-estimate', '--date', '--dated-since', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--expected-state', '--explain', '--facts', '--federated-read', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--fuzzy', '--grammar-diagnostics', '--group', '--hard-deadline', '--health-interval', '--held', '--help', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-deleted', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--lanes', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--oversized', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--probe', '--prune-orphans', '--purge', '--queue', '--queue-only', '--quiet', '--reason', '--rebuild', '--recent', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--replace', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--retry-held', '--review-lower', '--row', '--scopes', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--to', '--trust', '--type', '--types', '--uninstall', '--updated-after', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],'lint': ['--abbrev-ref', '--accept-pending', '--adopt-slug-path', '--audit', '--autostash', '--background', '--brain', '--branch', '--cached', '--client', '--confirm-relocated-root', '--conflicts', '--dry-run', '--enable', '--exclude', '--expect-remote', '--expected-epoch', '--expected-revision', '--explain', '--ff-only', '--file', '--fix', '--follow', '--force', '--full', '--get', '--git-dir', '--git-path', '--grammar-diagnostics', '--hard', '--help', '--id', '--is-inside-work-tree', '--json', '--local', '--local-env-vars', '--manifest', '--no-accept-pending', '--no-autostash', '--no-cron', '--no-pull', '--no-tags', '--no-verify', '--only', '--pat-file', '--path', '--prefer', '--preview', '--probe', '--progress-interval', '--progress-json', '--pull', '--purge', '--push-only', '--quiet', '--rebase', '--require-clean', '--resolve', '--scopes', '--self-transfer', '--short', '--show-toplevel', '--slug', '--source', '--source-id', '--timeout', '--unset-all', '--wait', '--yes'],'loops': ['--all', '--as-of', '--brain', '--fail-fast', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--tools-json', '--top', '--type'],'lsd': ['--brain', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--max-usd', '--no-save', '--resume', '--save', '--source', '--strict-budget', '--yes'],- 'maintain': ['--adopt-columns', '--adopt-permissions', '--all', '--apply', '--assign-corpus', '--audit', '--background', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--concurrency', '--conflicts', '--contacts-dir', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--enable', '--expect', '--expected-revision', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--format', '--from-meetings', '--full', '--group-by', '--hard-deadline', '--harness', '--help', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--name', '--ner', '--no-autopilot-install', '--no-capture', '--no-delegate', '--no-embed', '--no-pull', '--once', '--only', '--operations', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer', '--preview', '--probe', '--probe-pglite', '--project', '--providers', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--reverse', '--safe', '--scope', '--scopes', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--to', '--token', '--top-k', '--type', '--url-env', '--verbose', '--version', '--window', '--workers', '--yes'],+ 'maintain': ['--adopt-columns', '--adopt-permissions', '--all', '--apply', '--assign-corpus', '--audit', '--background', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--concurrency', '--conflicts', '--contacts-dir', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--enable', '--expect', '--expected-revision', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--format', '--from-meetings', '--full', '--group-by', '--hard-deadline', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--name', '--ner', '--no-autopilot-install', '--no-capture', '--no-delegate', '--no-embed', '--no-pull', '--once', '--only', '--operations', '--oversized', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer', '--preview', '--probe', '--probe-pglite', '--project', '--providers', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--reverse', '--safe', '--scope', '--scopes', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--to', '--token', '--top-k', '--type', '--url-env', '--verbose', '--version', '--window', '--workers', '--yes'],'mcp': ['--admin-token-file', '--agent', '--arg', '--bearer-token-env-var', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--credentials-file', '--credentials-out', '--delegate', '--delegated-namespace', '--delegated-slug-prefixes', '--dry-run', '--enable-dcr', '--federated-read', '--flow', '--force', '--funnel', '--harness', '--header', '--help', '--if-version', '--install', '--issuer-url', '--json', '--limit', '--mcp-only', '--mcp-url', '--no-install', '--no-service', '--no-tailscale', '--oauth-client-id', '--oauth-client-secret', '--oauth-request', '--port', '--profile', '--queue', '--redirect-uri', '--remove', '--resume', '--root', '--scope', '--scopes', '--skills', '--source', '--status', '--surface', '--timeout-ms', '--token', '--token-endpoint-auth-method', '--token-ttl', '--url', '--yes'],- 'migrate': ['--accept-pending', '--admin-intent', '--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--follow', '--force', '--force-retry', '--full', '--harness', '--held', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--manifest', '--max-cost', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-migrate', '--non-interactive', '--only', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--plan', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--resume', '--retarget', '--rollback-to-source', '--scope', '--skip-verify', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--trigger-bypass', '--trust', '--url', '--url-env', '--wait', '--yes'],+ 'migrate': ['--accept-pending', '--admin-intent', '--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--follow', '--force', '--force-retry', '--full', '--harness', '--held', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--manifest', '--max-cost', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-migrate', '--non-interactive', '--only', '--oversized', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--plan', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--resume', '--retarget', '--rollback-to-source', '--scope', '--skip-verify', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--trigger-bypass', '--trust', '--url', '--url-env', '--wait', '--yes'],'models': ['--batch', '--brain', '--concurrent', '--cycles', '--dim', '--dimensions', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--limit', '--max-tokens', '--max-usd', '--output', '--receipt-dir', '--skip', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--source', '--status', '--task', '--to', '--yes'],'mounts': ['--alias', '--brain', '--database-path', '--database-url', '--db-path', '--db-url', '--engine', '--help', '--id', '--json', '--mcp-url', '--path', '--skills-dir', '--source'],'notability-eval': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--in', '--json', '--out', '--repo', '--skip-llm', '--source', '--status', '--target-high', '--target-low', '--target-medium'],@@ -112,7 +112,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'report': ['--brain', '--content', '--dir', '--help', '--json', '--source', '--title', '--type'],'repos': ['--abandon', '--abbrev-ref', '--abort', '--accept-suggested', '--access', '--account', '--add', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--adopt-slug-path', '--after', '--all', '--all-new', '--allow-unverified-remote', '--allowed-operations', '--app-id', '--app-install', '--app-pem', '--apply', '--audit', '--auto-additive', '--autostash', '--backups', '--before', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--branch', '--budget-usd-per-day', '--cached', '--calendar-id', '--category', '--classify', '--cleanup-dead-local-locks', '--clear', '--client', '--clone-dir', '--code', '--confirm-destructive', '--confirm-quiesced', '--confirm-relocated-root', '--conflicts', '--contacts-dir', '--count', '--days', '--decisions', '--delegated-namespace', '--delegated-slug-prefixes', '--depth', '--detect', '--diff-filter', '--dir', '--disable', '--dry-run', '--enable', '--error-unmatch', '--exclude', '--expect-remote', '--expected-epoch', '--expected-incarnation', '--expected-state', '--federated', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--force', '--format', '--from', '--full', '--future-days', '--get', '--git-dir', '--git-path', '--github-repo', '--grant-types', '--group-by', '--hard', '--help', '--history-days', '--http', '--id', '--if-version', '--include', '--include-warns', '--is-inside-work-tree', '--json', '--keep-storage', '--kind', '--lanes', '--limit', '--local', '--local-env-vars', '--loops-exclude-labels', '--manifest', '--max-cost-usd', '--message', '--migrate-legacy', '--migration', '--min-trust', '--name', '--name-only', '--no-autostash', '--no-cron', '--no-embed', '--no-federate', '--no-federated', '--no-harden', '--no-lanes', '--no-pull', '--no-tags', '--no-verify', '--only', '--operations', '--origin', '--others', '--out', '--params', '--pat-file', '--path', '--plan', '--porcelain', '--preview', '--probe', '--profile', '--pull', '--push-only', '--quiet', '--read-sources', '--rebase', '--redirect-uri', '--refresh-operations', '--remove-backup', '--repair', '--replace', '--repos', '--request-id', '--require-clean', '--reset-checkpoint', '--reset-default', '--resolve', '--resume', '--retry-failed', '--scope', '--scopes', '--secret', '--self-transfer', '--services', '--set', '--shared-skills', '--short', '--show-toplevel', '--since', '--slug-prefixes', '--source', '--source-id', '--source-ids', '--sources', '--stale', '--state', '--status', '--stdin', '--surface', '--takes-holders', '--token', '--token-command', '--token-endpoint-auth-method', '--token-env', '--token-ttl', '--unset-all', '--untracked-files', '--url', '--usage', '--verify', '--wait', '--wait-drain', '--warn-only', '--window', '--yes'],'resolvers': ['--backend', '--brain', '--cost', '--help', '--json', '--source'],- 'retrieval-upgrade': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--full', '--held', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--non-interactive', '--only', '--pace', '--pace-max-concurrency', '--plan', '--priority', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--retarget', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--wait', '--yes'],+ 'retrieval-upgrade': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--full', '--held', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--non-interactive', '--only', '--oversized', '--pace', '--pace-max-concurrency', '--plan', '--priority', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--retarget', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--wait', '--yes'],'routing-eval': ['--brain', '--help', '--json', '--llm', '--skills-dir', '--source'],'salience': ['--brain', '--days', '--help', '--json', '--kind', '--limit', '--mcp-only', '--slug-prefix', '--source'],'schema': ['--alias', '--apply', '--as-filing-rules', '--brain', '--dims', '--expert', '--expert-routing', '--extractable', '--fields', '--force', '--help', '--inverse', '--json', '--kind', '--no-prefix', '--pack', '--page-type', '--prefix', '--primitive', '--schema-pack', '--since', '--source', '--source-id', '--target-type', '--to', '--with-db'],@@ -128,7 +128,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'status': ['--abbrev-ref', '--acknowledge-managed', '--all', '--allow-empty', '--apply', '--brain', '--break-lock', '--cached', '--concurrency', '--confirm-destructive', '--deadline-ms', '--diff-filter', '--empty', '--exclude', '--exclude-standard', '--fast', '--filters', '--fix', '--force-break-lock', '--format', '--full', '--full-history', '--hard-deadline', '--help', '--include-gitignored', '--include-hidden', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--lanes', '--max-age', '--max-sources', '--mcp-only', '--missing-path', '--name-only', '--no-auto-embed', '--no-bulk', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--others', '--parallel', '--path', '--priority', '--quiet', '--repo', '--reset-checkpoint', '--retry-failed', '--retry-held', '--section', '--serial', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--strategy', '--timeout', '--url', '--verify', '--watch', '--workers', '--working-tree', '--yes'],'storage': ['--brain', '--fix', '--help', '--json', '--plan', '--repo', '--restore-only', '--source', '--to'],'sweep': ['--accept-pending', '--apply', '--assign-corpus', '--background', '--batch-limit', '--brain', '--budget-ms', '--delete-brain', '--explain', '--follow', '--help', '--home', '--json', '--no-accept-pending', '--no-delegate', '--once', '--only', '--progress-interval', '--progress-json', '--quiet', '--session', '--source', '--timeout', '--wait'],- 'sync': ['--abbrev-ref', '--accept-pending', '--account', '--acknowledge-managed', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--confirm-quiesced', '--confirm-relocated-root', '--conflicts', '--contacts-dir', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--enable', '--exclude', '--exclude-standard', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--first-parent', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--group-by', '--hard-deadline', '--harness', '--held', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lanes', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--log-noop', '--manifest', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-capture', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--once', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--providers', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--reverse', '--scope', '--scopes', '--self-transfer', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],+ 'sync': ['--abbrev-ref', '--accept-pending', '--account', '--acknowledge-managed', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--confirm-quiesced', '--confirm-relocated-root', '--conflicts', '--contacts-dir', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--enable', '--exclude', '--exclude-standard', '--expect', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--first-parent', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--group-by', '--hard-deadline', '--harness', '--held', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lanes', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--log-noop', '--manifest', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-capture', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--once', '--only', '--operations', '--others', '--oversized', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--providers', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--reverse', '--scope', '--scopes', '--self-transfer', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],'takes': ['--accept', '--batch-size', '--before', '--brain', '--bucket-size', '--by', '--claim', '--dim', '--dir', '--domain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--evidence', '--expected-revision', '--expired', '--force', '--from-pages', '--help', '--holder', '--include-covered', '--json', '--kind', '--limit', '--max-pages', '--no-embed', '--no-embedding', '--offset', '--outcome', '--path', '--quality', '--reject', '--request-id', '--row', '--semantic', '--since', '--sort', '--source', '--source-id', '--stale', '--status', '--supabase', '--to', '--unit', '--until', '--value', '--weight', '--who', '--yes'],'think': ['--anchor', '--brain', '--calibration-holder', '--help', '--json', '--mcp-only', '--model', '--only', '--reference-date', '--rounds', '--save', '--since', '--source', '--take', '--until', '--with-calibration'],'transcripts': ['--accept-pending', '--all', '--all-discovery', '--apply', '--background', '--brain', '--days', '--dry-run', '--embed', '--explain', '--facts', '--follow', '--format', '--full', '--help', '--include-self', '--json', '--limit', '--max-bytes', '--max-cost-usd', '--no-accept-pending', '--only', '--progress-interval', '--progress-json', '--purge', '--quiet', '--since', '--source', '--source-id', '--timeout', '--wait'],diff --git a/src/core/persistence/page-mutations.ts b/src/core/persistence/page-mutations.tsindex b10fb59671..5d36b89c57 100644--- a/src/core/persistence/page-mutations.ts+++ b/src/core/persistence/page-mutations.ts@@ -19,6 +19,8 @@ import { assertPersistenceAccepting, estimatedRetryAfterMs, waiterOnlyOwner, onPimport { parseWireWriteWaitMs } from './write-wait.ts';import { assertTimelineNotOmitted, isTimelineSection, timelineSectionOf, type TimelineSection } from './timeline-omission.ts';import { contentOriginTier } from '../trust/tier.ts';+import { PAGE_MAX_BYTES } from '../page-size-policy.ts';+import { contentSizeHold } from '../markdown.ts';import { throwIfHeld } from '../trust/gate-outcomes.ts';import { admitWrite, assertPageRequestIdentity, assertReplayIntent, getWriteRequest, intentDigest, type WriteAdmission } from './journal.ts';import { submissionAuthority, authorizeStoredRequest } from './authority.ts';@@ -244,6 +246,15 @@ export async function preparePageAdmission(ctx: OperationContext,throw new OperationError('invalid_params', 'fence_repair is reserved for the trusted fence repair.','Drop fence_repair and submit the page without it; gbrain repair fences records its own receipt on the brain host. To fix a malformed facts or takes fence, correct it in content (or write facts with remember and takes with takes_add); a held file is repaired by the brain host operator with gbrain repair fences, so ask the user to run it.');}+ // A body over the page ceiling can never be admitted: refuse it as a caller error before the journal+ // reserves intent bytes, so an oversized write never reads as retryable queue_capacity.+ const body = input.params.content;+ const bodyBytes = (input.operation === 'put_page' || input.operation === 'capture') && typeof body === 'string' && body.length > PAGE_MAX_BYTES / 3+ ? Buffer.byteLength(body, 'utf-8') : 0;+ if (bodyBytes > PAGE_MAX_BYTES) {+ throw new OperationError('request_too_large', contentSizeHold(bodyBytes, PAGE_MAX_BYTES)!.message,+ `Nothing was admitted or written, and the same content is refused on every retry. Pages up to ${PAGE_MAX_BYTES} bytes are stored and searchable; send a smaller page.`);+ }const { page_batch: _forged, timeline_section: _section, ...params } = input.params;const p: Record<string, unknown> = { ...params, ...parseMutationPrecondition(params) };if (p.content_origin !== undefined) contentOriginTier(p.content_origin);diff --git a/test/audit/audit-dir-preload.test.ts b/test/audit/audit-dir-preload.test.tsindex 3987eeddd9..ba675ed16b 100644--- a/test/audit/audit-dir-preload.test.ts+++ b/test/audit/audit-dir-preload.test.ts@@ -48,12 +48,13 @@ describe('shared test-bootstrap audit isolation (#2823)', () => {const realAuditFile = join(realAuditDir, computeContentSanityAuditFilename());// Reproduce the exact disposition the leaking fixture hits: body bytes- // over DEFAULT_BYTES_BLOCK (500_000) with no junk pattern match →+ // over the block threshold (an operator's 500_000) with no junk pattern match →// shouldSkipEmbed=true, no shouldQuarantine → classified 'soft_block'.const result = assessContentSanity({compiled_truth: 'x'.repeat(600_000),timeline: '',title: 'Borderline',+ bytes_block: 500_000,});expect(result.shouldSkipEmbed).toBe(true);expect(result.shouldQuarantine).toBe(false);diff --git a/test/cli-input-plumbing-2822.test.ts b/test/cli-input-plumbing-2822.test.tsindex 844a6d62c1..93bace3ba0 100644--- a/test/cli-input-plumbing-2822.test.ts+++ b/test/cli-input-plumbing-2822.test.ts@@ -132,12 +132,18 @@ describe('#2822 — chunk_skip_reason on 0-chunk puts', () => {});test('oversized content the gate marks embed_skip → embed_skip', async () => {- const result = (await putPage.handler(makeCtx(), {- slug: 'inbox/skipped-embed',- content: `---\ntitle: Big\n---\n\n${'Some prose that keeps going past the block threshold. '.repeat(10_000)}`,- })) as { chunks: number; chunk_skip_reason?: string };- expect(result.chunks).toBe(0);- expect(result.chunk_skip_reason).toBe('embed_skip');+ // An operator's bytes_block under the page ceiling: the gate stores the page with embed_skip and no chunks.+ await engine.setConfig('content_sanity.bytes_block', '500000');+ try {+ const result = (await putPage.handler(makeCtx(), {+ slug: 'inbox/skipped-embed',+ content: `---\ntitle: Big\n---\n\n${'Some prose that keeps going past the block threshold. '.repeat(10_000)}`,+ })) as { chunks: number; chunk_skip_reason?: string };+ expect(result.chunks).toBe(0);+ expect(result.chunk_skip_reason).toBe('embed_skip');+ } finally {+ await engine.unsetConfig('content_sanity.bytes_block');+ }});// #6259: a local put_page is not an owner-tier path, so an embed_skip it plants is stripped.diff --git a/test/doctor-behavioral.test.ts b/test/doctor-behavioral.test.tsindex 69752a06c1..5746cbbeaf 100644--- a/test/doctor-behavioral.test.ts+++ b/test/doctor-behavioral.test.ts@@ -29,6 +29,7 @@ import {type Check,} from '../src/commands/doctor.ts';import { buildEmbedSkipMarker } from '../src/core/embed-skip.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;@@ -214,7 +215,7 @@ describe('buildChecks — orchestrator against PGLite', () => {// the postgres.js singleton, which is never connected on the default// PGLite engine — so every run reported// "Skipped (No database connection: connect() has not been called)".- const big = 'oversized page body prose for the block threshold probe. '.repeat(11_000); // ~630KB > 500KB default+ const big = 'oversized page body prose for the block threshold probe. '.repeat(Math.ceil((PAGE_MAX_BYTES + 1) / 57)); // over the 24 MiB default blockawait engine.putPage('wiki/oversized-probe-1871', {type: 'note',title: 'Oversized Probe 1871',@@ -253,7 +254,7 @@ describe('buildChecks — orchestrator against PGLite', () => {// (an object from buildEmbedSkipMarker, not a bare boolean) — the// canonical writer (src/core/content-sanity.ts) never writes a boolean,// and the exclusion must match what actually lands in frontmatter.- const big = 'oversized page body prose for the embed_skip exclusion probe. '.repeat(11_000);+ const big = 'oversized page body prose for the embed_skip exclusion probe. '.repeat(Math.ceil((PAGE_MAX_BYTES + 1) / 62));await engine.putPage('wiki/oversized-embed-skip-probe', {type: 'note',title: 'Oversized Embed-Skip Probe',@@ -285,7 +286,7 @@ describe('buildChecks — orchestrator against PGLite', () => {// embed-skip consumer in the codebase (embed.ts, postgres-engine.ts,// pglite-engine.ts). This check must stay consistent with that shared// contract rather than inventing its own true/false semantics.- const big = 'oversized page body prose for the embed_skip-absent probe. '.repeat(11_000);+ const big = 'oversized page body prose for the embed_skip-absent probe. '.repeat(Math.ceil((PAGE_MAX_BYTES + 1) / 59));await engine.putPage('wiki/oversized-embed-skip-absent-probe', {type: 'note',title: 'Oversized Embed-Skip-Absent Probe',diff --git a/test/eval-brainbench-e2e.slow.test.ts b/test/eval-brainbench-e2e.slow.test.tsindex fc3cad109c..02354bdd5c 100644--- a/test/eval-brainbench-e2e.slow.test.ts+++ b/test/eval-brainbench-e2e.slow.test.ts@@ -22,6 +22,7 @@ import { beforeAll, describe, expect, test } from 'bun:test';import { cpSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';const REPO = process.cwd();const CLI = join(REPO, 'src', 'cli.ts');@@ -159,7 +160,7 @@ beforeAll(async () => {mkdirSync(join(dupRoot, 'fixtures'));mkdirSync(join(dupRoot, 'gold'));// A page whose content exceeds importFromContent's size cap → status 'skipped' → SeedError.- const huge = 'x'.repeat(5_000_001);+ const huge = 'x'.repeat(PAGE_MAX_BYTES + 1);writeFileSync(join(dupRoot, 'fixtures', 'seedfail-001.fixture.json'),JSON.stringify({diff --git a/test/fixtures/goldens/cli/literal-imports.json b/test/fixtures/goldens/cli/literal-imports.jsonindex f31f044594..f2c173c4e7 100644--- a/test/fixtures/goldens/cli/literal-imports.json+++ b/test/fixtures/goldens/cli/literal-imports.json@@ -147,6 +147,7 @@"./commands/reindex.ts","./commands/reindex-multimodal.ts","./core/sync-concurrency.ts",+ "./core/oversized-backfill.ts","./commands/reindex-vectors.ts","./commands/reindex-aliases.ts","./commands/reindex.ts",diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.jsonindex 24a1aa8769..85af1fb5d2 100644--- a/test/fixtures/goldens/doctor/content-pglite-human.json+++ b/test/fixtures/goldens/doctor/content-pglite-human.json@@ -65,7 +65,7 @@" [OK] pglite_scale: PGLite at 5 pages — comfortable below the 1000-page threshold"," [OK] rls: Skipped (PGLite — no PostgREST exposure, RLS not applicable)"," [OK] schema_version: Version <latest> (latest: <latest>)",- " [OK] schema_columns: 1115 column(s) verified against live schema",+ " [OK] schema_columns: 1132 column(s) verified against live schema"," [OK] rls_event_trigger: Skipped (PGLite — no event trigger support)"," [INFO] embeddings: Not applicable: embeddings are disabled on this brain (keyword search keeps working)."," [INFO] embedding_provider: Not probed: embeddings are disabled on this brain by choice (keyword search keeps working).",@@ -124,7 +124,8 @@" [OK] cross_modal_modality_backfill: All image-asset chunks have modality=image"," [OK] unified_multimodal_coverage: search.unified_multimodal is off; coverage check N/A"," [OK] markdown_body_completeness: No truncated bodies detected",- " [OK] oversized_pages: No pages exceed 500000 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ " [OK] oversized_pages: No pages exceed 25165824 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ " [OK] partial_embedding: No large page is held or capped by embed.max_usd_per_page."," [OK] scraper_junk_pages: No junk-pattern hits in 5 recent page(s) (use --content-audit for full scan)"," [OK] content_sanity_audit_recent: No content-sanity events in last 7 days (audit JSONL is local to this host; share GBRAIN_AUDIT_DIR for multi-host visibility)"," [OK] quarantined_pages: No quarantined pages",@@ -182,6 +183,7 @@" [OK] consumers_without_heartbeat: PGLite admits one process; no consumer heartbeat rows are kept."," [OK] host_identity_mismatch: This process's host identity (<home>/.gbrain/persistence/host.json) owns every binding this filesystem holds."," [OK] extract_atoms_held_failed: No managed atom page or transcript is held after repeated extraction failures.",+ " [OK] extraction_input_truncated: Every page extraction read all of its input (no head-only, tail-window or size-skip receipts)."," [OK] fence_integrity: No malformed facts or takes fence is held, stored or waiting in a checkout (2 source(s) scanned)."," [OK] search_mode: Mode: conservative (no per-key overrides — mode bundle is canonical)."," [OK] hidden_by_search_policy: No pages hidden by search-exclude policy.",diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.jsonindex 6e9e2049c4..1572fee13a 100644--- a/test/fixtures/goldens/doctor/content-pglite-json.json+++ b/test/fixtures/goldens/doctor/content-pglite-json.json@@ -552,7 +552,7 @@},{"category": "meta",- "message": "1115 column(s) verified against live schema",+ "message": "1132 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1322,10 +1322,16 @@},{"category": "brain",- "message": "No pages exceed 500000 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ "message": "No pages exceed 25165824 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)","name": "oversized_pages","status": "ok"},+ {+ "category": "brain",+ "message": "No large page is held or capped by embed.max_usd_per_page.",+ "name": "partial_embedding",+ "status": "ok"+ },{"category": "brain","message": "No junk-pattern hits in 5 recent page(s) (use --content-audit for full scan)",@@ -2249,6 +2255,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex 2a3fc4c786..1180aa4756 100644--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json@@ -554,7 +554,7 @@},{"category": "meta",- "message": "1115 column(s) verified against live schema",+ "message": "1132 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1432,10 +1432,16 @@},{"category": "brain",- "message": "No pages exceed 500000 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ "message": "No pages exceed 25165824 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)","name": "oversized_pages","status": "ok"},+ {+ "category": "brain",+ "message": "No large page is held or capped by embed.max_usd_per_page.",+ "name": "partial_embedding",+ "status": "ok"+ },{"category": "brain","message": "No junk-pattern hits in 20 recent page(s) (use --content-audit for full scan)",@@ -2354,6 +2360,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {@@ -3725,7 +3740,7 @@},{"category": "meta",- "message": "1115 column(s) verified against live schema",+ "message": "1132 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -4603,10 +4618,16 @@},{"category": "brain",- "message": "No pages exceed 500000 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ "message": "No pages exceed 25165824 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)","name": "oversized_pages","status": "ok"},+ {+ "category": "brain",+ "message": "No large page is held or capped by embed.max_usd_per_page.",+ "name": "partial_embedding",+ "status": "ok"+ },{"category": "brain","message": "No junk-pattern hits in 20 recent page(s) (use --content-audit for full scan)",@@ -5525,6 +5546,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.jsonindex 7cc31d7a40..f70b780a93 100644--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json@@ -535,7 +535,7 @@},{"category": "ops",- "message": "RLS enabled on 134/134 public tables",+ "message": "RLS enabled on 136/136 public tables","name": "rls","status": "ok"},@@ -547,7 +547,7 @@},{"category": "meta",- "message": "1121 column(s) verified against live schema",+ "message": "1138 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1428,10 +1428,16 @@},{"category": "brain",- "message": "No pages exceed 500000 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ "message": "No pages exceed 25165824 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)","name": "oversized_pages","status": "ok"},+ {+ "category": "brain",+ "message": "No large page is held or capped by embed.max_usd_per_page.",+ "name": "partial_embedding",+ "status": "ok"+ },{"category": "brain","message": "No junk-pattern hits in 20 recent page(s) (use --content-audit for full scan)",@@ -2348,6 +2354,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {@@ -3698,7 +3713,7 @@},{"category": "ops",- "message": "RLS enabled on 134/134 public tables",+ "message": "RLS enabled on 136/136 public tables","name": "rls","status": "ok"},@@ -3710,7 +3725,7 @@},{"category": "meta",- "message": "1121 column(s) verified against live schema",+ "message": "1138 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -4591,10 +4606,16 @@},{"category": "brain",- "message": "No pages exceed 500000 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)",+ "message": "No pages exceed 25165824 bytes (excluding embed_skip pages, which already took the accepted non-embeddable remediation)","name": "oversized_pages","status": "ok"},+ {+ "category": "brain",+ "message": "No large page is held or capped by embed.max_usd_per_page.",+ "name": "partial_embedding",+ "status": "ok"+ },{"category": "brain","message": "No junk-pattern hits in 20 recent page(s) (use --content-audit for full scan)",@@ -5511,6 +5532,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex ebf92f41a7..f9b16d70d9 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -2132,6 +2132,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {@@ -2209,15 +2218,6 @@"name": "fence_integrity","status": "ok"},- {- "category": "brain",- "details": {- "groups": []- },- "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",- "name": "extraction_input_truncated",- "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 562c3289de..301d1efbaa 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -2140,6 +2140,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {@@ -2217,15 +2226,6 @@"name": "fence_integrity","status": "ok"},- {- "category": "brain",- "details": {- "groups": []- },- "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",- "name": "extraction_input_truncated",- "status": "ok"- },{"category": "ops","message": "Mode: conservative (no per-key overrides — mode bundle is canonical).",diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex c2fb7c3031..7ac1b719fd 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -2134,6 +2134,15 @@"name": "extract_atoms_held_failed","status": "ok"},+ {+ "category": "brain",+ "details": {+ "groups": []+ },+ "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",+ "name": "extraction_input_truncated",+ "status": "ok"+ },{"category": "brain","details": {@@ -2211,15 +2220,6 @@"name": "fence_integrity","status": "ok"},- {- "category": "brain",- "details": {- "groups": []- },- "message": "Every page extraction read all of its input (no head-only, tail-window or size-skip receipts).",- "name": "extraction_input_truncated",- "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 2aafd88a82..50888bbd4a 100644--- a/test/fixtures/goldens/doctor/registry-build-checks.json+++ b/test/fixtures/goldens/doctor/registry-build-checks.json@@ -783,11 +783,11 @@},{"category": "brain",- "name": "fence_integrity"+ "name": "extraction_input_truncated"},{"category": "brain",- "name": "extraction_input_truncated"+ "name": "fence_integrity"},{"category": "ops",diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.jsonindex 3f105bf6fe..32367afb7f 100644--- a/test/fixtures/goldens/exports/types.json+++ b/test/fixtures/goldens/exports/types.json@@ -4566,7 +4566,7 @@"kind": "variable","name": "MAX_FILE_SIZE","signature": [- "5000000"+ "number"]},{diff --git a/test/fixtures/goldens/sql-text/chunks.json b/test/fixtures/goldens/sql-text/chunks.jsonindex 0377b7b9c9..f347cbb26c 100644--- a/test/fixtures/goldens/sql-text/chunks.json+++ b/test/fixtures/goldens/sql-text/chunks.json@@ -33,8 +33,8 @@{"lane": "pool","params": [],- "sql": "SELECT count(*)::int AS count FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND cc.\"embedding\" IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip')",- "textSha256": "f7c19af79f144c19284a85521a93bf64cc5034c5784271637faefd9faacf99a6"+ "sql": "SELECT count(*)::int AS count FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND cc.\"embedding\" IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open')",+ "textSha256": "97bfdf50343c2c13a69749e54ca43f8a8831070a4bda17853d6c06f667697009"}],"signature+includeNullSignature": [@@ -49,8 +49,8 @@"params": ["string"],- "sql": "SELECT count(*)::int AS count FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND (cc.\"embedding\" IS NULL OR p.embedding_signature IS NULL OR p.embedding_signature <> $1) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip')",- "textSha256": "eaf3dbafdaa135ddd90d480f2fed763481c3e0ed23b37c52f57888b7f758c866"+ "sql": "SELECT count(*)::int AS count FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND (cc.\"embedding\" IS NULL OR p.embedding_signature IS NULL OR p.embedding_signature <> $1) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open')",+ "textSha256": "da53d97719d3277cfbdfda19c015c9b2b05f80723dccfad34cbb7594e70b30df"}],"signature+sourceId": [@@ -66,8 +66,8 @@"string","string"],- "sql": "SELECT count(*)::int AS count FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND (cc.\"embedding\" IS NULL OR (p.embedding_signature IS NOT NULL AND p.embedding_signature <> $1)) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND p.source_id = $2",- "textSha256": "617a3e9d3faff29727611581e3391e39cdb18f073a32a9db523d7d5604cbfdc0"+ "sql": "SELECT count(*)::int AS count FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND (cc.\"embedding\" IS NULL OR (p.embedding_signature IS NOT NULL AND p.embedding_signature <> $1)) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') AND p.source_id = $2",+ "textSha256": "112deb1371695b66247475c2092862ab7bda82f38933168df00b8bb399671571"}]},@@ -296,8 +296,8 @@"params": ["array<>"],- "sql": "UPDATE content_chunks cc SET \"embedding\" = NULL, embedded_at = NULL, embedded_text_hash = NULL, embedding_pending_since = now() FROM pages p WHERE cc.page_id = p.id AND p.source_id=ANY($1::text[]) AND EXISTS (SELECT 1 FROM sources s WHERE s.id=p.source_id AND NOT s.archived) AND p.deleted_at IS NULL AND cc.\"embedding\" IS NOT NULL AND cc.embedded_text_hash IS NOT NULL AND cc.embedded_text_hash <> md5(cc.chunk_text) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') RETURNING cc.page_id",- "textSha256": "1923e910207cfe4111f94acf3d93af891997f1f1ef503ede9593b0650ccb54e7"+ "sql": "UPDATE content_chunks cc SET \"embedding\" = NULL, embedded_at = NULL, embedded_text_hash = NULL, embedding_pending_since = now() FROM pages p WHERE cc.page_id = p.id AND p.source_id=ANY($1::text[]) AND EXISTS (SELECT 1 FROM sources s WHERE s.id=p.source_id AND NOT s.archived) AND p.deleted_at IS NULL AND cc.\"embedding\" IS NOT NULL AND cc.embedded_text_hash IS NOT NULL AND cc.embedded_text_hash <> md5(cc.chunk_text) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') RETURNING cc.page_id",+ "textSha256": "fb381f53bfef8651bd109cb1182781bd25f65cf2a1b0b94ffbfc3d97186acc08"},{"event": "commit",@@ -330,8 +330,8 @@"array<>","string"],- "sql": "UPDATE content_chunks cc SET \"embedding\" = NULL, embedded_at = NULL, embedded_text_hash = NULL, embedding_pending_since = now() FROM pages p WHERE cc.page_id = p.id AND p.source_id=ANY($1::text[]) AND EXISTS (SELECT 1 FROM sources s WHERE s.id=p.source_id AND NOT s.archived) AND p.deleted_at IS NULL AND cc.\"embedding\" IS NOT NULL AND cc.embedded_text_hash IS NOT NULL AND cc.embedded_text_hash <> md5(cc.chunk_text) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND p.source_id = $2 RETURNING cc.page_id",- "textSha256": "8aa457cf6fd0f7a5891eb13db34d5d109faebe46ef2c798adf18622dac5a2687"+ "sql": "UPDATE content_chunks cc SET \"embedding\" = NULL, embedded_at = NULL, embedded_text_hash = NULL, embedding_pending_since = now() FROM pages p WHERE cc.page_id = p.id AND p.source_id=ANY($1::text[]) AND EXISTS (SELECT 1 FROM sources s WHERE s.id=p.source_id AND NOT s.archived) AND p.deleted_at IS NULL AND cc.\"embedding\" IS NOT NULL AND cc.embedded_text_hash IS NOT NULL AND cc.embedded_text_hash <> md5(cc.chunk_text) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') AND p.source_id = $2 RETURNING cc.page_id",+ "textSha256": "ab5f41f2171c1b82bfd50dba397be0dbd0f23849bb1ffe55b2a1bc389ba13a5b"},{"event": "commit",@@ -453,8 +453,8 @@"number","number"],- "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND (cc.page_id, cc.chunk_index) > ($1, $2) ORDER BY cc.page_id, cc.chunk_index LIMIT $3",- "textSha256": "7485ae74ce21c864245aa7feecc993e754f5a92be9a173ffbc820cb9c9982610"+ "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') AND (cc.page_id, cc.chunk_index) > ($1, $2) ORDER BY cc.page_id, cc.chunk_index LIMIT $3",+ "textSha256": "30e3022cbdd786647cd5d83b3e6e290d685612da6f4ff4d0e60ae2d32a62da47"}],"sourceId": [@@ -472,8 +472,8 @@"number","number"],- "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND p.source_id = $1 AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND (cc.page_id, cc.chunk_index) > ($2, $3) ORDER BY cc.page_id, cc.chunk_index LIMIT $4",- "textSha256": "552e046582d33013abd64e01d8aa7c165f4ce31105f23f14a9268e385a8b7a8c"+ "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND p.source_id = $1 AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') AND (cc.page_id, cc.chunk_index) > ($2, $3) ORDER BY cc.page_id, cc.chunk_index LIMIT $4",+ "textSha256": "2bcb4b1c3ef490a7c0dd05a40de054a9a723e102f1c6d7ef5ea9ba4d2907c752"}],"updated_desc": [@@ -488,8 +488,8 @@"params": ["number"],- "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $1",- "textSha256": "b50b804738defb5e6746ba788e604689399938c0ff67579bd035b03fa43dcd51"+ "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $1",+ "textSha256": "ae7a9e008a2ee2e9a06c81076831d0aab18e2a7687caf4ddebe242f4af32c5d3"}],"updated_desc+cursor": [@@ -510,8 +510,8 @@"number","number"],- "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND ( p.updated_at < $1::timestamptz OR (p.updated_at = $2::timestamptz AND p.id > $3) OR (p.updated_at = $4::timestamptz AND p.id = $5 AND cc.chunk_index > $6) ) ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $7",- "textSha256": "5ac6b67b9ace4e0a6f2f67b416795073440d15cbc9628b08fbab911ec6ca891f"+ "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') AND ( p.updated_at < $1::timestamptz OR (p.updated_at = $2::timestamptz AND p.id > $3) OR (p.updated_at = $4::timestamptz AND p.id = $5 AND cc.chunk_index > $6) ) ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $7",+ "textSha256": "a6705a1ff3131f3f832055d173b08efaf220385b9ea9bede8b02dc3c009590bc"}],"updated_desc+sourceId": [@@ -527,8 +527,8 @@"string","number"],- "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND p.source_id = $1 AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $2",- "textSha256": "2b767ab1b7ba583d593e075e19b79072f3e21b3891e85d0a6c3fc58ddbf0b424"+ "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND p.source_id = $1 AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $2",+ "textSha256": "d2a8d36b4683a0ae5b0983b0d06fb22e1cc0e6360b6e0a8593c46014adefe2f1"}],"updated_desc+sourceId+cursor": [@@ -550,8 +550,8 @@"number","number"],- "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND p.source_id = $1 AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND ( p.updated_at < $2::timestamptz OR (p.updated_at = $3::timestamptz AND p.id > $4) OR (p.updated_at = $5::timestamptz AND p.id = $6 AND cc.chunk_index > $7) ) ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $8",- "textSha256": "ba7b2efcb89df8907fad094882719d8cba4b24b23bb8d3bdec1229133001c655"+ "sql": "SELECT p.slug, cc.chunk_index, cc.chunk_text, cc.chunk_source, cc.model, cc.token_count, p.source_id, cc.page_id, p.updated_at FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE cc.\"embedding\" IS NULL AND p.deleted_at IS NULL AND p.source_id = $1 AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open') AND ( p.updated_at < $2::timestamptz OR (p.updated_at = $3::timestamptz AND p.id > $4) OR (p.updated_at = $5::timestamptz AND p.id = $6 AND cc.chunk_index > $7) ) ORDER BY p.updated_at DESC NULLS LAST, p.id ASC, cc.chunk_index ASC LIMIT $8",+ "textSha256": "e7d5d93ccb96ab546168596ee9ea4b15d2441d62bb0d05d4505f4dc1d10a8c98"}]},@@ -580,8 +580,8 @@{"lane": "pool","params": [],- "sql": "SELECT COALESCE(SUM(LENGTH(cc.chunk_text)), 0)::bigint AS chars FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND cc.\"embedding\" IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip')",- "textSha256": "293069e934731c25886cdeb52825015630186dbe93a0fabe01b67e10cb81c4e4"+ "sql": "SELECT COALESCE(SUM(LENGTH(cc.chunk_text)), 0)::bigint AS chars FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND cc.\"embedding\" IS NULL AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open')",+ "textSha256": "67b4ffd6b3b6383b7b7d4a9737bd2e6fa6a4be6c63106a284daa636e37a55168"}],"signature": [@@ -596,8 +596,8 @@"params": ["string"],- "sql": "SELECT COALESCE(SUM(LENGTH(cc.chunk_text)), 0)::bigint AS chars FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND (cc.\"embedding\" IS NULL OR (p.embedding_signature IS NOT NULL AND p.embedding_signature <> $1)) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip')",- "textSha256": "0af30c01b21c5d96c909aba54e4e4843cbdbf919b281441dc75d2698e3f1ce64"+ "sql": "SELECT COALESCE(SUM(LENGTH(cc.chunk_text)), 0)::bigint AS chars FROM content_chunks cc JOIN pages p ON p.id = cc.page_id WHERE p.deleted_at IS NULL AND (cc.\"embedding\" IS NULL OR (p.embedding_signature IS NOT NULL AND p.embedding_signature <> $1)) AND NOT (COALESCE(p.frontmatter, '{}'::jsonb) ? 'embed_skip') AND NOT EXISTS (SELECT 1 FROM page_embedding_budget peb WHERE peb.page_id = p.id AND peb.state <> 'open')",+ "textSha256": "9c034aef0db1eb12ebc2f41441bdb1bb9a71f59663efbfa7ca19099e7e8aaa97"}]},diff --git a/test/github-source-materialize.test.ts b/test/github-source-materialize.test.tsindex 2f1b789484..4d18ef0ec8 100644--- a/test/github-source-materialize.test.ts+++ b/test/github-source-materialize.test.ts@@ -7,6 +7,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { resetPgliteState } from './helpers/reset-pglite.ts';import { withEnv } from './helpers/with-env.ts';import { runGitHubSync, type GitHubSourceConfig } from '../src/core/github-source.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;@@ -371,7 +372,7 @@ describe('github-source materialize', () => {expect(initial.failedFiles ?? 0).toBe(0);expect(JSON.parse(readFileSync(join(dir, '.github-source.json'), 'utf-8')).last_sweep_at).toBe('2026-08-02T00:00:00Z');const oldPage = readFileSync(join(dir, 'gh', REPO, '3.md'), 'utf-8');- fx.items.get(3)!.body = 'x'.repeat(5_000_001);+ fx.items.get(3)!.body = 'x'.repeat(PAGE_MAX_BYTES + 1);fx.items.get(3)!.updated_at = '2026-08-07T00:00:00Z';const res = await runGitHubSync(engine,@@ -403,7 +404,7 @@ describe('github-source materialize', () => {await withEnv({ GH_TOKEN: 'test-token' }, async () => {await runGitHubSync(engine, 'ghsrc', makeCfg(dir), { sourceId: 'ghsrc', full: true }, fetchImpl);const oldPage = readFileSync(join(dir, 'gh', REPO, '3.md'), 'utf-8');- fx.items.get(3)!.body = 'x'.repeat(5_000_001);+ fx.items.get(3)!.body = 'x'.repeat(PAGE_MAX_BYTES + 1);await expect(runGitHubSync(engine,'ghsrc',diff --git a/test/import-clear-failures-on-success.test.ts b/test/import-clear-failures-on-success.test.tsindex 93e9cd94d7..59e89e74f3 100644--- a/test/import-clear-failures-on-success.test.ts+++ b/test/import-clear-failures-on-success.test.ts@@ -22,6 +22,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { runImport } from '../src/commands/import.ts';import { withEnv } from './helpers/with-env.ts';import { loadSyncFailures } from '../src/core/sync-failure-ledger.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;@@ -48,7 +49,7 @@ describe('a path that fails then succeeds clears its ledger row (#3839)', () =>// Run 1: poison.md is oversized (deterministic soft-failure, same// MAX_FILE_SIZE trigger as the #3838 test — no thrown exception needed).const poisonPath = join(repo, 'poison.md');- writeFileSync(poisonPath, '---\ntype: note\n---\n' + 'x'.repeat(5_000_001));+ writeFileSync(poisonPath, '---\ntype: note\n---\n' + 'x'.repeat(PAGE_MAX_BYTES + 1));const gbrainHome = mkdtempSync(join(tmpdir(), 'gbrain-home-'));diff --git a/test/import-source-id-bookkeeping.test.ts b/test/import-source-id-bookkeeping.test.tsindex b9e26135ea..38922e5124 100644--- a/test/import-source-id-bookkeeping.test.ts+++ b/test/import-source-id-bookkeeping.test.ts@@ -22,6 +22,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { runImport } from '../src/commands/import.ts';import { withEnv } from './helpers/with-env.ts';import { loadSyncFailures } from '../src/core/sync-failure-ledger.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;@@ -59,10 +60,10 @@ describe('import bookkeeping records the resolved source (#3838)', () => {execSync('git commit -m seed', { cwd: repo, stdio: 'pipe' });// Deterministic soft-failure: import-file.ts rejects any file over- // MAX_FILE_SIZE (5_000_000 bytes) with a real `result.error`, which+ // MAX_FILE_SIZE (the 24 MiB page ceiling) with a real `result.error`, which// runImport pushes into `failures[]` without needing a thrown// exception — the exact code path recordFailures reads from.- writeFileSync(join(repo, 'oversized.md'), '---\ntype: note\n---\n' + 'x'.repeat(5_000_001));+ writeFileSync(join(repo, 'oversized.md'), '---\ntype: note\n---\n' + 'x'.repeat(PAGE_MAX_BYTES + 1));const gbrainHome = mkdtempSync(join(tmpdir(), 'gbrain-home-'));await withEnv({ GBRAIN_HOME: gbrainHome }, async () => {diff --git a/test/import-source-id-last-sync-at.test.ts b/test/import-source-id-last-sync-at.test.tsindex bba29f9756..0c88e5290e 100644--- a/test/import-source-id-last-sync-at.test.ts+++ b/test/import-source-id-last-sync-at.test.ts@@ -24,6 +24,7 @@ import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { runImport } from '../src/commands/import.ts';import { withEnv } from './helpers/with-env.ts';import { resetPgliteState } from './helpers/reset-pglite.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;@@ -299,9 +300,9 @@ describe('import stamps sources.last_sync_at for a local_path-registered sourcewriteFileSync(join(repo, 'seed.md'), '---\ntype: note\n---\n# Seed\n\nbody\n');// Deterministic soft-failure, same technique as// import-source-id-bookkeeping.test.ts: import-file.ts rejects any file- // over MAX_FILE_SIZE (5_000_000 bytes) with a real result.error, which+ // over MAX_FILE_SIZE (the 24 MiB page ceiling) with a real result.error, which// runImport pushes into failures[] without needing a thrown exception.- writeFileSync(join(repo, 'oversized.md'), '---\ntype: note\n---\n' + 'x'.repeat(5_000_001));+ writeFileSync(join(repo, 'oversized.md'), '---\ntype: note\n---\n' + 'x'.repeat(PAGE_MAX_BYTES + 1));await engine.executeRaw(`INSERT INTO sources (id, name, local_path) VALUES ('dept-x', 'dept-x', $1)`,diff --git a/test/lint-content-sanity.test.ts b/test/lint-content-sanity.test.tsindex 0c3caf0c66..2a921abd2b 100644--- a/test/lint-content-sanity.test.ts+++ b/test/lint-content-sanity.test.ts@@ -28,7 +28,7 @@ describe('lint — huge-page rule', () => {test('fires with block-threshold language when body exceeds block', () => {const content = MINIMAL_FRONTMATTER + 'a'.repeat(600_000);- const issues = lintContent(content, 'test.md');+ const issues = lintContent(content, 'test.md', { contentSanity: { bytes_block: 500_000 } });const huge = issues.find((i) => i.rule === 'huge-page');expect(huge).toBeDefined();expect(huge!.message).toContain('block');diff --git a/test/persistence-sync-holds.test.ts b/test/persistence-sync-holds.test.tsindex 2f4c70ab45..48219d5918 100644--- a/test/persistence-sync-holds.test.ts+++ b/test/persistence-sync-holds.test.ts@@ -22,6 +22,7 @@ import { gitHoldStatusLines, readGitHoldStatuses } from '../src/core/persistenceimport { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';import { testBackends } from './helpers/test-backends.ts';import { withEnv } from './helpers/with-env.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';const backends = testBackends();const home = mkdtempSync(join(tmpdir(), 'gbrain-sync-holds-'));@@ -108,9 +109,9 @@ test('fixing and committing the file imports it and clears the hold; deleting aexpect(result.holds_outstanding).toBeUndefined();}), 180_000);-test('slug conflicts and files over 5 MB and over the 10 MiB read bound are held; valid files keep importing', () => each(async engine => {- const big = `---\ntitle: Big\n---\n${'x'.repeat(6_000_000)}\n`;- const huge = `---\ntitle: Huge\n---\n${'y'.repeat(11 * 1024 * 1024)}\n`;+test('slug conflicts and files over the page ceiling (the sync read bound) are held; valid files keep importing', () => each(async engine => {+ const big = `---\ntitle: Big\n---\n${'x'.repeat(PAGE_MAX_BYTES + 16)}\n`;+ const huge = `---\ntitle: Huge\n---\n${'y'.repeat(PAGE_MAX_BYTES + 1024 * 1024)}\n`;const s = await source(engine, { 'notes/slug.md': '---\ntitle: Slug\nslug: notes/elsewhere\n---\nBody.\n', 'notes/big.md': big, 'notes/huge.md': huge, 'notes/ok.md': note('Ok') });const result = await s.sync();expect(result).toMatchObject({ status: 'first_sync', added: 1, held_count: 3 });@@ -125,7 +126,7 @@ test('slug conflicts and files over 5 MB and over the 10 MiB read bound are heldtest('an oversized pinned blob is held by its size even when the working copy is small', () => each(async engine => {const s = await source(engine, { 'notes/ok.md': note('Ok') });- s.write('notes/history.md', `---\ntitle: History\n---\n${'z'.repeat(11 * 1024 * 1024)}\n`); commit(s.root, 'big');+ s.write('notes/history.md', `---\ntitle: History\n---\n${'z'.repeat(PAGE_MAX_BYTES + 1024 * 1024)}\n`); commit(s.root, 'big');s.write('notes/history.md', note('Small now'));const result = await s.sync();expect(result.held?.map(item => [item.path, item.code])).toEqual([['notes/history.md', 'file_too_large']]);diff --git a/test/put-page-error-passthrough.test.ts b/test/put-page-error-passthrough.test.tsindex 36cff1fd25..64ff57ca2d 100644--- a/test/put-page-error-passthrough.test.ts+++ b/test/put-page-error-passthrough.test.ts@@ -7,11 +7,17 @@* pushing >5MB got bare `{ status: 'skipped', chunks: 0 }` and had no idea* why the page never appeared. The reason now rides the op response.* capture delegates to put_page, so it inherits the passthrough.+ *+ * Large pages (N14 baseline): a body over the page ceiling is refused as+ * request_too_large (a caller error) before journal admission, so it never+ * reserves intent bytes and never reads as retryable queue_capacity, even when+ * it is also over the journal's intent-byte cap.*/import { describe, test, expect, beforeAll, afterAll, beforeEach } from 'bun:test';import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { resetPgliteState } from './helpers/reset-pglite.ts';import { operations, type OperationContext } from '../src/core/operations.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;const put_page = operations.find(o => o.name === 'put_page')!;@@ -43,14 +49,27 @@ beforeEach(async () => {}, 30_000);describe('put_page passes the skip/error reason through (#3984)', () => {- test('>5MB content returns a failed receipt with a bounded size diagnostic', async () => {- const big = '---\ntype: note\n---\n' + 'x'.repeat(5_000_001);+ test('content over the page ceiling is refused before admission with a bounded size diagnostic', async () => {+ const big = '---\ntype: note\n---\n' + 'x'.repeat(PAGE_MAX_BYTES);let failure: any;try { await put_page.handler(ctxOf(), { slug: 'notes/too-big', content: big }); } catch (error) { failure = error; }expect(failure.code).toBe('request_too_large');- expect(failure.message).toContain('max 5000000');- expect(failure.writeRequest.state).toBe('failed');+ expect(failure.message).toContain(`max ${PAGE_MAX_BYTES}`);+ expect(failure.message.length).toBeLessThan(400);+ expect(failure.writeRequest).toBeUndefined();expect(await engine.getPage('notes/too-big')).toBeNull();+ const [journal] = await engine.executeRaw<{ n: number }>('SELECT count(*)::int AS n FROM persistence_requests');+ expect(Number(journal.n)).toBe(0);+ });++ test('an over-ceiling body that is also over the intent-byte cap is a size refusal, never queue_capacity', async () => {+ await engine.setConfig('persistence.limits.principal_intent_bytes', String(16 * 1024 * 1024));+ const big = '---\ntype: note\n---\n' + 'x'.repeat(PAGE_MAX_BYTES);+ let failure: any;+ try { await put_page.handler(ctxOf(), { slug: 'notes/too-big-for-the-journal', content: big }); } catch (error) { failure = error; }+ expect(failure.code).toBe('request_too_large');+ const small = await put_page.handler(ctxOf(), { slug: 'notes/fits', content: '---\ntype: note\n---\nfits\n' }) as Record<string, unknown>;+ expect(small.status).toBe('created_or_updated');});test('invalid YAML returns a failed receipt without copying submitted content', async () => {diff --git a/test/sync-legacy-holds.test.ts b/test/sync-legacy-holds.test.tsindex acd326bffd..6dd0aaa36e 100644--- a/test/sync-legacy-holds.test.ts+++ b/test/sync-legacy-holds.test.ts@@ -23,6 +23,7 @@ import { makeGitFixture } from './helpers/git-fixture.ts';import { isolatedPersistencePostgres } from './helpers/persistence-postgres.ts';import { testBackends } from './helpers/test-backends.ts';import { withEnv } from './helpers/with-env.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';const backends = testBackends();const engines: BrainEngine[] = [];@@ -139,7 +140,7 @@ test('incremental: a refused commit is held, fixing it imports and clears the hotest('slug conflicts and over-size files are held, and a slug conflict re-screens every run', () => eachEngine(async () => {const { id, root } = await source({ 'notes/a.md': good('Alpha') });await sync(id, root);- write(root, { 'notes/spoof.md': '---\ntitle: Spoof\nslug: notes/a\n---\nBody.\n', 'notes/huge.md': `---\ntitle: Huge\n---\n${'x'.repeat(5_100_000)}\n` });+ write(root, { 'notes/spoof.md': '---\ntitle: Spoof\nslug: notes/a\n---\nBody.\n', 'notes/huge.md': `---\ntitle: Huge\n---\n${'x'.repeat(PAGE_MAX_BYTES + 100_000)}\n` });const result = await sync(id, root);expect(result.status).toBe('synced');expect(await lastCommit(id)).toBe(git(root, 'rev-parse', 'HEAD'));diff --git a/test/sync-rename-reconcile.serial.test.ts b/test/sync-rename-reconcile.serial.test.tsindex 0707dd3e30..f72c48001a 100644--- a/test/sync-rename-reconcile.serial.test.ts+++ b/test/sync-rename-reconcile.serial.test.ts@@ -30,6 +30,7 @@ import { tmpdir } from 'node:os';import { join } from 'node:path';import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { resetPgliteState } from './helpers/reset-pglite.ts';+import { PAGE_MAX_BYTES } from '../src/core/page-size-policy.ts';let engine: PGLiteEngine;const repos: string[] = [];@@ -1026,7 +1027,7 @@ describe('#3583 review: an over-size-gate fallback-regime file suspends deletes// noise), but the liveness index reads the WORKING TREE — where the// file now sits over the gate. Concluding "no row possible" from the// current size would delete the row imported before the growth.- const bigBody = 'x'.repeat(5_100_000);+ const bigBody = 'x'.repeat(PAGE_MAX_BYTES + 100_000);writeFileSync(join(repo, '\u{1F389}.md'), ['---', 'type: person', 'title: Party Notes', 'slug: Party-Notes', '---','', bigBody,@@ -1086,7 +1087,7 @@ describe('#3583 review: an over-size-gate fallback-regime file suspends deletes// Now make the tracked-slug index incomplete, exactly as above.writeFileSync(join(repo, '\u{1F389}.md'), ['---', 'type: person', 'title: Party Notes', 'slug: Party-Notes', '---',- '', 'x'.repeat(5_100_000),+ '', 'x'.repeat(PAGE_MAX_BYTES + 100_000),].join('\n'));await engine.putPage('people/ghost', {type: 'person', title: 'Ghost (stale)', compiled_truth: 'no backing file anywhere',diff --git a/test/write-gate-work-counters-6490.test.ts b/test/write-gate-work-counters-6490.test.tsindex 97eed758e6..4dc25f4552 100644--- a/test/write-gate-work-counters-6490.test.ts+++ b/test/write-gate-work-counters-6490.test.ts@@ -85,17 +85,20 @@ describe('write gate work counters (#6490)', () => {expect(work.scannedChars).toBeLessThanOrEqual(130_000);});- test('5 MB adversarial text (every anchor in every window): the prefilter cannot help, the ranged search still bounds the scan', () => {+ test('adversarial text at the import cap (every anchor in every window): the prefilter cannot help, the ranged search still bounds the scan', () => {const { work, hits, plainHits, fieldChars } = assess(adversarial(MAX_IMPORT_BYTES));- console.log(`[write-gate work] 5 MB adversarial: ${JSON.stringify(work)}`);+ console.log(`[write-gate work] ${MAX_IMPORT_BYTES}-byte adversarial: ${JSON.stringify(work)}`);expect(hits).toEqual(plainHits);- // Measured: windows 1491, patternChecks 29802, regexCalls 219480, scannedChars 116975221.+ // Measured at 5 MB: windows 1491, patternChecks 29802, regexCalls 219480, scannedChars 116975221; at the+ // 24 MiB page ceiling: windows 7500, patternChecks 149982, regexCalls 1104728, scannedChars 588776939.+ // The bounds are the 5 MB bounds per byte, so the work stays linear in the page size.+ const perFiveMb = MAX_IMPORT_BYTES / 5_000_000;expect(work.normalizedChars).toBe(0);expect(work.anchorScanChars).toBe(fieldChars);expect(work.windows).toBeLessThanOrEqual(Math.ceil(fieldChars / STEP) + 1);- expect(work.patternChecks).toBeLessThanOrEqual(45_000);- expect(work.regexCalls).toBeLessThanOrEqual(330_000);- expect(work.scannedChars).toBeLessThanOrEqual(175_000_000);+ expect(work.patternChecks).toBeLessThanOrEqual(45_000 * perFiveMb);+ expect(work.regexCalls).toBeLessThanOrEqual(330_000 * perFiveMb);+ expect(work.scannedChars).toBeLessThanOrEqual(175_000_000 * perFiveMb);});test('the accumulator is per assessment: a second call starts from zero and a reused one adds up', () => {