Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

GBRA-161 PR 1a (wip): regenerate goldens

garrytan7441e46b6dae
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.ts
index cf6355b45f..8014ce64a0 100644
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@ -20,7 +20,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'append': ['--brain', '--expect-tail', '--expected-revision', '--file', '--force', '--help', '--json', '--region', '--request-id', '--separator', '--source'],
'apply-migrations': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--apply', '--apply-rewrites', '--backup-confirmed', '--brain', '--break-lock', '--confirm-quiesced', '--content-root', '--dry-run', '--export-db-only', '--export-source', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--help', '--host-dir', '--http', '--install', '--json', '--legacy-lock', '--list', '--locks', '--migrate-only', '--migration', '--mode', '--no-autopilot-install', '--non-interactive', '--only', '--path', '--prefer-postgres', '--probe', '--repo', '--require-db', '--skip-verify', '--source', '--statement-timeout', '--uninstall', '--url', '--yes'],
'auth': ['--add', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all-new', '--allowed-operations', '--before', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--category', '--cleanup-dead-local-locks', '--client', '--code', '--confirm-quiesced', '--confirm-relocated-root', '--days', '--delegated-namespace', '--delegated-slug-prefixes', '--disable', '--dry-run', '--enable', '--enable-dcr-insecure', '--expected-epoch', '--expected-state', '--federated-read', '--fix', '--force', '--grant-types', '--group-by', '--help', '--id', '--if-version', '--json', '--limit', '--manifest', '--max-concurrent', '--migrate-legacy', '--min-trust', '--no-pull', '--operations', '--origin', '--parked-pushes', '--pat-file', '--path', '--probe', '--profile', '--read-sources', '--redirect-uri', '--refresh-operations', '--repair', '--replace', '--request-id', '--reset-default', '--scopes', '--self-transfer', '--shared-skills', '--since', '--slug-prefixes', '--source', '--source-ids', '--sources', '--state', '--surface', '--takes-holders', '--token', '--token-endpoint-auth-method', '--token-ttl', '--usage', '--wait', '--warn-only', '--yes'],
- 'autopilot': ['--apply', '--batch', '--brain', '--check', '--dimensions', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--exit-code', '--expect', '--explain', '--ff-only', '--force', '--force-retry', '--from-pages', '--help', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--markdown', '--max-cost', '--max-rss', '--max-runtime', '--max-usd', '--migrate-only', '--model', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-embed-cache', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--output', '--params', '--path', '--pause', '--phase', '--reader-mode', '--reason', '--refresh-cache', '--refs', '--remediation-plan', '--repo', '--resume', '--retry-global', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--source', '--stale', '--status', '--swap-only', '--tags', '--target', '--trust', '--uninstall', '--user', '--verify', '--version', '--yes'],
+ 'autopilot': ['--apply', '--batch', '--brain', '--check', '--dimensions', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--exit-code', '--expect', '--explain', '--ff-only', '--force', '--force-retry', '--from-pages', '--help', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--key', '--kind', '--markdown', '--max-cost', '--max-rss', '--max-runtime', '--max-usd', '--migrate-only', '--mode', '--model', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-embed-cache', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--output', '--params', '--path', '--pause', '--phase', '--reader-mode', '--reason', '--refresh-cache', '--refs', '--remediation-plan', '--repo', '--resume', '--retry-global', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--source', '--stale', '--status', '--swap-only', '--tags', '--target', '--trust', '--uninstall', '--user', '--verify', '--version', '--yes'],
'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', '--purge-mirror', '--quiet', '--restore-only', '--source', '--timeout', '--timings', '--wait'],
'beliefs': ['--apply', '--archived-at', '--brain', '--from-url-env', '--help', '--json', '--probe', '--purge-mirror', '--since', '--source'],
@@ -50,7 +50,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'db-repair': ['--accept-pending', '--apply', '--apply-rewrites', '--background', '--brain', '--break-lock', '--db-url', '--dry-run', '--explain', '--filter', '--follow', '--force', '--force-retry', '--format', '--help', '--http', '--json', '--legacy-lock', '--locks', '--name', '--no-accept-pending', '--path', '--prefer-postgres', '--probe', '--progress-interval', '--progress-json', '--quiet', '--remediate', '--restart', '--skip-verify', '--source', '--statement-timeout', '--supabase', '--timeout', '--timings', '--undo-last-rewrite', '--url', '--version', '--wait', '--yes'],
'decide': ['--accept-all', '--all', '--all-from', '--apply', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--expect', '--from', '--help', '--include-withdrawals', '--input', '--items-out', '--json', '--kind', '--limit', '--max-cost', '--max-usd', '--min', '--non-interactive', '--out', '--provenance', '--provider', '--query', '--rate', '--reason', '--reason-family', '--recommended', '--remove', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--trust', '--undo', '--uri-prefix', '--version', '--what-if-threshold', '--yes'],
'doctor': ['--abandon', '--abbrev-ref', '--accept-pending', '--access', '--account', '--acknowledge-managed', '--add', '--admin-intent', '--adopt', '--adopt-columns', '--adopt-permissions', '--after', '--aliases', '--all', '--all-drifted', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--allowed-operations', '--apply', '--apply-rewrites', '--assign-corpus', '--audit', '--auto', '--auto-additive', '--auto-fix', '--autostash', '--background', '--batch', '--batch-check', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--branch', '--break-lock', '--budget-ms', '--budget-policy', '--budget-tokens', '--budget-usd', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--class', '--clear', '--clear-never-installed', '--cli-socket', '--client', '--close', '--concurrency', '--confidence', '--confirm', '--confirm-quiesced', '--confirm-relocated-root', '--conflicts', '--contacts-dir', '--content-audit', '--content-root', '--conversation', '--count', '--cursor', '--dataset', '--db-url', '--delegated-namespace', '--delegated-slug-prefixes', '--delete-brain', '--dest', '--detach', '--detail', '--diff-filter', '--dim', '--dimensions', '--dir', '--disable', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--enable', '--enable-dcr', '--end-of-options', '--entity', '--env', '--error-unmatch', '--exclude', '--exclude-standard', '--expand', '--expect', '--expect-local', '--expect-remote', '--expect-upstream', '--expected-epoch', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--first-parent', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--fresh-token', '--from', '--from-meetings', '--from-pages', '--full', '--fuzzy', '--generation', '--get', '--git-common-dir', '--git-dir', '--git-path', '--group', '--group-by', '--hard', '--hard-deadline', '--harness', '--held', '--help', '--home', '--http', '--id', '--if-version', '--ignore-env-override', '--images', '--include-ambiguous', '--include-deleted', '--include-failures', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--include-withdrawals', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--items-out', '--job-isolation', '--jq', '--json', '--keep', '--keep-checkout', '--key', '--kind', '--lanes', '--lang', '--left-right', '--legacy-lock', '--limit', '--link-source', '--link-type', '--list', '--literal-pathspecs', '--local', '--local-env-vars', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-facts', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--migration', '--min', '--min-n', '--mode', '--model', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-autostash', '--no-capture', '--no-confirm', '--no-cron', '--no-delegate', '--no-edit', '--no-embed', '--no-embed-cache', '--no-embedding', '--no-expand', '--no-extract', '--no-filters', '--no-hooks', '--no-lanes', '--no-llm', '--no-migrate', '--no-probe', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-seat', '--no-tags', '--no-verify', '--no-walk', '--non-interactive', '--now', '--older-than', '--once', '--only', '--operations', '--others', '--out', '--output', '--oversized', '--overwrite', '--page', '--parallel', '--params', '--parked-pushes', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--profile', '--progress-interval', '--progress-json', '--project', '--provider', '--providers', '--prune-orphans', '--public-url', '--pull', '--pure', '--purge', '--push-only', '--query', '--question', '--queue', '--quiet', '--rate', '--reader-mode', '--reauth', '--rebase', '--rebuild', '--recommended', '--redact-paths', '--reference-date', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--relative', '--relower', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--repair', '--repair-unknown-markers', '--replace', '--repo', '--request', '--request-id', '--require-clean', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--resolve', '--restore-only', '--resume', '--retry-failed', '--retry-global', '--retry-held', '--retry-parked', '--reverse', '--review-lower', '--revision', '--rollback-to-source', '--run', '--save', '--scope', '--scopes', '--search-mode', '--seat', '--section', '--select', '--self-transfer', '--semantic', '--session', '--session-id', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-prefix', '--show-token', '--show-toplevel', '--side', '--since', '--since-last-run', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--state', '--statement-timeout', '--status', '--stdin', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--tier', '--timeout', '--timings', '--to', '--token', '--token-ttl', '--top-k', '--trust', '--type', '--unindexed', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vacuum', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--warn-only', '--watch', '--what-if-threshold', '--window', '--workers', '--working-tree', '--workspace', '--yes'],
- 'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--probe', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],
+ 'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--from', '--help', '--input', '--install', '--json', '--key', '--kind', '--limit', '--list', '--max-usd', '--mode', '--once', '--path', '--phase', '--probe', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],
'edge-proposals': ['--access', '--add', '--all', '--all-applied', '--all-held', '--allowed-operations', '--asof', '--body', '--bound-slug-prefixes', '--brain', '--client', '--cursor', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--from-index', '--full', '--fuzzy', '--group-by', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--prefer', '--purge', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--status', '--surface', '--to', '--updated-after', '--url', '--yes'],
'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],
'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--client', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--group', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-null-signature', '--json', '--legacy-lock', '--max-cost', '--max-cost-usd', '--max-facts', '--max-runtime', '--max-usd', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--no-embed', '--no-embedding', '--no-hooks', '--only', '--oversized', '--pace', '--pace-max-concurrency', '--path', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--scopes', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--surface', '--timeout', '--timings', '--to', '--wait', '--yes'],
@@ -75,7 +75,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'graph-query': ['--brain', '--depth', '--direction', '--help', '--hop', '--include-foreign', '--json', '--mcp-only', '--request-id', '--source', '--type'],
'hook': ['--allow-unverified-remote', '--auto', '--batch-check', '--brain', '--branch', '--cached', '--count', '--diff-filter', '--enable', '--end-of-options', '--env', '--get', '--harness', '--help', '--jq', '--json', '--limit', '--name-only', '--others', '--pat-file', '--path', '--porcelain', '--pure', '--quiet', '--remove', '--seat', '--session', '--show-current', '--show-toplevel', '--since', '--source', '--yes'],
'import': ['--accept-pending', '--admin-intent', '--allow-empty', '--allow-noncanonical-root', '--apply', '--background', '--batch-check', '--brain', '--cached', '--confirm-relocated-root', '--diff-filter', '--dim', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--format', '--fresh', '--help', '--include-gitignored', '--is-shallow-repository', '--json', '--literal-pathspecs', '--log-noop', '--manifest', '--name-only', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-gpg-sign', '--no-pull', '--no-renames', '--no-verify', '--only', '--others', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--self-transfer', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--timings', '--to', '--url', '--verify', '--wait', '--workers'],
- 'init': ['--access', '--acknowledge-managed', '--adopt', '--after', '--aliases', '--all', '--all-drifted', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--audit', '--auto', '--auto-additive', '--background', '--batch', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--budget-policy', '--budget-tokens', '--budget-usd', '--by-mention', '--catch-up', '--chat-model', '--check', '--class', '--clear-never-installed', '--cli-socket', '--client', '--close', '--confirm-relocated-root', '--conflicts', '--content-root', '--conversation', '--cursor', '--db-only', '--dest', '--detach', '--detail', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--entity', '--exclude', '--expand', '--expansion-model', '--expect', '--expect-local', '--expect-remote', '--expect-upstream', '--explain', '--facts', '--fast', '--file', '--fix', '--force', '--force-retry', '--format', '--fresh-token', '--from', '--from-meetings', '--full', '--git', '--grant-types', '--group-by', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-ambiguous', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--install', '--issuer-url', '--json', '--keep', '--keep-checkout', '--key', '--lanes', '--legacy-lock', '--limit', '--list', '--local-postgres', '--markdown', '--max-cost-usd', '--max-facts', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--min-n', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-extract', '--no-filters', '--no-git', '--no-lanes', '--no-llm', '--no-probe', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--older-than', '--once', '--only', '--oversized', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--providers', '--pull', '--purge', '--push-only', '--query', '--question', '--quiet', '--rebase', '--rebuild', '--redact-paths', '--reference-date', '--remediate', '--remove', '--repair', '--repair-unknown-markers', '--repo', '--request', '--reset', '--resolve', '--resume', '--retry-failed', '--retry-parked', '--save', '--schema-pack', '--scope', '--scopes', '--search-mode', '--section', '--self-transfer', '--semantic', '--session', '--session-id', '--show-toplevel', '--side', '--since', '--since-last-run', '--skip', '--skip-embed-check', '--skip-failed', '--slug', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--state', '--status', '--stdin', '--strategy', '--supabase', '--surface', '--tier', '--timeout', '--to', '--token', '--touchpoint', '--url', '--url-env', '--user', '--vacuum', '--verbose', '--version', '--wait', '--warn-only', '--watch', '--working-tree', '--workspace', '--yes'],
+ 'init': ['--access', '--acknowledge-managed', '--adopt', '--after', '--aliases', '--all', '--all-drifted', '--allow-create-db', '--allow-docker', '--apply', '--assign-corpus', '--audit', '--auto', '--auto-additive', '--background', '--batch', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--budget-policy', '--budget-tokens', '--budget-usd', '--by-mention', '--catch-up', '--chat-model', '--check', '--class', '--clear-never-installed', '--cli-socket', '--client', '--close', '--confirm-relocated-root', '--conflicts', '--content-root', '--conversation', '--cursor', '--db-only', '--dest', '--detach', '--detail', '--dim', '--disable', '--drain', '--embedding-dimensions', '--embedding-model', '--enable', '--entity', '--exclude', '--expand', '--expansion-model', '--expect', '--expect-local', '--expect-remote', '--expect-upstream', '--explain', '--facts', '--fast', '--file', '--fix', '--force', '--force-retry', '--format', '--fresh-token', '--from', '--from-meetings', '--full', '--git', '--grant-types', '--group-by', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-ambiguous', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--install', '--issuer-url', '--json', '--keep', '--keep-checkout', '--key', '--kind', '--lanes', '--legacy-lock', '--limit', '--list', '--local-postgres', '--markdown', '--max-cost-usd', '--max-facts', '--max-usd', '--mcp-only', '--mcp-url', '--migrate-only', '--migration', '--min-n', '--mode', '--model', '--no-autopilot-install', '--no-autostash', '--no-delegate', '--no-embed', '--no-embedding', '--no-expand', '--no-extract', '--no-filters', '--no-git', '--no-lanes', '--no-llm', '--no-probe', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--older-than', '--once', '--only', '--oversized', '--page', '--params', '--pat-file', '--path', '--pglite', '--phase', '--plan', '--prefer', '--prefer-postgres', '--preview', '--probe', '--profile', '--provenance', '--providers', '--pull', '--purge', '--push-only', '--query', '--question', '--quiet', '--rebase', '--rebuild', '--redact-paths', '--reference-date', '--remediate', '--remove', '--repair', '--repair-unknown-markers', '--repo', '--request', '--reset', '--resolve', '--resume', '--retry-failed', '--retry-parked', '--save', '--schema-pack', '--scope', '--scopes', '--search-mode', '--section', '--self-transfer', '--semantic', '--session', '--session-id', '--show-toplevel', '--side', '--since', '--since-last-run', '--skip', '--skip-embed-check', '--skip-failed', '--slug', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--state', '--status', '--stdin', '--strategy', '--supabase', '--surface', '--tier', '--timeout', '--to', '--token', '--touchpoint', '--url', '--url-env', '--user', '--vacuum', '--verbose', '--version', '--wait', '--warn-only', '--watch', '--working-tree', '--workspace', '--yes'],
'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],
'integrity': ['--accept-pending', '--auto', '--backend', '--background', '--body', '--brain', '--check', '--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', '--timeout', '--timings', '--type', '--wait'],
'jobs': ['--abbrev-ref', '--access', '--account', '--acknowledge-managed', '--add', '--admin-intent', '--adopt-slug-path', '--aliases', '--all', '--all-sources', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--body', '--bound-slug-prefixes', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--check', '--cli-path', '--client', '--close', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--confirm-relocated-root', '--cost-estimate', '--cursor', '--date', '--dated-since', '--days', '--delay', '--detach', '--detail', '--diff-filter', '--dir', '--drain', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--enable', '--entities', '--exclude', '--exclude-standard', '--expect', '--expect-local', '--expect-upstream', '--expected-state', '--explain', '--facts', '--federated-read', '--ff-only', '--file', '--filters', '--finished-since', '--fix', '--follow', '--force', '--force-break-lock', '--force-retry', '--format', '--fresh', '--from-index', '--from-meetings', '--full', '--full-history', '--fuzzy', '--git', '--grammar-diagnostics', '--group', '--group-by', '--hard-deadline', '--health-interval', '--held', '--help', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-ambiguous', '--include-deleted', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--keep', '--kind', '--lanes', '--legacy-lock', '--limit', '--list', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--migration', '--min-context', '--missing-path', '--mode', '--model', '--multimodal', '--name', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-embedding', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-lanes', '--no-llm', '--no-pull', '--no-renames', '--no-repair', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--oversized', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--pat-file', '--path', '--pause', '--pglite', '--phase', '--pid-file', '--plan', '--port', '--prefer', '--preview', '--priority', '--probe', '--prune-orphans', '--pull', '--purge', '--question', '--queue', '--queue-only', '--quiet', '--rate', '--reason', '--rebuild', '--recent', '--record', '--redact-paths', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--remediate', '--repo', '--request-id', '--reset-checkpoint', '--resume', '--retry-failed', '--retry-global', '--retry-held', '--retry-parked', '--review-lower', '--row', '--scope', '--scopes', '--section', '--segment-limit', '--select', '--self-transfer', '--serial', '--session', '--show-toplevel', '--side', '--sigkill-rescue', '--since', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-guard', '--source-id', '--sources', '--src-subpath', '--stale', '--state', '--statement-timeout', '--status', '--strategy', '--suites', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--tier', '--timeout', '--timeout-ms', '--to', '--token', '--trust', '--type', '--types', '--uninstall', '--updated-after', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
@@ -85,7 +85,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'maintain': ['--account', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--after', '--all', '--apply', '--assign-corpus', '--audit', '--background', '--brain', '--break-lock', '--budget-ms', '--by-mention', '--cached', '--catch-up', '--concurrency', '--conflicts', '--contacts-dir', '--content-audit', '--conversation', '--count', '--detach', '--detail', '--dim', '--dir', '--drain', '--dry-run', '--enable', '--entity', '--expect', '--expected-revision', '--expected-state', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--format', '--from-meetings', '--full', '--group-by', '--hard-deadline', '--harness', '--held', '--help', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--keep-checkout', '--kind', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--list', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--name', '--name-only', '--ner', '--no-autopilot-install', '--no-capture', '--no-delegate', '--no-embed', '--no-pull', '--once', '--only', '--operations', '--oversized', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer', '--preview', '--probe', '--probe-pglite', '--project', '--providers', '--prune-orphans', '--push-only', '--query', '--question', '--queue', '--reader-mode', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--remove-core', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--retry-held', '--retry-parked', '--reverse', '--safe', '--scope', '--scopes', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slug', '--slugs', '--source', '--source-id', '--sources', '--stale', '--state', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--tier', '--to', '--token', '--top-k', '--type', '--unindexed', '--url-env', '--user', '--verbose', '--version', '--window', '--workers', '--yes'],
'mcp': ['--admin-token-file', '--agent', '--arg', '--bearer-token-env-var', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--credentials-file', '--credentials-out', '--delegate', '--delegated-namespace', '--delegated-slug-prefixes', '--dry-run', '--enable-dcr', '--federated-read', '--flow', '--force', '--funnel', '--harness', '--header', '--help', '--if-version', '--install', '--issuer-url', '--json', '--limit', '--mcp-only', '--mcp-url', '--no-install', '--no-service', '--no-tailscale', '--oauth-client-id', '--oauth-client-secret', '--oauth-request', '--port', '--profile', '--queue', '--redirect-uri', '--remove', '--resume', '--root', '--scope', '--scopes', '--skills', '--source', '--status', '--surface', '--timeout-ms', '--token', '--token-endpoint-auth-method', '--token-ttl', '--url', '--yes'],
'migrate': ['--accept-pending', '--admin-intent', '--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--follow', '--force', '--force-retry', '--harness', '--held', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--manifest', '--max-cost', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-migrate', '--non-interactive', '--only', '--oversized', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--plan', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--resume', '--retarget', '--rollback-to-source', '--scope', '--skip-verify', '--slugs', '--source', '--stale', '--statement-timeout', '--status', '--timeout', '--timings', '--to', '--trigger-bypass', '--trust', '--url', '--url-env', '--wait', '--yes'],
- 'models': ['--batch', '--brain', '--concurrent', '--cycles', '--dim', '--dimensions', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--limit', '--max-tokens', '--max-usd', '--output', '--receipt-dir', '--skip', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--source', '--status', '--task', '--to', '--yes'],
+ 'models': ['--batch', '--brain', '--concurrent', '--cycles', '--dim', '--dimensions', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--key', '--kind', '--limit', '--max-tokens', '--max-usd', '--mode', '--output', '--receipt-dir', '--skip', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--source', '--status', '--task', '--to', '--yes'],
'mounts': ['--alias', '--brain', '--database-path', '--database-url', '--db-path', '--db-url', '--engine', '--help', '--id', '--json', '--mcp-url', '--path', '--skills-dir', '--source'],
'notability-eval': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--in', '--json', '--out', '--repo', '--skip-llm', '--source', '--status', '--target-high', '--target-low', '--target-medium'],
'notices': ['--brain', '--help', '--json', '--source'],
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
index 90cc50ea7a..b040d51b92 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -621,6 +630,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1062,6 +1080,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1469,6 +1495,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2020,6 +2047,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
index dd1469c4b1..e58ddf2029 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -621,6 +630,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1062,6 +1080,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1469,6 +1495,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2020,6 +2047,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
index acd10f1d6d..647157f524 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -621,6 +630,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1062,6 +1080,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1465,6 +1491,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2016,6 +2043,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json b/test/fixtures/goldens/catalog/pglite-schema-blob-default.json
index d961e5c719..32207c9bfd 100644
--- a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json
+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-default.json
@@ -40,6 +40,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"eval_candidates.eval_candidates_detail_check": "c CHECK (((detail IS NULL) OR (detail = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
"eval_candidates.eval_candidates_detail_resolved_check": "c CHECK (((detail_resolved IS NULL) OR (detail_resolved = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
@@ -456,6 +465,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -806,6 +824,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"eval_candidates_pkey": "CREATE UNIQUE INDEX eval_candidates_pkey ON public.eval_candidates USING btree (id)",
"eval_capture_failures_pkey": "CREATE UNIQUE INDEX eval_capture_failures_pkey ON public.eval_capture_failures USING btree (id)",
@@ -1089,6 +1115,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
"eval_capture_failures_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_capture_failures.id",
"eval_takes_quality_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=eval_takes_quality_runs.id",
@@ -1530,6 +1557,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id 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.json
index e00cd83152..6459b8ea52 100644
--- a/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json
@@ -40,6 +40,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"eval_candidates.eval_candidates_detail_check": "c CHECK (((detail IS NULL) OR (detail = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
"eval_candidates.eval_candidates_detail_resolved_check": "c CHECK (((detail_resolved IS NULL) OR (detail_resolved = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
@@ -456,6 +465,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -806,6 +824,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"eval_candidates_pkey": "CREATE UNIQUE INDEX eval_candidates_pkey ON public.eval_candidates USING btree (id)",
"eval_capture_failures_pkey": "CREATE UNIQUE INDEX eval_capture_failures_pkey ON public.eval_capture_failures USING btree (id)",
@@ -1089,6 +1115,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
"eval_capture_failures_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_capture_failures.id",
"eval_takes_quality_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=eval_takes_quality_runs.id",
@@ -1530,6 +1557,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id 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.json
index bec1d2cc76..c1e5b89596 100644
--- a/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json
@@ -40,6 +40,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"eval_candidates.eval_candidates_detail_check": "c CHECK (((detail IS NULL) OR (detail = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
"eval_candidates.eval_candidates_detail_resolved_check": "c CHECK (((detail_resolved IS NULL) OR (detail_resolved = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
@@ -456,6 +465,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -806,6 +824,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"eval_candidates_pkey": "CREATE UNIQUE INDEX eval_candidates_pkey ON public.eval_candidates USING btree (id)",
"eval_capture_failures_pkey": "CREATE UNIQUE INDEX eval_capture_failures_pkey ON public.eval_capture_failures USING btree (id)",
@@ -1088,6 +1114,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
"eval_capture_failures_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_capture_failures.id",
"eval_takes_quality_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=eval_takes_quality_runs.id",
@@ -1529,6 +1556,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-db-initschema.json b/test/fixtures/goldens/catalog/postgres-db-initschema.json
index 80c8d46a27..b7212869eb 100644
--- a/test/fixtures/goldens/catalog/postgres-db-initschema.json
+++ b/test/fixtures/goldens/catalog/postgres-db-initschema.json
@@ -49,6 +49,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"eval_candidates.eval_candidates_detail_check": "c CHECK (((detail IS NULL) OR (detail = ANY (ARRAY['low'::text, 'medium'::text, 'high'::text]))))",
@@ -473,6 +482,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -824,6 +842,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1110,6 +1136,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
"eval_capture_failures_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_capture_failures.id",
"eval_takes_quality_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=eval_takes_quality_runs.id",
@@ -1580,6 +1607,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index 2029e976cc..4664812d51 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -625,6 +634,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1063,6 +1081,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1471,6 +1497,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2021,6 +2048,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
index ff390b706c..eec460e3d3 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -625,6 +634,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1063,6 +1081,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1471,6 +1497,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2021,6 +2048,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
index 64a892589b..af393d4c7a 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -625,6 +634,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1063,6 +1081,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1467,6 +1493,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2017,6 +2044,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index 0cdc73f832..4ded754291 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -78,8 +78,8 @@
" [OK] pglite_scale: PGLite at 5 pages — comfortable below the 1000-page threshold",
" [OK] rls: Skipped (PGLite — no PostgREST exposure, RLS not applicable)",
" [OK] schema_version: Version <latest> (latest: <latest>)",
- " [OK] schema_columns: 1296 column(s) verified against live schema",
- " [OK] schema_missing_tables: All 152 table(s) the applied migrations create exist.",
+ " [OK] schema_columns: 1329 column(s) verified against live schema",
+ " [OK] schema_missing_tables: All 155 table(s) the applied migrations create exist.",
" [OK] rls_event_trigger: Skipped (PGLite — no event trigger support)",
" [INFO] embeddings: Not applicable: embeddings are disabled on this brain (keyword search keeps working).",
" [INFO] embedding_provider: Not probed: embeddings are disabled on this brain by choice (keyword search keeps working).",
@@ -125,6 +125,8 @@
" [OK] google_calendar_readable: No Google source recorded an unreadable calendar at its last sync.",
" [OK] google_api_access: No Google source recorded a disabled API or missing scope at its last sync.",
" [OK] atom_retirements_restorable: No atom retired by an empty re-extraction is waiting to be restored.",
+ " [OK] generation_retirements: No live generation retired items in the last 30 day(s).",
+ " [OK] generation_held: No derived generation is held.",
" [OK] extractor_facts_expired: No conversation-extractor fact is left expired by the pre-v0.60.11.0 projection.",
" [OK] conversation_label_facts: No conversation fact carries the pre-fix meeting-label signature (a 1970-01-01 segment on a label page).",
" [OK] conversation_outcomes_stale: No conversation extraction outcome predates extractor version 1.",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index 9d085e328d..97da0545f6 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -1036,14 +1036,14 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1296 column(s) verified against live schema",
+ "message": "1329 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 152 table(s) the applied migrations create exist.",
+ "message": "All 155 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -1723,6 +1723,35 @@
"name": "atom_retirements_restorable",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "by_source": [],
+ "docs": "docs/guides/repair.md#generations",
+ "items": 0,
+ "keys": 0,
+ "repair": "generations",
+ "restore_days": 30
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No live generation retired items in the last 30 day(s).",
+ "name": "generation_retirements",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "by_reason": [],
+ "count": 0,
+ "docs": "docs/guides/repair.md#generations",
+ "releasable": 0,
+ "repair": "generations"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No derived generation is held.",
+ "name": "generation_held",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 2efc00fe88..d9dfa43fa7 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -1107,14 +1107,14 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1296 column(s) verified against live schema",
+ "message": "1329 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 152 table(s) the applied migrations create exist.",
+ "message": "All 155 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -1902,6 +1902,35 @@
"name": "atom_retirements_restorable",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "by_source": [],
+ "docs": "docs/guides/repair.md#generations",
+ "items": 0,
+ "keys": 0,
+ "repair": "generations",
+ "restore_days": 30
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No live generation retired items in the last 30 day(s).",
+ "name": "generation_retirements",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "by_reason": [],
+ "count": 0,
+ "docs": "docs/guides/repair.md#generations",
+ "releasable": 0,
+ "repair": "generations"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No derived generation is held.",
+ "name": "generation_held",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
@@ -5647,14 +5676,14 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1296 column(s) verified against live schema",
+ "message": "1329 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 152 table(s) the applied migrations create exist.",
+ "message": "All 155 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -6442,6 +6471,35 @@
"name": "atom_retirements_restorable",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "by_source": [],
+ "docs": "docs/guides/repair.md#generations",
+ "items": 0,
+ "keys": 0,
+ "repair": "generations",
+ "restore_days": 30
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No live generation retired items in the last 30 day(s).",
+ "name": "generation_retirements",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "by_reason": [],
+ "count": 0,
+ "docs": "docs/guides/repair.md#generations",
+ "releasable": 0,
+ "repair": "generations"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No derived generation is held.",
+ "name": "generation_held",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index 08ac4073c4..1f1940d7eb 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -949,14 +949,14 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1296 column(s) verified against live schema",
+ "message": "1329 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 152 table(s) the applied migrations create exist.",
+ "message": "All 155 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -1600,6 +1600,35 @@
"name": "atom_retirements_restorable",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "by_source": [],
+ "docs": "docs/guides/repair.md#generations",
+ "items": 0,
+ "keys": 0,
+ "repair": "generations",
+ "restore_days": 30
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No live generation retired items in the last 30 day(s).",
+ "name": "generation_retirements",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "by_reason": [],
+ "count": 0,
+ "docs": "docs/guides/repair.md#generations",
+ "releasable": 0,
+ "repair": "generations"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No derived generation is held.",
+ "name": "generation_held",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 57c105df4d..38829a5c93 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -996,14 +996,14 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1296 column(s) verified against live schema",
+ "message": "1329 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 152 table(s) the applied migrations create exist.",
+ "message": "All 155 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -1656,6 +1656,35 @@
"name": "atom_retirements_restorable",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "by_source": [],
+ "docs": "docs/guides/repair.md#generations",
+ "items": 0,
+ "keys": 0,
+ "repair": "generations",
+ "restore_days": 30
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No live generation retired items in the last 30 day(s).",
+ "name": "generation_retirements",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "by_reason": [],
+ "count": 0,
+ "docs": "docs/guides/repair.md#generations",
+ "releasable": 0,
+ "repair": "generations"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No derived generation is held.",
+ "name": "generation_held",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 2b47098523..d4d1d3d8bb 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -978,7 +978,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "RLS enabled on 151/151 public tables",
+ "message": "RLS enabled on 154/154 public tables",
"name": "rls",
"status": "ok"
},
@@ -992,14 +992,14 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1302 column(s) verified against live schema",
+ "message": "1335 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 151 table(s) the applied migrations create exist.",
+ "message": "All 154 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -1661,6 +1661,35 @@
"name": "atom_retirements_restorable",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "by_source": [],
+ "docs": "docs/guides/repair.md#generations",
+ "items": 0,
+ "keys": 0,
+ "repair": "generations",
+ "restore_days": 30
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No live generation retired items in the last 30 day(s).",
+ "name": "generation_retirements",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "details": {
+ "by_reason": [],
+ "count": 0,
+ "docs": "docs/guides/repair.md#generations",
+ "releasable": 0,
+ "repair": "generations"
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "No derived generation is held.",
+ "name": "generation_held",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.json
index d192590ec6..a4d2b99b74 100644
--- a/test/fixtures/goldens/doctor/registry-build-checks.json
+++ b/test/fixtures/goldens/doctor/registry-build-checks.json
@@ -545,6 +545,14 @@
"category": "brain",
"name": "atom_retirements_restorable"
},
+ {
+ "category": "brain",
+ "name": "generation_retirements"
+ },
+ {
+ "category": "brain",
+ "name": "generation_held"
+ },
{
"category": "brain",
"name": "extractor_facts_expired"
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 6882c665ee..34514f09d6 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -6459,7 +6459,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"rate_limited\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"absent_from_worktree\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"admission_paused\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"atom_drain_incomplete\" | \"atom_drain_no_progress\" | \"atom_drain_provider_failure\" | \"autopilot_job_owned_by_other_brain\" | \"body_staging_expired\" | \"budget_below_recent_runtime\" | \"backup_dump_failed\" | \"backup_too_large\" | \"belief_coverage_required\" | \"belief_stale_preparation\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_cleanup_pending\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"coverage_from\" | \"coverage_gap\" | \"clock_mismatch\" | \"extract_write_lost\" | \"item_failures_systemic\" | \"known_as_of_unproven\" | \"cache_quota_exceeded\" | \"calendar_unreadable\" | \"capacity_paused\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_not_found\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"commit_lock_busy\" | \"commit_paths_invalid\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"connection_lost\" | \"chunkless_pages_healable\" | \"consent_required\" | \"consent_timeout\" | \"consumers_without_heartbeat\" | \"content_repair_needs_human\" | \"content_null_bytes\" | \"content_rejected\" | \"continuation_unproven\" | \"corpus_chat_unavailable\" | \"corpus_window_backoff\" | \"corpus_window_dead_lettered\" | \"convergence_read_failed\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cursor_incarnation_retired\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"deleted_page_chunks_overdue\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"drain_stalled\" | \"managed_sync_not_moving\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"doctor_tier_unavailable\" | \"effect_not_failed\" | \"embed_backfill_stalled\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_identity_unqualified\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_state_unknown\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"entity_types_unavailable\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"fact_withdrawn\" | \"fact_rows_collide\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"file_database_drift\" | \"fix_not_writable\" | \"file_drift\" | \"file_drift_mixed_selection\" | \"file_drift_state_required\" | \"file_removed_during_scan\" | \"file_unreadable\" | \"file_too_large\" | \"follow_approval_required\" | \"forget_requires_owner\" | \"reserved_frontmatter_key\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"ghost_mass_delete_refused\" | \"notifier_stalled\" | \"origin_twin_mass_merge_refused\" | \"ghost_storage_unknown\" | \"git_branch_unborn\" | \"git_durability_not_enabled\" | \"git_checkout_required\" | \"git_detached_head\" | \"git_index_locked\" | \"git_index_stale\" | \"git_target_pending\" | \"git_operation_in_progress\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"git_object_missing\" | \"gitlink_not_followed\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"grant_scope\" | \"graph_incomplete\" | \"host_identity_mismatch\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"head_blocked\" | \"held_failed\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"integrate_conflict\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"unclosed_ambiguous_tail\" | \"tail_exposure_approval\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"ipc_path_too_long\" | \"legacy_twin_mass_merge_refused\" | \"legacy_twins_storage_unknown\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"legacy_lock_removal_refused\" | \"link_cursor_invalid\" | \"local_conflict\" | \"lock_busy\" | \"loops_extraction_skipped\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_failure_unsettled\" | \"managed_remedy_unavailable\" | \"merge_recommended\" | \"movement_unknown\" | \"managed_sync_flag_refused\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_declined\" | \"migration_failed\" | \"migration_host_work_pending\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_context_ceiling\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_converged\" | \"not_owner_host\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"page_body_rows_unreadable\" | \"page_projection_stale\" | \"page_shrink_refused\" | \"page_too_large_for_inline\" | \"parse_error\" | \"part_splits_code_point\" | \"part_too_large\" | \"frontmatter_alias_limit\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"path_not_utf8\" | \"pattern_claims_pending\" | \"patterns_min_interval\" | \"pending_verify\" | \"pending_writes\" | \"persistence_restart_required\" | \"pool_inflight_over_budget\" | \"deep_health_probe_failed\" | \"refresh_required\" | \"serve_self_exit_suppressed\" | \"serve_unhealthy_exit\" | \"persistence_write_stall\" | \"push_unconfirmed\" | \"schema_lock_blocked\" | \"pg_connection_recovery_failed\" | \"pg_connection_stuck\" | \"pg_pool_stalled\" | \"pg_statement_build_failed\" | \"pglite_busy\" | \"pglite_vector_index_too_large\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"knock_on_exhausted\" | \"keyword_skipped_after_timeout\" | \"publication_pending\" | \"pull_blocked_local_changes\" | \"purge_blocked_pending_recovery\" | \"purge_lookup_timeout\" | \"purge_mirror_unwritable\" | \"question_not_found\" | \"question_owner_only\" | \"rank_entities_timeout\" | \"read_budget_exhausted\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"pat_file_unreadable\" | \"reconcile_host_required\" | \"reconcile_read_incomplete\" | \"recovery_prior_stage_unavailable\" | \"recovery_version_unsupported\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"rename_identity_unreadable\" | \"rename_reconcile_failed\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"reset_upstream_refused\" | \"resume_spec_mismatch\" | \"result_too_large\" | \"revision_unavailable\" | \"schema_owner_required\" | \"scope_missing\" | \"search_cursor_requires_keyword\" | \"search_mode_local_only\" | \"scorecard_group_by_local_only\" | \"search_offset_over_cap\" | \"segmented_mirror_writer_gate\" | \"serve_build_drift\" | \"runtime_build_skew\" | \"serve_port_in_use\" | \"serve_status_only\" | \"settle_mismatch\" | \"setup_harness_unsupported\" | \"setup_hosted_connection\" | \"setup_owner_conflict\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"slug_page_mismatch\" | \"slug_root_mode_mismatch\" | \"source_binding_required\" | \"source_id_taken\" | \"source_mismatch\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stale_unavailable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_admission_restricted\" | \"sync_drain_lease_held\" | \"content_receipt_stale\" | \"sync_first_run_in_progress\" | \"sync_no_successful_sync\" | \"sync_cursor_replaced\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trust_raise_refused\" | \"two_consumers_on_host\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unpriced_model\" | \"unmanaged_database_path\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"unsupported_path\" | \"upload_expired\" | \"upload_not_found\" | \"upload_protected_content\" | \"upload_too_many_parts\" | \"upstream\" | \"upstream_diverged\" | \"upstream_rewritten\" | \"upstream_unknown\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_mirror_failed\" | \"withdrawal_mirror_pending\" | \"withdrawal_provenance\" | \"write_capacity_low\" | \"write_gate_rejected\" | \"write_held\" | \"worktree_dirty\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | \"schema_pack_too_large\" | \"schema_pack_emit_mismatch\" | undefined",
+ "canonical?: \"unknown\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"timeout\" | \"rate_limited\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"absent_from_worktree\" | \"access_command_failed\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"admission_paused\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"atom_drain_incomplete\" | \"atom_drain_no_progress\" | \"atom_drain_provider_failure\" | \"autopilot_job_owned_by_other_brain\" | \"body_staging_expired\" | \"budget_below_recent_runtime\" | \"backup_dump_failed\" | \"backup_too_large\" | \"belief_coverage_required\" | \"belief_stale_preparation\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_cleanup_pending\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"coverage_from\" | \"coverage_gap\" | \"clock_mismatch\" | \"extract_write_lost\" | \"item_failures_systemic\" | \"known_as_of_unproven\" | \"cache_quota_exceeded\" | \"calendar_unreadable\" | \"capacity_paused\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_not_found\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"commit_lock_busy\" | \"commit_paths_invalid\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"connection_lost\" | \"chunkless_pages_healable\" | \"consent_required\" | \"consent_timeout\" | \"consumers_without_heartbeat\" | \"content_repair_needs_human\" | \"content_null_bytes\" | \"content_rejected\" | \"continuation_unproven\" | \"corpus_chat_unavailable\" | \"corpus_window_backoff\" | \"corpus_window_dead_lettered\" | \"convergence_read_failed\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cursor_incarnation_retired\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"deleted_page_chunks_overdue\" | \"demo_graph_failed\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"drain_stalled\" | \"managed_sync_not_moving\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"doctor_tier_unavailable\" | \"effect_not_failed\" | \"embed_backfill_stalled\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_identity_unqualified\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_state_unknown\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"engine_graduated\" | \"entity_types_unavailable\" | \"eval_suite_unwired\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"fact_withdrawn\" | \"fact_rows_collide\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"file_database_drift\" | \"fix_not_writable\" | \"file_drift\" | \"file_drift_mixed_selection\" | \"file_drift_state_required\" | \"file_removed_during_scan\" | \"file_unreadable\" | \"file_too_large\" | \"follow_approval_required\" | \"forget_requires_owner\" | \"reserved_frontmatter_key\" | \"generation_fenced\" | \"generation_held\" | \"generation_live_conflict\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"ghost_mass_delete_refused\" | \"notifier_stalled\" | \"origin_twin_mass_merge_refused\" | \"ghost_storage_unknown\" | \"git_branch_unborn\" | \"git_durability_not_enabled\" | \"git_checkout_required\" | \"git_detached_head\" | \"git_index_locked\" | \"git_index_stale\" | \"git_target_pending\" | \"git_operation_in_progress\" | \"git_push_unavailable\" | \"git_target_unsafe\" | \"git_unavailable\" | \"git_object_missing\" | \"gitlink_not_followed\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"grant_scope\" | \"graph_incomplete\" | \"host_identity_mismatch\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"head_blocked\" | \"held_failed\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"integrate_conflict\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"unclosed_ambiguous_tail\" | \"tail_exposure_approval\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"ipc_path_too_long\" | \"legacy_twin_mass_merge_refused\" | \"legacy_twins_storage_unknown\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"legacy_lock_removal_refused\" | \"link_cursor_invalid\" | \"local_conflict\" | \"lock_busy\" | \"loops_extraction_skipped\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_failure_unsettled\" | \"managed_remedy_unavailable\" | \"merge_recommended\" | \"movement_unknown\" | \"managed_sync_flag_refused\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_declined\" | \"migration_failed\" | \"migration_host_work_pending\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_context_ceiling\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_converged\" | \"not_owner_host\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"page_body_rows_unreadable\" | \"page_projection_stale\" | \"page_shrink_refused\" | \"page_too_large_for_inline\" | \"parse_error\" | \"part_splits_code_point\" | \"part_too_large\" | \"frontmatter_alias_limit\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"path_not_utf8\" | \"pattern_claims_pending\" | \"patterns_min_interval\" | \"pending_verify\" | \"pending_writes\" | \"persistence_restart_required\" | \"pool_inflight_over_budget\" | \"deep_health_probe_failed\" | \"refresh_required\" | \"serve_self_exit_suppressed\" | \"serve_unhealthy_exit\" | \"persistence_write_stall\" | \"push_unconfirmed\" | \"schema_lock_blocked\" | \"pg_connection_recovery_failed\" | \"pg_connection_stuck\" | \"pg_pool_stalled\" | \"pg_statement_build_failed\" | \"pglite_busy\" | \"pglite_vector_index_too_large\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"knock_on_exhausted\" | \"keyword_skipped_after_timeout\" | \"publication_pending\" | \"pull_blocked_local_changes\" | \"purge_blocked_pending_recovery\" | \"purge_lookup_timeout\" | \"purge_mirror_unwritable\" | \"question_not_found\" | \"question_owner_only\" | \"rank_entities_timeout\" | \"read_budget_exhausted\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"pat_file_unreadable\" | \"reconcile_host_required\" | \"reconcile_read_incomplete\" | \"recovery_prior_stage_unavailable\" | \"recovery_version_unsupported\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"refresh_source_changed\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"rename_identity_unreadable\" | \"rename_reconcile_failed\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"reset_upstream_refused\" | \"resume_spec_mismatch\" | \"result_too_large\" | \"revision_unavailable\" | \"schema_owner_required\" | \"scope_missing\" | \"search_cursor_requires_keyword\" | \"search_mode_local_only\" | \"scorecard_group_by_local_only\" | \"search_offset_over_cap\" | \"segmented_mirror_writer_gate\" | \"serve_build_drift\" | \"runtime_build_skew\" | \"serve_port_in_use\" | \"serve_status_only\" | \"settle_mismatch\" | \"setup_harness_unsupported\" | \"setup_hosted_connection\" | \"setup_owner_conflict\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"slug_page_mismatch\" | \"slug_root_mode_mismatch\" | \"source_binding_required\" | \"source_id_taken\" | \"source_mismatch\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stale_unavailable\" | \"state_mismatch\" | \"sync_not_applicable\" | \"sync_admission_restricted\" | \"sync_drain_lease_held\" | \"content_receipt_stale\" | \"sync_first_run_in_progress\" | \"sync_no_successful_sync\" | \"sync_cursor_replaced\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"triage_unreliable_backoff\" | \"trust_raise_refused\" | \"two_consumers_on_host\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unpriced_model\" | \"unmanaged_database_path\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"unsupported_path\" | \"upload_expired\" | \"upload_not_found\" | \"upload_protected_content\" | \"upload_too_many_parts\" | \"upstream\" | \"upstream_diverged\" | \"upstream_rewritten\" | \"upstream_unknown\" | \"verification_failed\" | \"withdrawal_capacity\" | \"withdrawal_mirror_failed\" | \"withdrawal_mirror_pending\" | \"withdrawal_provenance\" | \"write_capacity_low\" | \"write_gate_rejected\" | \"write_held\" | \"worktree_dirty\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | \"schema_pack_too_large\" | \"schema_pack_emit_mismatch\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.json
index 8ba43d1064..35737a6a1c 100644
--- a/test/fixtures/goldens/migrations/records.json
+++ b/test/fixtures/goldens/migrations/records.json
@@ -1,6 +1,6 @@
{
"golden": {
- "count": 259,
+ "count": 260,
"gaps": [
17,
18,
@@ -72,7 +72,7 @@
"tableRows": "906d2413b13d76a06d5910885e47ed5c544be4ff3a2266e83146715721b24270",
"verifyProjectionStatistics": "0d231b04ecfbc5a4109d6fca9567bf4e8c9e9db6c3fbbb35212e026579ed6f67"
},
- "latest": 264,
+ "latest": 265,
"records": [
{
"handler": {
@@ -4201,6 +4201,19 @@
"transaction": "absent",
"verify": "absent",
"version": 264
+ },
+ {
+ "handler": "absent",
+ "idempotent": true,
+ "name": "derived_generations",
+ "sql": {
+ "length": 2337,
+ "sha256": "2a5b53563f732d056acc660cf3e91bc1a1c72fd1f5bbb1f68960f6e66c7f1800"
+ },
+ "sqlFor": "absent",
+ "transaction": "absent",
+ "verify": "absent",
+ "version": 265
}
],
"versions": [
@@ -4462,7 +4475,8 @@
261,
262,
263,
- 264
+ 264,
+ 265
]
},
"normalizer": "migrations-record-v1"
diff --git a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
index 3406bcbcbf..4400283234 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -60,6 +60,15 @@
"decision_receipts.decision_receipts_pkey": "p PRIMARY KEY (id)",
"derivation_inputs.derivation_inputs_pkey": "p PRIMARY KEY (derived_table, derived_id, input_table, input_id)",
"derivation_inputs.derivation_inputs_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_action_check": "c CHECK ((action = ANY (ARRAY['published'::text, 'retired'::text, 'revived'::text, 'kept'::text, 'adopted'::text])))",
+ "derived_generation_items.derived_generation_items_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE CASCADE",
+ "derived_generation_items.derived_generation_items_pkey": "p PRIMARY KEY (generation_id, item_key)",
+ "derived_generation_valve.derived_generation_valve_pkey": "p PRIMARY KEY (source_id, kind, window_key)",
+ "derived_generation_valve.derived_generation_valve_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_held_reason_check": "c CHECK (((held_reason IS NULL) OR (held_reason = ANY (ARRAY['shrunk'::text, 'oversize'::text, 'valve'::text, 'no_proof'::text, 'fence_absent'::text, 'attempts_exhausted'::text, 'segmented_unsupported'::text]))))",
+ "derived_generations.derived_generations_pkey": "p PRIMARY KEY (id)",
+ "derived_generations.derived_generations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "derived_generations.derived_generations_state_check": "c CHECK ((state = ANY (ARRAY['live'::text, 'held'::text, 'superseded'::text])))",
"dream_synthesis_completions.dream_synthesis_completions_pkey": "p PRIMARY KEY (source_id, idempotency_key)",
"dream_verdicts.dream_verdicts_pkey": "p PRIMARY KEY (file_path, content_hash)",
"drift_decisions.drift_decisions_pkey": "p PRIMARY KEY (id)",
@@ -621,6 +630,15 @@
"derivation_inputs": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "derived_generation_items": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generation_valve": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "derived_generations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"dream_synthesis_completions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1062,6 +1080,14 @@
"decision_receipts_pkey": "CREATE UNIQUE INDEX decision_receipts_pkey ON public.decision_receipts USING btree (id)",
"decision_receipts_slot_created_idx": "CREATE INDEX decision_receipts_slot_created_idx ON public.decision_receipts USING btree (slot, created_at)",
"derivation_inputs_pkey": "CREATE UNIQUE INDEX derivation_inputs_pkey ON public.derivation_inputs USING btree (derived_table, derived_id, input_table, input_id)",
+ "derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",
+ "derived_generation_items_pkey": "CREATE UNIQUE INDEX derived_generation_items_pkey ON public.derived_generation_items USING btree (generation_id, item_key)",
+ "derived_generation_valve_pkey": "CREATE UNIQUE INDEX derived_generation_valve_pkey ON public.derived_generation_valve USING btree (source_id, kind, window_key)",
+ "derived_generations_one_hold": "CREATE UNIQUE INDEX derived_generations_one_hold ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'held'::text)",
+ "derived_generations_one_live": "CREATE UNIQUE INDEX derived_generations_one_live ON public.derived_generations USING btree (source_id, kind, owner_key) WHERE (state = 'live'::text)",
+ "derived_generations_operation": "CREATE INDEX derived_generations_operation ON public.derived_generations USING btree (operation_id)",
+ "derived_generations_pkey": "CREATE UNIQUE INDEX derived_generations_pkey ON public.derived_generations USING btree (id)",
+ "derived_generations_state_created": "CREATE INDEX derived_generations_state_created ON public.derived_generations USING btree (state, created_at)",
"dream_synthesis_completions_pkey": "CREATE UNIQUE INDEX dream_synthesis_completions_pkey ON public.dream_synthesis_completions USING btree (source_id, idempotency_key)",
"dream_verdicts_expires_idx": "CREATE INDEX dream_verdicts_expires_idx ON public.dream_verdicts USING btree (expires_at)",
"dream_verdicts_pkey": "CREATE UNIQUE INDEX dream_verdicts_pkey ON public.dream_verdicts USING btree (file_path, content_hash)",
@@ -1469,6 +1495,7 @@
"decide_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_proposals.id",
"decide_review_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decide_review_proposals.id",
"decision_receipts_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=decision_receipts.id",
+ "derived_generations_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=derived_generations.id",
"drift_decisions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=drift_decisions.id",
"entity_identities_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=entity_identities.id",
"eval_candidates_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=eval_candidates.id",
@@ -2020,6 +2047,54 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "derived_generation_items": {
+ "columns": [
+ "1 generation_id bigint/int8 NOT NULL",
+ "2 item_key text/text NOT NULL",
+ "3 identity_hash text/text NOT NULL",
+ "4 action text/text NOT NULL",
+ "5 preimage jsonb/jsonb NULL",
+ "6 preimage_bytes integer/int4 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generation_valve": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 kind text/text NOT NULL",
+ "3 window_key text/text NOT NULL",
+ "4 retired integer/int4 NOT NULL DEFAULT 0",
+ "5 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "derived_generations": {
+ "columns": [
+ "1 id bigint/int8 NOT NULL DEFAULT nextval('derived_generations_id_seq'::regclass)",
+ "2 source_id text/text NOT NULL",
+ "3 kind text/text NOT NULL",
+ "4 owner_key text/text NOT NULL",
+ "5 generation integer/int4 NOT NULL DEFAULT 0",
+ "6 state text/text NOT NULL",
+ "7 run_id text/text NULL",
+ "8 operation_id text/text NOT NULL",
+ "9 hold_id text/text NULL",
+ "10 input_pin text/text NULL",
+ "11 input_size bigint/int8 NULL",
+ "12 completeness jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "13 item_set_hash text/text NOT NULL",
+ "14 held_reason text/text NULL",
+ "15 held_context jsonb/jsonb NULL",
+ "16 proposal jsonb/jsonb NULL",
+ "17 proposal_bytes integer/int4 NULL",
+ "18 attempts integer/int4 NOT NULL DEFAULT 0",
+ "19 superseded_by bigint/int8 NULL",
+ "20 restore_of bigint/int8 NULL",
+ "21 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"dream_synthesis_completions": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/sql-text/pages.json b/test/fixtures/goldens/sql-text/pages.json
index 6ea1e57365..00fd4c2b9a 100644
--- a/test/fixtures/goldens/sql-text/pages.json
+++ b/test/fixtures/goldens/sql-text/pages.json
@@ -789,8 +789,8 @@
"params": [
"number"
],
- "sql": "DELETE FROM pages WHERE deleted_at IS NOT NULL AND deleted_at < now() - ($1 || ' hours')::interval -- #6729: the old page of an open rename-identity downgrade waits for its disposition (identityDowngradePurgeHold). AND NOT EXISTS (SELECT 1 FROM op_checkpoints dg WHERE dg.op = 'sync-identity-downgrade' AND dg.fingerprint = pages.id::text AND dg.completed_keys->0->>'disposition' IS NULL AND pages.deleted_at = (dg.completed_keys->0->>'old_deleted_at')::timestamptz) -- #7013: a restorable re-extraction retirement waits out its hold (atomRetirementPurgeHold). AND NOT (pages.type='atom' AND pages.frontmatter->>'retired_by'='managed-reextract' AND pages.deleted_at > now() - interval '30 days' AND pages.id IN (SELECT held.id FROM (WITH retired AS ( SELECT p.id, p.source_id, p.slug, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, NULLIF(p.frontmatter->>'source_slug','') AS origin_slug, COALESCE(NULLIF(p.frontmatter->>'source_slug',''), p.frontmatter->>'source_path') AS origin, regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','') AS hash, p.frontmatter->>'retired_at' AS retired_at FROM pages p WHERE p.type='atom' AND p.deleted_at IS NOT NULL AND p.frontmatter->>'retired_by'='managed-reextract' AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) ), latest AS ( SELECT DISTINCT ON (source_id, okey) source_id, okey, hash FROM retired WHERE okey IS NOT NULL ORDER BY source_id, okey, retired_at DESC NULLS LAST, id DESC ), live AS ( SELECT p.source_id, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, array_agg(DISTINCT regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','')) AS hashes FROM pages p WHERE p.type='atom' AND p.deleted_at IS NULL AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) GROUP BY 1, 2 ) SELECT r.id, r.source_id, r.slug, CASE WHEN r.origin_slug IS NOT NULL THEN 'page' ELSE 'transcript' END AS origin_kind, r.origin, o.id AS origin_page_id, r.hash, r.retired_at, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL)) AS origin_live, (lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash])) AS replaced, COALESCE(l.hash = r.hash, false) AS latest, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL) AND NOT COALESCE(lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash]), false) AND COALESCE(l.hash = r.hash, false)) AS restorable FROM retired r LEFT JOIN pages o ON o.source_id=r.source_id AND o.slug=r.origin_slug AND o.deleted_at IS NULL LEFT JOIN live lv ON lv.source_id=r.source_id AND lv.okey=r.okey LEFT JOIN latest l ON l.source_id=r.source_id AND l.okey=r.okey) held WHERE held.restorable)) -- GBRA-161: every derived retirement waits out its hold (derivedRetirementPurgeHold). AND NOT (COALESCE(pages.frontmatter->>'retired_by','') IN ('extract-atoms','managed-reextract','stale-atoms','life-chronicle') AND pages.deleted_at > now() - interval '30 days') RETURNING slug, source_id",
- "textSha256": "a4287bea2e44bfc3207dcedebb9c4640aeb64cc6fb25fff0c89c9c6fc5440610"
+ "sql": "DELETE FROM pages WHERE deleted_at IS NOT NULL AND deleted_at < now() - ($1 || ' hours')::interval -- #6729: the old page of an open rename-identity downgrade waits for its disposition (identityDowngradePurgeHold). AND NOT EXISTS (SELECT 1 FROM op_checkpoints dg WHERE dg.op = 'sync-identity-downgrade' AND dg.fingerprint = pages.id::text AND dg.completed_keys->0->>'disposition' IS NULL AND pages.deleted_at = (dg.completed_keys->0->>'old_deleted_at')::timestamptz) -- #7013: a restorable re-extraction retirement waits out its hold (atomRetirementPurgeHold). AND NOT (pages.type='atom' AND pages.frontmatter->>'retired_by'='managed-reextract' AND pages.deleted_at > now() - interval '30 days' AND pages.id IN (SELECT held.id FROM (WITH retired AS ( SELECT p.id, p.source_id, p.slug, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, NULLIF(p.frontmatter->>'source_slug','') AS origin_slug, COALESCE(NULLIF(p.frontmatter->>'source_slug',''), p.frontmatter->>'source_path') AS origin, regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','') AS hash, p.frontmatter->>'retired_at' AS retired_at FROM pages p WHERE p.type='atom' AND p.deleted_at IS NOT NULL AND p.frontmatter->>'retired_by'='managed-reextract' AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) ), latest AS ( SELECT DISTINCT ON (source_id, okey) source_id, okey, hash FROM retired WHERE okey IS NOT NULL ORDER BY source_id, okey, retired_at DESC NULLS LAST, id DESC ), live AS ( SELECT p.source_id, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, array_agg(DISTINCT regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','')) AS hashes FROM pages p WHERE p.type='atom' AND p.deleted_at IS NULL AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) GROUP BY 1, 2 ) SELECT r.id, r.source_id, r.slug, CASE WHEN r.origin_slug IS NOT NULL THEN 'page' ELSE 'transcript' END AS origin_kind, r.origin, o.id AS origin_page_id, r.hash, r.retired_at, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL)) AS origin_live, (lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash])) AS replaced, COALESCE(l.hash = r.hash, false) AS latest, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL) AND NOT COALESCE(lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash]), false) AND COALESCE(l.hash = r.hash, false)) AS restorable FROM retired r LEFT JOIN pages o ON o.source_id=r.source_id AND o.slug=r.origin_slug AND o.deleted_at IS NULL LEFT JOIN live lv ON lv.source_id=r.source_id AND lv.okey=r.okey LEFT JOIN latest l ON l.source_id=r.source_id AND l.okey=r.okey) held WHERE held.restorable)) -- GBRA-161: every derived retirement waits out its hold (derivedRetirementPurgeHold). AND NOT (COALESCE(pages.frontmatter->>'retired_by','') IN ('extract-atoms','managed-reextract','stale-atoms','life-chronicle','generation-restore') AND pages.deleted_at > now() - interval '1 day' * (SELECT COALESCE(MAX(CASE WHEN c.value ~ '^[0-9]{1,3}$' THEN CASE WHEN c.value::int BETWEEN 3 AND 365 THEN c.value::int END END), 30) FROM config c WHERE c.key = 'generations.restore_days')) RETURNING slug, source_id",
+ "textSha256": "d880433080df787afb8d146e3de3eb37ece094d8e6867f5aa1f7af77e09d40a3"
},
{
"event": "commit",
@@ -803,8 +803,8 @@
"params": [
"number"
],
- "sql": "SELECT slug, deleted_at FROM pages WHERE deleted_at IS NOT NULL AND deleted_at < now() - ($1 || ' hours')::interval AND NOT EXISTS (SELECT 1 FROM op_checkpoints dg WHERE dg.op = 'sync-identity-downgrade' AND dg.fingerprint = pages.id::text AND dg.completed_keys->0->>'disposition' IS NULL AND pages.deleted_at = (dg.completed_keys->0->>'old_deleted_at')::timestamptz) AND NOT (pages.type='atom' AND pages.frontmatter->>'retired_by'='managed-reextract' AND pages.deleted_at > now() - interval '30 days' AND pages.id IN (SELECT held.id FROM (WITH retired AS ( SELECT p.id, p.source_id, p.slug, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, NULLIF(p.frontmatter->>'source_slug','') AS origin_slug, COALESCE(NULLIF(p.frontmatter->>'source_slug',''), p.frontmatter->>'source_path') AS origin, regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','') AS hash, p.frontmatter->>'retired_at' AS retired_at FROM pages p WHERE p.type='atom' AND p.deleted_at IS NOT NULL AND p.frontmatter->>'retired_by'='managed-reextract' AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) ), latest AS ( SELECT DISTINCT ON (source_id, okey) source_id, okey, hash FROM retired WHERE okey IS NOT NULL ORDER BY source_id, okey, retired_at DESC NULLS LAST, id DESC ), live AS ( SELECT p.source_id, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, array_agg(DISTINCT regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','')) AS hashes FROM pages p WHERE p.type='atom' AND p.deleted_at IS NULL AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) GROUP BY 1, 2 ) SELECT r.id, r.source_id, r.slug, CASE WHEN r.origin_slug IS NOT NULL THEN 'page' ELSE 'transcript' END AS origin_kind, r.origin, o.id AS origin_page_id, r.hash, r.retired_at, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL)) AS origin_live, (lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash])) AS replaced, COALESCE(l.hash = r.hash, false) AS latest, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL) AND NOT COALESCE(lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash]), false) AND COALESCE(l.hash = r.hash, false)) AS restorable FROM retired r LEFT JOIN pages o ON o.source_id=r.source_id AND o.slug=r.origin_slug AND o.deleted_at IS NULL LEFT JOIN live lv ON lv.source_id=r.source_id AND lv.okey=r.okey LEFT JOIN latest l ON l.source_id=r.source_id AND l.okey=r.okey) held WHERE held.restorable)) AND NOT (COALESCE(pages.frontmatter->>'retired_by','') IN ('extract-atoms','managed-reextract','stale-atoms','life-chronicle') AND pages.deleted_at > now() - interval '30 days') ORDER BY deleted_at ASC, slug ASC",
- "textSha256": "180642b2b72ef387136dcc3b411df2f7e21e90db965d1c2102ffe5746c6be0a3"
+ "sql": "SELECT slug, deleted_at FROM pages WHERE deleted_at IS NOT NULL AND deleted_at < now() - ($1 || ' hours')::interval AND NOT EXISTS (SELECT 1 FROM op_checkpoints dg WHERE dg.op = 'sync-identity-downgrade' AND dg.fingerprint = pages.id::text AND dg.completed_keys->0->>'disposition' IS NULL AND pages.deleted_at = (dg.completed_keys->0->>'old_deleted_at')::timestamptz) AND NOT (pages.type='atom' AND pages.frontmatter->>'retired_by'='managed-reextract' AND pages.deleted_at > now() - interval '30 days' AND pages.id IN (SELECT held.id FROM (WITH retired AS ( SELECT p.id, p.source_id, p.slug, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, NULLIF(p.frontmatter->>'source_slug','') AS origin_slug, COALESCE(NULLIF(p.frontmatter->>'source_slug',''), p.frontmatter->>'source_path') AS origin, regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','') AS hash, p.frontmatter->>'retired_at' AS retired_at FROM pages p WHERE p.type='atom' AND p.deleted_at IS NOT NULL AND p.frontmatter->>'retired_by'='managed-reextract' AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) ), latest AS ( SELECT DISTINCT ON (source_id, okey) source_id, okey, hash FROM retired WHERE okey IS NOT NULL ORDER BY source_id, okey, retired_at DESC NULLS LAST, id DESC ), live AS ( SELECT p.source_id, CASE WHEN NULLIF(p.frontmatter->>'source_slug','') IS NOT NULL THEN 'slug:'||(p.frontmatter->>'source_slug') WHEN NULLIF(p.frontmatter->>'source_path','') IS NOT NULL THEN 'path:'||(p.frontmatter->>'source_path') END AS okey, array_agg(DISTINCT regexp_replace(COALESCE(p.frontmatter->>'source_hash',''),'^pending:','')) AS hashes FROM pages p WHERE p.type='atom' AND p.deleted_at IS NULL AND NULLIF(p.frontmatter->>'imported_from','') IS NULL AND (true) GROUP BY 1, 2 ) SELECT r.id, r.source_id, r.slug, CASE WHEN r.origin_slug IS NOT NULL THEN 'page' ELSE 'transcript' END AS origin_kind, r.origin, o.id AS origin_page_id, r.hash, r.retired_at, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL)) AS origin_live, (lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash])) AS replaced, COALESCE(l.hash = r.hash, false) AS latest, (r.okey IS NOT NULL AND (r.origin_slug IS NULL OR o.id IS NOT NULL) AND NOT COALESCE(lv.hashes IS NOT NULL AND NOT (lv.hashes <@ ARRAY[r.hash]), false) AND COALESCE(l.hash = r.hash, false)) AS restorable FROM retired r LEFT JOIN pages o ON o.source_id=r.source_id AND o.slug=r.origin_slug AND o.deleted_at IS NULL LEFT JOIN live lv ON lv.source_id=r.source_id AND lv.okey=r.okey LEFT JOIN latest l ON l.source_id=r.source_id AND l.okey=r.okey) held WHERE held.restorable)) AND NOT (COALESCE(pages.frontmatter->>'retired_by','') IN ('extract-atoms','managed-reextract','stale-atoms','life-chronicle','generation-restore') AND pages.deleted_at > now() - interval '1 day' * (SELECT COALESCE(MAX(CASE WHEN c.value ~ '^[0-9]{1,3}$' THEN CASE WHEN c.value::int BETWEEN 3 AND 365 THEN c.value::int END END), 30) FROM config c WHERE c.key = 'generations.restore_days')) ORDER BY deleted_at ASC, slug ASC",
+ "textSha256": "e412959967b8dfb68846397eee9177fbb1c62b430a495ac723b29e3895f28034"
}
]
},