Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(goldens): catalog and doctor goldens for A2 after merging the new A1 (GBRA-218)

garrytan2b6c8cb08f74
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
index 6e7febfd5f..7db776f96b 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
@@ -8,6 +8,24 @@
"access_groups.access_groups_pkey": "p PRIMARY KEY (id)",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
+ "access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
+ "access_pending_coverage.access_pending_coverage_prefix_check": "c CHECK (((prefix = ''::text) OR ((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0))))",
+ "access_pending_coverage.access_pending_coverage_reason_check": "c CHECK ((reason = ANY (ARRAY['pending'::text, 'invalid'::text])))",
+ "access_pending_coverage.access_pending_coverage_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_migrations.access_policy_migrations_direction_check": "c CHECK ((direction = ANY (ARRAY['to_git'::text, 'to_database'::text])))",
+ "access_policy_migrations.access_policy_migrations_phase_check": "c CHECK ((phase = ANY (ARRAY['started'::text, 'exported'::text, 'committed'::text, 'switched'::text])))",
+ "access_policy_migrations.access_policy_migrations_pkey": "p PRIMARY KEY (id)",
+ "access_policy_migrations.access_policy_migrations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_revisions.access_policy_revisions_change_kind_check": "c CHECK ((change_kind = ANY (ARRAY['narrowing'::text, 'widening'::text, 'mixed'::text, 'unchanged'::text])))",
+ "access_policy_revisions.access_policy_revisions_pkey": "p PRIMARY KEY (source_id, revision)",
+ "access_policy_revisions.access_policy_revisions_revision_check": "c CHECK ((revision > 0))",
+ "access_policy_revisions.access_policy_revisions_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_state.access_policy_state_pkey": "p PRIMARY KEY (source_id)",
+ "access_policy_state.access_policy_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "access_rules.access_rules_pkey": "p PRIMARY KEY (source_id, rule_id)",
+ "access_rules.access_rules_prefix_check": "c CHECK (((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0)))",
+ "access_rules.access_rules_rule_id_check": "c CHECK ((rule_id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
+ "access_rules.access_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
"access_tokens.access_tokens_min_trust_check": "c CHECK (((min_trust IS NULL) OR (min_trust = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text]))))",
"access_tokens.access_tokens_pkey": "p PRIMARY KEY (id)",
"access_tokens.access_tokens_private_pages_check": "c CHECK ((private_pages = ANY (ARRAY['none'::text, 'granted_sources'::text])))",
@@ -549,10 +567,13 @@
"bump_page_generation_fn()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=314d4775d7c90f8ed650ea12ae3687f388f714ed3d30582dc8ff678dfea1dc97",
"enforce_minion_queue_protocol()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=be82640d1979fc81dc812efb78bb3596ef536f656d20750e5e4aa19016bf4784",
"gbrain_access_derive_page_readers()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=55923fb552adcdc8e5e3c820a0b4ba11f74748b4478f52de2e1b7506e969ac4d",
+ "gbrain_access_folder_rules(p_source text, p_slug text)": "RETURNS text[] kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2fcbf1744ede8ffc2ac16972f3d793109543710ecfe13ae9849eced94f347305",
"gbrain_access_mark_restricted()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=e45dc26421664fa3d409fba6c612af88905d2df35923f9592bcb759fc1ea618f",
"gbrain_access_norm_readers(vals text[])": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, pg_temp] body_sha256=b536c2604461abac62c90c090d127b71bdda8ed23d43ae25790606a8ee64f769",
- "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=f4b698f7fb87ae726b6e965b048f59d709afa834d97fd52240a81f898f069b3a",
+ "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=691cabb9e3951b1ac732fceaf826aaaa2e69cab650caaac6df2cbbaf47764ad4",
+ "gbrain_access_pending_covers(p_source text, p_slug text)": "RETURNS boolean kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=3a5530179ad6f056532e398fb4de58610125625e09140340ff138a2e268772a8",
"gbrain_access_readers(fm jsonb)": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=18348cb56089106aaec6470076ee652d7ed3bfbcb20e950a24abd52a21e7a380",
+ "gbrain_access_stamp_folder_rules()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=5185d4f512c372e3c42ef274294d2ab2daf1b93f3ce46516f514831cbee10f7d",
"gbrain_advance_page_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2a431195dc4c4150e3428251d0dec0a685cdc2992525c1b4b54dff103d5d99c9",
"gbrain_advance_tag_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=7807b26b4933148aa63c67fca824a60d3492396728205d04e16c48c81174cbd5",
"gbrain_bump_trust_generation()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=4708a89d166ac0999a8922ad8ee8f69fea3213c59e0782d96220f93b0c001a62",
@@ -599,6 +620,21 @@
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_pending_coverage": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_migrations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_revisions": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_state": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_rules": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_tokens": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1094,6 +1130,12 @@
"access_group_members_pkey": "CREATE UNIQUE INDEX access_group_members_pkey ON public.access_group_members USING btree (group_id, member_id)",
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
+ "access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
+ "access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
+ "access_policy_revisions_operation_idx": "CREATE UNIQUE INDEX access_policy_revisions_operation_idx ON public.access_policy_revisions USING btree (operation_id) WHERE (operation_id IS NOT NULL)",
+ "access_policy_revisions_pkey": "CREATE UNIQUE INDEX access_policy_revisions_pkey ON public.access_policy_revisions USING btree (source_id, revision)",
+ "access_policy_state_pkey": "CREATE UNIQUE INDEX access_policy_state_pkey ON public.access_policy_state USING btree (source_id)",
+ "access_rules_pkey": "CREATE UNIQUE INDEX access_rules_pkey ON public.access_rules USING btree (source_id, rule_id)",
"access_tokens_pkey": "CREATE UNIQUE INDEX access_tokens_pkey ON public.access_tokens USING btree (id)",
"access_tokens_token_hash_key": "CREATE UNIQUE INDEX access_tokens_token_hash_key ON public.access_tokens USING btree (token_hash)",
"belief_commit_marks_pkey": "CREATE UNIQUE INDEX belief_commit_marks_pkey ON public.belief_commit_marks USING btree (publication_id)",
@@ -1428,6 +1470,7 @@
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
"pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
+ "pages_folder_rule_ids_gin": "CREATE INDEX pages_folder_rule_ids_gin ON public.pages USING gin (folder_rule_ids) WHERE (folder_rule_ids IS NOT NULL)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_live_origin_key": "CREATE UNIQUE INDEX pages_live_origin_key ON public.pages USING btree (source_id, source_path) WHERE ((deleted_at IS NULL) AND (source_path IS NOT NULL))",
@@ -1672,6 +1715,65 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_pending_coverage": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 prefix text/text NOT NULL",
+ "3 reason text/text NOT NULL",
+ "4 revision bigint/int8 NULL",
+ "5 detail jsonb/jsonb NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_migrations": {
+ "columns": [
+ "1 id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 direction text/text NOT NULL",
+ "4 phase text/text NOT NULL",
+ "5 receipts jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_revisions": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 revision bigint/int8 NOT NULL",
+ "3 rules jsonb/jsonb NOT NULL",
+ "4 digest text/text NOT NULL",
+ "5 change_kind text/text NOT NULL",
+ "6 origin text/text NOT NULL",
+ "7 operation_id text/text NULL",
+ "8 proposed_by text/text NULL",
+ "9 approved_by text/text NULL",
+ "10 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "11 applied_at timestamp with time zone/timestamptz NULL",
+ "12 approved_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_state": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_rules": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 rule_id text/text NOT NULL",
+ "3 prefix text/text NOT NULL",
+ "4 readable_by ARRAY/_text NOT NULL",
+ "5 revision bigint/int8 NOT NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 created_by text/text NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_tokens": {
"columns": [
"1 id uuid/uuid NOT NULL DEFAULT gen_random_uuid()",
@@ -3354,7 +3456,8 @@
"52 timeline_lead text/text NULL",
"53 links_extract_failure jsonb/jsonb NULL",
"54 withheld_source_path text/text NULL",
- "55 page_readers ARRAY/_text NULL"
+ "55 page_readers ARRAY/_text NULL",
+ "56 folder_rule_ids ARRAY/_text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
@@ -4361,6 +4464,8 @@
},
"triggers": {
"access_members.access_members_mark_restricted": "CREATE TRIGGER access_members_mark_restricted AFTER INSERT ON public.access_members FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_pending_coverage.access_pending_coverage_mark_restricted": "CREATE TRIGGER access_pending_coverage_mark_restricted AFTER INSERT ON public.access_pending_coverage FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_rules.access_rules_mark_restricted": "CREATE TRIGGER access_rules_mark_restricted AFTER INSERT ON public.access_rules FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
"access_tokens.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.access_tokens DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.min_trust IS DISTINCT FROM new.min_trust)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
@@ -4401,6 +4506,7 @@
"pages.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()",
"pages.pages_access_derive_readers": "CREATE TRIGGER pages_access_derive_readers BEFORE INSERT OR UPDATE OF frontmatter, page_readers ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_derive_page_readers()",
"pages.pages_access_mark_restricted": "CREATE TRIGGER pages_access_mark_restricted AFTER INSERT OR UPDATE OF frontmatter ON public.pages FOR EACH ROW WHEN ((new.frontmatter ? 'readable_by'::text)) EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "pages.pages_access_stamp_folder_rules": "CREATE TRIGGER pages_access_stamp_folder_rules BEFORE INSERT OR UPDATE OF slug, source_id, folder_rule_ids ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_stamp_folder_rules()",
"pages.pages_clear_atom_scan_state": "CREATE TRIGGER pages_clear_atom_scan_state AFTER UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_clear_atom_page_state()",
"pages.pages_derivation_scope_delete": "CREATE TRIGGER pages_derivation_scope_delete AFTER UPDATE OF deleted_at ON public.pages FOR EACH ROW WHEN (((old.deleted_at IS NULL) AND (new.deleted_at IS NOT NULL))) EXECUTE FUNCTION gbrain_mark_derivation_scope_entry()",
"pages.pages_forget_retrievals": "CREATE TRIGGER pages_forget_retrievals AFTER DELETE ON public.pages REFERENCING OLD TABLE AS gbrain_deleted_pages FOR EACH STATEMENT EXECUTE FUNCTION gbrain_forget_page_retrievals()",
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
index 4eebc51c43..74868d57d3 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
@@ -8,6 +8,24 @@
"access_groups.access_groups_pkey": "p PRIMARY KEY (id)",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
+ "access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
+ "access_pending_coverage.access_pending_coverage_prefix_check": "c CHECK (((prefix = ''::text) OR ((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0))))",
+ "access_pending_coverage.access_pending_coverage_reason_check": "c CHECK ((reason = ANY (ARRAY['pending'::text, 'invalid'::text])))",
+ "access_pending_coverage.access_pending_coverage_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_migrations.access_policy_migrations_direction_check": "c CHECK ((direction = ANY (ARRAY['to_git'::text, 'to_database'::text])))",
+ "access_policy_migrations.access_policy_migrations_phase_check": "c CHECK ((phase = ANY (ARRAY['started'::text, 'exported'::text, 'committed'::text, 'switched'::text])))",
+ "access_policy_migrations.access_policy_migrations_pkey": "p PRIMARY KEY (id)",
+ "access_policy_migrations.access_policy_migrations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_revisions.access_policy_revisions_change_kind_check": "c CHECK ((change_kind = ANY (ARRAY['narrowing'::text, 'widening'::text, 'mixed'::text, 'unchanged'::text])))",
+ "access_policy_revisions.access_policy_revisions_pkey": "p PRIMARY KEY (source_id, revision)",
+ "access_policy_revisions.access_policy_revisions_revision_check": "c CHECK ((revision > 0))",
+ "access_policy_revisions.access_policy_revisions_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_state.access_policy_state_pkey": "p PRIMARY KEY (source_id)",
+ "access_policy_state.access_policy_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "access_rules.access_rules_pkey": "p PRIMARY KEY (source_id, rule_id)",
+ "access_rules.access_rules_prefix_check": "c CHECK (((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0)))",
+ "access_rules.access_rules_rule_id_check": "c CHECK ((rule_id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
+ "access_rules.access_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
"access_tokens.access_tokens_min_trust_check": "c CHECK (((min_trust IS NULL) OR (min_trust = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text]))))",
"access_tokens.access_tokens_pkey": "p PRIMARY KEY (id)",
"access_tokens.access_tokens_private_pages_check": "c CHECK ((private_pages = ANY (ARRAY['none'::text, 'granted_sources'::text])))",
@@ -549,10 +567,13 @@
"bump_page_generation_fn()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=314d4775d7c90f8ed650ea12ae3687f388f714ed3d30582dc8ff678dfea1dc97",
"enforce_minion_queue_protocol()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=be82640d1979fc81dc812efb78bb3596ef536f656d20750e5e4aa19016bf4784",
"gbrain_access_derive_page_readers()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=55923fb552adcdc8e5e3c820a0b4ba11f74748b4478f52de2e1b7506e969ac4d",
+ "gbrain_access_folder_rules(p_source text, p_slug text)": "RETURNS text[] kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2fcbf1744ede8ffc2ac16972f3d793109543710ecfe13ae9849eced94f347305",
"gbrain_access_mark_restricted()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=e45dc26421664fa3d409fba6c612af88905d2df35923f9592bcb759fc1ea618f",
"gbrain_access_norm_readers(vals text[])": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, pg_temp] body_sha256=b536c2604461abac62c90c090d127b71bdda8ed23d43ae25790606a8ee64f769",
- "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=f4b698f7fb87ae726b6e965b048f59d709afa834d97fd52240a81f898f069b3a",
+ "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=691cabb9e3951b1ac732fceaf826aaaa2e69cab650caaac6df2cbbaf47764ad4",
+ "gbrain_access_pending_covers(p_source text, p_slug text)": "RETURNS boolean kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=3a5530179ad6f056532e398fb4de58610125625e09140340ff138a2e268772a8",
"gbrain_access_readers(fm jsonb)": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=18348cb56089106aaec6470076ee652d7ed3bfbcb20e950a24abd52a21e7a380",
+ "gbrain_access_stamp_folder_rules()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=5185d4f512c372e3c42ef274294d2ab2daf1b93f3ce46516f514831cbee10f7d",
"gbrain_advance_page_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2a431195dc4c4150e3428251d0dec0a685cdc2992525c1b4b54dff103d5d99c9",
"gbrain_advance_tag_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=7807b26b4933148aa63c67fca824a60d3492396728205d04e16c48c81174cbd5",
"gbrain_bump_trust_generation()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=4708a89d166ac0999a8922ad8ee8f69fea3213c59e0782d96220f93b0c001a62",
@@ -599,6 +620,21 @@
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_pending_coverage": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_migrations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_revisions": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_state": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_rules": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_tokens": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1094,6 +1130,12 @@
"access_group_members_pkey": "CREATE UNIQUE INDEX access_group_members_pkey ON public.access_group_members USING btree (group_id, member_id)",
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
+ "access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
+ "access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
+ "access_policy_revisions_operation_idx": "CREATE UNIQUE INDEX access_policy_revisions_operation_idx ON public.access_policy_revisions USING btree (operation_id) WHERE (operation_id IS NOT NULL)",
+ "access_policy_revisions_pkey": "CREATE UNIQUE INDEX access_policy_revisions_pkey ON public.access_policy_revisions USING btree (source_id, revision)",
+ "access_policy_state_pkey": "CREATE UNIQUE INDEX access_policy_state_pkey ON public.access_policy_state USING btree (source_id)",
+ "access_rules_pkey": "CREATE UNIQUE INDEX access_rules_pkey ON public.access_rules USING btree (source_id, rule_id)",
"access_tokens_pkey": "CREATE UNIQUE INDEX access_tokens_pkey ON public.access_tokens USING btree (id)",
"access_tokens_token_hash_key": "CREATE UNIQUE INDEX access_tokens_token_hash_key ON public.access_tokens USING btree (token_hash)",
"belief_commit_marks_pkey": "CREATE UNIQUE INDEX belief_commit_marks_pkey ON public.belief_commit_marks USING btree (publication_id)",
@@ -1428,6 +1470,7 @@
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
"pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
+ "pages_folder_rule_ids_gin": "CREATE INDEX pages_folder_rule_ids_gin ON public.pages USING gin (folder_rule_ids) WHERE (folder_rule_ids IS NOT NULL)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_live_origin_key": "CREATE UNIQUE INDEX pages_live_origin_key ON public.pages USING btree (source_id, source_path) WHERE ((deleted_at IS NULL) AND (source_path IS NOT NULL))",
@@ -1672,6 +1715,65 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_pending_coverage": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 prefix text/text NOT NULL",
+ "3 reason text/text NOT NULL",
+ "4 revision bigint/int8 NULL",
+ "5 detail jsonb/jsonb NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_migrations": {
+ "columns": [
+ "1 id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 direction text/text NOT NULL",
+ "4 phase text/text NOT NULL",
+ "5 receipts jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_revisions": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 revision bigint/int8 NOT NULL",
+ "3 rules jsonb/jsonb NOT NULL",
+ "4 digest text/text NOT NULL",
+ "5 change_kind text/text NOT NULL",
+ "6 origin text/text NOT NULL",
+ "7 operation_id text/text NULL",
+ "8 proposed_by text/text NULL",
+ "9 approved_by text/text NULL",
+ "10 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "11 applied_at timestamp with time zone/timestamptz NULL",
+ "12 approved_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_state": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_rules": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 rule_id text/text NOT NULL",
+ "3 prefix text/text NOT NULL",
+ "4 readable_by ARRAY/_text NOT NULL",
+ "5 revision bigint/int8 NOT NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 created_by text/text NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_tokens": {
"columns": [
"1 id uuid/uuid NOT NULL DEFAULT gen_random_uuid()",
@@ -3354,7 +3456,8 @@
"52 timeline_lead text/text NULL",
"53 links_extract_failure jsonb/jsonb NULL",
"54 withheld_source_path text/text NULL",
- "55 page_readers ARRAY/_text NULL"
+ "55 page_readers ARRAY/_text NULL",
+ "56 folder_rule_ids ARRAY/_text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
@@ -4361,6 +4464,8 @@
},
"triggers": {
"access_members.access_members_mark_restricted": "CREATE TRIGGER access_members_mark_restricted AFTER INSERT ON public.access_members FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_pending_coverage.access_pending_coverage_mark_restricted": "CREATE TRIGGER access_pending_coverage_mark_restricted AFTER INSERT ON public.access_pending_coverage FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_rules.access_rules_mark_restricted": "CREATE TRIGGER access_rules_mark_restricted AFTER INSERT ON public.access_rules FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
"access_tokens.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.access_tokens DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.min_trust IS DISTINCT FROM new.min_trust)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
@@ -4401,6 +4506,7 @@
"pages.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()",
"pages.pages_access_derive_readers": "CREATE TRIGGER pages_access_derive_readers BEFORE INSERT OR UPDATE OF frontmatter, page_readers ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_derive_page_readers()",
"pages.pages_access_mark_restricted": "CREATE TRIGGER pages_access_mark_restricted AFTER INSERT OR UPDATE OF frontmatter ON public.pages FOR EACH ROW WHEN ((new.frontmatter ? 'readable_by'::text)) EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "pages.pages_access_stamp_folder_rules": "CREATE TRIGGER pages_access_stamp_folder_rules BEFORE INSERT OR UPDATE OF slug, source_id, folder_rule_ids ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_stamp_folder_rules()",
"pages.pages_clear_atom_scan_state": "CREATE TRIGGER pages_clear_atom_scan_state AFTER UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_clear_atom_page_state()",
"pages.pages_derivation_scope_delete": "CREATE TRIGGER pages_derivation_scope_delete AFTER UPDATE OF deleted_at ON public.pages FOR EACH ROW WHEN (((old.deleted_at IS NULL) AND (new.deleted_at IS NOT NULL))) EXECUTE FUNCTION gbrain_mark_derivation_scope_entry()",
"pages.pages_forget_retrievals": "CREATE TRIGGER pages_forget_retrievals AFTER DELETE ON public.pages REFERENCING OLD TABLE AS gbrain_deleted_pages FOR EACH STATEMENT EXECUTE FUNCTION gbrain_forget_page_retrievals()",
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
index c0654135a8..4760a26216 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
@@ -8,6 +8,24 @@
"access_groups.access_groups_pkey": "p PRIMARY KEY (id)",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
+ "access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
+ "access_pending_coverage.access_pending_coverage_prefix_check": "c CHECK (((prefix = ''::text) OR ((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0))))",
+ "access_pending_coverage.access_pending_coverage_reason_check": "c CHECK ((reason = ANY (ARRAY['pending'::text, 'invalid'::text])))",
+ "access_pending_coverage.access_pending_coverage_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_migrations.access_policy_migrations_direction_check": "c CHECK ((direction = ANY (ARRAY['to_git'::text, 'to_database'::text])))",
+ "access_policy_migrations.access_policy_migrations_phase_check": "c CHECK ((phase = ANY (ARRAY['started'::text, 'exported'::text, 'committed'::text, 'switched'::text])))",
+ "access_policy_migrations.access_policy_migrations_pkey": "p PRIMARY KEY (id)",
+ "access_policy_migrations.access_policy_migrations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_revisions.access_policy_revisions_change_kind_check": "c CHECK ((change_kind = ANY (ARRAY['narrowing'::text, 'widening'::text, 'mixed'::text, 'unchanged'::text])))",
+ "access_policy_revisions.access_policy_revisions_pkey": "p PRIMARY KEY (source_id, revision)",
+ "access_policy_revisions.access_policy_revisions_revision_check": "c CHECK ((revision > 0))",
+ "access_policy_revisions.access_policy_revisions_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_state.access_policy_state_pkey": "p PRIMARY KEY (source_id)",
+ "access_policy_state.access_policy_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "access_rules.access_rules_pkey": "p PRIMARY KEY (source_id, rule_id)",
+ "access_rules.access_rules_prefix_check": "c CHECK (((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0)))",
+ "access_rules.access_rules_rule_id_check": "c CHECK ((rule_id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
+ "access_rules.access_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
"access_tokens.access_tokens_min_trust_check": "c CHECK (((min_trust IS NULL) OR (min_trust = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text]))))",
"access_tokens.access_tokens_pkey": "p PRIMARY KEY (id)",
"access_tokens.access_tokens_private_pages_check": "c CHECK ((private_pages = ANY (ARRAY['none'::text, 'granted_sources'::text])))",
@@ -549,10 +567,13 @@
"bump_page_generation_fn()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=314d4775d7c90f8ed650ea12ae3687f388f714ed3d30582dc8ff678dfea1dc97",
"enforce_minion_queue_protocol()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=be82640d1979fc81dc812efb78bb3596ef536f656d20750e5e4aa19016bf4784",
"gbrain_access_derive_page_readers()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=55923fb552adcdc8e5e3c820a0b4ba11f74748b4478f52de2e1b7506e969ac4d",
+ "gbrain_access_folder_rules(p_source text, p_slug text)": "RETURNS text[] kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2fcbf1744ede8ffc2ac16972f3d793109543710ecfe13ae9849eced94f347305",
"gbrain_access_mark_restricted()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=e45dc26421664fa3d409fba6c612af88905d2df35923f9592bcb759fc1ea618f",
"gbrain_access_norm_readers(vals text[])": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, pg_temp] body_sha256=b536c2604461abac62c90c090d127b71bdda8ed23d43ae25790606a8ee64f769",
- "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=f4b698f7fb87ae726b6e965b048f59d709afa834d97fd52240a81f898f069b3a",
+ "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=691cabb9e3951b1ac732fceaf826aaaa2e69cab650caaac6df2cbbaf47764ad4",
+ "gbrain_access_pending_covers(p_source text, p_slug text)": "RETURNS boolean kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=3a5530179ad6f056532e398fb4de58610125625e09140340ff138a2e268772a8",
"gbrain_access_readers(fm jsonb)": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=18348cb56089106aaec6470076ee652d7ed3bfbcb20e950a24abd52a21e7a380",
+ "gbrain_access_stamp_folder_rules()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=5185d4f512c372e3c42ef274294d2ab2daf1b93f3ce46516f514831cbee10f7d",
"gbrain_advance_page_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2a431195dc4c4150e3428251d0dec0a685cdc2992525c1b4b54dff103d5d99c9",
"gbrain_advance_tag_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=7807b26b4933148aa63c67fca824a60d3492396728205d04e16c48c81174cbd5",
"gbrain_bump_trust_generation()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=4708a89d166ac0999a8922ad8ee8f69fea3213c59e0782d96220f93b0c001a62",
@@ -599,6 +620,21 @@
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_pending_coverage": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_migrations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_revisions": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_state": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_rules": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_tokens": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1094,6 +1130,12 @@
"access_group_members_pkey": "CREATE UNIQUE INDEX access_group_members_pkey ON public.access_group_members USING btree (group_id, member_id)",
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
+ "access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
+ "access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
+ "access_policy_revisions_operation_idx": "CREATE UNIQUE INDEX access_policy_revisions_operation_idx ON public.access_policy_revisions USING btree (operation_id) WHERE (operation_id IS NOT NULL)",
+ "access_policy_revisions_pkey": "CREATE UNIQUE INDEX access_policy_revisions_pkey ON public.access_policy_revisions USING btree (source_id, revision)",
+ "access_policy_state_pkey": "CREATE UNIQUE INDEX access_policy_state_pkey ON public.access_policy_state USING btree (source_id)",
+ "access_rules_pkey": "CREATE UNIQUE INDEX access_rules_pkey ON public.access_rules USING btree (source_id, rule_id)",
"access_tokens_pkey": "CREATE UNIQUE INDEX access_tokens_pkey ON public.access_tokens USING btree (id)",
"access_tokens_token_hash_key": "CREATE UNIQUE INDEX access_tokens_token_hash_key ON public.access_tokens USING btree (token_hash)",
"belief_commit_marks_pkey": "CREATE UNIQUE INDEX belief_commit_marks_pkey ON public.belief_commit_marks USING btree (publication_id)",
@@ -1424,6 +1466,7 @@
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
"pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
+ "pages_folder_rule_ids_gin": "CREATE INDEX pages_folder_rule_ids_gin ON public.pages USING gin (folder_rule_ids) WHERE (folder_rule_ids IS NOT NULL)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_live_origin_key": "CREATE UNIQUE INDEX pages_live_origin_key ON public.pages USING btree (source_id, source_path) WHERE ((deleted_at IS NULL) AND (source_path IS NOT NULL))",
@@ -1668,6 +1711,65 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_pending_coverage": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 prefix text/text NOT NULL",
+ "3 reason text/text NOT NULL",
+ "4 revision bigint/int8 NULL",
+ "5 detail jsonb/jsonb NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_migrations": {
+ "columns": [
+ "1 id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 direction text/text NOT NULL",
+ "4 phase text/text NOT NULL",
+ "5 receipts jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_revisions": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 revision bigint/int8 NOT NULL",
+ "3 rules jsonb/jsonb NOT NULL",
+ "4 digest text/text NOT NULL",
+ "5 change_kind text/text NOT NULL",
+ "6 origin text/text NOT NULL",
+ "7 operation_id text/text NULL",
+ "8 proposed_by text/text NULL",
+ "9 approved_by text/text NULL",
+ "10 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "11 applied_at timestamp with time zone/timestamptz NULL",
+ "12 approved_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_state": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_rules": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 rule_id text/text NOT NULL",
+ "3 prefix text/text NOT NULL",
+ "4 readable_by ARRAY/_text NOT NULL",
+ "5 revision bigint/int8 NOT NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 created_by text/text NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_tokens": {
"columns": [
"1 id uuid/uuid NOT NULL DEFAULT gen_random_uuid()",
@@ -3350,7 +3452,8 @@
"52 timeline_lead text/text NULL",
"53 links_extract_failure jsonb/jsonb NULL",
"54 withheld_source_path text/text NULL",
- "55 page_readers ARRAY/_text NULL"
+ "55 page_readers ARRAY/_text NULL",
+ "56 folder_rule_ids ARRAY/_text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
@@ -4357,6 +4460,8 @@
},
"triggers": {
"access_members.access_members_mark_restricted": "CREATE TRIGGER access_members_mark_restricted AFTER INSERT ON public.access_members FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_pending_coverage.access_pending_coverage_mark_restricted": "CREATE TRIGGER access_pending_coverage_mark_restricted AFTER INSERT ON public.access_pending_coverage FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_rules.access_rules_mark_restricted": "CREATE TRIGGER access_rules_mark_restricted AFTER INSERT ON public.access_rules FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
"access_tokens.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.access_tokens DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.min_trust IS DISTINCT FROM new.min_trust)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
@@ -4397,6 +4502,7 @@
"pages.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()",
"pages.pages_access_derive_readers": "CREATE TRIGGER pages_access_derive_readers BEFORE INSERT OR UPDATE OF frontmatter, page_readers ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_derive_page_readers()",
"pages.pages_access_mark_restricted": "CREATE TRIGGER pages_access_mark_restricted AFTER INSERT OR UPDATE OF frontmatter ON public.pages FOR EACH ROW WHEN ((new.frontmatter ? 'readable_by'::text)) EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "pages.pages_access_stamp_folder_rules": "CREATE TRIGGER pages_access_stamp_folder_rules BEFORE INSERT OR UPDATE OF slug, source_id, folder_rule_ids ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_stamp_folder_rules()",
"pages.pages_clear_atom_scan_state": "CREATE TRIGGER pages_clear_atom_scan_state AFTER UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_clear_atom_page_state()",
"pages.pages_derivation_scope_delete": "CREATE TRIGGER pages_derivation_scope_delete AFTER UPDATE OF deleted_at ON public.pages FOR EACH ROW WHEN (((old.deleted_at IS NULL) AND (new.deleted_at IS NOT NULL))) EXECUTE FUNCTION gbrain_mark_derivation_scope_entry()",
"pages.pages_forget_retrievals": "CREATE TRIGGER pages_forget_retrievals AFTER DELETE ON public.pages REFERENCING OLD TABLE AS gbrain_deleted_pages FOR EACH STATEMENT EXECUTE FUNCTION gbrain_forget_page_retrievals()",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index dfcefc416c..151caa4f19 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -8,6 +8,24 @@
"access_groups.access_groups_pkey": "p PRIMARY KEY (id)",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
+ "access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
+ "access_pending_coverage.access_pending_coverage_prefix_check": "c CHECK (((prefix = ''::text) OR ((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0))))",
+ "access_pending_coverage.access_pending_coverage_reason_check": "c CHECK ((reason = ANY (ARRAY['pending'::text, 'invalid'::text])))",
+ "access_pending_coverage.access_pending_coverage_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_migrations.access_policy_migrations_direction_check": "c CHECK ((direction = ANY (ARRAY['to_git'::text, 'to_database'::text])))",
+ "access_policy_migrations.access_policy_migrations_phase_check": "c CHECK ((phase = ANY (ARRAY['started'::text, 'exported'::text, 'committed'::text, 'switched'::text])))",
+ "access_policy_migrations.access_policy_migrations_pkey": "p PRIMARY KEY (id)",
+ "access_policy_migrations.access_policy_migrations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_revisions.access_policy_revisions_change_kind_check": "c CHECK ((change_kind = ANY (ARRAY['narrowing'::text, 'widening'::text, 'mixed'::text, 'unchanged'::text])))",
+ "access_policy_revisions.access_policy_revisions_pkey": "p PRIMARY KEY (source_id, revision)",
+ "access_policy_revisions.access_policy_revisions_revision_check": "c CHECK ((revision > 0))",
+ "access_policy_revisions.access_policy_revisions_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_state.access_policy_state_pkey": "p PRIMARY KEY (source_id)",
+ "access_policy_state.access_policy_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "access_rules.access_rules_pkey": "p PRIMARY KEY (source_id, rule_id)",
+ "access_rules.access_rules_prefix_check": "c CHECK (((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0)))",
+ "access_rules.access_rules_rule_id_check": "c CHECK ((rule_id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
+ "access_rules.access_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
"access_tokens.access_tokens_min_trust_check": "c CHECK (((min_trust IS NULL) OR (min_trust = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text]))))",
"access_tokens.access_tokens_pkey": "p PRIMARY KEY (id)",
"access_tokens.access_tokens_private_pages_check": "c CHECK ((private_pages = ANY (ARRAY['none'::text, 'granted_sources'::text])))",
@@ -553,10 +571,13 @@
"bump_page_generation_fn()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=314d4775d7c90f8ed650ea12ae3687f388f714ed3d30582dc8ff678dfea1dc97",
"enforce_minion_queue_protocol()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=be82640d1979fc81dc812efb78bb3596ef536f656d20750e5e4aa19016bf4784",
"gbrain_access_derive_page_readers()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=55923fb552adcdc8e5e3c820a0b4ba11f74748b4478f52de2e1b7506e969ac4d",
+ "gbrain_access_folder_rules(p_source text, p_slug text)": "RETURNS text[] kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2fcbf1744ede8ffc2ac16972f3d793109543710ecfe13ae9849eced94f347305",
"gbrain_access_mark_restricted()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=e45dc26421664fa3d409fba6c612af88905d2df35923f9592bcb759fc1ea618f",
"gbrain_access_norm_readers(vals text[])": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, pg_temp] body_sha256=b536c2604461abac62c90c090d127b71bdda8ed23d43ae25790606a8ee64f769",
- "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=f4b698f7fb87ae726b6e965b048f59d709afa834d97fd52240a81f898f069b3a",
+ "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=691cabb9e3951b1ac732fceaf826aaaa2e69cab650caaac6df2cbbaf47764ad4",
+ "gbrain_access_pending_covers(p_source text, p_slug text)": "RETURNS boolean kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=3a5530179ad6f056532e398fb4de58610125625e09140340ff138a2e268772a8",
"gbrain_access_readers(fm jsonb)": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=18348cb56089106aaec6470076ee652d7ed3bfbcb20e950a24abd52a21e7a380",
+ "gbrain_access_stamp_folder_rules()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=5185d4f512c372e3c42ef274294d2ab2daf1b93f3ce46516f514831cbee10f7d",
"gbrain_advance_page_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2a431195dc4c4150e3428251d0dec0a685cdc2992525c1b4b54dff103d5d99c9",
"gbrain_advance_tag_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=7807b26b4933148aa63c67fca824a60d3492396728205d04e16c48c81174cbd5",
"gbrain_bump_trust_generation()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=4708a89d166ac0999a8922ad8ee8f69fea3213c59e0782d96220f93b0c001a62",
@@ -603,6 +624,21 @@
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_pending_coverage": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_migrations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_revisions": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_state": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_rules": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_tokens": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1095,6 +1131,12 @@
"access_group_members_pkey": "CREATE UNIQUE INDEX access_group_members_pkey ON public.access_group_members USING btree (group_id, member_id)",
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
+ "access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
+ "access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
+ "access_policy_revisions_operation_idx": "CREATE UNIQUE INDEX access_policy_revisions_operation_idx ON public.access_policy_revisions USING btree (operation_id) WHERE (operation_id IS NOT NULL)",
+ "access_policy_revisions_pkey": "CREATE UNIQUE INDEX access_policy_revisions_pkey ON public.access_policy_revisions USING btree (source_id, revision)",
+ "access_policy_state_pkey": "CREATE UNIQUE INDEX access_policy_state_pkey ON public.access_policy_state USING btree (source_id)",
+ "access_rules_pkey": "CREATE UNIQUE INDEX access_rules_pkey ON public.access_rules USING btree (source_id, rule_id)",
"access_tokens_pkey": "CREATE UNIQUE INDEX access_tokens_pkey ON public.access_tokens USING btree (id)",
"access_tokens_token_hash_key": "CREATE UNIQUE INDEX access_tokens_token_hash_key ON public.access_tokens USING btree (token_hash)",
"belief_commit_marks_pkey": "CREATE UNIQUE INDEX belief_commit_marks_pkey ON public.belief_commit_marks USING btree (publication_id)",
@@ -1432,6 +1474,7 @@
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
"pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
+ "pages_folder_rule_ids_gin": "CREATE INDEX pages_folder_rule_ids_gin ON public.pages USING gin (folder_rule_ids) WHERE (folder_rule_ids IS NOT NULL)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_live_origin_key": "CREATE UNIQUE INDEX pages_live_origin_key ON public.pages USING btree (source_id, source_path) WHERE ((deleted_at IS NULL) AND (source_path IS NOT NULL))",
@@ -1673,6 +1716,65 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_pending_coverage": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 prefix text/text NOT NULL",
+ "3 reason text/text NOT NULL",
+ "4 revision bigint/int8 NULL",
+ "5 detail jsonb/jsonb NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_migrations": {
+ "columns": [
+ "1 id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 direction text/text NOT NULL",
+ "4 phase text/text NOT NULL",
+ "5 receipts jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_revisions": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 revision bigint/int8 NOT NULL",
+ "3 rules jsonb/jsonb NOT NULL",
+ "4 digest text/text NOT NULL",
+ "5 change_kind text/text NOT NULL",
+ "6 origin text/text NOT NULL",
+ "7 operation_id text/text NULL",
+ "8 proposed_by text/text NULL",
+ "9 approved_by text/text NULL",
+ "10 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "11 applied_at timestamp with time zone/timestamptz NULL",
+ "12 approved_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_state": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_rules": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 rule_id text/text NOT NULL",
+ "3 prefix text/text NOT NULL",
+ "4 readable_by ARRAY/_text NOT NULL",
+ "5 revision bigint/int8 NOT NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 created_by text/text NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_tokens": {
"columns": [
"1 id uuid/uuid NOT NULL DEFAULT gen_random_uuid()",
@@ -3366,7 +3468,8 @@
"52 timeline_lead text/text NULL",
"53 links_extract_failure jsonb/jsonb NULL",
"54 withheld_source_path text/text NULL",
- "55 page_readers ARRAY/_text NULL"
+ "55 page_readers ARRAY/_text NULL",
+ "56 folder_rule_ids ARRAY/_text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -4356,6 +4459,8 @@
},
"triggers": {
"access_members.access_members_mark_restricted": "CREATE TRIGGER access_members_mark_restricted AFTER INSERT ON public.access_members FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_pending_coverage.access_pending_coverage_mark_restricted": "CREATE TRIGGER access_pending_coverage_mark_restricted AFTER INSERT ON public.access_pending_coverage FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_rules.access_rules_mark_restricted": "CREATE TRIGGER access_rules_mark_restricted AFTER INSERT ON public.access_rules FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
"access_tokens.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.access_tokens DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.min_trust IS DISTINCT FROM new.min_trust)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
@@ -4388,6 +4493,7 @@
"pages.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()",
"pages.pages_access_derive_readers": "CREATE TRIGGER pages_access_derive_readers BEFORE INSERT OR UPDATE OF frontmatter, page_readers ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_derive_page_readers()",
"pages.pages_access_mark_restricted": "CREATE TRIGGER pages_access_mark_restricted AFTER INSERT OR UPDATE OF frontmatter ON public.pages FOR EACH ROW WHEN ((new.frontmatter ? 'readable_by'::text)) EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "pages.pages_access_stamp_folder_rules": "CREATE TRIGGER pages_access_stamp_folder_rules BEFORE INSERT OR UPDATE OF slug, source_id, folder_rule_ids ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_stamp_folder_rules()",
"pages.pages_clear_atom_scan_state": "CREATE TRIGGER pages_clear_atom_scan_state AFTER UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_clear_atom_page_state()",
"pages.pages_derivation_scope_delete": "CREATE TRIGGER pages_derivation_scope_delete AFTER UPDATE OF deleted_at ON public.pages FOR EACH ROW WHEN (((old.deleted_at IS NULL) AND (new.deleted_at IS NOT NULL))) EXECUTE FUNCTION gbrain_mark_derivation_scope_entry()",
"pages.pages_forget_retrievals": "CREATE TRIGGER pages_forget_retrievals AFTER DELETE ON public.pages REFERENCING OLD TABLE AS gbrain_deleted_pages FOR EACH STATEMENT EXECUTE FUNCTION gbrain_forget_page_retrievals()",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
index 6aea4f3aad..a5b009fb6f 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -8,6 +8,24 @@
"access_groups.access_groups_pkey": "p PRIMARY KEY (id)",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
+ "access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
+ "access_pending_coverage.access_pending_coverage_prefix_check": "c CHECK (((prefix = ''::text) OR ((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0))))",
+ "access_pending_coverage.access_pending_coverage_reason_check": "c CHECK ((reason = ANY (ARRAY['pending'::text, 'invalid'::text])))",
+ "access_pending_coverage.access_pending_coverage_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_migrations.access_policy_migrations_direction_check": "c CHECK ((direction = ANY (ARRAY['to_git'::text, 'to_database'::text])))",
+ "access_policy_migrations.access_policy_migrations_phase_check": "c CHECK ((phase = ANY (ARRAY['started'::text, 'exported'::text, 'committed'::text, 'switched'::text])))",
+ "access_policy_migrations.access_policy_migrations_pkey": "p PRIMARY KEY (id)",
+ "access_policy_migrations.access_policy_migrations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_revisions.access_policy_revisions_change_kind_check": "c CHECK ((change_kind = ANY (ARRAY['narrowing'::text, 'widening'::text, 'mixed'::text, 'unchanged'::text])))",
+ "access_policy_revisions.access_policy_revisions_pkey": "p PRIMARY KEY (source_id, revision)",
+ "access_policy_revisions.access_policy_revisions_revision_check": "c CHECK ((revision > 0))",
+ "access_policy_revisions.access_policy_revisions_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_state.access_policy_state_pkey": "p PRIMARY KEY (source_id)",
+ "access_policy_state.access_policy_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "access_rules.access_rules_pkey": "p PRIMARY KEY (source_id, rule_id)",
+ "access_rules.access_rules_prefix_check": "c CHECK (((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0)))",
+ "access_rules.access_rules_rule_id_check": "c CHECK ((rule_id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
+ "access_rules.access_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
"access_tokens.access_tokens_min_trust_check": "c CHECK (((min_trust IS NULL) OR (min_trust = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text]))))",
"access_tokens.access_tokens_pkey": "p PRIMARY KEY (id)",
"access_tokens.access_tokens_private_pages_check": "c CHECK ((private_pages = ANY (ARRAY['none'::text, 'granted_sources'::text])))",
@@ -553,10 +571,13 @@
"bump_page_generation_fn()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=314d4775d7c90f8ed650ea12ae3687f388f714ed3d30582dc8ff678dfea1dc97",
"enforce_minion_queue_protocol()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=be82640d1979fc81dc812efb78bb3596ef536f656d20750e5e4aa19016bf4784",
"gbrain_access_derive_page_readers()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=55923fb552adcdc8e5e3c820a0b4ba11f74748b4478f52de2e1b7506e969ac4d",
+ "gbrain_access_folder_rules(p_source text, p_slug text)": "RETURNS text[] kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2fcbf1744ede8ffc2ac16972f3d793109543710ecfe13ae9849eced94f347305",
"gbrain_access_mark_restricted()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=e45dc26421664fa3d409fba6c612af88905d2df35923f9592bcb759fc1ea618f",
"gbrain_access_norm_readers(vals text[])": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, pg_temp] body_sha256=b536c2604461abac62c90c090d127b71bdda8ed23d43ae25790606a8ee64f769",
- "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=f4b698f7fb87ae726b6e965b048f59d709afa834d97fd52240a81f898f069b3a",
+ "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=691cabb9e3951b1ac732fceaf826aaaa2e69cab650caaac6df2cbbaf47764ad4",
+ "gbrain_access_pending_covers(p_source text, p_slug text)": "RETURNS boolean kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=3a5530179ad6f056532e398fb4de58610125625e09140340ff138a2e268772a8",
"gbrain_access_readers(fm jsonb)": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=18348cb56089106aaec6470076ee652d7ed3bfbcb20e950a24abd52a21e7a380",
+ "gbrain_access_stamp_folder_rules()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=5185d4f512c372e3c42ef274294d2ab2daf1b93f3ce46516f514831cbee10f7d",
"gbrain_advance_page_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2a431195dc4c4150e3428251d0dec0a685cdc2992525c1b4b54dff103d5d99c9",
"gbrain_advance_tag_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=7807b26b4933148aa63c67fca824a60d3492396728205d04e16c48c81174cbd5",
"gbrain_bump_trust_generation()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=4708a89d166ac0999a8922ad8ee8f69fea3213c59e0782d96220f93b0c001a62",
@@ -603,6 +624,21 @@
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_pending_coverage": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_migrations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_revisions": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_state": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_rules": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_tokens": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1095,6 +1131,12 @@
"access_group_members_pkey": "CREATE UNIQUE INDEX access_group_members_pkey ON public.access_group_members USING btree (group_id, member_id)",
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
+ "access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
+ "access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
+ "access_policy_revisions_operation_idx": "CREATE UNIQUE INDEX access_policy_revisions_operation_idx ON public.access_policy_revisions USING btree (operation_id) WHERE (operation_id IS NOT NULL)",
+ "access_policy_revisions_pkey": "CREATE UNIQUE INDEX access_policy_revisions_pkey ON public.access_policy_revisions USING btree (source_id, revision)",
+ "access_policy_state_pkey": "CREATE UNIQUE INDEX access_policy_state_pkey ON public.access_policy_state USING btree (source_id)",
+ "access_rules_pkey": "CREATE UNIQUE INDEX access_rules_pkey ON public.access_rules USING btree (source_id, rule_id)",
"access_tokens_pkey": "CREATE UNIQUE INDEX access_tokens_pkey ON public.access_tokens USING btree (id)",
"access_tokens_token_hash_key": "CREATE UNIQUE INDEX access_tokens_token_hash_key ON public.access_tokens USING btree (token_hash)",
"belief_commit_marks_pkey": "CREATE UNIQUE INDEX belief_commit_marks_pkey ON public.belief_commit_marks USING btree (publication_id)",
@@ -1432,6 +1474,7 @@
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
"pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
+ "pages_folder_rule_ids_gin": "CREATE INDEX pages_folder_rule_ids_gin ON public.pages USING gin (folder_rule_ids) WHERE (folder_rule_ids IS NOT NULL)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_live_origin_key": "CREATE UNIQUE INDEX pages_live_origin_key ON public.pages USING btree (source_id, source_path) WHERE ((deleted_at IS NULL) AND (source_path IS NOT NULL))",
@@ -1673,6 +1716,65 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_pending_coverage": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 prefix text/text NOT NULL",
+ "3 reason text/text NOT NULL",
+ "4 revision bigint/int8 NULL",
+ "5 detail jsonb/jsonb NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_migrations": {
+ "columns": [
+ "1 id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 direction text/text NOT NULL",
+ "4 phase text/text NOT NULL",
+ "5 receipts jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_revisions": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 revision bigint/int8 NOT NULL",
+ "3 rules jsonb/jsonb NOT NULL",
+ "4 digest text/text NOT NULL",
+ "5 change_kind text/text NOT NULL",
+ "6 origin text/text NOT NULL",
+ "7 operation_id text/text NULL",
+ "8 proposed_by text/text NULL",
+ "9 approved_by text/text NULL",
+ "10 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "11 applied_at timestamp with time zone/timestamptz NULL",
+ "12 approved_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_state": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_rules": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 rule_id text/text NOT NULL",
+ "3 prefix text/text NOT NULL",
+ "4 readable_by ARRAY/_text NOT NULL",
+ "5 revision bigint/int8 NOT NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 created_by text/text NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_tokens": {
"columns": [
"1 id uuid/uuid NOT NULL DEFAULT gen_random_uuid()",
@@ -3366,7 +3468,8 @@
"52 timeline_lead text/text NULL",
"53 links_extract_failure jsonb/jsonb NULL",
"54 withheld_source_path text/text NULL",
- "55 page_readers ARRAY/_text NULL"
+ "55 page_readers ARRAY/_text NULL",
+ "56 folder_rule_ids ARRAY/_text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -4356,6 +4459,8 @@
},
"triggers": {
"access_members.access_members_mark_restricted": "CREATE TRIGGER access_members_mark_restricted AFTER INSERT ON public.access_members FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_pending_coverage.access_pending_coverage_mark_restricted": "CREATE TRIGGER access_pending_coverage_mark_restricted AFTER INSERT ON public.access_pending_coverage FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_rules.access_rules_mark_restricted": "CREATE TRIGGER access_rules_mark_restricted AFTER INSERT ON public.access_rules FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
"access_tokens.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.access_tokens DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.min_trust IS DISTINCT FROM new.min_trust)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
@@ -4388,6 +4493,7 @@
"pages.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()",
"pages.pages_access_derive_readers": "CREATE TRIGGER pages_access_derive_readers BEFORE INSERT OR UPDATE OF frontmatter, page_readers ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_derive_page_readers()",
"pages.pages_access_mark_restricted": "CREATE TRIGGER pages_access_mark_restricted AFTER INSERT OR UPDATE OF frontmatter ON public.pages FOR EACH ROW WHEN ((new.frontmatter ? 'readable_by'::text)) EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "pages.pages_access_stamp_folder_rules": "CREATE TRIGGER pages_access_stamp_folder_rules BEFORE INSERT OR UPDATE OF slug, source_id, folder_rule_ids ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_stamp_folder_rules()",
"pages.pages_clear_atom_scan_state": "CREATE TRIGGER pages_clear_atom_scan_state AFTER UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_clear_atom_page_state()",
"pages.pages_derivation_scope_delete": "CREATE TRIGGER pages_derivation_scope_delete AFTER UPDATE OF deleted_at ON public.pages FOR EACH ROW WHEN (((old.deleted_at IS NULL) AND (new.deleted_at IS NOT NULL))) EXECUTE FUNCTION gbrain_mark_derivation_scope_entry()",
"pages.pages_forget_retrievals": "CREATE TRIGGER pages_forget_retrievals AFTER DELETE ON public.pages REFERENCING OLD TABLE AS gbrain_deleted_pages FOR EACH STATEMENT EXECUTE FUNCTION gbrain_forget_page_retrievals()",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
index cf7e2bfe13..f90f0cdd22 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -8,6 +8,24 @@
"access_groups.access_groups_pkey": "p PRIMARY KEY (id)",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
+ "access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
+ "access_pending_coverage.access_pending_coverage_prefix_check": "c CHECK (((prefix = ''::text) OR ((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0))))",
+ "access_pending_coverage.access_pending_coverage_reason_check": "c CHECK ((reason = ANY (ARRAY['pending'::text, 'invalid'::text])))",
+ "access_pending_coverage.access_pending_coverage_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_migrations.access_policy_migrations_direction_check": "c CHECK ((direction = ANY (ARRAY['to_git'::text, 'to_database'::text])))",
+ "access_policy_migrations.access_policy_migrations_phase_check": "c CHECK ((phase = ANY (ARRAY['started'::text, 'exported'::text, 'committed'::text, 'switched'::text])))",
+ "access_policy_migrations.access_policy_migrations_pkey": "p PRIMARY KEY (id)",
+ "access_policy_migrations.access_policy_migrations_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_revisions.access_policy_revisions_change_kind_check": "c CHECK ((change_kind = ANY (ARRAY['narrowing'::text, 'widening'::text, 'mixed'::text, 'unchanged'::text])))",
+ "access_policy_revisions.access_policy_revisions_pkey": "p PRIMARY KEY (source_id, revision)",
+ "access_policy_revisions.access_policy_revisions_revision_check": "c CHECK ((revision > 0))",
+ "access_policy_revisions.access_policy_revisions_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
+ "access_policy_state.access_policy_state_pkey": "p PRIMARY KEY (source_id)",
+ "access_policy_state.access_policy_state_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "access_rules.access_rules_pkey": "p PRIMARY KEY (source_id, rule_id)",
+ "access_rules.access_rules_prefix_check": "c CHECK (((length(prefix) <= 512) AND (prefix ~ '^([a-z0-9][a-z0-9._-]*/)+$'::text) AND (POSITION(('..'::text) IN (prefix)) = 0)))",
+ "access_rules.access_rules_rule_id_check": "c CHECK ((rule_id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
+ "access_rules.access_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES access_policy_state(source_id) ON DELETE CASCADE",
"access_tokens.access_tokens_min_trust_check": "c CHECK (((min_trust IS NULL) OR (min_trust = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text]))))",
"access_tokens.access_tokens_pkey": "p PRIMARY KEY (id)",
"access_tokens.access_tokens_private_pages_check": "c CHECK ((private_pages = ANY (ARRAY['none'::text, 'granted_sources'::text])))",
@@ -553,10 +571,13 @@
"bump_page_generation_fn()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=314d4775d7c90f8ed650ea12ae3687f388f714ed3d30582dc8ff678dfea1dc97",
"enforce_minion_queue_protocol()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=be82640d1979fc81dc812efb78bb3596ef536f656d20750e5e4aa19016bf4784",
"gbrain_access_derive_page_readers()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=55923fb552adcdc8e5e3c820a0b4ba11f74748b4478f52de2e1b7506e969ac4d",
+ "gbrain_access_folder_rules(p_source text, p_slug text)": "RETURNS text[] kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2fcbf1744ede8ffc2ac16972f3d793109543710ecfe13ae9849eced94f347305",
"gbrain_access_mark_restricted()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=e45dc26421664fa3d409fba6c612af88905d2df35923f9592bcb759fc1ea618f",
"gbrain_access_norm_readers(vals text[])": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, pg_temp] body_sha256=b536c2604461abac62c90c090d127b71bdda8ed23d43ae25790606a8ee64f769",
- "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=f4b698f7fb87ae726b6e965b048f59d709afa834d97fd52240a81f898f069b3a",
+ "gbrain_access_origin_restricted(p_id integer, p_source_id text, p_type text, fm jsonb)": "RETURNS boolean kind=f lang=plpgsql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=691cabb9e3951b1ac732fceaf826aaaa2e69cab650caaac6df2cbbaf47764ad4",
+ "gbrain_access_pending_covers(p_source text, p_slug text)": "RETURNS boolean kind=f lang=sql volatility=s secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=3a5530179ad6f056532e398fb4de58610125625e09140340ff138a2e268772a8",
"gbrain_access_readers(fm jsonb)": "RETURNS text[] kind=f lang=sql volatility=i secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=18348cb56089106aaec6470076ee652d7ed3bfbcb20e950a24abd52a21e7a380",
+ "gbrain_access_stamp_folder_rules()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=5185d4f512c372e3c42ef274294d2ab2daf1b93f3ce46516f514831cbee10f7d",
"gbrain_advance_page_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=2a431195dc4c4150e3428251d0dec0a685cdc2992525c1b4b54dff103d5d99c9",
"gbrain_advance_tag_revision()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=7807b26b4933148aa63c67fca824a60d3492396728205d04e16c48c81174cbd5",
"gbrain_bump_trust_generation()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public, pg_temp] body_sha256=4708a89d166ac0999a8922ad8ee8f69fea3213c59e0782d96220f93b0c001a62",
@@ -603,6 +624,21 @@
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_pending_coverage": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_migrations": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_revisions": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_policy_state": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "access_rules": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_tokens": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1095,6 +1131,12 @@
"access_group_members_pkey": "CREATE UNIQUE INDEX access_group_members_pkey ON public.access_group_members USING btree (group_id, member_id)",
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
+ "access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
+ "access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
+ "access_policy_revisions_operation_idx": "CREATE UNIQUE INDEX access_policy_revisions_operation_idx ON public.access_policy_revisions USING btree (operation_id) WHERE (operation_id IS NOT NULL)",
+ "access_policy_revisions_pkey": "CREATE UNIQUE INDEX access_policy_revisions_pkey ON public.access_policy_revisions USING btree (source_id, revision)",
+ "access_policy_state_pkey": "CREATE UNIQUE INDEX access_policy_state_pkey ON public.access_policy_state USING btree (source_id)",
+ "access_rules_pkey": "CREATE UNIQUE INDEX access_rules_pkey ON public.access_rules USING btree (source_id, rule_id)",
"access_tokens_pkey": "CREATE UNIQUE INDEX access_tokens_pkey ON public.access_tokens USING btree (id)",
"access_tokens_token_hash_key": "CREATE UNIQUE INDEX access_tokens_token_hash_key ON public.access_tokens USING btree (token_hash)",
"belief_commit_marks_pkey": "CREATE UNIQUE INDEX belief_commit_marks_pkey ON public.belief_commit_marks USING btree (publication_id)",
@@ -1428,6 +1470,7 @@
"pages_dedup_idx": "CREATE INDEX pages_dedup_idx ON public.pages USING btree (source_id, content_hash) WHERE (deleted_at IS NULL)",
"pages_deleted_at_purge_idx": "CREATE INDEX pages_deleted_at_purge_idx ON public.pages USING btree (deleted_at) WHERE (deleted_at IS NOT NULL)",
"pages_file_uri_name_idx": "CREATE INDEX pages_file_uri_name_idx ON public.pages USING btree (source_id, regexp_replace(source_uri, '^.*/'::text, ''::text)) WHERE (source_uri ~~ 'file:%'::text)",
+ "pages_folder_rule_ids_gin": "CREATE INDEX pages_folder_rule_ids_gin ON public.pages USING gin (folder_rule_ids) WHERE (folder_rule_ids IS NOT NULL)",
"pages_generation_idx": "CREATE INDEX pages_generation_idx ON public.pages USING btree (generation)",
"pages_links_extracted_at_idx": "CREATE INDEX pages_links_extracted_at_idx ON public.pages USING btree (source_id, links_extracted_at)",
"pages_live_origin_key": "CREATE UNIQUE INDEX pages_live_origin_key ON public.pages USING btree (source_id, source_path) WHERE ((deleted_at IS NULL) AND (source_path IS NOT NULL))",
@@ -1669,6 +1712,65 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_pending_coverage": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 prefix text/text NOT NULL",
+ "3 reason text/text NOT NULL",
+ "4 revision bigint/int8 NULL",
+ "5 detail jsonb/jsonb NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_migrations": {
+ "columns": [
+ "1 id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 direction text/text NOT NULL",
+ "4 phase text/text NOT NULL",
+ "5 receipts jsonb/jsonb NOT NULL DEFAULT '{}'::jsonb",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_revisions": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 revision bigint/int8 NOT NULL",
+ "3 rules jsonb/jsonb NOT NULL",
+ "4 digest text/text NOT NULL",
+ "5 change_kind text/text NOT NULL",
+ "6 origin text/text NOT NULL",
+ "7 operation_id text/text NULL",
+ "8 proposed_by text/text NULL",
+ "9 approved_by text/text NULL",
+ "10 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "11 applied_at timestamp with time zone/timestamptz NULL",
+ "12 approved_at timestamp with time zone/timestamptz NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_policy_state": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "access_rules": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 rule_id text/text NOT NULL",
+ "3 prefix text/text NOT NULL",
+ "4 readable_by ARRAY/_text NOT NULL",
+ "5 revision bigint/int8 NOT NULL",
+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 created_by text/text NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_tokens": {
"columns": [
"1 id uuid/uuid NOT NULL DEFAULT gen_random_uuid()",
@@ -3362,7 +3464,8 @@
"52 timeline_lead text/text NULL",
"53 links_extract_failure jsonb/jsonb NULL",
"54 withheld_source_path text/text NULL",
- "55 page_readers ARRAY/_text NULL"
+ "55 page_readers ARRAY/_text NULL",
+ "56 folder_rule_ids ARRAY/_text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -4352,6 +4455,8 @@
},
"triggers": {
"access_members.access_members_mark_restricted": "CREATE TRIGGER access_members_mark_restricted AFTER INSERT ON public.access_members FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_pending_coverage.access_pending_coverage_mark_restricted": "CREATE TRIGGER access_pending_coverage_mark_restricted AFTER INSERT ON public.access_pending_coverage FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "access_rules.access_rules_mark_restricted": "CREATE TRIGGER access_rules_mark_restricted AFTER INSERT ON public.access_rules FOR EACH ROW EXECUTE FUNCTION gbrain_access_mark_restricted()",
"access_tokens.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.access_tokens DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.min_trust IS DISTINCT FROM new.min_trust)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
"config.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.config DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.key ~~ 'trust.%'::text)) EXECUTE FUNCTION gbrain_bump_trust_generation()",
@@ -4384,6 +4489,7 @@
"pages.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()",
"pages.pages_access_derive_readers": "CREATE TRIGGER pages_access_derive_readers BEFORE INSERT OR UPDATE OF frontmatter, page_readers ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_derive_page_readers()",
"pages.pages_access_mark_restricted": "CREATE TRIGGER pages_access_mark_restricted AFTER INSERT OR UPDATE OF frontmatter ON public.pages FOR EACH ROW WHEN ((new.frontmatter ? 'readable_by'::text)) EXECUTE FUNCTION gbrain_access_mark_restricted()",
+ "pages.pages_access_stamp_folder_rules": "CREATE TRIGGER pages_access_stamp_folder_rules BEFORE INSERT OR UPDATE OF slug, source_id, folder_rule_ids ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_access_stamp_folder_rules()",
"pages.pages_clear_atom_scan_state": "CREATE TRIGGER pages_clear_atom_scan_state AFTER UPDATE ON public.pages FOR EACH ROW EXECUTE FUNCTION gbrain_clear_atom_page_state()",
"pages.pages_derivation_scope_delete": "CREATE TRIGGER pages_derivation_scope_delete AFTER UPDATE OF deleted_at ON public.pages FOR EACH ROW WHEN (((old.deleted_at IS NULL) AND (new.deleted_at IS NOT NULL))) EXECUTE FUNCTION gbrain_mark_derivation_scope_entry()",
"pages.pages_forget_retrievals": "CREATE TRIGGER pages_forget_retrievals AFTER DELETE ON public.pages REFERENCING OLD TABLE AS gbrain_deleted_pages FOR EACH STATEMENT EXECUTE FUNCTION gbrain_forget_page_retrievals()",
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index 9184745a0c..6a3676a964 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -82,11 +82,15 @@
" [INFO] access_unknown_readers: Not applicable: no page names readers and no member exists.",
" [INFO] access_recent_narrowings: Not applicable: no page names readers and no member exists.",
" [INFO] access_page_readers_backfill: Not applicable: no page names readers and no member exists.",
+ " [INFO] access_policy_pending: Not applicable: no source has a folder rule.",
+ " [INFO] access_policy_widening_held: Not applicable: no source has a folder rule.",
+ " [INFO] access_policy_invalid: Not applicable: no source has a folder rule.",
+ " [INFO] access_policy_store_mismatch: Not applicable: no source has a folder rule.",
" [OK] rls: Skipped (PGLite — no PostgREST exposure, RLS not applicable)",
" [OK] function_search_path: Every gbrain function that pins a search_path ends it with pg_temp",
" [OK] schema_version: Version <latest> (latest: <latest>)",
" [OK] schema_columns: 1388 column(s) verified against live schema",
- " [OK] schema_missing_tables: All 165 table(s) the applied migrations create exist.",
+ " [OK] schema_missing_tables: All 170 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).",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index d061410d2d..cb31bfee1a 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -1078,6 +1078,42 @@
"severity": "info",
"status": "ok"
},
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_pending",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_widening_held",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_invalid",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_store_mismatch",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -1109,7 +1145,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 165 table(s) the applied migrations create exist.",
+ "message": "All 170 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 94f70e20de..b06cd9a159 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -1149,6 +1149,42 @@
"severity": "info",
"status": "ok"
},
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_pending",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_widening_held",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_invalid",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_store_mismatch",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -1180,7 +1216,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 165 table(s) the applied migrations create exist.",
+ "message": "All 170 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -6066,6 +6102,42 @@
"severity": "info",
"status": "ok"
},
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_pending",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_widening_held",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_invalid",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_store_mismatch",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -6097,7 +6169,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 165 table(s) the applied migrations create exist.",
+ "message": "All 170 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index a24f527727..848edb89c8 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -1145,10 +1145,46 @@
"severity": "info",
"status": "ok"
},
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_pending",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_widening_held",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_invalid",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_store_mismatch",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "RLS enabled on 164/164 public tables",
+ "message": "RLS enabled on 169/169 public tables",
"name": "rls",
"status": "ok"
},
@@ -1176,7 +1212,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 164 table(s) the applied migrations create exist.",
+ "message": "All 169 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -6063,10 +6099,46 @@
"severity": "info",
"status": "ok"
},
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_pending",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_widening_held",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_invalid",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "Not applicable: no source has a folder rule.",
+ "name": "access_policy_store_mismatch",
+ "readiness_state": "not_applicable",
+ "severity": "info",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "RLS enabled on 164/164 public tables",
+ "message": "RLS enabled on 169/169 public tables",
"name": "rls",
"status": "ok"
},
@@ -6094,7 +6166,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 164 table(s) the applied migrations create exist.",
+ "message": "All 169 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index 1aaa5e45d9..ee9b8f8e3e 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -1058,7 +1058,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 165 table(s) the applied migrations create exist.",
+ "message": "All 170 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index cf0cfbd7c5..6397162ac2 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -1105,7 +1105,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 165 table(s) the applied migrations create exist.",
+ "message": "All 170 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 141d01b136..5d929af4de 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -1101,7 +1101,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 164 table(s) the applied migrations create exist.",
+ "message": "All 169 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},