Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test: regenerate catalog, migration, doctor and CLI goldens after the L1b merge
garrytan29939d1e6f32
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.jsonindex 3353aed6c7..3afb427bc6 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json@@ -389,6 +389,11 @@"timeline_entries.timeline_entries_pkey": "p PRIMARY KEY (id)","timeline_entries.timeline_entries_trust_tier_check": "c CHECK ((trust_tier = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text])))","timeline_entries.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "trust_allow_rules.trust_allow_rules_pkey": "p PRIMARY KEY (id)",+ "trust_allow_rules.trust_allow_rules_reason_check": "c CHECK (((reason IS NULL) OR (length(reason) <= 500)))",+ "trust_allow_rules.trust_allow_rules_reason_family_check": "c CHECK (((reason_family IS NULL) OR (reason_family = ANY (ARRAY['override'::text, 'standing_instruction'::text, 'exfiltration'::text, 'credential'::text]))))",+ "trust_allow_rules.trust_allow_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "trust_allow_rules.trust_allow_rules_uri_prefix_check": "c CHECK (((uri_prefix IS NULL) OR ((length(uri_prefix) >= 1) AND (length(uri_prefix) <= 2048))))","trust_policy_state.trust_policy_state_id_check": "c CHECK ((id = 1))","trust_policy_state.trust_policy_state_pkey": "p PRIMARY KEY (id)","trust_proposals.trust_proposals_action_check": "c CHECK ((action = ANY (ARRAY['supersede_fact'::text, 'supersede_take'::text, 'forget'::text, 'lower_page'::text, 'confirm'::text])))",@@ -446,7 +451,7 @@"gbrain_require_persistence_protocol(required integer)": "RETURNS void kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=af07b7fac60dec0a4fe568217931ac449d32f73b3a53a047b3b02a5f59cb5058","gbrain_snapshot_version_trust()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=7452350236ed4c68a6cd1f4d78a1381a4ef44cc70e8a032141f01bba4a704702","gbrain_stamp_revision_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=d446ed1145d8bb9c93cb0ca4aa076a5dc7a5fe07b3e79518adaf1b17b0a51216",- "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=c3dbe0330bcdd42294891167e4d9cbec0902e8304ce26e934f0b124bd451bb94",+ "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e37916d28aa1c5e936f3991aef485e67aaadc38de084204b86ec3caf7928cca7","gbrain_stamp_version_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=1b28a0e5769198d86490dc20b2aee80b7e6595670428a63ac9c6825cd2a35b10","gbrain_stamp_write_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=50e9b0e5bf37eeae6555dd16c8104cb0807be6c05a79e0c82237d45162c21dc2","update_chunk_search_vector()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e12c37d5489202aaf708560db42e6c0c7c8886d198d412e1c5d915c3ae782559",@@ -831,6 +836,9 @@"timeline_entries": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "trust_allow_rules": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"trust_policy_state": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1220,6 +1228,9 @@"think_ab_results_pkey": "CREATE UNIQUE INDEX think_ab_results_pkey ON public.think_ab_results USING btree (id)","think_ab_results_recent_idx": "CREATE INDEX think_ab_results_recent_idx ON public.think_ab_results USING btree (source_id, ran_at DESC)","timeline_entries_pkey": "CREATE UNIQUE INDEX timeline_entries_pkey ON public.timeline_entries USING btree (id)",+ "trust_allow_rules_active_idx": "CREATE INDEX trust_allow_rules_active_idx ON public.trust_allow_rules USING btree (source_id) WHERE (removed_at IS NULL)",+ "trust_allow_rules_active_unique": "CREATE UNIQUE INDEX trust_allow_rules_active_unique ON public.trust_allow_rules USING btree (source_id, COALESCE(uri_prefix, ''::text), COALESCE(reason_family, ''::text)) WHERE (removed_at IS NULL)",+ "trust_allow_rules_pkey": "CREATE UNIQUE INDEX trust_allow_rules_pkey ON public.trust_allow_rules USING btree (id)","trust_policy_state_pkey": "CREATE UNIQUE INDEX trust_policy_state_pkey ON public.trust_policy_state USING btree (id)","trust_proposals_pending_idx": "CREATE INDEX trust_proposals_pending_idx ON public.trust_proposals USING btree (source_id, created_at) WHERE (status = 'pending'::text)","trust_proposals_pending_unique": "CREATE UNIQUE INDEX trust_proposals_pending_unique ON public.trust_proposals USING btree (action, target_table, target_id, COALESCE(related_table, ''::text), COALESCE(related_id, (0)::bigint)) WHERE (status = 'pending'::text)",@@ -1296,6 +1307,7 @@"takes_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=takes.id","think_ab_results_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=think_ab_results.id","timeline_entries_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=timeline_entries.id",+ "trust_allow_rules_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_allow_rules.id","trust_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_proposals.id","wanted_links_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wanted_links.id","write_gate_holds_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=write_gate_holds.id",@@ -3340,6 +3352,20 @@],"flags": "relkind=r rls=false force_rls=false"},+ "trust_allow_rules": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('trust_allow_rules_id_seq'::regclass)",+ "2 source_id text/text NOT NULL",+ "3 uri_prefix text/text NULL",+ "4 reason_family text/text NULL",+ "5 created_by text/text NOT NULL",+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "7 removed_at timestamp with time zone/timestamptz NULL",+ "8 removed_by text/text NULL",+ "9 reason text/text NULL"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"trust_policy_state": {"columns": ["1 id smallint/int2 NOT NULL",diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.jsonindex 2a6ea38d4d..5fc2566d91 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json@@ -389,6 +389,11 @@"timeline_entries.timeline_entries_pkey": "p PRIMARY KEY (id)","timeline_entries.timeline_entries_trust_tier_check": "c CHECK ((trust_tier = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text])))","timeline_entries.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "trust_allow_rules.trust_allow_rules_pkey": "p PRIMARY KEY (id)",+ "trust_allow_rules.trust_allow_rules_reason_check": "c CHECK (((reason IS NULL) OR (length(reason) <= 500)))",+ "trust_allow_rules.trust_allow_rules_reason_family_check": "c CHECK (((reason_family IS NULL) OR (reason_family = ANY (ARRAY['override'::text, 'standing_instruction'::text, 'exfiltration'::text, 'credential'::text]))))",+ "trust_allow_rules.trust_allow_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "trust_allow_rules.trust_allow_rules_uri_prefix_check": "c CHECK (((uri_prefix IS NULL) OR ((length(uri_prefix) >= 1) AND (length(uri_prefix) <= 2048))))","trust_policy_state.trust_policy_state_id_check": "c CHECK ((id = 1))","trust_policy_state.trust_policy_state_pkey": "p PRIMARY KEY (id)","trust_proposals.trust_proposals_action_check": "c CHECK ((action = ANY (ARRAY['supersede_fact'::text, 'supersede_take'::text, 'forget'::text, 'lower_page'::text, 'confirm'::text])))",@@ -446,7 +451,7 @@"gbrain_require_persistence_protocol(required integer)": "RETURNS void kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=af07b7fac60dec0a4fe568217931ac449d32f73b3a53a047b3b02a5f59cb5058","gbrain_snapshot_version_trust()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=7452350236ed4c68a6cd1f4d78a1381a4ef44cc70e8a032141f01bba4a704702","gbrain_stamp_revision_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=d446ed1145d8bb9c93cb0ca4aa076a5dc7a5fe07b3e79518adaf1b17b0a51216",- "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=c3dbe0330bcdd42294891167e4d9cbec0902e8304ce26e934f0b124bd451bb94",+ "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e37916d28aa1c5e936f3991aef485e67aaadc38de084204b86ec3caf7928cca7","gbrain_stamp_version_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=1b28a0e5769198d86490dc20b2aee80b7e6595670428a63ac9c6825cd2a35b10","gbrain_stamp_write_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=50e9b0e5bf37eeae6555dd16c8104cb0807be6c05a79e0c82237d45162c21dc2","update_chunk_search_vector()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e099e8a1d30bd74b7632b6055d3edffe753c00c00183e3bdac34d28d23347555",@@ -831,6 +836,9 @@"timeline_entries": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "trust_allow_rules": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"trust_policy_state": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1220,6 +1228,9 @@"think_ab_results_pkey": "CREATE UNIQUE INDEX think_ab_results_pkey ON public.think_ab_results USING btree (id)","think_ab_results_recent_idx": "CREATE INDEX think_ab_results_recent_idx ON public.think_ab_results USING btree (source_id, ran_at DESC)","timeline_entries_pkey": "CREATE UNIQUE INDEX timeline_entries_pkey ON public.timeline_entries USING btree (id)",+ "trust_allow_rules_active_idx": "CREATE INDEX trust_allow_rules_active_idx ON public.trust_allow_rules USING btree (source_id) WHERE (removed_at IS NULL)",+ "trust_allow_rules_active_unique": "CREATE UNIQUE INDEX trust_allow_rules_active_unique ON public.trust_allow_rules USING btree (source_id, COALESCE(uri_prefix, ''::text), COALESCE(reason_family, ''::text)) WHERE (removed_at IS NULL)",+ "trust_allow_rules_pkey": "CREATE UNIQUE INDEX trust_allow_rules_pkey ON public.trust_allow_rules USING btree (id)","trust_policy_state_pkey": "CREATE UNIQUE INDEX trust_policy_state_pkey ON public.trust_policy_state USING btree (id)","trust_proposals_pending_idx": "CREATE INDEX trust_proposals_pending_idx ON public.trust_proposals USING btree (source_id, created_at) WHERE (status = 'pending'::text)","trust_proposals_pending_unique": "CREATE UNIQUE INDEX trust_proposals_pending_unique ON public.trust_proposals USING btree (action, target_table, target_id, COALESCE(related_table, ''::text), COALESCE(related_id, (0)::bigint)) WHERE (status = 'pending'::text)",@@ -1296,6 +1307,7 @@"takes_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=takes.id","think_ab_results_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=think_ab_results.id","timeline_entries_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=timeline_entries.id",+ "trust_allow_rules_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_allow_rules.id","trust_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_proposals.id","wanted_links_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wanted_links.id","write_gate_holds_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=write_gate_holds.id",@@ -3340,6 +3352,20 @@],"flags": "relkind=r rls=false force_rls=false"},+ "trust_allow_rules": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('trust_allow_rules_id_seq'::regclass)",+ "2 source_id text/text NOT NULL",+ "3 uri_prefix text/text NULL",+ "4 reason_family text/text NULL",+ "5 created_by text/text NOT NULL",+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "7 removed_at timestamp with time zone/timestamptz NULL",+ "8 removed_by text/text NULL",+ "9 reason text/text NULL"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"trust_policy_state": {"columns": ["1 id smallint/int2 NOT NULL",diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.jsonindex 7268c179bf..e0ce66acec 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json@@ -389,6 +389,11 @@"timeline_entries.timeline_entries_pkey": "p PRIMARY KEY (id)","timeline_entries.timeline_entries_trust_tier_check": "c CHECK ((trust_tier = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text])))","timeline_entries.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "trust_allow_rules.trust_allow_rules_pkey": "p PRIMARY KEY (id)",+ "trust_allow_rules.trust_allow_rules_reason_check": "c CHECK (((reason IS NULL) OR (length(reason) <= 500)))",+ "trust_allow_rules.trust_allow_rules_reason_family_check": "c CHECK (((reason_family IS NULL) OR (reason_family = ANY (ARRAY['override'::text, 'standing_instruction'::text, 'exfiltration'::text, 'credential'::text]))))",+ "trust_allow_rules.trust_allow_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "trust_allow_rules.trust_allow_rules_uri_prefix_check": "c CHECK (((uri_prefix IS NULL) OR ((length(uri_prefix) >= 1) AND (length(uri_prefix) <= 2048))))","trust_policy_state.trust_policy_state_id_check": "c CHECK ((id = 1))","trust_policy_state.trust_policy_state_pkey": "p PRIMARY KEY (id)","trust_proposals.trust_proposals_action_check": "c CHECK ((action = ANY (ARRAY['supersede_fact'::text, 'supersede_take'::text, 'forget'::text, 'lower_page'::text, 'confirm'::text])))",@@ -446,7 +451,7 @@"gbrain_require_persistence_protocol(required integer)": "RETURNS void kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=af07b7fac60dec0a4fe568217931ac449d32f73b3a53a047b3b02a5f59cb5058","gbrain_snapshot_version_trust()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=7452350236ed4c68a6cd1f4d78a1381a4ef44cc70e8a032141f01bba4a704702","gbrain_stamp_revision_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=d446ed1145d8bb9c93cb0ca4aa076a5dc7a5fe07b3e79518adaf1b17b0a51216",- "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=c3dbe0330bcdd42294891167e4d9cbec0902e8304ce26e934f0b124bd451bb94",+ "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e37916d28aa1c5e936f3991aef485e67aaadc38de084204b86ec3caf7928cca7","gbrain_stamp_version_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=1b28a0e5769198d86490dc20b2aee80b7e6595670428a63ac9c6825cd2a35b10","gbrain_stamp_write_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=50e9b0e5bf37eeae6555dd16c8104cb0807be6c05a79e0c82237d45162c21dc2","update_chunk_search_vector()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e12c37d5489202aaf708560db42e6c0c7c8886d198d412e1c5d915c3ae782559",@@ -831,6 +836,9 @@"timeline_entries": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "trust_allow_rules": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"trust_policy_state": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1216,6 +1224,9 @@"think_ab_results_pkey": "CREATE UNIQUE INDEX think_ab_results_pkey ON public.think_ab_results USING btree (id)","think_ab_results_recent_idx": "CREATE INDEX think_ab_results_recent_idx ON public.think_ab_results USING btree (source_id, ran_at DESC)","timeline_entries_pkey": "CREATE UNIQUE INDEX timeline_entries_pkey ON public.timeline_entries USING btree (id)",+ "trust_allow_rules_active_idx": "CREATE INDEX trust_allow_rules_active_idx ON public.trust_allow_rules USING btree (source_id) WHERE (removed_at IS NULL)",+ "trust_allow_rules_active_unique": "CREATE UNIQUE INDEX trust_allow_rules_active_unique ON public.trust_allow_rules USING btree (source_id, COALESCE(uri_prefix, ''::text), COALESCE(reason_family, ''::text)) WHERE (removed_at IS NULL)",+ "trust_allow_rules_pkey": "CREATE UNIQUE INDEX trust_allow_rules_pkey ON public.trust_allow_rules USING btree (id)","trust_policy_state_pkey": "CREATE UNIQUE INDEX trust_policy_state_pkey ON public.trust_policy_state USING btree (id)","trust_proposals_pending_idx": "CREATE INDEX trust_proposals_pending_idx ON public.trust_proposals USING btree (source_id, created_at) WHERE (status = 'pending'::text)","trust_proposals_pending_unique": "CREATE UNIQUE INDEX trust_proposals_pending_unique ON public.trust_proposals USING btree (action, target_table, target_id, COALESCE(related_table, ''::text), COALESCE(related_id, (0)::bigint)) WHERE (status = 'pending'::text)",@@ -1292,6 +1303,7 @@"takes_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=takes.id","think_ab_results_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=think_ab_results.id","timeline_entries_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=timeline_entries.id",+ "trust_allow_rules_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_allow_rules.id","trust_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_proposals.id","wanted_links_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wanted_links.id","write_gate_holds_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=write_gate_holds.id",@@ -3336,6 +3348,20 @@],"flags": "relkind=r rls=false force_rls=false"},+ "trust_allow_rules": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('trust_allow_rules_id_seq'::regclass)",+ "2 source_id text/text NOT NULL",+ "3 uri_prefix text/text NULL",+ "4 reason_family text/text NULL",+ "5 created_by text/text NOT NULL",+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "7 removed_at timestamp with time zone/timestamptz NULL",+ "8 removed_by text/text NULL",+ "9 reason text/text NULL"+ ],+ "flags": "relkind=r rls=false force_rls=false"+ },"trust_policy_state": {"columns": ["1 id smallint/int2 NOT NULL",diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.jsonindex b6a19c3ca2..7e051a2c64 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json@@ -391,6 +391,11 @@"timeline_entries.timeline_entries_pkey": "p PRIMARY KEY (id)","timeline_entries.timeline_entries_trust_tier_check": "c CHECK ((trust_tier = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text])))","timeline_entries.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "trust_allow_rules.trust_allow_rules_pkey": "p PRIMARY KEY (id)",+ "trust_allow_rules.trust_allow_rules_reason_check": "c CHECK (((reason IS NULL) OR (length(reason) <= 500)))",+ "trust_allow_rules.trust_allow_rules_reason_family_check": "c CHECK (((reason_family IS NULL) OR (reason_family = ANY (ARRAY['override'::text, 'standing_instruction'::text, 'exfiltration'::text, 'credential'::text]))))",+ "trust_allow_rules.trust_allow_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "trust_allow_rules.trust_allow_rules_uri_prefix_check": "c CHECK (((uri_prefix IS NULL) OR ((length(uri_prefix) >= 1) AND (length(uri_prefix) <= 2048))))","trust_policy_state.trust_policy_state_id_check": "c CHECK ((id = 1))","trust_policy_state.trust_policy_state_pkey": "p PRIMARY KEY (id)","trust_proposals.trust_proposals_action_check": "c CHECK ((action = ANY (ARRAY['supersede_fact'::text, 'supersede_take'::text, 'forget'::text, 'lower_page'::text, 'confirm'::text])))",@@ -409,6 +414,9 @@"write_gate_holds.write_gate_holds_kind_check": "c CHECK ((kind = ANY (ARRAY['fact'::text, 'take'::text])))","write_gate_holds.write_gate_holds_pkey": "p PRIMARY KEY (id)","write_gate_holds.write_gate_holds_status_check": "c CHECK ((status = ANY (ARRAY['held'::text, 'released'::text, 'dropped'::text])))",+ "write_gate_receipts.trust_generation_delete": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "write_gate_receipts.trust_generation_insert": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "write_gate_receipts.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED","write_gate_receipts.write_gate_receipts_pkey": "p PRIMARY KEY (id)","write_gate_receipts.write_gate_receipts_target_table_check": "c CHECK ((target_table = ANY (ARRAY['pages'::text, 'facts'::text, 'takes'::text, 'timeline_entries'::text, 'write_gate_holds'::text])))","write_gate_receipts.write_gate_receipts_verdict_check": "c CHECK ((verdict = ANY (ARRAY['flag'::text, 'quarantine'::text])))"@@ -446,7 +454,7 @@"gbrain_require_persistence_protocol(required integer)": "RETURNS void kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=af07b7fac60dec0a4fe568217931ac449d32f73b3a53a047b3b02a5f59cb5058","gbrain_snapshot_version_trust()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=7452350236ed4c68a6cd1f4d78a1381a4ef44cc70e8a032141f01bba4a704702","gbrain_stamp_revision_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=d446ed1145d8bb9c93cb0ca4aa076a5dc7a5fe07b3e79518adaf1b17b0a51216",- "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=c3dbe0330bcdd42294891167e4d9cbec0902e8304ce26e934f0b124bd451bb94",+ "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e37916d28aa1c5e936f3991aef485e67aaadc38de084204b86ec3caf7928cca7","gbrain_stamp_version_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=1b28a0e5769198d86490dc20b2aee80b7e6595670428a63ac9c6825cd2a35b10","gbrain_stamp_write_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=50e9b0e5bf37eeae6555dd16c8104cb0807be6c05a79e0c82237d45162c21dc2","notify_minion_job_change()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=17f7c36408688409c80befd0a9ef9314e597d78a195418d1b94426e3d0b662f8",@@ -829,6 +837,9 @@"timeline_entries": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "trust_allow_rules": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"trust_policy_state": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1219,6 +1230,9 @@"think_ab_results_pkey": "CREATE UNIQUE INDEX think_ab_results_pkey ON public.think_ab_results USING btree (id)","think_ab_results_recent_idx": "CREATE INDEX think_ab_results_recent_idx ON public.think_ab_results USING btree (source_id, ran_at DESC)","timeline_entries_pkey": "CREATE UNIQUE INDEX timeline_entries_pkey ON public.timeline_entries USING btree (id)",+ "trust_allow_rules_active_idx": "CREATE INDEX trust_allow_rules_active_idx ON public.trust_allow_rules USING btree (source_id) WHERE (removed_at IS NULL)",+ "trust_allow_rules_active_unique": "CREATE UNIQUE INDEX trust_allow_rules_active_unique ON public.trust_allow_rules USING btree (source_id, COALESCE(uri_prefix, ''::text), COALESCE(reason_family, ''::text)) WHERE (removed_at IS NULL)",+ "trust_allow_rules_pkey": "CREATE UNIQUE INDEX trust_allow_rules_pkey ON public.trust_allow_rules USING btree (id)","trust_policy_state_pkey": "CREATE UNIQUE INDEX trust_policy_state_pkey ON public.trust_policy_state USING btree (id)","trust_proposals_pending_idx": "CREATE INDEX trust_proposals_pending_idx ON public.trust_proposals USING btree (source_id, created_at) WHERE (status = 'pending'::text)","trust_proposals_pending_unique": "CREATE UNIQUE INDEX trust_proposals_pending_unique ON public.trust_proposals USING btree (action, target_table, target_id, COALESCE(related_table, ''::text), COALESCE(related_id, (0)::bigint)) WHERE (status = 'pending'::text)",@@ -1294,6 +1308,7 @@"takes_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=takes.id","think_ab_results_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=think_ab_results.id","timeline_entries_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=timeline_entries.id",+ "trust_allow_rules_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_allow_rules.id","trust_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_proposals.id","wanted_links_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wanted_links.id","write_gate_holds_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=write_gate_holds.id",@@ -3332,6 +3347,20 @@],"flags": "relkind=r rls=true force_rls=false"},+ "trust_allow_rules": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('trust_allow_rules_id_seq'::regclass)",+ "2 source_id text/text NOT NULL",+ "3 uri_prefix text/text NULL",+ "4 reason_family text/text NULL",+ "5 created_by text/text NOT NULL",+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "7 removed_at timestamp with time zone/timestamptz NULL",+ "8 removed_by text/text NULL",+ "9 reason text/text NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"trust_policy_state": {"columns": ["1 id smallint/int2 NOT NULL",@@ -3478,7 +3507,10 @@"timeline_entries.gbrain_write_attribution": "CREATE TRIGGER gbrain_write_attribution BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_write_attribution()","timeline_entries.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()","timeline_entries.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.timeline_entries DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.trust_tier IS DISTINCT FROM new.trust_tier)) EXECUTE FUNCTION gbrain_bump_trust_generation()",- "timeline_entries.trust_tier_stamp": "CREATE TRIGGER trust_tier_stamp BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_trust_tier()"+ "timeline_entries.trust_tier_stamp": "CREATE TRIGGER trust_tier_stamp BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_trust_tier()",+ "write_gate_receipts.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN (true) EXECUTE FUNCTION gbrain_bump_trust_generation()",+ "write_gate_receipts.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN (true) EXECUTE FUNCTION gbrain_bump_trust_generation()",+ "write_gate_receipts.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((((((old.verdict IS DISTINCT FROM new.verdict) OR (old.reason_families IS DISTINCT FROM new.reason_families)) OR (old.content_hash IS DISTINCT FROM new.content_hash)) OR (old.target_table IS DISTINCT FROM new.target_table)) OR (old.target_id IS DISTINCT FROM new.target_id))) EXECUTE FUNCTION gbrain_bump_trust_generation()"},"viewColumns": {"page_links": [diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.jsonindex 1c25a74043..0acfdb4f27 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json@@ -391,6 +391,11 @@"timeline_entries.timeline_entries_pkey": "p PRIMARY KEY (id)","timeline_entries.timeline_entries_trust_tier_check": "c CHECK ((trust_tier = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text])))","timeline_entries.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "trust_allow_rules.trust_allow_rules_pkey": "p PRIMARY KEY (id)",+ "trust_allow_rules.trust_allow_rules_reason_check": "c CHECK (((reason IS NULL) OR (length(reason) <= 500)))",+ "trust_allow_rules.trust_allow_rules_reason_family_check": "c CHECK (((reason_family IS NULL) OR (reason_family = ANY (ARRAY['override'::text, 'standing_instruction'::text, 'exfiltration'::text, 'credential'::text]))))",+ "trust_allow_rules.trust_allow_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "trust_allow_rules.trust_allow_rules_uri_prefix_check": "c CHECK (((uri_prefix IS NULL) OR ((length(uri_prefix) >= 1) AND (length(uri_prefix) <= 2048))))","trust_policy_state.trust_policy_state_id_check": "c CHECK ((id = 1))","trust_policy_state.trust_policy_state_pkey": "p PRIMARY KEY (id)","trust_proposals.trust_proposals_action_check": "c CHECK ((action = ANY (ARRAY['supersede_fact'::text, 'supersede_take'::text, 'forget'::text, 'lower_page'::text, 'confirm'::text])))",@@ -409,6 +414,9 @@"write_gate_holds.write_gate_holds_kind_check": "c CHECK ((kind = ANY (ARRAY['fact'::text, 'take'::text])))","write_gate_holds.write_gate_holds_pkey": "p PRIMARY KEY (id)","write_gate_holds.write_gate_holds_status_check": "c CHECK ((status = ANY (ARRAY['held'::text, 'released'::text, 'dropped'::text])))",+ "write_gate_receipts.trust_generation_delete": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "write_gate_receipts.trust_generation_insert": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "write_gate_receipts.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED","write_gate_receipts.write_gate_receipts_pkey": "p PRIMARY KEY (id)","write_gate_receipts.write_gate_receipts_target_table_check": "c CHECK ((target_table = ANY (ARRAY['pages'::text, 'facts'::text, 'takes'::text, 'timeline_entries'::text, 'write_gate_holds'::text])))","write_gate_receipts.write_gate_receipts_verdict_check": "c CHECK ((verdict = ANY (ARRAY['flag'::text, 'quarantine'::text])))"@@ -446,7 +454,7 @@"gbrain_require_persistence_protocol(required integer)": "RETURNS void kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=af07b7fac60dec0a4fe568217931ac449d32f73b3a53a047b3b02a5f59cb5058","gbrain_snapshot_version_trust()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=7452350236ed4c68a6cd1f4d78a1381a4ef44cc70e8a032141f01bba4a704702","gbrain_stamp_revision_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=d446ed1145d8bb9c93cb0ca4aa076a5dc7a5fe07b3e79518adaf1b17b0a51216",- "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=c3dbe0330bcdd42294891167e4d9cbec0902e8304ce26e934f0b124bd451bb94",+ "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e37916d28aa1c5e936f3991aef485e67aaadc38de084204b86ec3caf7928cca7","gbrain_stamp_version_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=1b28a0e5769198d86490dc20b2aee80b7e6595670428a63ac9c6825cd2a35b10","gbrain_stamp_write_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=50e9b0e5bf37eeae6555dd16c8104cb0807be6c05a79e0c82237d45162c21dc2","notify_minion_job_change()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=17f7c36408688409c80befd0a9ef9314e597d78a195418d1b94426e3d0b662f8",@@ -829,6 +837,9 @@"timeline_entries": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "trust_allow_rules": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"trust_policy_state": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1219,6 +1230,9 @@"think_ab_results_pkey": "CREATE UNIQUE INDEX think_ab_results_pkey ON public.think_ab_results USING btree (id)","think_ab_results_recent_idx": "CREATE INDEX think_ab_results_recent_idx ON public.think_ab_results USING btree (source_id, ran_at DESC)","timeline_entries_pkey": "CREATE UNIQUE INDEX timeline_entries_pkey ON public.timeline_entries USING btree (id)",+ "trust_allow_rules_active_idx": "CREATE INDEX trust_allow_rules_active_idx ON public.trust_allow_rules USING btree (source_id) WHERE (removed_at IS NULL)",+ "trust_allow_rules_active_unique": "CREATE UNIQUE INDEX trust_allow_rules_active_unique ON public.trust_allow_rules USING btree (source_id, COALESCE(uri_prefix, ''::text), COALESCE(reason_family, ''::text)) WHERE (removed_at IS NULL)",+ "trust_allow_rules_pkey": "CREATE UNIQUE INDEX trust_allow_rules_pkey ON public.trust_allow_rules USING btree (id)","trust_policy_state_pkey": "CREATE UNIQUE INDEX trust_policy_state_pkey ON public.trust_policy_state USING btree (id)","trust_proposals_pending_idx": "CREATE INDEX trust_proposals_pending_idx ON public.trust_proposals USING btree (source_id, created_at) WHERE (status = 'pending'::text)","trust_proposals_pending_unique": "CREATE UNIQUE INDEX trust_proposals_pending_unique ON public.trust_proposals USING btree (action, target_table, target_id, COALESCE(related_table, ''::text), COALESCE(related_id, (0)::bigint)) WHERE (status = 'pending'::text)",@@ -1294,6 +1308,7 @@"takes_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=takes.id","think_ab_results_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=think_ab_results.id","timeline_entries_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=timeline_entries.id",+ "trust_allow_rules_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_allow_rules.id","trust_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_proposals.id","wanted_links_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wanted_links.id","write_gate_holds_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=write_gate_holds.id",@@ -3332,6 +3347,20 @@],"flags": "relkind=r rls=true force_rls=false"},+ "trust_allow_rules": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('trust_allow_rules_id_seq'::regclass)",+ "2 source_id text/text NOT NULL",+ "3 uri_prefix text/text NULL",+ "4 reason_family text/text NULL",+ "5 created_by text/text NOT NULL",+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "7 removed_at timestamp with time zone/timestamptz NULL",+ "8 removed_by text/text NULL",+ "9 reason text/text NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"trust_policy_state": {"columns": ["1 id smallint/int2 NOT NULL",@@ -3478,7 +3507,10 @@"timeline_entries.gbrain_write_attribution": "CREATE TRIGGER gbrain_write_attribution BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_write_attribution()","timeline_entries.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()","timeline_entries.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.timeline_entries DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.trust_tier IS DISTINCT FROM new.trust_tier)) EXECUTE FUNCTION gbrain_bump_trust_generation()",- "timeline_entries.trust_tier_stamp": "CREATE TRIGGER trust_tier_stamp BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_trust_tier()"+ "timeline_entries.trust_tier_stamp": "CREATE TRIGGER trust_tier_stamp BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_trust_tier()",+ "write_gate_receipts.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN (true) EXECUTE FUNCTION gbrain_bump_trust_generation()",+ "write_gate_receipts.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN (true) EXECUTE FUNCTION gbrain_bump_trust_generation()",+ "write_gate_receipts.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((((((old.verdict IS DISTINCT FROM new.verdict) OR (old.reason_families IS DISTINCT FROM new.reason_families)) OR (old.content_hash IS DISTINCT FROM new.content_hash)) OR (old.target_table IS DISTINCT FROM new.target_table)) OR (old.target_id IS DISTINCT FROM new.target_id))) EXECUTE FUNCTION gbrain_bump_trust_generation()"},"viewColumns": {"page_links": [diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.jsonindex 7ea7675f43..95f6637d05 100644--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json@@ -391,6 +391,11 @@"timeline_entries.timeline_entries_pkey": "p PRIMARY KEY (id)","timeline_entries.timeline_entries_trust_tier_check": "c CHECK ((trust_tier = ANY (ARRAY['user_confirmed'::text, 'operator_curated'::text, 'tool_observed'::text, 'agent_written'::text, 'unknown'::text, 'external_untrusted'::text])))","timeline_entries.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "trust_allow_rules.trust_allow_rules_pkey": "p PRIMARY KEY (id)",+ "trust_allow_rules.trust_allow_rules_reason_check": "c CHECK (((reason IS NULL) OR (length(reason) <= 500)))",+ "trust_allow_rules.trust_allow_rules_reason_family_check": "c CHECK (((reason_family IS NULL) OR (reason_family = ANY (ARRAY['override'::text, 'standing_instruction'::text, 'exfiltration'::text, 'credential'::text]))))",+ "trust_allow_rules.trust_allow_rules_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",+ "trust_allow_rules.trust_allow_rules_uri_prefix_check": "c CHECK (((uri_prefix IS NULL) OR ((length(uri_prefix) >= 1) AND (length(uri_prefix) <= 2048))))","trust_policy_state.trust_policy_state_id_check": "c CHECK ((id = 1))","trust_policy_state.trust_policy_state_pkey": "p PRIMARY KEY (id)","trust_proposals.trust_proposals_action_check": "c CHECK ((action = ANY (ARRAY['supersede_fact'::text, 'supersede_take'::text, 'forget'::text, 'lower_page'::text, 'confirm'::text])))",@@ -409,6 +414,9 @@"write_gate_holds.write_gate_holds_kind_check": "c CHECK ((kind = ANY (ARRAY['fact'::text, 'take'::text])))","write_gate_holds.write_gate_holds_pkey": "p PRIMARY KEY (id)","write_gate_holds.write_gate_holds_status_check": "c CHECK ((status = ANY (ARRAY['held'::text, 'released'::text, 'dropped'::text])))",+ "write_gate_receipts.trust_generation_delete": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "write_gate_receipts.trust_generation_insert": "t TRIGGER DEFERRABLE INITIALLY DEFERRED",+ "write_gate_receipts.trust_generation_update": "t TRIGGER DEFERRABLE INITIALLY DEFERRED","write_gate_receipts.write_gate_receipts_pkey": "p PRIMARY KEY (id)","write_gate_receipts.write_gate_receipts_target_table_check": "c CHECK ((target_table = ANY (ARRAY['pages'::text, 'facts'::text, 'takes'::text, 'timeline_entries'::text, 'write_gate_holds'::text])))","write_gate_receipts.write_gate_receipts_verdict_check": "c CHECK ((verdict = ANY (ARRAY['flag'::text, 'quarantine'::text])))"@@ -446,7 +454,7 @@"gbrain_require_persistence_protocol(required integer)": "RETURNS void kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=af07b7fac60dec0a4fe568217931ac449d32f73b3a53a047b3b02a5f59cb5058","gbrain_snapshot_version_trust()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=7452350236ed4c68a6cd1f4d78a1381a4ef44cc70e8a032141f01bba4a704702","gbrain_stamp_revision_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=d446ed1145d8bb9c93cb0ca4aa076a5dc7a5fe07b3e79518adaf1b17b0a51216",- "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=c3dbe0330bcdd42294891167e4d9cbec0902e8304ce26e934f0b124bd451bb94",+ "gbrain_stamp_trust_tier()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=e37916d28aa1c5e936f3991aef485e67aaadc38de084204b86ec3caf7928cca7","gbrain_stamp_version_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=1b28a0e5769198d86490dc20b2aee80b7e6595670428a63ac9c6825cd2a35b10","gbrain_stamp_write_attribution()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=50e9b0e5bf37eeae6555dd16c8104cb0807be6c05a79e0c82237d45162c21dc2","notify_minion_job_change()": "RETURNS trigger kind=f lang=plpgsql volatility=v secdef=false config=[search_path=pg_catalog, public] body_sha256=17f7c36408688409c80befd0a9ef9314e597d78a195418d1b94426e3d0b662f8",@@ -829,6 +837,9 @@"timeline_entries": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "trust_allow_rules": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"trust_policy_state": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1215,6 +1226,9 @@"think_ab_results_pkey": "CREATE UNIQUE INDEX think_ab_results_pkey ON public.think_ab_results USING btree (id)","think_ab_results_recent_idx": "CREATE INDEX think_ab_results_recent_idx ON public.think_ab_results USING btree (source_id, ran_at DESC)","timeline_entries_pkey": "CREATE UNIQUE INDEX timeline_entries_pkey ON public.timeline_entries USING btree (id)",+ "trust_allow_rules_active_idx": "CREATE INDEX trust_allow_rules_active_idx ON public.trust_allow_rules USING btree (source_id) WHERE (removed_at IS NULL)",+ "trust_allow_rules_active_unique": "CREATE UNIQUE INDEX trust_allow_rules_active_unique ON public.trust_allow_rules USING btree (source_id, COALESCE(uri_prefix, ''::text), COALESCE(reason_family, ''::text)) WHERE (removed_at IS NULL)",+ "trust_allow_rules_pkey": "CREATE UNIQUE INDEX trust_allow_rules_pkey ON public.trust_allow_rules USING btree (id)","trust_policy_state_pkey": "CREATE UNIQUE INDEX trust_policy_state_pkey ON public.trust_policy_state USING btree (id)","trust_proposals_pending_idx": "CREATE INDEX trust_proposals_pending_idx ON public.trust_proposals USING btree (source_id, created_at) WHERE (status = 'pending'::text)","trust_proposals_pending_unique": "CREATE UNIQUE INDEX trust_proposals_pending_unique ON public.trust_proposals USING btree (action, target_table, target_id, COALESCE(related_table, ''::text), COALESCE(related_id, (0)::bigint)) WHERE (status = 'pending'::text)",@@ -1290,6 +1304,7 @@"takes_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=takes.id","think_ab_results_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=think_ab_results.id","timeline_entries_id_seq": "integer start=1 min=1 max=2147483647 increment=1 cycle=false cache=1 owned_by=timeline_entries.id",+ "trust_allow_rules_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_allow_rules.id","trust_proposals_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=trust_proposals.id","wanted_links_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wanted_links.id","write_gate_holds_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=write_gate_holds.id",@@ -3328,6 +3343,20 @@],"flags": "relkind=r rls=true force_rls=false"},+ "trust_allow_rules": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('trust_allow_rules_id_seq'::regclass)",+ "2 source_id text/text NOT NULL",+ "3 uri_prefix text/text NULL",+ "4 reason_family text/text NULL",+ "5 created_by text/text NOT NULL",+ "6 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "7 removed_at timestamp with time zone/timestamptz NULL",+ "8 removed_by text/text NULL",+ "9 reason text/text NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"trust_policy_state": {"columns": ["1 id smallint/int2 NOT NULL",@@ -3474,7 +3503,10 @@"timeline_entries.gbrain_write_attribution": "CREATE TRIGGER gbrain_write_attribution BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_write_attribution()","timeline_entries.managed_writer_guard": "CREATE TRIGGER managed_writer_guard BEFORE INSERT OR DELETE OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_require_managed_writer()","timeline_entries.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.timeline_entries DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((old.trust_tier IS DISTINCT FROM new.trust_tier)) EXECUTE FUNCTION gbrain_bump_trust_generation()",- "timeline_entries.trust_tier_stamp": "CREATE TRIGGER trust_tier_stamp BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_trust_tier()"+ "timeline_entries.trust_tier_stamp": "CREATE TRIGGER trust_tier_stamp BEFORE INSERT OR UPDATE ON public.timeline_entries FOR EACH ROW EXECUTE FUNCTION gbrain_stamp_trust_tier()",+ "write_gate_receipts.trust_generation_delete": "CREATE CONSTRAINT TRIGGER trust_generation_delete AFTER DELETE ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN (true) EXECUTE FUNCTION gbrain_bump_trust_generation()",+ "write_gate_receipts.trust_generation_insert": "CREATE CONSTRAINT TRIGGER trust_generation_insert AFTER INSERT ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN (true) EXECUTE FUNCTION gbrain_bump_trust_generation()",+ "write_gate_receipts.trust_generation_update": "CREATE CONSTRAINT TRIGGER trust_generation_update AFTER UPDATE ON public.write_gate_receipts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((((((old.verdict IS DISTINCT FROM new.verdict) OR (old.reason_families IS DISTINCT FROM new.reason_families)) OR (old.content_hash IS DISTINCT FROM new.content_hash)) OR (old.target_table IS DISTINCT FROM new.target_table)) OR (old.target_id IS DISTINCT FROM new.target_id))) EXECUTE FUNCTION gbrain_bump_trust_generation()"},"viewColumns": {"page_links": [diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.jsonindex adbeeb949e..d20b534c47 100644--- a/test/fixtures/goldens/cli/tools-json.json+++ b/test/fixtures/goldens/cli/tools-json.json@@ -2,8 +2,8 @@"golden": {"exitCode": 0,"stderr": "",- "stdoutBytes": 219437,- "stdoutSha256": "d51f1094ade15139c8afd64979b53cbc2f9e410136aa62c9f073637c74db6c40",+ "stdoutBytes": 221372,+ "stdoutSha256": "a78d3ddbcb7d9c24c3ad271be60e2ed6e01c0d0f5ee05ed9f365c3a59e915599","toolNames": ["remember","entity",@@ -51,6 +51,7 @@"get_brain_identity","quarantine_list","get_write_attribution",+ "confirm_memory","list_skills","get_skill","list_brain_skillpack",@@ -178,6 +179,7 @@"mutating": true,"name": "remember","parameters": {+ "content_origin": "string?","entity": "string?","expected_revision": "string?","fact": "string?",@@ -195,6 +197,15 @@"required_scopes": [],"schema": {"properties": {+ "content_origin": {+ "description": "Where the content came from: user_said, tool_output (web page, email, file or other tool text: stored as untrusted), inferred. Set it.",+ "enum": [+ "user_said",+ "tool_output",+ "inferred"+ ],+ "type": "string"+ },"entity": {"description": "Subject (name or slug).","type": "string"@@ -445,6 +456,7 @@"parameters": {"allow_empty": "boolean?","content": "string",+ "content_origin": "string?","drop_timeline": "boolean?","expected_revision": "string?","force": "boolean?",@@ -467,6 +479,15 @@"description": "Complete markdown (get_page include_content:true).","type": "string"},+ "content_origin": {+ "description": "Where the content came from: user_said, tool_output (web page, email, file or other tool text: stored as untrusted), inferred. Set it.",+ "enum": [+ "user_said",+ "tool_output",+ "inferred"+ ],+ "type": "string"+ },"drop_timeline": {"description": "No Timeline in content: delete its entries.","type": "boolean"@@ -712,6 +733,7 @@"name": "capture","parameters": {"content": "string",+ "content_origin": "string?","depth": "string?","expected_revision": "string?","force": "boolean?",@@ -732,6 +754,15 @@"description": "Markdown or text (not a file path).","type": "string"},+ "content_origin": {+ "description": "Where the content came from: user_said, tool_output (web page, email, file or other tool text: stored as untrusted), inferred. Set it.",+ "enum": [+ "user_said",+ "tool_output",+ "inferred"+ ],+ "type": "string"+ },"depth": {"description": "Event depth page to link.","type": "string"@@ -2384,6 +2415,30 @@},"scope": "admin"},+ {+ "description": "Owner only: mark a fact, take or page as confirmed by the user (trust tier user_confirmed). Needs a connection the user granted memory_confirm on the brain host; agent connections are refused with a command for the user to run. Never call this on your own judgment: confirm only what the user explicitly confirmed.",+ "idempotent": true,+ "local_only": false,+ "mutating": true,+ "name": "confirm_memory",+ "parameters": {+ "ref": "string"+ },+ "required_scopes": [],+ "schema": {+ "properties": {+ "ref": {+ "description": "What to confirm: f<id> (fact), t<id> (take) or p:<source>/<slug> (page).",+ "type": "string"+ }+ },+ "required": [+ "ref"+ ],+ "type": "object"+ },+ "scope": "write"+ },{"description": "Skills: prose instruction sets (NOT executable code) for tasks with this server's tools, with triggers, usable_tools and unavailable_tools. Use one via get_skill.","idempotent": true,diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex 56a7fc102f..670a10acab 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -502,7 +502,7 @@},{"category": "ops",- "message": "RLS enabled on 121/121 public tables",+ "message": "RLS enabled on 130/130 public tables","name": "rls","status": "ok"},@@ -514,7 +514,7 @@},{"category": "meta",- "message": "992 column(s) verified against live schema",+ "message": "1055 column(s) verified against live schema","name": "schema_columns","status": "ok"},@@ -1824,6 +1824,23 @@"name": "trust_tiers","status": "ok"},+ {+ "category": "brain",+ "details": {+ "completed_at": null,+ "detector_version": 1,+ "total_unscanned": 0,+ "unscanned": {+ "facts": 0,+ "pages": 0,+ "takes": 0,+ "timeline_entries": 0+ }+ },+ "message": "Every agent-written or lower row has been scanned by the current write-gate detector; proactive suppression covers them.",+ "name": "trust_scan",+ "status": "ok"+ },{"category": "brain","details": {diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.jsonindex a0dae38a71..4abc4c6038 100644--- a/test/fixtures/goldens/exports/types.json+++ b/test/fixtures/goldens/exports/types.json@@ -21,11 +21,13 @@"members": ["excludePrivate?: boolean | undefined","lookback_days?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sigma?: number | undefined","since?: string | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "AnomaliesOpts"},@@ -152,7 +154,7 @@"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>","listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>","listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",- "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: FactVisibility[]; }) => Promise<FactRow[]>",+ "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: FactVisibility[]; eligibility?: FactListOpts[\"eligibility\"]; }) => Promise<FactRow[]>","listTakes: (opts?: TakesListOpts) => Promise<Take[]>","loadContradictionsTrend: (days: number) => Promise<Array<{ run_id: string; ran_at: string; judge_model: string; queries_evaluated: number; queries_with_contradiction: number; total_contradictions_flagged: number; wilson_ci_lower: number; wilson_ci_upper: number; judge_errors_total: number; cost_usd_total: number; duration_ms: number; source_tier_breakdown: Record<string, unknown>; report_json: Record<string, unknown>; }>>","lockPageKeys: (keys: readonly PageKey[]) => Promise<void>",@@ -191,8 +193,8 @@"runMigration: (version: number, sql: string) => Promise<void>","searchKeyword: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchKeywordChunks: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",- "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; }) => Promise<TakeHit[]>",- "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; }) => Promise<TakeHit[]>",+ "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",+ "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>","searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>","setConfig: (key: string, value: string) => Promise<void>",@@ -304,12 +306,14 @@"degreeLinkTypes: string[]","excludePrivate?: boolean | undefined","linkTypes: string[]",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","neighborCap: number","objectTypes: string[]","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined","subjectTypes: string[]",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined","temporal?: EdgeTemporalOpts | undefined","toward: \"object\" | \"subject\""@@ -322,9 +326,11 @@"excludePrivate?: boolean | undefined","kind?: string | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","week?: boolean | undefined"],"name": "ChronicleTimelineOpts"@@ -670,9 +676,11 @@"members": ["excludePrivate?: boolean | undefined","includeDeleted?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "GetPageOpts"},@@ -837,9 +845,11 @@"excludePrivate?: boolean | undefined","includeQuarantined?: boolean | undefined","minConfidence?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","visibility?: (\"private\" | \"world\")[] | undefined"],"name": "OntologyReadOpts"@@ -953,9 +963,11 @@"kind": "interface","members": ["excludePrivate?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined"],"name": "PageReadPolicy"@@ -964,9 +976,11 @@"kind": "interface","members": ["excludePrivate?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "PageReadScope"},@@ -1101,7 +1115,7 @@"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>","listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>","listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",- "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: (\"private\" | \"world\")[]; }) => Promise<FactRow[]>",+ "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: (\"private\" | \"world\")[]; eligibility?: FactListOpts[\"eligibility\"]; }) => Promise<FactRow[]>","listTakes: (opts?: TakesListOpts) => Promise<Take[]>","loadContradictionsTrend: (days: number) => Promise<Array<{ run_id: string; ran_at: string; judge_model: string; queries_evaluated: number; queries_with_contradiction: number; total_contradictions_flagged: number; wilson_ci_lower: number; wilson_ci_upper: number; judge_errors_total: number; cost_usd_total: number; duration_ms: number; source_tier_breakdown: Record<string, unknown>; report_json: Record<string, unknown>; }>>","lockPageKeys: (keys: readonly PageKey[]) => Promise<void>",@@ -1174,8 +1188,8 @@"runMigration: (_version: number, sqlStr: string) => Promise<void>","searchKeyword: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchKeywordChunks: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",- "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; }) => Promise<TakeHit[]>",- "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; }) => Promise<TakeHit[]>",+ "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",+ "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>","searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>","setConfig: (key: string, value: string) => Promise<void>",@@ -1248,10 +1262,12 @@"includeMentions?: boolean | undefined","limit?: number | undefined","linkTypes?: string[] | null | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","seedRefs?: { source_id: string; slug: string; }[] | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined","temporal?: EdgeTemporalOpts | undefined"],@@ -1297,11 +1313,13 @@"days?: number | undefined","excludePrivate?: boolean | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","recency_bias?: \"flat\" | \"on\" | undefined","requireSafeChunks?: boolean | undefined","slugPrefix?: string | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined"],"name": "SalienceOpts"@@ -1344,6 +1362,7 @@"intentWeighting?: boolean | undefined","language?: string | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","nearSymbol?: string | undefined","offset?: number | undefined","onVectorPoolMeta?: ((m: VectorPoolMeta) => void) | undefined",@@ -1363,6 +1382,7 @@"sourceId?: string | undefined","sourceIds?: string[] | undefined","source_boosts?: Record<string, number> | undefined",+ "suppressFlagged?: boolean | undefined","symbolKind?: string | undefined","takesHoldersAllowList?: string[] | undefined","tokenBudget?: number | undefined",@@ -1413,6 +1433,7 @@"keyword_relaxed?: boolean | undefined","message_id?: string | undefined","modality?: \"image\" | \"text\" | undefined",+ "origin?: string | undefined","page_id: number","recency_boost?: number | undefined","relational?: RelationalEvidence | undefined",@@ -1441,7 +1462,9 @@"thread_id?: string | undefined","title: string","title_match_boost?: number | undefined",+ "trust_tier?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","type: string",+ "unconfirmed?: true | undefined","unverified?: boolean | undefined"],"name": "SearchResult"@@ -1504,11 +1527,14 @@"members": ["after?: string | undefined","before?: string | undefined",+ "eligibility?: ReadEligibility | undefined","excludePrivate?: boolean | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "TimelineOpts"},@@ -3300,7 +3326,7 @@"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>","listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>","listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",- "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: FactVisibility[]; }) => Promise<FactRow[]>",+ "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: FactVisibility[]; eligibility?: FactListOpts[\"eligibility\"]; }) => Promise<FactRow[]>","listTakes: (opts?: TakesListOpts) => Promise<Take[]>","loadContradictionsTrend: (days: number) => Promise<Array<{ run_id: string; ran_at: string; judge_model: string; queries_evaluated: number; queries_with_contradiction: number; total_contradictions_flagged: number; wilson_ci_lower: number; wilson_ci_upper: number; judge_errors_total: number; cost_usd_total: number; duration_ms: number; source_tier_breakdown: Record<string, unknown>; report_json: Record<string, unknown>; }>>","lockPageKeys: (keys: readonly PageKey[]) => Promise<void>",@@ -3339,8 +3365,8 @@"runMigration: (version: number, sql: string) => Promise<void>","searchKeyword: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchKeywordChunks: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",- "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; }) => Promise<TakeHit[]>",- "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; }) => Promise<TakeHit[]>",+ "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",+ "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; sourceId?: string; sourceIds?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>","searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>","setConfig: (key: string, value: string) => Promise<void>",@@ -3389,9 +3415,11 @@"bucketSize?: number | undefined","excludePrivate?: boolean | undefined","holder?: string | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "CalibrationCurveOpts"},@@ -3456,6 +3484,7 @@"kind": "interface","members": ["activeOnly?: boolean | undefined",+ "eligibility?: ReadEligibility | undefined","eventTime?: boolean | undefined","excludeAuditRows?: boolean | undefined","fingerprint?: boolean | undefined",@@ -3493,9 +3522,11 @@"source_id: string","source_session: string | null","superseded_by: number | null",+ "trust_tier?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","valid_from: Date","valid_until: Date | null",- "visibility: FactVisibility"+ "visibility: FactVisibility",+ "write_origin?: Record<string, unknown> | null | undefined"],"name": "FactRow"},@@ -3637,13 +3668,15 @@"members": ["excludePrivate?: boolean | undefined","includeDeleted?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","preserveExactIdentity?: boolean | undefined","requireLiveSource?: boolean | undefined","requireSafeChunks?: boolean | undefined","requireUnambiguous?: boolean | undefined","resolveAlias?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "PageSnapshotOptions"},@@ -3814,10 +3847,12 @@"kind": "interface","members": ["active?: boolean | undefined",+ "eligibility?: ReadEligibility | undefined","excludePrivate?: boolean | undefined","holder?: string | undefined","kind?: string | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","offset?: number | undefined","page_id?: number | undefined","page_slug?: string | undefined",@@ -3826,6 +3861,7 @@"sortBy?: \"weight\" | \"since_date\" | \"created_at\" | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined"],"name": "TakesListOpts"@@ -3852,10 +3888,12 @@"domainPrefix?: string | undefined","excludePrivate?: boolean | undefined","holder?: string | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","since?: string | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","until?: string | undefined"],"name": "TakesScorecardOpts"@@ -3909,9 +3947,11 @@"members": ["excludePrivate?: boolean | undefined","frontierCap?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","temporal?: EdgeTemporalOpts | undefined"],"name": "TraverseGraphOpts"@@ -5758,7 +5798,7 @@"grantRevision?: number | undefined","hasSourceGrant?: boolean | undefined","issuedScopes?: string[] | undefined",- "minTrust?: \"unknown\" | \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"external_untrusted\" | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","principal?: { kind: \"oauth_client\" | \"legacy_token\"; id: string; } | undefined","scopes: string[]","sourceActive?: boolean | undefined",@@ -6174,7 +6214,7 @@"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>","listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>","listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",- "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: (\"private\" | \"world\")[]; }) => Promise<FactRow[]>",+ "listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: (\"private\" | \"world\")[]; eligibility?: FactListOpts[\"eligibility\"]; }) => Promise<FactRow[]>","listTakes: (opts?: TakesListOpts) => Promise<Take[]>","loadContradictionsTrend: (days: number) => Promise<Array<{ run_id: string; ran_at: string; judge_model: string; queries_evaluated: number; queries_with_contradiction: number; total_contradictions_flagged: number; wilson_ci_lower: number; wilson_ci_upper: number; judge_errors_total: number; cost_usd_total: number; duration_ms: number; source_tier_breakdown: Record<string, unknown>; report_json: Record<string, unknown>; }>>","lockPageKeys: (keys: readonly PageKey[]) => Promise<void>",@@ -6244,8 +6284,8 @@"runMigration: (_version: number, sql: string) => Promise<void>","searchKeyword: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchKeywordChunks: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>",- "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; }) => Promise<TakeHit[]>",- "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; }) => Promise<TakeHit[]>",+ "searchTakes: (query: string, opts?: SearchOpts & { takesHoldersAllowList?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>",+ "searchTakesVector: (embedding: Float32Array, opts?: SearchOpts & { takesHoldersAllowList?: string[]; eligibility?: ReadEligibility; }) => Promise<TakeHit[]>","searchTitles: (query: string, opts?: SearchOpts) => Promise<SearchResult[]>","searchVector: (embedding: Float32Array, opts?: SearchOpts) => Promise<SearchResult[]>","setConfig: (key: string, value: string) => Promise<void>",@@ -6565,7 +6605,7 @@"kind": "interface","members": ["budget_tokens?: number | undefined",- "caller?: { remote?: boolean; sourceId?: string; sourceIds?: string[]; excludePrivate?: boolean; } | undefined",+ "caller?: { remote?: boolean; sourceId?: string; sourceIds?: string[]; excludePrivate?: boolean; minTrust?: TrustTier; } | undefined","detail?: \"low\" | \"medium\" | \"high\" | undefined","hits: FrozenHit[]","return_unit: \"auto\" | \"chunk\" | \"window\" | \"section\" | \"page\"",@@ -6671,9 +6711,11 @@"members": ["detail?: \"low\" | \"medium\" | \"high\" | undefined","excludePrivate?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "DeliveryScope"},@@ -6902,7 +6944,7 @@"kind": "function","name": "pageEvidenceText","signature": [- "(page: { compiled_truth: string; timeline: string; }, includeTimeline: boolean) => { text: string; timelineAt: number; }"+ "(page: { compiled_truth: string; timeline: string; fenceOverlay?: FenceChunkOverlay; }, includeTimeline: boolean) => { text: string; timelineAt: number; }"]},{@@ -7031,6 +7073,7 @@"language?: string | undefined","limit?: number | undefined","metadataBoostGate?: MetadataBoostGate | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","mode?: string | undefined","nearSymbol?: string | undefined","offset?: number | undefined",@@ -7056,6 +7099,7 @@"sourceId?: string | undefined","sourceIds?: string[] | undefined","source_boosts?: Record<string, number> | undefined",+ "suppressFlagged?: boolean | undefined","symbolKind?: string | undefined","takesHoldersAllowList?: string[] | undefined","tokenBudget?: number | undefined",@@ -7096,6 +7140,7 @@"fallback?: RecencyDecayConfig | undefined","floorRatio?: number | undefined","graphSignalsEnabled?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","onGraphMeta?: ((meta: GraphSignalsMeta) => void) | undefined","onScoreDistribution?: ((dist: ScoreDistribution) => void) | undefined","query?: string | undefined",@@ -7105,6 +7150,7 @@"skipMetadataBoosts?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined","titleBoost?: number | undefined"],@@ -7581,11 +7627,13 @@"members": ["excludePrivate?: boolean | undefined","lookback_days?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sigma?: number | undefined","since?: string | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "AnomaliesOpts"},@@ -7689,12 +7737,14 @@"degreeLinkTypes: string[]","excludePrivate?: boolean | undefined","linkTypes: string[]",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","neighborCap: number","objectTypes: string[]","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined","subjectTypes: string[]",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined","temporal?: EdgeTemporalOpts | undefined","toward: \"object\" | \"subject\""@@ -7707,9 +7757,11 @@"excludePrivate?: boolean | undefined","kind?: string | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","week?: boolean | undefined"],"name": "ChronicleTimelineOpts"@@ -8055,9 +8107,11 @@"members": ["excludePrivate?: boolean | undefined","includeDeleted?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "GetPageOpts"},@@ -8222,9 +8276,11 @@"excludePrivate?: boolean | undefined","includeQuarantined?: boolean | undefined","minConfidence?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","visibility?: (\"private\" | \"world\")[] | undefined"],"name": "OntologyReadOpts"@@ -8338,9 +8394,11 @@"kind": "interface","members": ["excludePrivate?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined"],"name": "PageReadPolicy"@@ -8349,9 +8407,11 @@"kind": "interface","members": ["excludePrivate?: boolean | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "PageReadScope"},@@ -8416,10 +8476,12 @@"includeMentions?: boolean | undefined","limit?: number | undefined","linkTypes?: string[] | null | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","seedRefs?: { source_id: string; slug: string; }[] | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined","temporal?: EdgeTemporalOpts | undefined"],@@ -8465,11 +8527,13 @@"days?: number | undefined","excludePrivate?: boolean | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","recency_bias?: \"flat\" | \"on\" | undefined","requireSafeChunks?: boolean | undefined","slugPrefix?: string | undefined","sourceId?: string | undefined","sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined","takesHoldersAllowList?: string[] | undefined"],"name": "SalienceOpts"@@ -8512,6 +8576,7 @@"intentWeighting?: boolean | undefined","language?: string | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","nearSymbol?: string | undefined","offset?: number | undefined","onVectorPoolMeta?: ((m: VectorPoolMeta) => void) | undefined",@@ -8531,6 +8596,7 @@"sourceId?: string | undefined","sourceIds?: string[] | undefined","source_boosts?: Record<string, number> | undefined",+ "suppressFlagged?: boolean | undefined","symbolKind?: string | undefined","takesHoldersAllowList?: string[] | undefined","tokenBudget?: number | undefined",@@ -8581,6 +8647,7 @@"keyword_relaxed?: boolean | undefined","message_id?: string | undefined","modality?: \"image\" | \"text\" | undefined",+ "origin?: string | undefined","page_id: number","recency_boost?: number | undefined","relational?: RelationalEvidence | undefined",@@ -8609,7 +8676,9 @@"thread_id?: string | undefined","title: string","title_match_boost?: number | undefined",+ "trust_tier?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","type: string",+ "unconfirmed?: true | undefined","unverified?: boolean | undefined"],"name": "SearchResult"@@ -8672,11 +8741,14 @@"members": ["after?: string | undefined","before?: string | undefined",+ "eligibility?: ReadEligibility | undefined","excludePrivate?: boolean | undefined","limit?: number | undefined",+ "minTrust?: \"user_confirmed\" | \"operator_curated\" | \"tool_observed\" | \"agent_written\" | \"unknown\" | \"external_untrusted\" | undefined","requireSafeChunks?: boolean | undefined","sourceId?: string | undefined",- "sourceIds?: string[] | undefined"+ "sourceIds?: string[] | undefined",+ "suppressFlagged?: boolean | undefined"],"name": "TimelineOpts"},diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.jsonindex 68d7cea1aa..5a8c9f5ca8 100644--- a/test/fixtures/goldens/migrations/records.json+++ b/test/fixtures/goldens/migrations/records.json@@ -1,6 +1,6 @@{"golden": {- "count": 218,+ "count": 219,"gaps": [17,18,@@ -15,8 +15,7 @@226,227,228,- 229,- 233+ 229],"helpers": {"ALIAS_TABLES": "cddd37c636af42d862c08ca7754a57dfe9d12576b769fa8f74a5f02c803f67a0",@@ -3271,8 +3270,8 @@"idempotent": true,"name": "trust_tiers","sql": {- "length": 20422,- "sha256": "b3e7750c08d970c587250a270434dc4e2ac54e3568240b58b9ecc2c4d0168cd9"+ "length": 20566,+ "sha256": "115fa2a9d77328902790fa9bd7a0c611f904cdb542b7ee19481d0954dc6d8bad"},"sqlFor": "absent","transaction": "absent",@@ -3305,6 +3304,19 @@"verify": "absent","version": 232},+ {+ "handler": "absent",+ "idempotent": true,+ "name": "trust_allow_rules",+ "sql": {+ "length": 889,+ "sha256": "6c71ed5e5a86cb2b06ecf4430d6568fa32dcf89c2fa5fffa9a40dc694304ae5c"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",+ "version": 233+ },{"handler": "absent","idempotent": true,@@ -3537,6 +3549,7 @@230,231,232,+ 233,234]},diff --git a/test/fixtures/goldens/sql-text/facts.json b/test/fixtures/goldens/sql-text/facts.jsonindex e273b6910e..4918ebb643 100644--- a/test/fixtures/goldens/sql-text/facts.json+++ b/test/fixtures/goldens/sql-text/facts.json@@ -574,7 +574,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND entity_slug = $2 AND consolidated_at IS NULL AND kind = ANY($3::text[]) AND visibility = ANY($4::text[]) AND source != ALL($5::text[]) AND fact ILIKE $6 ESCAPE '\\' ORDER BY valid_from DESC, id DESC LIMIT $7 OFFSET $8",- "textSha256": "be494a6935e25722d68ceaee7a2d67aa12a45b886a5154165e73c8be1f06e461"+ "textSha256": "c5f3f63210603247370f2801d42d47410b2051d13ff8e1b4aef4e6eaea721e60"}],"default": [@@ -587,7 +587,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND entity_slug = $2 AND expired_at IS NULL AND (valid_until IS NULL OR valid_until > now()) ORDER BY valid_from DESC, id DESC LIMIT $3 OFFSET $4",- "textSha256": "f480c85f5b2b56d825347ae4812946eb71fcb8730bb4eb23655c538dab8e0b2e"+ "textSha256": "6ec4921a6e59a0e9e87892e6ccdf71fd754a7d9f090ff984612965f03d358720"}]},@@ -606,7 +606,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND source_session = $2 AND consolidated_at IS NULL AND kind = ANY($3::text[]) AND visibility = ANY($4::text[]) AND source != ALL($5::text[]) AND fact ILIKE $6 ESCAPE '\\' ORDER BY created_at DESC, id DESC LIMIT $7 OFFSET $8",- "textSha256": "869e7e5ad9aeab19b81e704f439f4043c269defe2fbcb30e57b23c37cea8fded"+ "textSha256": "3e20f1408963e21b6163f69a3968546ecfe320c3ccf93051a70355b5502738b6"}],"default": [@@ -619,7 +619,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND source_session = $2 AND expired_at IS NULL AND (valid_until IS NULL OR valid_until > now()) ORDER BY created_at DESC, id DESC LIMIT $3 OFFSET $4",- "textSha256": "16af231e53b7564dc3e84fe282ab684b8aa5ab3135ac6b602943d26f00fd96ba"+ "textSha256": "3bb863323c2a88b50ce1b737f2da391a18cca8742c6049efe96a209bb66fcbec"}]},@@ -632,7 +632,7 @@"number"],"sql": "SELECT *, to_char(created_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS created_at_iso FROM facts WHERE source_id = $1 AND expired_at IS NULL AND (valid_until IS NULL OR valid_until > now()) ORDER BY created_at ASC, id ASC LIMIT $2",- "textSha256": "0a40122b0f45781fe163473acc69c889aeb6c63e2fd366f2f15731229025b466"+ "textSha256": "cbf74977e9bd8227e796439b8c2c1b3be749383469c75a77112b6dbc92fcbff8"}],"keyset": [@@ -646,7 +646,7 @@"number"],"sql": "SELECT *, gbrain_fact_fingerprint(fact) AS fact_fingerprint, to_char(created_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS created_at_iso FROM facts WHERE source_id = $1 AND (created_at > $2::text::timestamptz OR (created_at = $3::text::timestamptz AND id > $4)) ORDER BY created_at ASC, id ASC LIMIT $5",- "textSha256": "48e52d1c6898cb66b520371fe6e65624ccfca9643f2e6e4dcf8f30186bbbdd0f"+ "textSha256": "71abbadee1ad18cb7b39dace5104e59b7d6235122355a699d7322d0dd22e2eb5"}],"strictTime": [@@ -659,7 +659,7 @@"number"],"sql": "SELECT *, to_char(created_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS created_at_iso FROM facts WHERE source_id = $1 AND created_at > $2::text::timestamptz AND expired_at IS NULL AND (valid_until IS NULL OR valid_until > now()) AND visibility = ANY($3::text[]) ORDER BY created_at ASC, id ASC LIMIT $4",- "textSha256": "8918057b510da33d9b032fdefda14dfd7c9f5e67dd28b763ee8823cfa87b42f5"+ "textSha256": "b433fc98e8fd4702a594ff9efd187c89390875187059f5ee9b695b467f45c233"}]},@@ -680,7 +680,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND COALESCE(valid_from, created_at) >= $2 AND entity_slug = $3 AND source_session = $4 AND consolidated_at IS NULL AND kind = ANY($5::text[]) AND visibility = ANY($6::text[]) AND source != ALL($7::text[]) AND fact ILIKE $8 ESCAPE '\\' ORDER BY COALESCE(valid_from, created_at) DESC, id DESC LIMIT $9 OFFSET $10",- "textSha256": "a635199e1e8bc1742eaa0209a8bc5b296098640ab38aa287635fe9195fa696ae"+ "textSha256": "8ef6416fe6a75cd5a9e639c5e891a2325eaa046459911480ffe0b9fbd10c79c9"}],"default": [@@ -693,7 +693,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND created_at >= $2 AND expired_at IS NULL AND (valid_until IS NULL OR valid_until > now()) ORDER BY created_at DESC, id DESC LIMIT $3 OFFSET $4",- "textSha256": "3f0a5fa0e5e1a4338c4d9a10f70015aef0d1d34504c0161ce43eae3a104f6beb"+ "textSha256": "aa5b526eb12e737df05d6ec0b7d7a34837fa3540430220ae18c8b283f73ffc2f"}]},@@ -706,7 +706,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND superseded_by IS NOT NULL ORDER BY COALESCE(expired_at, valid_until) DESC, id DESC LIMIT $2",- "textSha256": "c9884eab330821c3b6b9a84fd1ae17e215ce8911ba3945e954b6918172b22d9c"+ "textSha256": "586a64d75b93c904191897f8356290c4f3992c340d05b01e1ea364199f40fdbd"}],"since+visibility": [@@ -719,7 +719,7 @@"number"],"sql": "SELECT * FROM facts WHERE source_id = $1 AND superseded_by IS NOT NULL AND COALESCE(expired_at, valid_until) >= $2 AND visibility = ANY($3::text[]) ORDER BY COALESCE(expired_at, valid_until) DESC, id DESC LIMIT $4",- "textSha256": "5df970c375dc85b29e4d5fca79616dc18bbd6090717d96be62472c7fa38177ed"+ "textSha256": "528d9a6d4e088e9aaee9f9bd39bb1ca10cd6ebf3b566c33966867d5ac249401d"}]},diff --git a/test/fixtures/goldens/sql-text/takes.json b/test/fixtures/goldens/sql-text/takes.jsonindex 9e67f41384..7da02b8235 100644--- a/test/fixtures/goldens/sql-text/takes.json+++ b/test/fixtures/goldens/sql-text/takes.json@@ -224,7 +224,7 @@"number"],"sql": "SELECT t.*, p.slug AS page_slug FROM takes t JOIN pages p ON p.id = t.page_id WHERE 1=1 AND ($1::int IS NULL OR t.page_id = $2::int) AND ($3::text IS NULL OR p.slug = $4::text) AND ($5::text IS NULL OR t.holder = $6::text) AND ($7::text IS NULL OR t.kind = $8::text) AND ($9::boolean IS NULL OR t.active = $10::boolean) AND ( $11::boolean IS NULL OR ($12::boolean = true AND t.resolved_at IS NOT NULL) OR ($13::boolean = false AND t.resolved_at IS NULL) ) AND ( $14::text[] IS NULL OR t.holder = ANY($15::text[]) ) ORDER BY CASE WHEN $16 = 'weight' THEN t.weight END DESC NULLS LAST, CASE WHEN $17 = 'since_date' THEN t.since_date END DESC NULLS LAST, CASE WHEN $18 = 'created_at' THEN t.created_at END DESC NULLS LAST LIMIT $19 OFFSET $20",- "textSha256": "974ece0b8fa9166ba0b1462f293fc6e19c1952e1fccac100b957afd1d2ceccbb"+ "textSha256": "94ba5b480a63e8948c598eeeef15dd6e3b52381f9438242f47f715ba58d3c93b"}],"sourceId": [@@ -254,7 +254,7 @@"number"],"sql": "SELECT t.*, p.slug AS page_slug FROM takes t JOIN pages p ON p.id = t.page_id WHERE 1=1 AND ($1::int IS NULL OR t.page_id = $2::int) AND ($3::text IS NULL OR p.slug = $4::text) AND ($5::text IS NULL OR t.holder = $6::text) AND ($7::text IS NULL OR t.kind = $8::text) AND ($9::boolean IS NULL OR t.active = $10::boolean) AND ( $11::boolean IS NULL OR ($12::boolean = true AND t.resolved_at IS NOT NULL) OR ($13::boolean = false AND t.resolved_at IS NULL) ) AND ( $14::text[] IS NULL OR t.holder = ANY($15::text[]) ) AND p.source_id = $16 ORDER BY CASE WHEN $17 = 'weight' THEN t.weight END DESC NULLS LAST, CASE WHEN $18 = 'since_date' THEN t.since_date END DESC NULLS LAST, CASE WHEN $19 = 'created_at' THEN t.created_at END DESC NULLS LAST LIMIT $20 OFFSET $21",- "textSha256": "adad16434be36a3105641b3e645cc6cfb0cd0d90b1cb9b0dfc5eb861ac5ff0b1"+ "textSha256": "8f77bbecf2e374e6d1f591a98e00dc760b5e75b61fc879a6ce7b5e5f03a04151"}],"sourceIds+excludePrivate": [@@ -284,7 +284,7 @@"number"],"sql": "SELECT t.*, p.slug AS page_slug FROM takes t JOIN pages p ON p.id = t.page_id WHERE 1=1 AND (COALESCE(p.frontmatter->>'visibility', CASE WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN p.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = p.source_id AND derived_origin.slug = p.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = p.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN p.type = 'event' AND p.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = p.source_id AND chronicle_origin.slug = p.frontmatter->'event'->>'depth' AND COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type = 'atom' OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = p.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') = 'array' THEN p.frontmatter->'derived_from' ELSE jsonb_build_array(p.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) AND ($1::int IS NULL OR t.page_id = $2::int) AND ($3::text IS NULL OR p.slug = $4::text) AND ($5::text IS NULL OR t.holder = $6::text) AND ($7::text IS NULL OR t.kind = $8::text) AND ($9::boolean IS NULL OR t.active = $10::boolean) AND ( $11::boolean IS NULL OR ($12::boolean = true AND t.resolved_at IS NOT NULL) OR ($13::boolean = false AND t.resolved_at IS NULL) ) AND ( $14::text[] IS NULL OR t.holder = ANY($15::text[]) ) AND p.source_id = ANY($16::text[]) ORDER BY CASE WHEN $17 = 'weight' THEN t.weight END DESC NULLS LAST, CASE WHEN $18 = 'since_date' THEN t.since_date END DESC NULLS LAST, CASE WHEN $19 = 'created_at' THEN t.created_at END DESC NULLS LAST LIMIT $20 OFFSET $21",- "textSha256": "8f7fd0a88c768517a46c6179802a19e0f99b016284ff580503ae9f48f15bb7a6"+ "textSha256": "9b268ccbae5d5b51b8c8403ead68a6d7636516445e218297a1d857ca2faedd85"}]},@@ -358,7 +358,7 @@"number"],"sql": "SELECT t.id AS take_id, t.page_id, p.slug AS page_slug, t.row_num, t.claim, t.kind, t.holder, t.weight, word_similarity($1, t.claim)::real AS score FROM takes t JOIN pages p ON p.id = t.page_id WHERE t.active AND $2 <% t.claim AND ( $3::text[] IS NULL OR t.holder = ANY($4::text[]) ) ORDER BY score DESC, t.weight DESC LIMIT $5",- "textSha256": "34e67c5eb1d2c5f639547d25d2e1712cdc1b24d4f6d59629ca994375c2286648"+ "textSha256": "2ec29ded123f4c0644aaa43f01de0b9177ad4ff08b78ef1731b281775f60b78d"}],"sourceId": [@@ -373,7 +373,7 @@"number"],"sql": "SELECT t.id AS take_id, t.page_id, p.slug AS page_slug, t.row_num, t.claim, t.kind, t.holder, t.weight, word_similarity($1, t.claim)::real AS score FROM takes t JOIN pages p ON p.id = t.page_id WHERE t.active AND $2 <% t.claim AND ( $3::text[] IS NULL OR t.holder = ANY($4::text[]) ) AND p.source_id = $5 ORDER BY score DESC, t.weight DESC LIMIT $6",- "textSha256": "d3cab7eb4b940a5fd1f1e04d8058b1a13d95083a9689df6a9b7e77ace4e50149"+ "textSha256": "e55e410c13fae1926ee79c0183a301b15946d8c04646c9ad0752983f9d7b9872"}],"sourceIds+excludePrivate": [@@ -388,7 +388,7 @@"number"],"sql": "SELECT t.id AS take_id, t.page_id, p.slug AS page_slug, t.row_num, t.claim, t.kind, t.holder, t.weight, word_similarity($1, t.claim)::real AS score FROM takes t JOIN pages p ON p.id = t.page_id WHERE t.active AND $2 <% t.claim AND (COALESCE(p.frontmatter->>'visibility', CASE WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN p.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = p.source_id AND derived_origin.slug = p.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = p.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN p.type = 'event' AND p.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = p.source_id AND chronicle_origin.slug = p.frontmatter->'event'->>'depth' AND COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type = 'atom' OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = p.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') = 'array' THEN p.frontmatter->'derived_from' ELSE jsonb_build_array(p.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) AND ( $3::text[] IS NULL OR t.holder = ANY($4::text[]) ) AND p.source_id = ANY($5::text[]) ORDER BY score DESC, t.weight DESC LIMIT $6",- "textSha256": "9a4df8330d3b3ec0e9a9cbcbf73fe417dacc39db2ac10d378f7468e02b491068"+ "textSha256": "475873a0331cb561a20bb70ec538f2fc126e3db515657f12d58ff1611e97a028"}]},@@ -404,7 +404,7 @@"number"],"sql": "SELECT t.id AS take_id, t.page_id, p.slug AS page_slug, t.row_num, t.claim, t.kind, t.holder, t.weight, (1 - (t.embedding <=> $1::vector))::real AS score FROM takes t JOIN pages p ON p.id = t.page_id WHERE t.active AND t.embedding IS NOT NULL AND ( $2::text[] IS NULL OR t.holder = ANY($3::text[]) ) ORDER BY t.embedding <=> $4::vector LIMIT $5",- "textSha256": "28e886336542c1f9f448881d77ef271ea62d0ce5b4418da97faf94119e6d4c20"+ "textSha256": "4d82b910a352aa07599dbf8eb4ec2939a89d008e0fac7db0c70eac15ff9347c0"}],"sourceId": [@@ -419,7 +419,7 @@"number"],"sql": "SELECT t.id AS take_id, t.page_id, p.slug AS page_slug, t.row_num, t.claim, t.kind, t.holder, t.weight, (1 - (t.embedding <=> $1::vector))::real AS score FROM takes t JOIN pages p ON p.id = t.page_id WHERE t.active AND t.embedding IS NOT NULL AND ( $2::text[] IS NULL OR t.holder = ANY($3::text[]) ) AND p.source_id = $4 ORDER BY t.embedding <=> $5::vector LIMIT $6",- "textSha256": "cc06c98b52d8b78658b74fe07eb33390c82722dca85a92b2b879e537ad06b7da"+ "textSha256": "a9758d2943a82b8c95a801ee9c1417a7217a5cf866b312dbc5b876567ca25dec"}],"sourceIds+excludePrivate": [@@ -434,7 +434,7 @@"number"],"sql": "SELECT t.id AS take_id, t.page_id, p.slug AS page_slug, t.row_num, t.claim, t.kind, t.holder, t.weight, (1 - (t.embedding <=> $1::vector))::real AS score FROM takes t JOIN pages p ON p.id = t.page_id WHERE t.active AND t.embedding IS NOT NULL AND (COALESCE(p.frontmatter->>'visibility', CASE WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN p.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = p.source_id AND derived_origin.slug = p.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = p.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN p.type = 'event' AND p.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = p.source_id AND chronicle_origin.slug = p.frontmatter->'event'->>'depth' AND COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type = 'atom' OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = p.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') = 'array' THEN p.frontmatter->'derived_from' ELSE jsonb_build_array(p.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) AND ( $2::text[] IS NULL OR t.holder = ANY($3::text[]) ) AND p.source_id = ANY($4::text[]) ORDER BY t.embedding <=> $5::vector LIMIT $6",- "textSha256": "0aa6701896aa6c022fb3f8353f4e9f4859b47acd3d3a526d34d6abaadbcecbda"+ "textSha256": "d1584159bba86c3f6bd9bf09ad7b57b988f25edf932cc7bd67f583e3b1a48e00"}]},diff --git a/test/fixtures/goldens/sql-text/timeline.json b/test/fixtures/goldens/sql-text/timeline.jsonindex c034577950..bac466c3e1 100644--- a/test/fixtures/goldens/sql-text/timeline.json+++ b/test/fixtures/goldens/sql-text/timeline.json@@ -126,7 +126,7 @@"number"],"sql": "SELECT te.* FROM sources s CROSS JOIN LATERAL (SELECT * FROM pages WHERE source_id = s.id AND slug = $1 OFFSET 0) p JOIN timeline_entries te ON te.page_id = p.id WHERE p.slug = $2 ORDER BY te.date DESC, te.id DESC LIMIT $3",- "textSha256": "70a8feb6c889c5ded02b4af84e6b01e4ed07e4031f87a9851500e2bf28c1823d"+ "textSha256": "90a5d6308ad3ae744d9c4ff5b12171201ee09832b878bb3ad68367301e82a32f"}],"excludePrivate": [@@ -138,7 +138,7 @@"number"],"sql": "SELECT te.* FROM sources s CROSS JOIN LATERAL (SELECT * FROM pages WHERE source_id = s.id AND slug = $1 OFFSET 0) p JOIN timeline_entries te ON te.page_id = p.id WHERE p.slug = $2 AND (COALESCE(p.frontmatter->>'visibility', CASE WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN p.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = p.source_id AND derived_origin.slug = p.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (p.type = 'atom' OR (p.type = 'concept' AND p.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = p.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN p.type = 'event' AND p.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = p.source_id AND chronicle_origin.slug = p.frontmatter->'event'->>'depth' AND COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type = 'atom' OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = p.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(p.frontmatter->'derived_from') = 'array' THEN p.frontmatter->'derived_from' ELSE jsonb_build_array(p.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) AND (te.event_page_id IS NULL OR EXISTS ( SELECT 1 FROM pages event_private WHERE event_private.id = te.event_page_id AND (COALESCE(event_private.frontmatter->>'visibility', CASE WHEN (event_private.type = 'atom' OR (event_private.type = 'concept' AND event_private.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN event_private.type = 'atom' THEN EXISTS (SELECT 1 FROM pages derived_origin WHERE derived_origin.source_id = event_private.source_id AND derived_origin.slug = event_private.frontmatter->>'source_slug' AND derived_origin.frontmatter->>'visibility' = 'private') WHEN (event_private.type = 'atom' OR (event_private.type = 'concept' AND event_private.frontmatter->>'synthesized_by' IS NOT NULL)) THEN EXISTS (SELECT 1 FROM links derived_input_link JOIN pages derived_input ON derived_input.id = derived_input_link.to_page_id WHERE derived_input_link.from_page_id = event_private.id AND derived_input_link.link_source = 'concept-provenance' AND derived_input_link.link_type = 'synthesized_from' AND (COALESCE(derived_input.frontmatter->>'visibility', CASE WHEN derived_input.type = 'atom' THEN 'private' ELSE 'world' END) = 'private' OR EXISTS (SELECT 1 FROM pages derived_input_origin WHERE derived_input_origin.source_id = derived_input.source_id AND derived_input_origin.slug = derived_input.frontmatter->>'source_slug' AND derived_input_origin.frontmatter->>'visibility' = 'private'))) WHEN event_private.type = 'event' AND event_private.frontmatter->>'captured_via' LIKE 'life-chronicle:%' THEN NOT EXISTS (SELECT 1 FROM pages chronicle_origin WHERE chronicle_origin.source_id = event_private.source_id AND chronicle_origin.slug = event_private.frontmatter->'event'->>'depth' AND COALESCE(chronicle_origin.frontmatter->>'visibility', CASE WHEN (chronicle_origin.type = 'atom' OR (chronicle_origin.type = 'concept' AND chronicle_origin.frontmatter->>'synthesized_by' IS NOT NULL)) THEN 'private' ELSE 'world' END) <> 'private' AND NOT (CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = chronicle_origin.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(chronicle_origin.frontmatter->'derived_from') = 'array' THEN chronicle_origin.frontmatter->'derived_from' ELSE jsonb_build_array(chronicle_origin.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) ELSE false END) AND NOT (CASE WHEN jsonb_typeof(event_private.frontmatter->'derived_from') IN ('array', 'string') THEN EXISTS ( SELECT 1 FROM pages declared_origin WHERE declared_origin.source_id = event_private.source_id AND declared_origin.frontmatter->>'visibility' = 'private' AND declared_origin.slug IN ( SELECT regexp_replace(declared.slug, '\\.md$', '') FROM jsonb_array_elements_text( CASE WHEN jsonb_typeof(event_private.frontmatter->'derived_from') = 'array' THEN event_private.frontmatter->'derived_from' ELSE jsonb_build_array(event_private.frontmatter->'derived_from') END) AS declared(slug))) ELSE false END)) )) ORDER BY te.date DESC, te.id DESC LIMIT $3",- "textSha256": "403ba23be5418e679910242b72046a27ed28982a19287c18759d3dd5439f84db"+ "textSha256": "fcde6cee55ab188f09db13e74de45ac8133445c2e2b029fcbe71262f898c4469"}],"sourceId": [@@ -150,7 +150,7 @@"number"],"sql": "SELECT te.* FROM timeline_entries te JOIN pages p ON p.id = te.page_id WHERE p.slug = $1 AND p.source_id = $2 ORDER BY te.date DESC, te.id DESC LIMIT $3",- "textSha256": "f26827fb9b8de85797d0c2d929e2c3550cf89f35b2683da4b91d67e9c39f241c"+ "textSha256": "19bcd2d665602c4f8895746bb4c903643c0d2e45196d2302392a3a050400c565"}],"sourceIds+after+before": [@@ -164,7 +164,7 @@"number"],"sql": "SELECT te.* FROM timeline_entries te JOIN pages p ON p.id = te.page_id WHERE p.slug = $1 AND p.source_id = ANY($2::text[]) AND te.date >= $3::date AND te.date <= $4::date ORDER BY te.date DESC, te.id DESC LIMIT $5",- "textSha256": "c468b1205bd34b5d84e3f98d800daff8d7939b8b5e94b1d0a42ba33d62832197"+ "textSha256": "26e413d08b123bc206b40f20c6c2f567faff932d47d1676725bfb306839befcf"}]},