Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chronicle: compact phase dispatch, size ratchets, regenerated goldens and flag registry (#5876)
garrytane8136e900895
diff --git a/scripts/check-orphan-modules.mjs b/scripts/check-orphan-modules.mjsindex 09fa913cd5..30ee9b34e2 100644--- a/scripts/check-orphan-modules.mjs+++ b/scripts/check-orphan-modules.mjs@@ -69,7 +69,6 @@ const PERMITTED_TEST_ONLY = [{ path: 'src/mcp/tool-catalog.ts', reason: 'script-reachable' },{ path: 'src/core/postgres-engine/forward-reference-bootstrap.ts', reason: 'held: refactor wave 1 E1 façade re-exporting engine-sql/bootstrap.ts (CLAUDE.md façade rule); every runtime caller imports engine-sql/bootstrap.ts' },{ path: 'src/core/archive-crawler-config.ts', reason: "held: skills/archive-crawler/SKILL.md describes the scan_paths safety fence as code-enforced; wire-or-retract is a product decision" },- { path: 'src/core/chronicle/backstop.ts', reason: 'held: the put_page chronicle backstop was dropped in v0.51.0.0, so the documented auto_chronicle setting does nothing; restore-or-retract is a product decision' },{ path: 'src/core/onboard/impact-capture.ts', reason: 'held: sole writer of migration_impact_log, which the shipped `gbrain onboard --history` reads; wire-or-retract is a product decision' },{ path: 'src/core/progressive-batch/orchestrator.ts', reason: 'held: TODOS.md keeps an open item to re-compose progressive-batch with --workers on the 3 reindex sites (callers dropped in the v0.41.17.0 merge)' },{ path: 'src/core/progressive-batch/retrofit-wrap.ts', reason: 'held: progressive-batch re-compose item still open in TODOS.md' },diff --git a/scripts/function-size-baseline.tsv b/scripts/function-size-baseline.tsvindex 65e75800a5..6389f68bb6 100644--- a/scripts/function-size-baseline.tsv+++ b/scripts/function-size-baseline.tsv@@ -33,7 +33,7 @@ src/core/check-resolvable.ts checkResolvable 419 seed: W5 baseline, refactor wavsrc/core/config.ts loadConfigWithEngine 362 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +2 #5824: search.vector_legacy_guard DB-plane mergesrc/core/context-engine.ts createGBrainContextEngine 520 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +1 #4618: seat sidecar call before the segment spool (helper recordOpenclawSeat)src/core/context/retrieval-reflex.ts resolveEntitiesToPointers 355 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1)-src/core/cycle.ts runCycle 1241 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +5 #5809: extract_atoms phase gets a real abort signal; +2 #5809: cycle_already_running names the lock holder; +1 #4578: a lock steal during the last selected phase reports lock_stolen (one phase per runCycle call); +4 GBRA-40 F4b: planner-stats refresh after the freshness phases+src/core/cycle.ts runCycle 1255 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +5 #5809: extract_atoms phase gets a real abort signal; +2 #5809: cycle_already_running names the lock holder; +1 #4578: a lock steal during the last selected phase reports lock_stolen (one phase per runCycle call); +4 GBRA-40 F4b: planner-stats refresh after the freshness phases; +14 #5876: Life Chronicle phase dispatch blocksrc/core/cycle/extract-atoms.ts runPhaseExtractAtoms 787 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +12 #5809/#5832: hard/soft stop checks, chat-call signal, abortable pacing, no post-stop writes; +1 #5856: one BudgetTracker per drain attempt (reuse the attempt's tracker)src/core/cycle/extract-atoms.ts runPhaseExtractAtoms>withBudgetTracker(#1) 316 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1); +11 #5809/#5832: per-item and pre-commit abort checks, chat-call signal, abortable pacing, catch-side stopsrc/core/cycle/extract-facts.ts runExtractFacts 505 seed: W5 baseline, refactor wave 1 (decomposition deferred to wave 2, plan D1)diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsvindex d0c6f75034..b40a79cbf4 100644--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@ -13,7 +13,7 @@ src/commands/jobs.ts 658 ratchet refactor wave 1 split target (W4 jobs, cut linesrc/commands/serve-http.ts 915 ratchet refactor wave 1 W4 split into serve-http-<area>.ts modules; ceiling rationale: docs/architecture/key-files/commands-5.md entry for src/commands/serve-http.tssrc/core/ai/gateway.ts 4393 ratchet +7 fix wave 5 (#5137): provider-key redactor on every upstream error path and the first embedding 401/403 report (logic in ai/key-redact.ts, ai/key-warnings.ts); +20 System One v1: decide() delegating export + transport seam, RerankInput.onMeta/RerankMeta, TypeSafe reranker delegation to ai/decide/rerank-adapter.ts; +3 #5585: reconfigureGatewayWithEngine records expansion/chat model provenance (ai/gateway-model-sources.ts) + clears it with gateway state; lowered #5585: tracker record sites collapsed onto ai/budget-record.ts (recordOnTracker + failedCallUsage) while adding ledger fields (requested model, purpose, failed, estimated, countsAsCall); +20: schema-rejection fallback in chat() (retry once schemaless on a json_schema 4xx, remember the recipe for the process — mirrors expand()); re-summed after merging master v0.50.0.0 with the wave (structured-output + pricing hunks); +48: #4863 ChatOpts.responseSchema → tolerant json_schema Output on the chat() generateText call for openai-compatible recipes that declare structured outputs (facts extraction on Ollama); +74: #3657 post-sunset rerank short-circuit (effective-model check, once-per-process audit row + stderr, injected-clock seam); grown v0.46.26.0 megawave: config-plane probes + halt telemetry (#3387 #4312); +21 lines (OpenAI Responses API reasoning-item echo: ChatBlock 'reasoning' variant, chat()/toModelMessages() round-trip); wave-k absorbs: OCR routing seam (#4107 class), config-snapshot reader block (#3980); +21: #4107 OCR-model routing (getImageOcrModel); +10: keyless OPENAI_BASE_URL embedding override (#4385); wave-k #3622 reimpl: GBRAIN_EMBED_MAX_BATCH_TOKENS env cap for no_batch_cap recipes; +9: DeepSeek judge thinking pin plumbed through chat opts (#4069); +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); ranker wave v0.48.4.0: ChatOpts.temperature threaded to the transport (+15); +24: #4172 recipe-declared thinking headroom on the chat()/toolLoop() default — shared isThinkingModel predicate (Claude-5 regex || recipe thinking_by_default, fail-closed), also consumed by the subagent handler; +20: #4861 claude-cli expansion routed to the schemaless viaText path (the CLI adapter ignores responseFormat, so the native generateObject branch had no fallback); retired provider integration removed; safety wave: migration reranker input ceilings; lowered by fix wave 3 #5680 (embed request planning peeled to ai/embed-batch-plan.ts); +5 #4616: empty inputs skip the provider and every text/multimodal result is screened for zero-norm/NaN/Inf vectors (logic lives in ai/embedding-guard.ts); fix wave 3 integration: #4616 empty-input filtering feeds the shared #5680 batch planner; +3 #5691: embedQuery takes a per-request queryPrefix (no gateway state); +26 fix wave 7 (#5642): embed spend records bank provider-reported usage.tokens (all sub-batches reported → measured; chars-per-token estimate stays the fallback and the failure charge); +2 #5892: import + load-time call of installAiSdkWarningWriter (writer lives in ai/sdk-warnings.ts)src/commands/sync.ts 473 ratchet refactor wave 1 split target (W4 sync); ceiling rationale: docs/architecture/key-files/commands-6.md entry for src/commands/sync.ts; +2 for the #5751 SyncResult.legacySkips interface field (fix wave 4); +2 fix wave 4 lane B: SyncResult.connectorHolds interface field (held counts for the sync summary); +1 fix wave 5 (#5032): SyncResult.fileRefusals interface field (named per-file Windows colon refusals)-src/core/cycle.ts 3205 ratchet +2 System One v1 S9: extract_facts phase tail runs the conflict sweep (ai/decide/sweep.ts) only when the slot is not off; +2 System One v1: purge phase prunes decision receipts (ai/decide/store.ts); grown v0.46.26.0 megawave (#4102 #2608) + master v0.46.26.0 cycle-start orphan recovery; +10 wave G #3974: cycle-sync uncommitted-drift warn; grown wave-g (#4416): synthesize_concepts source threading; grown wave-g (#4416): synthesize_concepts source threading (same fix absorbed as #4417 on wave-k); wave-k: ); +7: #4077 abort threading; +10: #4745 fullImplicitSourceCycle opt-in contract; +3: #4890 extract phase jsonMode/quiet + pages-not-links totals; +1: wave review — extract phase passes quiet:true + jsonMode:false; +1: extract_facts pagesFailed detail; +8 fix wave 3: one cycle date resolved in runCycle and threaded to synthesize/patterns/drift (C-15); +1 #5632: cycle sync resumes an unfinished managed cursor with its stored options; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; -41 #5809: anyAbortSignal peeled to abort-signals.ts; +5 #5809: extract_atoms phase gets a real abort signal; +4 #5809: cycle_already_running names the lock holder; +7 #5255: cycle sync runs a managed pull request as no-pull and reports upstream_refresh; +1 #4578: a lock steal during the last selected phase reports lock_stolen, not aborted; +3 #5536: keyless embed phase clean-skips when embedding_disabled is set; +5 F4b: planner-stats refresh after the freshness phases (logic in planner-stats.ts)+src/core/cycle.ts 3225 ratchet +2 System One v1 S9: extract_facts phase tail runs the conflict sweep (ai/decide/sweep.ts) only when the slot is not off; +2 System One v1: purge phase prunes decision receipts (ai/decide/store.ts); grown v0.46.26.0 megawave (#4102 #2608) + master v0.46.26.0 cycle-start orphan recovery; +10 wave G #3974: cycle-sync uncommitted-drift warn; grown wave-g (#4416): synthesize_concepts source threading; grown wave-g (#4416): synthesize_concepts source threading (same fix absorbed as #4417 on wave-k); wave-k: ); +7: #4077 abort threading; +10: #4745 fullImplicitSourceCycle opt-in contract; +3: #4890 extract phase jsonMode/quiet + pages-not-links totals; +1: wave review — extract phase passes quiet:true + jsonMode:false; +1: extract_facts pagesFailed detail; +8 fix wave 3: one cycle date resolved in runCycle and threaded to synthesize/patterns/drift (C-15); +1 #5632: cycle sync resumes an unfinished managed cursor with its stored options; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; -41 #5809: anyAbortSignal peeled to abort-signals.ts; +5 #5809: extract_atoms phase gets a real abort signal; +4 #5809: cycle_already_running names the lock holder; +7 #5255: cycle sync runs a managed pull request as no-pull and reports upstream_refresh; +1 #4578: a lock steal during the last selected phase reports lock_stolen, not aborted; +3 #5536: keyless embed phase clean-skips when embedding_disabled is set; +5 F4b: planner-stats refresh after the freshness phases (logic in planner-stats.ts); +20 #5876: Life Chronicle phase registration (CyclePhase, ALL_PHASES, NEEDS_LOCK) and its runCycle dispatch blocksrc/core/cycle/synthesize.ts 3297 ratchet +26 System One v1 S7/S8: triage and grounding decide delegation (triage-decide.ts, grounding-decide.ts); merged waves; grown v0.46.26.0 megawave + master rolling lease via shared throttled renewer; grown wave-g (#4506): cycle summaries can stay out of the source repo; +18: expired-verdict sweep + DeepSeek judge thinking pin (#4069); +47: #4077 cooperative-abort threading; +110: eval fix wave F6 spend surfacing (withChatPhase wrap, triage/child token telemetry, zero-page counter); +32: F1b quote-verify call site + kill switch; +2: F1a/F3/F4a OUTPUT POLICY rules; +59: F2 verified-segment rescue (gate at report construction, rescue knobs, telemetry); +19: rubric v2 peak-scoring + docblock rescue branch; +50: #4337 summary link-sample cap + dream_created_cycle_date preserve-on-rerun; +5: #4348 resolveCycleDate wiring (local-day summary bucketing); +3 round-3 rebase true-up; +55: #4805 synth-v2 completion skip (findSynthV2Completion + prefix-parameterized loadSuccessfulSynthesisKeys); +10: #4886 mode-aware buildSynthesisPrompt (oneshot children drop tool-use/final-prose guidance); #5105: small legacy writer/refusal and shared revision CAS delegates; +4: merge of #5666 durable synthesis completions with the v0.59.18.0 verify-epoch wiring; +7 #5413/#5471 discovery exclusions (self-capture session ids, dream output directories); +6 fix wave 2 (v0.60.5.0) integration: W7 paid-loop breaker check before submission and released-key daily-cap count on top of the W1b discovery exclusions; +6 v0.60.5.0 master-merge true-up: the wave-2 growth (+13 W1b, +6 W7) re-summed over master v0.59.18.0 at 3222 lines with no slack; +76 fix wave 3: per-run USD gate + fail-closed daily cap (C-13), child first-write ownership for stamp/reverse-write (C-8, #5685), cycle-date prompt hint (C-15), opt-in attribution rule (#5425); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +19 at the merge; +2 #5806 triageNow clock seam forwarded to triage (interface field + call-site option); +4 #5854: a postprocess or summary publish still pending after its wait is deferred (publish_pending warn, no cooldown stamp; helper in synthesize-postprocess.ts)src/core/cycle/extract-atoms.ts 1808 ratchet crossed the 1500 unlisted cap in the atoms/extraction fix wave: +21 embed-aware cost gate (#4878), +65 atoms-array anchor scan (#4913); peel candidate: the parse block (parseAtomsOutcome / parseArrayAtOffset / atomsFromParsedArray) into extract-atoms-parse.ts; +35: #4853 transcript-origin atoms link to their conversation page; +130: #4916 transcript failure-count/tombstone (extract_atoms_transcript_state, TODOS P2(b)); wave composition: #4916 transcript-state skip + #4948 zero-atom prompt + #4943 meetings source-id summed; +3: wave review — a later `[]` is an honest zero-yield, a non-atom-shaped array is a counted failure; +13: wave review — explicit budget keeps the cap over an unpriced embed route ($0-priced); +14: wave review — transcript-state write errors surfaced, missing table warns once; merged reliability/shared-skills source integration; +37 fix wave 3: stable undated atom dates + stale-atom retirement (C-14); +3 #5525: effectiveVisibility stamped on non-managed atoms; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +3 at the merge; +6 fix wave 3 lane A (#5601): accepted-pending atom batches count as progress (helper in persistence/accepted-pending.ts); +4 fix wave 4: #5705 transcript-as-data system prompt lines and its message helper, #5627 response schema import (the atom-type list moved to extract-atoms-schema.ts); +30 #5809/#5832: drain hard/soft stop signals (ExtractAtomsOpts.signal/stopSignal, pre-commit abort checks, no strike or post-stop writes after a hard stop) and the cancellable backlog count; +1 #5812: transcript items are paste-stripped (corpusTextForExtraction import) before the input cut; +1 #5820: extract_atoms discovery passes selfCaptureSessionIds like synthesize; +10 #5856/#5854: drain attempt state (one BudgetTracker + one publish wait across batches) and the opt-in connector email/meeting exclusion (predicate in connector-atoms.ts)src/core/engine.ts 2678 ratchet grown v0.46.26.0 megawave: relational/visibility/usage contract surface (#4352 #4218); grown wave-g (#4524 #4527): orphans-mode contract + removeLink deleted count; wave-k: +4 fail-closed TrajectoryOpts.remote contract doc (#3855), +2 FactListOpts.unconsolidatedOnly (#4070), +14 getAllConfig bulk-read contract (#3980); +1: getBacklinkCounts page-id contract doc (#4380); +9: FactListOpts.grep SQL pre-limit contract (#3851); +13: dream-verdict TTL contract (#4069); +33: softDeletePages batch soft-delete contract (#4587); +8: #4592 scoped getStats/getHealth contract doc; +5 read-time TTL validity contract docs (active vs history read semantics); +12: #4280 findOrphanPages type/quarantined metadata contract; +14: traversePathsDetailed row-cap contract (ship-review); +12: resolveSlugWithAliasDetailed owning-source contract (ship-review) | merged v0.48.1.0: master #4788 + wave traversePathsDetailed/resolveSlugWithAliasDetailed; master: | merged v0.48.1.0 true-up; corrective release: read-policy signatures and Chronicle scope; +7: #4882 listFactsSince entitySlug/sessionId composition doc; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: guarded derived projection preparation and read seals; #5105: resident-stop registration and direct transaction contract; #5105: +1 raw preservation contract for legacy engine migration; merged company ingestion/schema routing changes; safety wave: fact embedding model and text identity contract; +5 write-path wave: findDuplicatePage excludeSlug + id-first ranking contract; +2 fw3 A14: addTag tagSource provenance contract; evidence delivery: getChunkWindows interface member + type import (+3); #5761: +4 markPagesAttendanceBlocked member + countStalePagesForExtraction attendance option; +4 #5888: FactListOpts.fingerprint + FactRow.fact_fingerprint contract (hot-memory duplicate collapse)diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.tsindex 25bb58d64e..84df7566fc 100644--- a/src/core/cli-flag-registry.generated.ts+++ b/src/core/cli-flag-registry.generated.ts@@ -23,13 +23,13 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'backfill': ['--batch-size', '--brain', '--concurrency', '--dry-run', '--fresh', '--help', '--json', '--keep-index', '--list', '--max-errors', '--max-rows', '--resume', '--source'],'backup': ['--accept-pending', '--background', '--brain', '--confirm-authority-reviewed', '--confirm-backup-compatible', '--confirm-quiesced', '--dir', '--explain', '--follow', '--full', '--help', '--into', '--json', '--mode', '--no-accept-pending', '--output', '--path', '--progress-interval', '--progress-json', '--quiet', '--restore-only', '--source', '--timeout', '--wait'],'bench': ['--baseline', '--brain', '--force', '--from', '--help', '--json', '--label', '--limit', '--source', '--threshold-jaccard', '--threshold-latency-multiplier', '--threshold-top1', '--to', '--tool'],- 'book-mirror': ['--accept-pending', '--access', '--asof', '--author', '--background', '--bound-slug-prefixes', '--brain', '--chapters-dir', '--context-file', '--date', '--days', '--dry-run', '--entities', '--explain', '--fact', '--federated-read', '--file', '--follow', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--max-turns', '--mode', '--model', '--multimodal', '--no-accept-pending', '--no-confirm', '--no-follow', '--once', '--page', '--path', '--progress-interval', '--progress-json', '--quiet', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--timeline', '--timeout', '--timeout-ms', '--title', '--trusted-extraction', '--types', '--url', '--wait', '--yes'],+ 'book-mirror': ['--accept-pending', '--access', '--asof', '--author', '--background', '--bound-slug-prefixes', '--brain', '--chapters-dir', '--context-file', '--date', '--dated-since', '--days', '--dry-run', '--entities', '--explain', '--fact', '--federated-read', '--file', '--follow', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--max-turns', '--mode', '--model', '--multimodal', '--no-accept-pending', '--no-confirm', '--no-follow', '--once', '--page', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--recent', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--timeline', '--timeout', '--timeout-ms', '--title', '--trusted-extraction', '--types', '--url', '--wait', '--yes'],'bootstrap': ['--abbrev-ref', '--abort', '--accept-visibility-change-consequences', '--active', '--all', '--allow-unverified-remote', '--auto', '--brain', '--branch', '--cached', '--confirm', '--count', '--delete-brain', '--diff-filter', '--dim', '--env', '--error-unmatch', '--exclude-standard', '--exit-code', '--file', '--force', '--gbrain-bin', '--get', '--get-url', '--git-dir', '--git-path', '--harness', '--heads', '--help', '--home', '--hostname', '--http', '--id', '--init', '--install', '--is-ancestor', '--is-inside-work-tree', '--jq', '--json', '--local', '--mcp-even-if-plugin', '--minimal', '--name', '--name-only', '--no-capture', '--no-cron', '--no-hooks', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--only', '--others', '--pat-file', '--path', '--pglite', '--porcelain', '--port', '--private', '--project', '--pure', '--push', '--push-only', '--quiet', '--rebase', '--refresh-operations', '--refresh-skills', '--remove', '--repair', '--scope', '--scopes', '--seat', '--set', '--short', '--show', '--show-toplevel', '--skills', '--skip', '--source', '--status', '--surface', '--to', '--token', '--token-name', '--unset-all', '--url', '--verify', '--version', '--visibility', '--workspace', '--yes'],'brainstorm': ['--brain', '--force-rechunk', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--no-save', '--resume', '--save', '--source', '--stale', '--strict-budget', '--yes'],'cache': ['--brain', '--help', '--json', '--source', '--yes'],- 'calibration': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--days', '--dry-run', '--entities', '--fact', '--federated-read', '--file', '--full', '--help', '--holder', '--http', '--image', '--json', '--key-prefix', '--kind', '--limit', '--mode', '--multimodal', '--once', '--page', '--path', '--phase', '--regenerate', '--scrub-gstack', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--timeline', '--trusted-extraction', '--types', '--undo-wave', '--url', '--with-calibration', '--yes'],+ 'calibration': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--dated-since', '--days', '--dry-run', '--entities', '--fact', '--federated-read', '--file', '--full', '--help', '--holder', '--http', '--image', '--json', '--key-prefix', '--kind', '--limit', '--mode', '--multimodal', '--once', '--page', '--path', '--phase', '--recent', '--regenerate', '--scrub-gstack', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--timeline', '--trusted-extraction', '--types', '--undo-wave', '--url', '--with-calibration', '--yes'],'call': ['--brain', '--help', '--json', '--source'],- 'capture': ['--accept-pending', '--access', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--date', '--days', '--depth', '--entities', '--expected-revision', '--explain', '--fact', '--federated-read', '--file', '--follow', '--force', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mcp-only', '--mode', '--multimodal', '--no-accept-pending', '--once', '--page', '--path', '--progress-interval', '--progress-json', '--quiet', '--request-id', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--stdin', '--surface', '--take', '--timeline', '--timeout', '--trusted-extraction', '--type', '--types', '--url', '--wait', '--what', '--where', '--who', '--yes'],+ 'capture': ['--accept-pending', '--access', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--date', '--dated-since', '--days', '--depth', '--entities', '--expected-revision', '--explain', '--fact', '--federated-read', '--file', '--follow', '--force', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mcp-only', '--mode', '--multimodal', '--no-accept-pending', '--once', '--page', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--recent', '--request-id', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--stdin', '--surface', '--take', '--timeline', '--timeout', '--trusted-extraction', '--type', '--types', '--url', '--wait', '--what', '--where', '--who', '--yes'],'check-backlinks': ['--accept-pending', '--background', '--brain', '--dir', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],'check-resolvable': ['--brain', '--dry-run', '--fix', '--help', '--json', '--skills-dir', '--source', '--strict', '--verbose'],'check-update': ['--brain', '--ff-only', '--force-retry', '--help', '--json', '--markdown', '--migrate-only', '--no-autopilot-install', '--no-bun-floor-check', '--non-interactive', '--refresh-cache', '--remediation-plan', '--source', '--swap-only', '--version', '--yes'],@@ -51,7 +51,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--help', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-facts', '--no-accept-pending', '--no-embed', '--no-embedding', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--priority', '--progress-interval', '--progress-json', '--quiet', '--show-toplevel', '--slugs', '--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', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--concurrency', '--confirm-destructive', '--date', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--explain', '--fact', '--federated-read', '--file', '--follow', '--force', '--full', '--help', '--http', '--image', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--mode', '--model', '--multimodal', '--no-accept-pending', '--once', '--order', '--output', '--page', '--path', '--progress-interval', '--progress-json', '--quiet', '--rate', '--reenrich-after', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stats', '--status', '--surface', '--take', '--thin', '--thin-threshold', '--timeline', '--timeout', '--trusted-extraction', '--types', '--url', '--wait', '--workers', '--yes'],+ 'enrich': ['--accept-pending', '--access', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--concurrency', '--confirm-destructive', '--date', '--dated-since', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--explain', '--fact', '--federated-read', '--file', '--follow', '--force', '--full', '--help', '--http', '--image', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--mode', '--model', '--multimodal', '--no-accept-pending', '--once', '--order', '--output', '--page', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--rate', '--recent', '--reenrich-after', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stats', '--status', '--surface', '--take', '--thin', '--thin-threshold', '--timeline', '--timeout', '--trusted-extraction', '--types', '--url', '--wait', '--workers', '--yes'],'eval': ['--ab-relational', '--accept-pending', '--against', '--allow-incomplete-judgments', '--allow-mixed-run-config', '--allow-regression', '--asof', '--autocut', '--background', '--baseline', '--batch', '--brain', '--budget-usd', '--budget-usd-answer', '--budget-usd-retrieval', '--by-type', '--by-type-floor', '--by-type-floor-metric', '--candidate', '--capture-pool', '--committed-baseline', '--compare', '--compare-limit', '--concurrent', '--config-a', '--config-b', '--corpus', '--cycles', '--days', '--decide', '--decide-calibration', '--decide-dataset', '--decide-force-on', '--decide-provider', '--decide-threshold', '--dedup-cosine', '--dedup-max-per-page', '--dedup-type-ratio', '--dimensions', '--distance-min', '--draws', '--embed-cache', '--embedder', '--embedding-dimensions', '--embedding-model', '--eval-pool-depth', '--expand', '--expansion', '--expansion-replay', '--expansion-variant-budget', '--explain', '--fixtures', '--follow', '--force-rechunk', '--format', '--from-capture', '--from-db', '--gold', '--grounding-min', '--harness', '--help', '--include-abstention', '--include-holdout', '--input', '--json', '--judge', '--judge-concurrency', '--judge-model', '--justification', '--k', '--keyword-only', '--limit', '--llm', '--max-pair-chars', '--max-tokens', '--max-usd', '--mcp-only', '--md', '--metric', '--min-recall', '--mode', '--model', '--models', '--modes', '--name-only', '--no-accept-pending', '--no-cache', '--no-embed-cache', '--no-expand', '--no-llm', '--no-trajectory', '--older-than', '--out', '--output', '--output-dir', '--parallel', '--parity-baseline', '--pglite', '--progress-interval', '--progress-json', '--qrels', '--queries-file', '--query', '--question-ids', '--questions', '--quiet', '--reader-max-tokens', '--reader-mode', '--receipt-dir', '--record', '--refresh-cache', '--reranker', '--resume-from', '--retrieval-only', '--rrf-k', '--rubric-version', '--runs', '--sample', '--sampling', '--save', '--search-pin', '--seed', '--severity', '--short', '--show-toplevel', '--since', '--skip-replay', '--slot', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--slug-prefix', '--source', '--stale', '--status', '--strategy', '--suite', '--suites', '--supabase', '--task', '--threshold', '--threshold-expected-top1', '--threshold-first-relevant-hit', '--threshold-jaccard', '--threshold-latency-multiplier', '--threshold-recall-at-k', '--threshold-top1', '--timeout', '--tool', '--top-k', '--top-regressions', '--until', '--update-baseline', '--usefulness-min', '--vectors', '--verbose', '--verify', '--wait', '--with-code-intel', '--yes'],'export': ['--accept-pending', '--background', '--brain', '--dir', '--explain', '--fix', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--repo', '--restore-only', '--slug-prefix', '--source', '--timeout', '--type', '--wait'],'extract': ['--accept-pending', '--admin-intent', '--after-slug', '--apply-preview', '--background', '--backup-verified', '--brain', '--break-lock', '--by-mention', '--catch-up', '--checkpoint', '--concurrency', '--confirm', '--db-url', '--dir', '--dry-run', '--expected-epoch', '--expected-state', '--explain', '--follow', '--from-meetings', '--help', '--include-frontmatter', '--infer-dates', '--json', '--kind', '--limit', '--manifest', '--ner', '--no-accept-pending', '--pack', '--path', '--progress-interval', '--progress-json', '--prune-orphans', '--quiet', '--rebuild', '--repair-attendance', '--self-transfer', '--since', '--source', '--source-id', '--stale', '--timeout', '--type', '--verbose', '--wait', '--workers', '--yes'],@@ -70,7 +70,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'init': ['--all', '--allow-create-db', '--allow-docker', '--brain', '--break-lock', '--chat-model', '--check', '--content-root', '--db-only', '--dim', '--embedding-dimensions', '--embedding-model', '--entity', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-expand', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--path', '--pglite', '--prefer-postgres', '--probe', '--provenance', '--quiet', '--schema-pack', '--scopes', '--show-toplevel', '--skip-embed-check', '--source', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--version', '--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', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--supabase', '--timeout', '--type', '--url', '--wait'],- 'jobs': ['--abbrev-ref', '--access', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--cli-path', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--cost-estimate', '--date', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--explain', '--fact', '--facts', '--federated-read', '--file', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-retry', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--hard-deadline', '--health-interval', '--help', '--http', '--idempotency-key', '--ids', '--image', '--images', '--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', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--mode', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--now', '--older-than', '--once', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--prune-orphans', '--queue', '--quiet', '--reason', '--rebuild', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--review-lower', '--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', '--stats', '--status', '--strategy', '--surface', '--swap-only', '--take', '--target', '--thin', '--thin-threshold', '--timeline', '--timeout', '--timeout-ms', '--trusted-extraction', '--type', '--types', '--uninstall', '--url', '--user', '--vectors', '--verbose', '--verify', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],+ 'jobs': ['--abbrev-ref', '--access', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--cli-path', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--cost-estimate', '--date', '--dated-since', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--explain', '--fact', '--facts', '--federated-read', '--file', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-retry', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--hard-deadline', '--health-interval', '--help', '--http', '--idempotency-key', '--ids', '--image', '--images', '--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', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--mode', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--now', '--older-than', '--once', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--prune-orphans', '--queue', '--quiet', '--reason', '--rebuild', '--recent', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--review-lower', '--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', '--stats', '--status', '--strategy', '--surface', '--swap-only', '--take', '--target', '--thin', '--thin-threshold', '--timeline', '--timeout', '--timeout-ms', '--trusted-extraction', '--type', '--types', '--uninstall', '--url', '--user', '--vectors', '--verbose', '--verify', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],'lint': ['--abbrev-ref', '--abort', '--accept-pending', '--all', '--background', '--brain', '--branch', '--cached', '--dry-run', '--exclude', '--exit-code', '--explain', '--file', '--fix', '--follow', '--get', '--get-url', '--git-dir', '--git-path', '--help', '--is-ancestor', '--is-inside-work-tree', '--json', '--local', '--name-only', '--no-accept-pending', '--no-cron', '--no-tags', '--no-verify', '--no-write-fetch-head', '--pat-file', '--path', '--progress-interval', '--progress-json', '--push', '--push-only', '--quiet', '--rebase', '--short', '--show-toplevel', '--source', '--timeout', '--unset-all', '--wait'],'loops': ['--all', '--as-of', '--brain', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--top', '--type'],'lsd': ['--brain', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--no-save', '--resume', '--save', '--source', '--strict-budget', '--yes'],@@ -80,18 +80,18 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'models': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--skip', '--source', '--status'],'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'],- 'onboard': ['--access', '--asof', '--auto', '--bound-slug-prefixes', '--brain', '--check', '--date', '--days', '--entities', '--explain', '--fact', '--federated-read', '--file', '--from-pages', '--full', '--help', '--history', '--http', '--image', '--json', '--kind', '--limit', '--max-usd', '--mode', '--multimodal', '--once', '--page', '--params', '--path', '--remediate', '--remediation-plan', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--target-score', '--timeline', '--trusted-extraction', '--types', '--url', '--yes'],+ 'onboard': ['--access', '--asof', '--auto', '--bound-slug-prefixes', '--brain', '--check', '--date', '--dated-since', '--days', '--entities', '--explain', '--fact', '--federated-read', '--file', '--from-pages', '--full', '--help', '--history', '--http', '--image', '--json', '--kind', '--limit', '--max-usd', '--mode', '--multimodal', '--once', '--page', '--params', '--path', '--phase', '--recent', '--remediate', '--remediation-plan', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--target-score', '--timeline', '--trusted-extraction', '--types', '--url', '--yes'],'orphans': ['--accept-pending', '--background', '--brain', '--count', '--explain', '--follow', '--help', '--include-pseudo', '--json', '--mode', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],'pages': ['--brain', '--dry-run', '--help', '--json', '--older-than', '--source'],'pglite-repair': ['--brain', '--break-lock', '--dry-run', '--help', '--json', '--path', '--source', '--vectors', '--yes'],'post-upgrade': ['--acknowledge-no-backup', '--admin-intent', '--all', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],'pricing': ['--brain', '--help', '--input', '--json', '--max-cost', '--max-runtime', '--output', '--rate', '--source'],'projections': ['--brain', '--enable-dcr', '--help', '--http', '--install', '--json', '--limit', '--now', '--port', '--public-url', '--remove', '--source', '--status', '--surface', '--user'],- 'protocol': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--days', '--entities', '--fact', '--federated-read', '--file', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mode', '--multimodal', '--once', '--page', '--path', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--synthesize', '--take', '--target', '--timeline', '--token', '--trusted-extraction', '--types', '--url', '--yes'],+ 'protocol': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--dated-since', '--days', '--entities', '--fact', '--federated-read', '--file', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mode', '--multimodal', '--once', '--page', '--path', '--phase', '--recent', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--synthesize', '--take', '--target', '--timeline', '--token', '--trusted-extraction', '--types', '--url', '--yes'],'providers': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--model', '--source', '--status', '--touchpoint'],'publish': ['--accent', '--bg', '--border', '--brain', '--card-bg', '--code-bg', '--error', '--fg', '--help', '--json', '--link', '--muted', '--out', '--password', '--source', '--title'],'quarantine': ['--apply', '--brain', '--force', '--force-rechunk', '--help', '--include-flagged', '--json', '--limit', '--no-embed', '--source', '--source-id', '--stale'],- 'recall': ['--accept-pending', '--access', '--as-context', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--budget-policy', '--budget-tokens', '--date', '--days', '--entities', '--explain', '--fact', '--federated-read', '--file', '--follow', '--full', '--grep', '--help', '--http', '--image', '--include-expired', '--json', '--kind', '--limit', '--mcp-only', '--mode', '--multimodal', '--no-accept-pending', '--once', '--page', '--path', '--pending', '--progress-interval', '--progress-json', '--query', '--quiet', '--reason', '--request-id', '--rollup', '--session', '--session-id', '--since', '--since-last-run', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stats', '--supersessions', '--surface', '--take', '--timeline', '--timeout', '--today', '--trusted-extraction', '--types', '--url', '--wait', '--watch', '--yes'],+ 'recall': ['--accept-pending', '--access', '--as-context', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--budget-policy', '--budget-tokens', '--date', '--dated-since', '--days', '--entities', '--explain', '--fact', '--federated-read', '--file', '--follow', '--full', '--grep', '--help', '--http', '--image', '--include-expired', '--json', '--kind', '--limit', '--mcp-only', '--mode', '--multimodal', '--no-accept-pending', '--once', '--page', '--path', '--pending', '--phase', '--progress-interval', '--progress-json', '--query', '--quiet', '--reason', '--recent', '--request-id', '--rollup', '--session', '--session-id', '--since', '--since-last-run', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stats', '--supersessions', '--surface', '--take', '--timeline', '--timeout', '--today', '--trusted-extraction', '--types', '--url', '--wait', '--watch', '--yes'],'reconcile-links': ['--accept-pending', '--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],'reindex': ['--accept-pending', '--aliases', '--background', '--brain', '--concurrency', '--cost-estimate', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--follow', '--force', '--force-rechunk', '--help', '--json', '--limit', '--markdown', '--multimodal', '--no-accept-pending', '--no-embed', '--no-embedding', '--pglite', '--progress-interval', '--progress-json', '--quiet', '--repo', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--type', '--vectors', '--wait', '--workers', '--yes'],'reindex-code': ['--accept-pending', '--background', '--brain', '--break-lock', '--concurrency', '--db-url', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--follow', '--force', '--help', '--json', '--max-cost', '--max-cost-usd', '--max-runtime', '--no-accept-pending', '--no-embed', '--path', '--progress-interval', '--progress-json', '--quiet', '--source', '--status', '--timeout', '--wait', '--workers', '--yes'],@@ -126,5 +126,5 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'upgrade': ['--acknowledge-no-backup', '--admin-intent', '--all', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],'waiting': ['--all', '--as-of', '--brain', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--top', '--type'],'watch': ['--brain', '--help', '--json', '--max-pages', '--min-confidence', '--source', '--window-turns'],- 'whoknows': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--days', '--entities', '--explain', '--fact', '--federated-read', '--file', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mcp-only', '--mode', '--multimodal', '--once', '--page', '--path', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--timeline', '--trusted-extraction', '--types', '--url', '--yes'],+ 'whoknows': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--dated-since', '--days', '--entities', '--explain', '--fact', '--federated-read', '--file', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mcp-only', '--mode', '--multimodal', '--once', '--page', '--path', '--phase', '--recent', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stats', '--surface', '--take', '--timeline', '--trusted-extraction', '--types', '--url', '--yes'],};diff --git a/src/core/cycle.ts b/src/core/cycle.tsindex 278ccae7a1..a6b1f377f3 100644--- a/src/core/cycle.ts+++ b/src/core/cycle.ts@@ -80,10 +80,7 @@ export type CyclePhase =// soft-band takes against recent timeline evidence; report-only in v1// (writes reports/drift-<date>; auto_update mutates nothing).| 'drift'- // #5876 — Life Chronicle: extracts timeline events from meeting,- // conversation and calendar pages decided at write time (ledger rows),- // bounded per run and by a rolling daily limit. Default ON- // (`gbrain config set auto_chronicle false` opts out).+ // #5876 — Life Chronicle events from meeting/conversation/calendar pages (default ON).| 'chronicle'| 'embed' | 'orphans' | 'purge'// v0.39 T12: schema-suggest passive trigger (D3 + D4 plan-eng-review).@@ -174,8 +171,7 @@ export const ALL_PHASES: CyclePhase[] = [// the calibration trio (fresh take resolutions) and BEFORE embed so the// drift report page gets embedded same-cycle. Report-only in v1.'drift',- // #5876 — Life Chronicle events. Global (scans every source with per-source- // fairness). AFTER drift, BEFORE embed so new event pages embed same-cycle.+ // #5876 — Life Chronicle events (global). BEFORE embed so event pages embed same-cycle.'chronicle',// v0.41.11.0 — opt-in conversation-facts backfill. Default OFF; reads// cycle.conversation_facts_backfill.enabled gate inside the wrapper.@@ -2745,34 +2741,16 @@ export async function runCycle(await safeYield(opts.yieldBetweenPhases);}- // ── #5876: Life Chronicle ──────────────────────────────────- // Default ON. Executes ledger rows decided at write time (and backfill- // rows): ≤50 items and a wall-time bound per run, per-source fairness,- // a rolling daily reservation and a per-page BudgetTracker scope.+ // #5876 Life Chronicle (default ON): executes write-time ledger decisions and backfill rows, bounded per run.if (phases.includes('chronicle')) {checkAborted(cycleSignal);- if (!engine) {- phaseResults.push({- phase: 'chronicle',- status: 'skipped',- duration_ms: 0,- summary: 'no database connected',- details: { reason: 'no_database' },- });- } else {+ if (!engine) phaseResults.push({ phase: 'chronicle', status: 'skipped', duration_ms: 0, summary: 'no database connected', details: { reason: 'no_database' } });+ else {progress.start('cycle.chronicle');const { runPhaseChronicle } = await import('./cycle/chronicle.ts');- const { result, duration_ms } = await timePhase(() =>- runPhaseChronicle(engine, {- dryRun,- signal: cycleSignal,- yieldDuringPhase: opts.yieldDuringPhase,- deadlineAtMs: opts.deadlineAtMs ?? null,- }), 'chronicle',- );- result.duration_ms = duration_ms;- phaseResults.push(result);- progress.finish();+ const { result, duration_ms } = await timePhase(() => runPhaseChronicle(engine, { dryRun, signal: cycleSignal,+ yieldDuringPhase: opts.yieldDuringPhase, deadlineAtMs: opts.deadlineAtMs ?? null }), 'chronicle');+ result.duration_ms = duration_ms; phaseResults.push(result); progress.finish();}await safeYield(opts.yieldBetweenPhases);}diff --git a/test/chronicle-auto-phase.test.ts b/test/chronicle-auto-phase.test.tsindex 3f49b0b086..2456ba2fd3 100644--- a/test/chronicle-auto-phase.test.ts+++ b/test/chronicle-auto-phase.test.ts@@ -333,24 +333,3 @@ describe('ledger and discovery (E1/E6/D12)', () => {expect((await rows(engine)).map((r) => [r.slug, r.state, r.reason])).toEqual([['meetings/legacy', 'skipped', 'no_write_decision']]);}), 120_000);});--describe('unmanaged brain (E6)', () => {- test('the phase scans pages changed since activation; earlier pages stay with backfill', async () => {- const { PGLiteEngine } = await import('../src/core/pglite-engine.ts');- const engine = new PGLiteEngine();- await engine.connect({}); await engine.initSchema();- try {- await engine.setConfig('chronicle.auto_settle_seconds', '0');- await engine.putPage('meetings/before', { type: 'meeting', title: 'Before', compiled_truth: BODY, frontmatter: { date: today } });- await Bun.sleep(20);- await engine.setConfig('chronicle.activated_at', new Date().toISOString());- await Bun.sleep(20);- await engine.putPage('meetings/after', { type: 'meeting', title: 'After', compiled_truth: BODY, frontmatter: { date: today } });- const judge = countingJudge(() => ({ events: [ev('Alice agreed to ship the beta')] }));- const r = await runPhaseChronicle(engine, { judge });- expect(judge.calls).toBe(1);- expect(r.details).toMatchObject({ extracted: 1, events_written: 1 });- expect((await rows(engine)).map((x) => [x.slug, x.state])).toEqual([['meetings/after', 'extracted']]);- } finally { await engine.disconnect(); }- }, 120_000);-});diff --git a/test/chronicle-auto-unmanaged.test.ts b/test/chronicle-auto-unmanaged.test.tsnew file mode 100644index 0000000000..7d2ac5a942--- /dev/null+++ b/test/chronicle-auto-unmanaged.test.ts@@ -0,0 +1,37 @@+/**+ * #5876 (E6) — the `chronicle` phase on an unmanaged brain (trusted local+ * writers, no write-time decision): it scans pages changed since the+ * activation stamp and extracts them; pages written before activation stay+ * history for `gbrain chronicle-backfill`.+ * Fails when: an unmanaged brain never extracts automatically, or the first+ * run after upgrade sweeps pre-activation history.+ * Seams: injected judge; in-memory PGLite.+ */+import { afterAll, beforeAll, expect, test } from 'bun:test';+import { PGLiteEngine } from '../src/core/pglite-engine.ts';+import { runPhaseChronicle } from '../src/core/cycle/chronicle.ts';++let engine: PGLiteEngine;+const today = new Date().toISOString().slice(0, 10);+const BODY = 'Alice and Bob reviewed the launch plan and agreed on the next steps for the beta. '.repeat(3);++beforeAll(async () => { engine = new PGLiteEngine(); await engine.connect({}); await engine.initSchema(); }, 120_000);+afterAll(async () => { await engine.disconnect(); });++test('the phase scans pages changed since activation; earlier pages stay with backfill', async () => {+ await engine.setConfig('chronicle.auto_settle_seconds', '0');+ await engine.putPage('meetings/before', { type: 'meeting', title: 'Before', compiled_truth: BODY, frontmatter: { date: today } });+ await Bun.sleep(20);+ await engine.setConfig('chronicle.activated_at', new Date().toISOString());+ await Bun.sleep(20);+ await engine.putPage('meetings/after', { type: 'meeting', title: 'After', compiled_truth: BODY, frontmatter: { date: today } });+ let calls = 0;+ const r = await runPhaseChronicle(engine, { judge: async () => {+ calls++;+ return { events: [{ when: today, who: ['people/alice-example'], what: 'Alice agreed to ship the beta', kind: 'commitment' }] };+ } });+ expect(calls).toBe(1);+ expect(r.details).toMatchObject({ extracted: 1, events_written: 1 });+ expect(await engine.executeRaw('SELECT slug, state FROM chronicle_page_state ORDER BY slug')).toEqual([{ slug: 'meetings/after', state: 'extracted' }]);+ expect((await engine.getTimelineForDate(today, {})).map((r) => r.summary)).toEqual(['Alice agreed to ship the beta']);+});diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.jsonindex 4f0686f397..20d35c7440 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json@@ -9,6 +9,13 @@"calibration_profiles.calibration_profiles_pkey": "p PRIMARY KEY (id)","calibration_profiles.calibration_profiles_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","chat_usage_log.chat_usage_log_pkey": "p PRIMARY KEY (id)",+ "chronicle_judge_reservations.chronicle_judge_reservations_pkey": "p PRIMARY KEY (id)",+ "chronicle_page_state.chronicle_page_state_attempts_check": "c CHECK ((attempts >= 0))",+ "chronicle_page_state.chronicle_page_state_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_pkey": "p PRIMARY KEY (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state.chronicle_page_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'skipped'::text, 'extracted'::text, 'failed'::text])))",+ "chronicle_page_state.chronicle_page_state_trigger_check": "c CHECK ((trigger = ANY (ARRAY['auto'::text, 'backfill'::text])))","code_edges_chunk.code_edges_chunk_from_chunk_id_fkey": "f FOREIGN KEY (from_chunk_id) REFERENCES content_chunks(id) ON DELETE CASCADE","code_edges_chunk.code_edges_chunk_pkey": "p PRIMARY KEY (id)","code_edges_chunk.code_edges_chunk_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",@@ -335,6 +342,12 @@"chat_usage_log": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "chronicle_judge_reservations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "chronicle_page_state": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"code_edges_chunk": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -640,6 +653,11 @@"calibration_profiles_pkey": "CREATE UNIQUE INDEX calibration_profiles_pkey ON public.calibration_profiles USING btree (id)","calibration_profiles_published_idx": "CREATE INDEX calibration_profiles_published_idx ON public.calibration_profiles USING btree (source_id, published, holder) WHERE (published = true)","chat_usage_log_pkey": "CREATE UNIQUE INDEX chat_usage_log_pkey ON public.chat_usage_log USING btree (id)",+ "chronicle_judge_reservations_at_idx": "CREATE INDEX chronicle_judge_reservations_at_idx ON public.chronicle_judge_reservations USING btree (reserved_at)",+ "chronicle_judge_reservations_pkey": "CREATE UNIQUE INDEX chronicle_judge_reservations_pkey ON public.chronicle_judge_reservations USING btree (id)",+ "chronicle_page_state_page_idx": "CREATE INDEX chronicle_page_state_page_idx ON public.chronicle_page_state USING btree (page_id)",+ "chronicle_page_state_pkey": "CREATE UNIQUE INDEX chronicle_page_state_pkey ON public.chronicle_page_state USING btree (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state_work_idx": "CREATE INDEX chronicle_page_state_work_idx ON public.chronicle_page_state USING btree (source_id, state, next_attempt_at)","code_edges_chunk_pkey": "CREATE UNIQUE INDEX code_edges_chunk_pkey ON public.code_edges_chunk USING btree (id)","code_edges_chunk_unique": "CREATE UNIQUE INDEX code_edges_chunk_unique ON public.code_edges_chunk USING btree (from_chunk_id, to_chunk_id, edge_type)","code_edges_symbol_pkey": "CREATE UNIQUE INDEX code_edges_symbol_pkey ON public.code_edges_symbol USING btree (id)",@@ -964,6 +982,7 @@"sequences": {"calibration_profiles_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=calibration_profiles.id","chat_usage_log_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chat_usage_log.id",+ "chronicle_judge_reservations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chronicle_judge_reservations.id","code_edges_chunk_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_chunk.id","code_edges_symbol_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_symbol.id","code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",@@ -1097,6 +1116,41 @@],"flags": "relkind=r rls=false force_rls=false"},+ "chronicle_judge_reservations": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('chronicle_judge_reservations_id_seq'::regclass)",+ "2 reserved_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "3 source_id text/text NOT NULL",+ "4 page_id integer/int4 NOT NULL",+ "5 content_hash text/text NOT NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "chronicle_page_state": {+ "columns": [+ "1 source_id text/text NOT NULL",+ "2 page_id integer/int4 NOT NULL",+ "3 content_hash text/text NOT NULL",+ "4 extractor_version integer/int4 NOT NULL",+ "5 slug text/text NOT NULL",+ "6 state text/text NOT NULL",+ "7 reason text/text NULL",+ "8 trigger text/text NOT NULL",+ "9 principal_kind text/text NULL",+ "10 principal_id text/text NULL",+ "11 request_id uuid/uuid NULL",+ "12 no_extract boolean/bool NOT NULL DEFAULT false",+ "13 attempts integer/int4 NOT NULL DEFAULT 0",+ "14 next_attempt_at timestamp with time zone/timestamptz NULL",+ "15 cost_usd numeric/numeric NULL",+ "16 unpriced boolean/bool NOT NULL DEFAULT false",+ "17 event_slugs ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "18 event_hashes ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "19 decided_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "20 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"code_edges_chunk": {"columns": ["1 id integer/int4 NOT NULL DEFAULT nextval('code_edges_chunk_id_seq'::regclass)",diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.jsonindex 7f41912877..cae6b08a48 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json@@ -9,6 +9,13 @@"calibration_profiles.calibration_profiles_pkey": "p PRIMARY KEY (id)","calibration_profiles.calibration_profiles_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","chat_usage_log.chat_usage_log_pkey": "p PRIMARY KEY (id)",+ "chronicle_judge_reservations.chronicle_judge_reservations_pkey": "p PRIMARY KEY (id)",+ "chronicle_page_state.chronicle_page_state_attempts_check": "c CHECK ((attempts >= 0))",+ "chronicle_page_state.chronicle_page_state_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_pkey": "p PRIMARY KEY (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state.chronicle_page_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'skipped'::text, 'extracted'::text, 'failed'::text])))",+ "chronicle_page_state.chronicle_page_state_trigger_check": "c CHECK ((trigger = ANY (ARRAY['auto'::text, 'backfill'::text])))","code_edges_chunk.code_edges_chunk_from_chunk_id_fkey": "f FOREIGN KEY (from_chunk_id) REFERENCES content_chunks(id) ON DELETE CASCADE","code_edges_chunk.code_edges_chunk_pkey": "p PRIMARY KEY (id)","code_edges_chunk.code_edges_chunk_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",@@ -335,6 +342,12 @@"chat_usage_log": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "chronicle_judge_reservations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "chronicle_page_state": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"code_edges_chunk": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -640,6 +653,11 @@"calibration_profiles_pkey": "CREATE UNIQUE INDEX calibration_profiles_pkey ON public.calibration_profiles USING btree (id)","calibration_profiles_published_idx": "CREATE INDEX calibration_profiles_published_idx ON public.calibration_profiles USING btree (source_id, published, holder) WHERE (published = true)","chat_usage_log_pkey": "CREATE UNIQUE INDEX chat_usage_log_pkey ON public.chat_usage_log USING btree (id)",+ "chronicle_judge_reservations_at_idx": "CREATE INDEX chronicle_judge_reservations_at_idx ON public.chronicle_judge_reservations USING btree (reserved_at)",+ "chronicle_judge_reservations_pkey": "CREATE UNIQUE INDEX chronicle_judge_reservations_pkey ON public.chronicle_judge_reservations USING btree (id)",+ "chronicle_page_state_page_idx": "CREATE INDEX chronicle_page_state_page_idx ON public.chronicle_page_state USING btree (page_id)",+ "chronicle_page_state_pkey": "CREATE UNIQUE INDEX chronicle_page_state_pkey ON public.chronicle_page_state USING btree (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state_work_idx": "CREATE INDEX chronicle_page_state_work_idx ON public.chronicle_page_state USING btree (source_id, state, next_attempt_at)","code_edges_chunk_pkey": "CREATE UNIQUE INDEX code_edges_chunk_pkey ON public.code_edges_chunk USING btree (id)","code_edges_chunk_unique": "CREATE UNIQUE INDEX code_edges_chunk_unique ON public.code_edges_chunk USING btree (from_chunk_id, to_chunk_id, edge_type)","code_edges_symbol_pkey": "CREATE UNIQUE INDEX code_edges_symbol_pkey ON public.code_edges_symbol USING btree (id)",@@ -964,6 +982,7 @@"sequences": {"calibration_profiles_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=calibration_profiles.id","chat_usage_log_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chat_usage_log.id",+ "chronicle_judge_reservations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chronicle_judge_reservations.id","code_edges_chunk_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_chunk.id","code_edges_symbol_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_symbol.id","code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",@@ -1097,6 +1116,41 @@],"flags": "relkind=r rls=false force_rls=false"},+ "chronicle_judge_reservations": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('chronicle_judge_reservations_id_seq'::regclass)",+ "2 reserved_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "3 source_id text/text NOT NULL",+ "4 page_id integer/int4 NOT NULL",+ "5 content_hash text/text NOT NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "chronicle_page_state": {+ "columns": [+ "1 source_id text/text NOT NULL",+ "2 page_id integer/int4 NOT NULL",+ "3 content_hash text/text NOT NULL",+ "4 extractor_version integer/int4 NOT NULL",+ "5 slug text/text NOT NULL",+ "6 state text/text NOT NULL",+ "7 reason text/text NULL",+ "8 trigger text/text NOT NULL",+ "9 principal_kind text/text NULL",+ "10 principal_id text/text NULL",+ "11 request_id uuid/uuid NULL",+ "12 no_extract boolean/bool NOT NULL DEFAULT false",+ "13 attempts integer/int4 NOT NULL DEFAULT 0",+ "14 next_attempt_at timestamp with time zone/timestamptz NULL",+ "15 cost_usd numeric/numeric NULL",+ "16 unpriced boolean/bool NOT NULL DEFAULT false",+ "17 event_slugs ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "18 event_hashes ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "19 decided_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "20 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"code_edges_chunk": {"columns": ["1 id integer/int4 NOT NULL DEFAULT nextval('code_edges_chunk_id_seq'::regclass)",diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.jsonindex 4b4462cd73..d39dd73f40 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json@@ -9,6 +9,13 @@"calibration_profiles.calibration_profiles_pkey": "p PRIMARY KEY (id)","calibration_profiles.calibration_profiles_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","chat_usage_log.chat_usage_log_pkey": "p PRIMARY KEY (id)",+ "chronicle_judge_reservations.chronicle_judge_reservations_pkey": "p PRIMARY KEY (id)",+ "chronicle_page_state.chronicle_page_state_attempts_check": "c CHECK ((attempts >= 0))",+ "chronicle_page_state.chronicle_page_state_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_pkey": "p PRIMARY KEY (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state.chronicle_page_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'skipped'::text, 'extracted'::text, 'failed'::text])))",+ "chronicle_page_state.chronicle_page_state_trigger_check": "c CHECK ((trigger = ANY (ARRAY['auto'::text, 'backfill'::text])))","code_edges_chunk.code_edges_chunk_from_chunk_id_fkey": "f FOREIGN KEY (from_chunk_id) REFERENCES content_chunks(id) ON DELETE CASCADE","code_edges_chunk.code_edges_chunk_pkey": "p PRIMARY KEY (id)","code_edges_chunk.code_edges_chunk_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",@@ -335,6 +342,12 @@"chat_usage_log": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "chronicle_judge_reservations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "chronicle_page_state": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"code_edges_chunk": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -640,6 +653,11 @@"calibration_profiles_pkey": "CREATE UNIQUE INDEX calibration_profiles_pkey ON public.calibration_profiles USING btree (id)","calibration_profiles_published_idx": "CREATE INDEX calibration_profiles_published_idx ON public.calibration_profiles USING btree (source_id, published, holder) WHERE (published = true)","chat_usage_log_pkey": "CREATE UNIQUE INDEX chat_usage_log_pkey ON public.chat_usage_log USING btree (id)",+ "chronicle_judge_reservations_at_idx": "CREATE INDEX chronicle_judge_reservations_at_idx ON public.chronicle_judge_reservations USING btree (reserved_at)",+ "chronicle_judge_reservations_pkey": "CREATE UNIQUE INDEX chronicle_judge_reservations_pkey ON public.chronicle_judge_reservations USING btree (id)",+ "chronicle_page_state_page_idx": "CREATE INDEX chronicle_page_state_page_idx ON public.chronicle_page_state USING btree (page_id)",+ "chronicle_page_state_pkey": "CREATE UNIQUE INDEX chronicle_page_state_pkey ON public.chronicle_page_state USING btree (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state_work_idx": "CREATE INDEX chronicle_page_state_work_idx ON public.chronicle_page_state USING btree (source_id, state, next_attempt_at)","code_edges_chunk_pkey": "CREATE UNIQUE INDEX code_edges_chunk_pkey ON public.code_edges_chunk USING btree (id)","code_edges_chunk_unique": "CREATE UNIQUE INDEX code_edges_chunk_unique ON public.code_edges_chunk USING btree (from_chunk_id, to_chunk_id, edge_type)","code_edges_symbol_pkey": "CREATE UNIQUE INDEX code_edges_symbol_pkey ON public.code_edges_symbol USING btree (id)",@@ -960,6 +978,7 @@"sequences": {"calibration_profiles_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=calibration_profiles.id","chat_usage_log_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chat_usage_log.id",+ "chronicle_judge_reservations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chronicle_judge_reservations.id","code_edges_chunk_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_chunk.id","code_edges_symbol_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_edges_symbol.id","code_traversal_cache_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=code_traversal_cache.id",@@ -1093,6 +1112,41 @@],"flags": "relkind=r rls=false force_rls=false"},+ "chronicle_judge_reservations": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('chronicle_judge_reservations_id_seq'::regclass)",+ "2 reserved_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "3 source_id text/text NOT NULL",+ "4 page_id integer/int4 NOT NULL",+ "5 content_hash text/text NOT NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "chronicle_page_state": {+ "columns": [+ "1 source_id text/text NOT NULL",+ "2 page_id integer/int4 NOT NULL",+ "3 content_hash text/text NOT NULL",+ "4 extractor_version integer/int4 NOT NULL",+ "5 slug text/text NOT NULL",+ "6 state text/text NOT NULL",+ "7 reason text/text NULL",+ "8 trigger text/text NOT NULL",+ "9 principal_kind text/text NULL",+ "10 principal_id text/text NULL",+ "11 request_id uuid/uuid NULL",+ "12 no_extract boolean/bool NOT NULL DEFAULT false",+ "13 attempts integer/int4 NOT NULL DEFAULT 0",+ "14 next_attempt_at timestamp with time zone/timestamptz NULL",+ "15 cost_usd numeric/numeric NULL",+ "16 unpriced boolean/bool NOT NULL DEFAULT false",+ "17 event_slugs ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "18 event_hashes ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "19 decided_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "20 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"code_edges_chunk": {"columns": ["1 id integer/int4 NOT NULL DEFAULT nextval('code_edges_chunk_id_seq'::regclass)",diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json b/test/fixtures/goldens/catalog/pglite-schema-blob-default.jsonindex 3aebc0d724..967814ed6a 100644--- a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-default.json@@ -6,6 +6,13 @@"calibration_profiles.calibration_profiles_pkey": "p PRIMARY KEY (id)","calibration_profiles.calibration_profiles_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","chat_usage_log.chat_usage_log_pkey": "p PRIMARY KEY (id)",+ "chronicle_judge_reservations.chronicle_judge_reservations_pkey": "p PRIMARY KEY (id)",+ "chronicle_page_state.chronicle_page_state_attempts_check": "c CHECK ((attempts >= 0))",+ "chronicle_page_state.chronicle_page_state_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_pkey": "p PRIMARY KEY (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state.chronicle_page_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'skipped'::text, 'extracted'::text, 'failed'::text])))",+ "chronicle_page_state.chronicle_page_state_trigger_check": "c CHECK ((trigger = ANY (ARRAY['auto'::text, 'backfill'::text])))","config.config_pkey": "p PRIMARY KEY (key)","content_chunks.content_chunks_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE","content_chunks.content_chunks_pkey": "p PRIMARY KEY (id)",@@ -256,6 +263,12 @@"chat_usage_log": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "chronicle_judge_reservations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "chronicle_page_state": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"config": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -496,6 +509,11 @@"calibration_profiles_pkey": "CREATE UNIQUE INDEX calibration_profiles_pkey ON public.calibration_profiles USING btree (id)","calibration_profiles_published_idx": "CREATE INDEX calibration_profiles_published_idx ON public.calibration_profiles USING btree (source_id, published, holder) WHERE (published = true)","chat_usage_log_pkey": "CREATE UNIQUE INDEX chat_usage_log_pkey ON public.chat_usage_log USING btree (id)",+ "chronicle_judge_reservations_at_idx": "CREATE INDEX chronicle_judge_reservations_at_idx ON public.chronicle_judge_reservations USING btree (reserved_at)",+ "chronicle_judge_reservations_pkey": "CREATE UNIQUE INDEX chronicle_judge_reservations_pkey ON public.chronicle_judge_reservations USING btree (id)",+ "chronicle_page_state_page_idx": "CREATE INDEX chronicle_page_state_page_idx ON public.chronicle_page_state USING btree (page_id)",+ "chronicle_page_state_pkey": "CREATE UNIQUE INDEX chronicle_page_state_pkey ON public.chronicle_page_state USING btree (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state_work_idx": "CREATE INDEX chronicle_page_state_work_idx ON public.chronicle_page_state USING btree (source_id, state, next_attempt_at)","config_pkey": "CREATE UNIQUE INDEX config_pkey ON public.config USING btree (key)","content_chunks_pkey": "CREATE UNIQUE INDEX content_chunks_pkey ON public.content_chunks USING btree (id)","content_chunks_stale_idx": "CREATE INDEX content_chunks_stale_idx ON public.content_chunks USING btree (page_id, chunk_index) WHERE (embedding IS NULL)",@@ -720,6 +738,7 @@"sequences": {"calibration_profiles_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=calibration_profiles.id","chat_usage_log_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chat_usage_log.id",+ "chronicle_judge_reservations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chronicle_judge_reservations.id","content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id","context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id","decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",@@ -808,6 +827,41 @@],"flags": "relkind=r rls=false force_rls=false"},+ "chronicle_judge_reservations": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('chronicle_judge_reservations_id_seq'::regclass)",+ "2 reserved_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "3 source_id text/text NOT NULL",+ "4 page_id integer/int4 NOT NULL",+ "5 content_hash text/text NOT NULL"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },+ "chronicle_page_state": {+ "columns": [+ "1 source_id text/text NOT NULL",+ "2 page_id integer/int4 NOT NULL",+ "3 content_hash text/text NOT NULL",+ "4 extractor_version integer/int4 NOT NULL",+ "5 slug text/text NOT NULL",+ "6 state text/text NOT NULL",+ "7 reason text/text NULL",+ "8 trigger text/text NOT NULL",+ "9 principal_kind text/text NULL",+ "10 principal_id text/text NULL",+ "11 request_id uuid/uuid NULL",+ "12 no_extract boolean/bool NOT NULL DEFAULT false",+ "13 attempts integer/int4 NOT NULL DEFAULT 0",+ "14 next_attempt_at timestamp with time zone/timestamptz NULL",+ "15 cost_usd numeric/numeric NULL",+ "16 unpriced boolean/bool NOT NULL DEFAULT false",+ "17 event_slugs ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "18 event_hashes ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "19 decided_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "20 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"config": {"columns": ["1 key text/text NOT NULL",diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.jsonindex c2c25193a5..42bc796807 100644--- a/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json@@ -6,6 +6,13 @@"calibration_profiles.calibration_profiles_pkey": "p PRIMARY KEY (id)","calibration_profiles.calibration_profiles_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","chat_usage_log.chat_usage_log_pkey": "p PRIMARY KEY (id)",+ "chronicle_judge_reservations.chronicle_judge_reservations_pkey": "p PRIMARY KEY (id)",+ "chronicle_page_state.chronicle_page_state_attempts_check": "c CHECK ((attempts >= 0))",+ "chronicle_page_state.chronicle_page_state_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_pkey": "p PRIMARY KEY (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state.chronicle_page_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'skipped'::text, 'extracted'::text, 'failed'::text])))",+ "chronicle_page_state.chronicle_page_state_trigger_check": "c CHECK ((trigger = ANY (ARRAY['auto'::text, 'backfill'::text])))","config.config_pkey": "p PRIMARY KEY (key)","content_chunks.content_chunks_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE","content_chunks.content_chunks_pkey": "p PRIMARY KEY (id)",@@ -256,6 +263,12 @@"chat_usage_log": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "chronicle_judge_reservations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "chronicle_page_state": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"config": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -496,6 +509,11 @@"calibration_profiles_pkey": "CREATE UNIQUE INDEX calibration_profiles_pkey ON public.calibration_profiles USING btree (id)","calibration_profiles_published_idx": "CREATE INDEX calibration_profiles_published_idx ON public.calibration_profiles USING btree (source_id, published, holder) WHERE (published = true)","chat_usage_log_pkey": "CREATE UNIQUE INDEX chat_usage_log_pkey ON public.chat_usage_log USING btree (id)",+ "chronicle_judge_reservations_at_idx": "CREATE INDEX chronicle_judge_reservations_at_idx ON public.chronicle_judge_reservations USING btree (reserved_at)",+ "chronicle_judge_reservations_pkey": "CREATE UNIQUE INDEX chronicle_judge_reservations_pkey ON public.chronicle_judge_reservations USING btree (id)",+ "chronicle_page_state_page_idx": "CREATE INDEX chronicle_page_state_page_idx ON public.chronicle_page_state USING btree (page_id)",+ "chronicle_page_state_pkey": "CREATE UNIQUE INDEX chronicle_page_state_pkey ON public.chronicle_page_state USING btree (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state_work_idx": "CREATE INDEX chronicle_page_state_work_idx ON public.chronicle_page_state USING btree (source_id, state, next_attempt_at)","config_pkey": "CREATE UNIQUE INDEX config_pkey ON public.config USING btree (key)","content_chunks_pkey": "CREATE UNIQUE INDEX content_chunks_pkey ON public.content_chunks USING btree (id)","content_chunks_stale_idx": "CREATE INDEX content_chunks_stale_idx ON public.content_chunks USING btree (page_id, chunk_index) WHERE (embedding IS NULL)",@@ -720,6 +738,7 @@"sequences": {"calibration_profiles_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=calibration_profiles.id","chat_usage_log_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chat_usage_log.id",+ "chronicle_judge_reservations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chronicle_judge_reservations.id","content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id","context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id","decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",@@ -808,6 +827,41 @@],"flags": "relkind=r rls=false force_rls=false"},+ "chronicle_judge_reservations": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('chronicle_judge_reservations_id_seq'::regclass)",+ "2 reserved_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "3 source_id text/text NOT NULL",+ "4 page_id integer/int4 NOT NULL",+ "5 content_hash text/text NOT NULL"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },+ "chronicle_page_state": {+ "columns": [+ "1 source_id text/text NOT NULL",+ "2 page_id integer/int4 NOT NULL",+ "3 content_hash text/text NOT NULL",+ "4 extractor_version integer/int4 NOT NULL",+ "5 slug text/text NOT NULL",+ "6 state text/text NOT NULL",+ "7 reason text/text NULL",+ "8 trigger text/text NOT NULL",+ "9 principal_kind text/text NULL",+ "10 principal_id text/text NULL",+ "11 request_id uuid/uuid NULL",+ "12 no_extract boolean/bool NOT NULL DEFAULT false",+ "13 attempts integer/int4 NOT NULL DEFAULT 0",+ "14 next_attempt_at timestamp with time zone/timestamptz NULL",+ "15 cost_usd numeric/numeric NULL",+ "16 unpriced boolean/bool NOT NULL DEFAULT false",+ "17 event_slugs ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "18 event_hashes ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "19 decided_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "20 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"config": {"columns": ["1 key text/text NOT NULL",diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json b/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.jsonindex fc97debbf9..a9bccdedf0 100644--- a/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json@@ -6,6 +6,13 @@"calibration_profiles.calibration_profiles_pkey": "p PRIMARY KEY (id)","calibration_profiles.calibration_profiles_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","chat_usage_log.chat_usage_log_pkey": "p PRIMARY KEY (id)",+ "chronicle_judge_reservations.chronicle_judge_reservations_pkey": "p PRIMARY KEY (id)",+ "chronicle_page_state.chronicle_page_state_attempts_check": "c CHECK ((attempts >= 0))",+ "chronicle_page_state.chronicle_page_state_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_pkey": "p PRIMARY KEY (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state.chronicle_page_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "chronicle_page_state.chronicle_page_state_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'skipped'::text, 'extracted'::text, 'failed'::text])))",+ "chronicle_page_state.chronicle_page_state_trigger_check": "c CHECK ((trigger = ANY (ARRAY['auto'::text, 'backfill'::text])))","config.config_pkey": "p PRIMARY KEY (key)","content_chunks.content_chunks_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE","content_chunks.content_chunks_pkey": "p PRIMARY KEY (id)",@@ -256,6 +263,12 @@"chat_usage_log": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "chronicle_judge_reservations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "chronicle_page_state": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"config": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -496,6 +509,11 @@"calibration_profiles_pkey": "CREATE UNIQUE INDEX calibration_profiles_pkey ON public.calibration_profiles USING btree (id)","calibration_profiles_published_idx": "CREATE INDEX calibration_profiles_published_idx ON public.calibration_profiles USING btree (source_id, published, holder) WHERE (published = true)","chat_usage_log_pkey": "CREATE UNIQUE INDEX chat_usage_log_pkey ON public.chat_usage_log USING btree (id)",+ "chronicle_judge_reservations_at_idx": "CREATE INDEX chronicle_judge_reservations_at_idx ON public.chronicle_judge_reservations USING btree (reserved_at)",+ "chronicle_judge_reservations_pkey": "CREATE UNIQUE INDEX chronicle_judge_reservations_pkey ON public.chronicle_judge_reservations USING btree (id)",+ "chronicle_page_state_page_idx": "CREATE INDEX chronicle_page_state_page_idx ON public.chronicle_page_state USING btree (page_id)",+ "chronicle_page_state_pkey": "CREATE UNIQUE INDEX chronicle_page_state_pkey ON public.chronicle_page_state USING btree (source_id, page_id, content_hash, extractor_version)",+ "chronicle_page_state_work_idx": "CREATE INDEX chronicle_page_state_work_idx ON public.chronicle_page_state USING btree (source_id, state, next_attempt_at)","config_pkey": "CREATE UNIQUE INDEX config_pkey ON public.config USING btree (key)","content_chunks_pkey": "CREATE UNIQUE INDEX content_chunks_pkey ON public.content_chunks USING btree (id)","content_chunks_stale_idx": "CREATE INDEX content_chunks_stale_idx ON public.content_chunks USING btree (page_id, chunk_index) WHERE (embedding IS NULL)",@@ -719,6 +737,7 @@"sequences": {"calibration_profiles_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=calibration_profiles.id","chat_usage_log_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chat_usage_log.id",+ "chronicle_judge_reservations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=chronicle_judge_reservations.id","content_chunks_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=content_chunks.id","context_volunteer_events_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=context_volunteer_events.id","decide_calibrations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_calibrations.id",@@ -807,6 +826,41 @@],"flags": "relkind=r rls=false force_rls=false"},+ "chronicle_judge_reservations": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('chronicle_judge_reservations_id_seq'::regclass)",+ "2 reserved_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "3 source_id text/text NOT NULL",+ "4 page_id integer/int4 NOT NULL",+ "5 content_hash text/text NOT NULL"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },+ "chronicle_page_state": {+ "columns": [+ "1 source_id text/text NOT NULL",+ "2 page_id integer/int4 NOT NULL",+ "3 content_hash text/text NOT NULL",+ "4 extractor_version integer/int4 NOT NULL",+ "5 slug text/text NOT NULL",+ "6 state text/text NOT NULL",+ "7 reason text/text NULL",+ "8 trigger text/text NOT NULL",+ "9 principal_kind text/text NULL",+ "10 principal_id text/text NULL",+ "11 request_id uuid/uuid NULL",+ "12 no_extract boolean/bool NOT NULL DEFAULT false",+ "13 attempts integer/int4 NOT NULL DEFAULT 0",+ "14 next_attempt_at timestamp with time zone/timestamptz NULL",+ "15 cost_usd numeric/numeric NULL",+ "16 unpriced boolean/bool NOT NULL DEFAULT false",+ "17 event_slugs ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "18 event_hashes ARRAY/_text NOT NULL DEFAULT '{}'::text[]",+ "19 decided_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "20 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"config": {"columns": ["1 key text/text NOT NULL",diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.jsonindex f4ec1add0a..4c22c52117 100644--- a/test/fixtures/goldens/cli/tools-json.json+++ b/test/fixtures/goldens/cli/tools-json.json@@ -2,8 +2,8 @@"golden": {"exitCode": 0,"stderr": "",- "stdoutBytes": 209860,- "stdoutSha256": "1ec5b407e08b2b2333a2f5fe2c24561fa47447bb9303de69902a0bfe562610df",+ "stdoutBytes": 210736,+ "stdoutSha256": "e58c7525a0234ce0d695669f80e52ea2e454c41b605f61c2727562d9cbe6d567","toolNames": ["remember","entity",@@ -4076,26 +4076,41 @@}},{- "description": "Life Chronicle: sweep existing meeting/conversation/calendar pages into timeline events by enqueuing chronicle_extract jobs (one per eligible page). A page whose current content was already enqueued is skipped (already_enqueued), so repeat runs move on to pages not yet swept. --dry-run counts without enqueuing. Local-only bulk op. CLI: `gbrain chronicle-backfill [--since YYYY-MM-DD] [--limit N] [--dry-run]`.",+ "description": "Life Chronicle: queue existing meeting/conversation/calendar pages (by type or under meetings/, conversations/, cal/, calendar/) for timeline-event extraction. One paid chat call per page, so it needs --yes; --dry-run reports the candidates, an estimated cost and skip reasons. The chronicle_page_state ledger skips content already extracted or queued, so repeats never pay twice. Queued pages run in the `chronicle` cycle phase (`gbrain dream --phase chronicle`), exempt from the daily limit. Local-only bulk op. CLI: `gbrain chronicle-backfill [--since YYYY-MM-DD] [--dated-since YYYY-MM-DD] [--recent] [--limit N] [--dry-run | --yes]`.","name": "chronicle_backfill","parameters": {+ "dated_since": "string?","dry_run": "boolean?","limit": "number?",- "since": "string?"+ "recent": "boolean?",+ "since": "string?",+ "yes": "boolean?"},"schema": {"properties": {+ "dated_since": {+ "description": "Only pages whose own date (authored effective date, else frontmatter date/start) is on/after this date (YYYY-MM-DD).",+ "type": "string"+ },"dry_run": {- "description": "Count eligible pages without enqueuing.",+ "description": "Count candidates, estimate cost and report skip reasons without queuing.","type": "boolean"},"limit": {- "description": "Max pages per type to enqueue in this run (default 1000); pages already enqueued for their current content do not count.",+ "description": "Max pages queued in this run, across all types and sources (default 1000).","type": "number"},+ "recent": {+ "description": "Only pages within chronicle.auto_recent_days (the automatic path's window).",+ "type": "boolean"+ },"since": {- "description": "Only pages updated on/after this date (YYYY-MM-DD).",+ "description": "Only pages UPDATED on/after this date (YYYY-MM-DD). Use --dated-since for the page's own date.","type": "string"+ },+ "yes": {+ "description": "Consent to queue paid extraction (one chat call per page). Ask the user first.",+ "type": "boolean"}},"required": [],diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex 450fd2f82d..0cca210d61 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -8,9 +8,9 @@],"exit_code": 0,"report": {- "brain_checks_score": 80,+ "brain_checks_score": 75,"category_scores": {- "brain": 80,+ "brain": 75,"meta": 100,"ops": 95,"skill": 90@@ -392,13 +392,13 @@},{"category": "meta",- "message": "Version 197 (latest: 197)",+ "message": "Version 198 (latest: 198)","name": "schema_version","status": "ok"},{"category": "meta",- "message": "828 column(s) verified against live schema",+ "message": "853 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1091,11 +1091,15 @@{"category": "brain","details": {- "enabled": false+ "cause": "auto_chronicle has no reader in this version",+ "code": "auto_chronicle_no_effect",+ "docs": "docs/guides/troubleshooting.md#auto_chronicle-has-no-effect",+ "enabled": true,+ "fix": "gbrain chronicle-backfill --dry-run"},- "message": "auto_chronicle is off.",+ "message": "auto_chronicle=true currently has no effect: no write or cycle step enqueues chronicle extraction, so new meetings are not swept into events. Fix: run `gbrain chronicle-backfill --dry-run`, then `gbrain chronicle-backfill`; `gbrain config unset auto_chronicle` clears the setting.","name": "auto_chronicle",- "status": "ok"+ "status": "warn"},{"category": "brain",@@ -1271,13 +1275,14 @@"category": "meta","details": {"counts": {- "global": 9,+ "global": 10,"mixed": 2,"source": 12},"phase_scope_map": {"backlinks": "source","calibration_profile": "global",+ "chronicle": "global","consolidate": "source","conversation_facts_backfill": "source","drift": "global",@@ -1301,7 +1306,7 @@"synthesize_concepts": "global"}},- "message": "Phase taxonomy: 12 source-scoped, 9 brain-global, 2 mixed. Source-safe: [lint, backlinks, sync, extract, extract_facts, extract_atoms, recompute_emotional_weight, consolidate, propose_takes, conversation_facts_backfill, enrich_thin, schema-suggest]. Brain-global: [resolve_symbol_edges, synthesize_concepts, grade_takes, calibration_profile, drift, skillopt, embed, orphans, purge]. Mixed: [synthesize, patterns].",+ "message": "Phase taxonomy: 12 source-scoped, 10 brain-global, 2 mixed. Source-safe: [lint, backlinks, sync, extract, extract_facts, extract_atoms, recompute_emotional_weight, consolidate, propose_takes, conversation_facts_backfill, enrich_thin, schema-suggest]. Brain-global: [resolve_symbol_edges, synthesize_concepts, grade_takes, calibration_profile, drift, chronicle, skillopt, embed, orphans, purge]. Mixed: [synthesize, patterns].","name": "cycle_phase_scope","status": "ok"},@@ -1350,10 +1355,16 @@],"db_url_source": null,"engine": "pglite",- "health_score": 65,+ "health_score": 60,"schema_version": 2,"status": "warnings","top_issues": [+ {+ "fix": "auto_chronicle=true currently has no effect: no write or cycle step enqueues chronicle extraction, so new meetings are not swept into events. Fix: run `gbrain chronicle-backfill --dry-run`, then `gbrain chronicle-backfill`; `gbrain config unset auto_chronicle` clears the setting.",+ "name": "auto_chronicle",+ "status": "warn",+ "tier": "symptom"+ },{"fix": "1 knowledge asset(s) lack verified recovery: default (not_a_git_repo). Current recovery is not verified for all repositories. Run `gbrain backup status` for fix commands (`gbrain bootstrap repo` / `git remote add origin <url>` / `gbrain sources harden <id>`).","name": "backup_coverage",diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex fce5a69488..29f9c4edad 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -8,9 +8,9 @@],"exit_code": 0,"report": {- "brain_checks_score": 85,+ "brain_checks_score": 80,"category_scores": {- "brain": 85,+ "brain": 80,"meta": 100,"ops": 95,"skill": 90@@ -392,13 +392,13 @@},{"category": "meta",- "message": "Version 197 (latest: 197)",+ "message": "Version 198 (latest: 198)","name": "schema_version","status": "ok"},{"category": "meta",- "message": "828 column(s) verified against live schema",+ "message": "853 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1091,11 +1091,15 @@{"category": "brain","details": {- "enabled": false+ "cause": "auto_chronicle has no reader in this version",+ "code": "auto_chronicle_no_effect",+ "docs": "docs/guides/troubleshooting.md#auto_chronicle-has-no-effect",+ "enabled": true,+ "fix": "gbrain chronicle-backfill --dry-run"},- "message": "auto_chronicle is off.",+ "message": "auto_chronicle=true currently has no effect: no write or cycle step enqueues chronicle extraction, so new meetings are not swept into events. Fix: run `gbrain chronicle-backfill --dry-run`, then `gbrain chronicle-backfill`; `gbrain config unset auto_chronicle` clears the setting.","name": "auto_chronicle",- "status": "ok"+ "status": "warn"},{"category": "brain",@@ -1258,13 +1262,14 @@"category": "meta","details": {"counts": {- "global": 9,+ "global": 10,"mixed": 2,"source": 12},"phase_scope_map": {"backlinks": "source","calibration_profile": "global",+ "chronicle": "global","consolidate": "source","conversation_facts_backfill": "source","drift": "global",@@ -1288,7 +1293,7 @@"synthesize_concepts": "global"}},- "message": "Phase taxonomy: 12 source-scoped, 9 brain-global, 2 mixed. Source-safe: [lint, backlinks, sync, extract, extract_facts, extract_atoms, recompute_emotional_weight, consolidate, propose_takes, conversation_facts_backfill, enrich_thin, schema-suggest]. Brain-global: [resolve_symbol_edges, synthesize_concepts, grade_takes, calibration_profile, drift, skillopt, embed, orphans, purge]. Mixed: [synthesize, patterns].",+ "message": "Phase taxonomy: 12 source-scoped, 10 brain-global, 2 mixed. Source-safe: [lint, backlinks, sync, extract, extract_facts, extract_atoms, recompute_emotional_weight, consolidate, propose_takes, conversation_facts_backfill, enrich_thin, schema-suggest]. Brain-global: [resolve_symbol_edges, synthesize_concepts, grade_takes, calibration_profile, drift, chronicle, skillopt, embed, orphans, purge]. Mixed: [synthesize, patterns].","name": "cycle_phase_scope","status": "ok"},@@ -1337,10 +1342,16 @@],"db_url_source": null,"engine": "pglite",- "health_score": 70,+ "health_score": 65,"schema_version": 2,"status": "warnings","top_issues": [+ {+ "fix": "auto_chronicle=true currently has no effect: no write or cycle step enqueues chronicle extraction, so new meetings are not swept into events. Fix: run `gbrain chronicle-backfill --dry-run`, then `gbrain chronicle-backfill`; `gbrain config unset auto_chronicle` clears the setting.",+ "name": "auto_chronicle",+ "status": "warn",+ "tier": "symptom"+ },{"fix": "1 knowledge asset(s) lack verified recovery: default (not_a_git_repo). Current recovery is not verified for all repositories. Run `gbrain backup status` for fix commands (`gbrain bootstrap repo` / `git remote add origin <url>` / `gbrain sources harden <id>`).","name": "backup_coverage",diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.jsonindex 29faf71e5a..4504d4b687 100644--- a/test/fixtures/goldens/migrations/records.json+++ b/test/fixtures/goldens/migrations/records.json@@ -1,6 +1,6 @@{"golden": {- "count": 192,+ "count": 193,"gaps": [17,18,@@ -28,7 +28,7 @@"slugifyPath": "401dbca23580865d8b168dd8d84db4a6c708c6610d7cb61abafc7d0ee9809063","verifyProjectionStatistics": "59d9ccfea1c53384d8607874a51209a9c2dfd51b2b85a2cb6269fa4120faf1f3"},- "latest": 197,+ "latest": 198,"records": [{"handler": {@@ -2923,6 +2923,19 @@"transaction": "absent","verify": "absent","version": 197+ },+ {+ "handler": "absent",+ "idempotent": true,+ "name": "chronicle_page_state",+ "sql": {+ "length": 2184,+ "sha256": "34b7295ead460e8a342489a896eed604753a5ead983ebbfb3100d8bc191d5958"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",+ "version": 198}],"versions": [@@ -3117,7 +3130,8 @@194,195,196,- 197+ 197,+ 198]},"normalizer": "migrations-record-v1"