Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
GBRA-161 PR 1b: goldens for v266 and generation_pending (PGLite and Postgres)
garrytan58a4f8a5dc6c
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.tsindex 8014ce64a0..ae9589f5cd 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', '--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'],+ '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'],'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', '--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'],+ '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'],'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'],@@ -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', '--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'],+ 'models': ['--batch', '--brain', '--concurrent', '--cycles', '--dim', '--dimensions', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--limit', '--max-tokens', '--max-usd', '--output', '--receipt-dir', '--skip', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--source', '--status', '--task', '--to', '--yes'],'mounts': ['--alias', '--brain', '--database-path', '--database-url', '--db-path', '--db-url', '--engine', '--help', '--id', '--json', '--mcp-url', '--path', '--skills-dir', '--source'],'notability-eval': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--in', '--json', '--out', '--repo', '--skip-llm', '--source', '--status', '--target-high', '--target-low', '--target-medium'],'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.jsonindex a5e540513b..a6e54e1299 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json@@ -60,6 +60,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -632,6 +636,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1085,9 +1092,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2054,6 +2064,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2073,7 +2100,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -2110,7 +2138,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.jsonindex 783a33ec57..fd28a3d598 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -632,6 +636,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1085,9 +1092,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2054,6 +2064,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2073,7 +2100,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -2110,7 +2138,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.jsonindex 2533fd2ffc..a44aaeb8df 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -632,6 +636,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1085,9 +1092,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2050,6 +2060,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2069,7 +2096,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -2106,7 +2134,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json b/test/fixtures/goldens/catalog/pglite-schema-blob-default.jsonindex e88a938498..f68353953a 100644--- a/test/fixtures/goldens/catalog/pglite-schema-blob-default.json+++ b/test/fixtures/goldens/catalog/pglite-schema-blob-default.json@@ -40,6 +40,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -467,6 +471,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -829,9 +836,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -1564,6 +1574,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -1583,7 +1610,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -1620,7 +1648,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-schema-blob-fts-portuguese.jsonindex 254853ca90..a3eef1276e 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -467,6 +471,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -829,9 +836,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -1564,6 +1574,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -1583,7 +1610,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -1620,7 +1648,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.json b/test/fixtures/goldens/catalog/pglite-schema-blob-high-dims.jsonindex 2450953906..c3ed303085 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -467,6 +471,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -829,9 +836,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -1563,6 +1573,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -1582,7 +1609,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -1619,7 +1647,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-db-initschema.json b/test/fixtures/goldens/catalog/postgres-db-initschema.jsonindex 9286a47513..1afef79acb 100644--- a/test/fixtures/goldens/catalog/postgres-db-initschema.json+++ b/test/fixtures/goldens/catalog/postgres-db-initschema.json@@ -49,6 +49,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -484,6 +488,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -847,9 +854,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -1614,6 +1624,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -1633,7 +1660,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -1670,7 +1698,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.jsonindex e31a51bf54..deb5bc5393 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json@@ -60,6 +60,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -636,6 +640,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1086,9 +1093,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2055,6 +2065,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2074,7 +2101,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=true force_rls=false"},@@ -2111,7 +2139,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.jsonindex 399a830b7e..ed629f331d 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -636,6 +640,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1086,9 +1093,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2055,6 +2065,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2074,7 +2101,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=true force_rls=false"},@@ -2111,7 +2139,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.jsonindex 11be85d513..a56adf69c5 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -636,6 +640,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1086,9 +1093,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2051,6 +2061,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2070,7 +2097,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=true force_rls=false"},@@ -2107,7 +2135,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.jsonindex df87a6faa8..f1faba1848 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: 1336 column(s) verified against live schema",- " [OK] schema_missing_tables: All 156 table(s) the applied migrations create exist.",+ " [OK] schema_columns: 1351 column(s) verified against live schema",+ " [OK] schema_missing_tables: All 157 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).",@@ -127,6 +127,7 @@" [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] generation_pending: No activated generation waits on a member request, and no orphan candidate exists."," [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.jsonindex 31038eb5f6..cfd8085bf3 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": "1336 column(s) verified against live schema",+ "message": "1351 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 156 table(s) the applied migrations create exist.",+ "message": "All 157 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -1712,6 +1712,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -1752,6 +1753,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex a7a4712fe5..ec8347e533 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": "1336 column(s) verified against live schema",+ "message": "1351 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 156 table(s) the applied migrations create exist.",+ "message": "All 157 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -1891,6 +1891,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -1931,6 +1932,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {@@ -5676,14 +5692,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "1336 column(s) verified against live schema",+ "message": "1351 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 156 table(s) the applied migrations create exist.",+ "message": "All 157 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -6460,6 +6476,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -6500,6 +6517,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.jsonindex d38e42f5a8..6156ae2bab 100644--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json@@ -1089,7 +1089,7 @@{"category": "ops","elapsed_ms": "<volatile>",- "message": "RLS enabled on 155/155 public tables",+ "message": "RLS enabled on 156/156 public tables","name": "rls","status": "ok"},@@ -1103,14 +1103,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "1342 column(s) verified against live schema",+ "message": "1357 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 155 table(s) the applied migrations create exist.",+ "message": "All 156 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -1896,6 +1896,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -1936,6 +1937,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {@@ -5659,7 +5675,7 @@{"category": "ops","elapsed_ms": "<volatile>",- "message": "RLS enabled on 155/155 public tables",+ "message": "RLS enabled on 156/156 public tables","name": "rls","status": "ok"},@@ -5673,14 +5689,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "1342 column(s) verified against live schema",+ "message": "1357 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 155 table(s) the applied migrations create exist.",+ "message": "All 156 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -6466,6 +6482,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -6506,6 +6523,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex 3a8cb7405e..9fcff1b874 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": "1336 column(s) verified against live schema",+ "message": "1351 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 156 table(s) the applied migrations create exist.",+ "message": "All 157 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -1589,6 +1589,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -1629,6 +1630,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 0453410d80..0b16f9becd 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": "1336 column(s) verified against live schema",+ "message": "1351 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 156 table(s) the applied migrations create exist.",+ "message": "All 157 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -1645,6 +1645,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -1685,6 +1686,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex c04c1eea06..138bf00fbe 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 155/155 public tables",+ "message": "RLS enabled on 156/156 public tables","name": "rls","status": "ok"},@@ -992,14 +992,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "1342 column(s) verified against live schema",+ "message": "1357 column(s) verified against live schema","name": "schema_columns","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 155 table(s) the applied migrations create exist.",+ "message": "All 156 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -1650,6 +1650,7 @@"count": 0,"docs": "docs/guides/repair.md#atoms-restore","hold_until": null,+ "ledger_covered": 0,"newest_retired_at": null,"oldest_retired_at": null,"origins": 0,@@ -1690,6 +1691,21 @@"name": "generation_held","status": "ok"},+ {+ "category": "brain",+ "details": {+ "docs": "docs/guides/repair.md#generations",+ "orphan_candidates": [],+ "orphans": 0,+ "pending": 0,+ "pending_items": [],+ "retire_pending": 0+ },+ "elapsed_ms": "<volatile>",+ "message": "No activated generation waits on a member request, and no orphan candidate exists.",+ "name": "generation_pending",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.jsonindex a4d2b99b74..69aee762a1 100644--- a/test/fixtures/goldens/doctor/registry-build-checks.json+++ b/test/fixtures/goldens/doctor/registry-build-checks.json@@ -553,6 +553,10 @@"category": "brain","name": "generation_held"},+ {+ "category": "brain",+ "name": "generation_pending"+ },{"category": "brain","name": "extractor_facts_expired"diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.jsonindex cb26ad8192..3637350a89 100644--- a/test/fixtures/goldens/migrations/records.json+++ b/test/fixtures/goldens/migrations/records.json@@ -1,6 +1,6 @@{"golden": {- "count": 260,+ "count": 261,"gaps": [17,18,@@ -72,7 +72,7 @@"tableRows": "906d2413b13d76a06d5910885e47ed5c544be4ff3a2266e83146715721b24270","verifyProjectionStatistics": "0d231b04ecfbc5a4109d6fca9567bf4e8c9e9db6c3fbbb35212e026579ed6f67"},- "latest": 265,+ "latest": 266,"records": [{"handler": {@@ -4214,6 +4214,19 @@"transaction": "absent","verify": "absent","version": 265+ },+ {+ "handler": "absent",+ "idempotent": true,+ "name": "derived_generation_activations",+ "sql": {+ "length": 1151,+ "sha256": "a33706dbe93948e527af3f692ece4aed3ab7d41f6789ddb552e75fcf39e6055c"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",+ "version": 266}],"versions": [@@ -4476,7 +4489,8 @@262,263,264,- 265+ 265,+ 266]},"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.jsonindex 3f879f8740..d10d3e98e1 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,10 @@"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_activations.derived_generation_activations_generation_id_fkey": "f FOREIGN KEY (generation_id) REFERENCES derived_generations(id) ON DELETE SET NULL",+ "derived_generation_activations.derived_generation_activations_pkey": "p PRIMARY KEY (id)",+ "derived_generation_activations.derived_generation_activations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "derived_generation_activations.derived_generation_activations_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'activated'::text])))","derived_generation_attempts.derived_generation_attempts_pkey": "p PRIMARY KEY (hold_id)","derived_generation_attempts.derived_generation_attempts_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])))",@@ -632,6 +636,9 @@"derivation_inputs": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "derived_generation_activations": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"derived_generation_attempts": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1085,9 +1092,12 @@"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_activations_key": "CREATE INDEX derived_generation_activations_key ON public.derived_generation_activations USING btree (source_id, kind, owner_key, state)",+ "derived_generation_activations_pkey": "CREATE UNIQUE INDEX derived_generation_activations_pkey ON public.derived_generation_activations USING btree (id)","derived_generation_attempts_key": "CREATE INDEX derived_generation_attempts_key ON public.derived_generation_attempts USING btree (source_id, kind, owner_key)","derived_generation_attempts_pkey": "CREATE UNIQUE INDEX derived_generation_attempts_pkey ON public.derived_generation_attempts USING btree (hold_id)","derived_generation_items_key": "CREATE INDEX derived_generation_items_key ON public.derived_generation_items USING btree (item_key)",+ "derived_generation_items_pending": "CREATE INDEX derived_generation_items_pending ON public.derived_generation_items USING btree (generation_id) WHERE pending","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)",@@ -2054,6 +2064,23 @@],"flags": "relkind=r rls=true force_rls=false"},+ "derived_generation_activations": {+ "columns": [+ "1 id text/text NOT NULL",+ "2 source_id text/text NOT NULL",+ "3 kind text/text NOT NULL",+ "4 owner_key text/text NOT NULL",+ "5 expected_generation integer/int4 NOT NULL",+ "6 input_pin text/text NULL",+ "7 item_set_hash text/text NOT NULL",+ "8 state text/text NOT NULL",+ "9 generation_id bigint/int8 NULL",+ "10 members jsonb/jsonb NOT NULL DEFAULT '[]'::jsonb",+ "11 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "12 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"derived_generation_attempts": {"columns": ["1 hold_id text/text NOT NULL",@@ -2073,7 +2100,8 @@"3 identity_hash text/text NOT NULL","4 action text/text NOT NULL","5 preimage jsonb/jsonb NULL",- "6 preimage_bytes integer/int4 NULL"+ "6 preimage_bytes integer/int4 NULL",+ "7 pending boolean/bool NOT NULL DEFAULT false"],"flags": "relkind=r rls=false force_rls=false"},@@ -2110,7 +2138,9 @@"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()"+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "23 locator text/text NULL",+ "24 activation_id text/text NULL"],"flags": "relkind=r rls=false force_rls=false"},diff --git a/test/fixtures/goldens/sql-text/pages.json b/test/fixtures/goldens/sql-text/pages.jsonindex 00fd4c2b9a..e28fc5691c 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','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"+ "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, (SELECT g.id FROM derived_generation_items i JOIN derived_generations g ON g.id=i.generation_id WHERE g.source_id=r.source_id AND g.kind='atom' AND g.state='live' AND i.item_key=r.slug AND i.action='retired' ORDER BY g.id DESC LIMIT 1) AS ledger_generation 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": "b23c99bbcf6f35b181a39bf1c0b1e5d90c95c1965323861db55f59d60f63caf0"},{"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','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"+ "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, (SELECT g.id FROM derived_generation_items i JOIN derived_generations g ON g.id=i.generation_id WHERE g.source_id=r.source_id AND g.kind='atom' AND g.state='live' AND i.item_key=r.slug AND i.action='retired' ORDER BY g.id DESC LIMIT 1) AS ledger_generation 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": "9e33c1110b060594c5e908aff9ed93346811af360db69a8a7843455c8ac4e764"}]},