Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(catalog): Postgres engine-init goldens include persistence_consumers and the committed-receipt watermark index (v222)

garrytan7633b3a16bfe
diff --git a/test/fixtures/goldens/catalog/postgres-db-initschema.json b/test/fixtures/goldens/catalog/postgres-db-initschema.json
index e06d6731e5..4091dc5512 100644
--- a/test/fixtures/goldens/catalog/postgres-db-initschema.json
+++ b/test/fixtures/goldens/catalog/postgres-db-initschema.json
@@ -159,6 +159,8 @@
"persistence_brain.persistence_brain_pkey": "p PRIMARY KEY (singleton)",
"persistence_brain.persistence_brain_singleton_check": "c CHECK ((singleton = 1))",
"persistence_brain.persistence_brain_writer_protocol_floor_check": "c CHECK ((writer_protocol_floor = ANY (ARRAY[1, 2])))",
+ "persistence_consumers.persistence_consumers_mode_check": "c CHECK ((mode = ANY (ARRAY['probing'::text, 'full'::text, 'waiter_only'::text, 'promoted'::text])))",
+ "persistence_consumers.persistence_consumers_pkey": "p PRIMARY KEY (host_id, pid, nonce)",
"persistence_counters.persistence_counters_intent_bytes_check": "c CHECK ((intent_bytes >= 0))",
"persistence_counters.persistence_counters_lifetime_ids_check": "c CHECK ((lifetime_ids >= 0))",
"persistence_counters.persistence_counters_outstanding_count_check": "c CHECK ((outstanding_count >= 0))",
@@ -484,6 +486,9 @@
"persistence_brain": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "persistence_consumers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"persistence_counters": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -783,6 +788,7 @@
"pages_pkey": "CREATE UNIQUE INDEX pages_pkey ON public.pages USING btree (id)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
+ "persistence_consumers_pkey": "CREATE UNIQUE INDEX persistence_consumers_pkey ON public.persistence_consumers USING btree (host_id, pid, nonce)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
"persistence_effects_pkey": "CREATE UNIQUE INDEX persistence_effects_pkey ON public.persistence_effects USING btree (id)",
"persistence_effects_request_id_kind_key": "CREATE UNIQUE INDEX persistence_effects_request_id_kind_key ON public.persistence_effects USING btree (request_id, kind)",
@@ -1869,6 +1875,26 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "persistence_consumers": {
+ "columns": [
+ "1 host_id uuid/uuid NOT NULL",
+ "2 pid integer/int4 NOT NULL",
+ "3 nonce text/text NOT NULL",
+ "4 pid_ns text/text NULL",
+ "5 kind text/text NOT NULL",
+ "6 mode text/text NOT NULL",
+ "7 started_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "9 restart_required boolean/bool NOT NULL DEFAULT false",
+ "10 root_barrier_age_ms integer/int4 NULL",
+ "11 pool jsonb/jsonb NULL",
+ "12 host_json_path text/text NOT NULL",
+ "13 persistence_home text/text NOT NULL",
+ "14 minted_under jsonb/jsonb NULL",
+ "15 version text/text NOT NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"persistence_counters": {
"columns": [
"1 key text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index 3d2ccdfe1d..8a485fc265 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -211,6 +211,8 @@
"persistence_brain.persistence_brain_pkey": "p PRIMARY KEY (singleton)",
"persistence_brain.persistence_brain_singleton_check": "c CHECK ((singleton = 1))",
"persistence_brain.persistence_brain_writer_protocol_floor_check": "c CHECK ((writer_protocol_floor = ANY (ARRAY[1, 2])))",
+ "persistence_consumers.persistence_consumers_mode_check": "c CHECK ((mode = ANY (ARRAY['probing'::text, 'full'::text, 'waiter_only'::text, 'promoted'::text])))",
+ "persistence_consumers.persistence_consumers_pkey": "p PRIMARY KEY (host_id, pid, nonce)",
"persistence_counters.persistence_counters_intent_bytes_check": "c CHECK ((intent_bytes >= 0))",
"persistence_counters.persistence_counters_lifetime_ids_check": "c CHECK ((lifetime_ids >= 0))",
"persistence_counters.persistence_counters_outstanding_count_check": "c CHECK ((outstanding_count >= 0))",
@@ -629,6 +631,9 @@
"persistence_brain": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "persistence_consumers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"persistence_counters": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1037,6 +1042,7 @@
"pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
+ "persistence_consumers_pkey": "CREATE UNIQUE INDEX persistence_consumers_pkey ON public.persistence_consumers USING btree (host_id, pid, nonce)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
"persistence_effects_parked": "CREATE INDEX persistence_effects_parked ON public.persistence_effects USING btree (id) WHERE (data ? 'parked'::text)",
"persistence_effects_pending": "CREATE INDEX persistence_effects_pending ON public.persistence_effects USING btree (next_attempt_at, id) WHERE (state = ANY (ARRAY['queued'::text, 'running'::text]))",
@@ -1047,6 +1053,7 @@
"persistence_host_bindings_pkey": "CREATE UNIQUE INDEX persistence_host_bindings_pkey ON public.persistence_host_bindings USING btree (worktree_id, host_id)",
"persistence_local_writers_credential_hash_key": "CREATE UNIQUE INDEX persistence_local_writers_credential_hash_key ON public.persistence_local_writers USING btree (credential_hash)",
"persistence_local_writers_pkey": "CREATE UNIQUE INDEX persistence_local_writers_pkey ON public.persistence_local_writers USING btree (id)",
+ "persistence_requests_committed_watermark": "CREATE INDEX persistence_requests_committed_watermark ON public.persistence_requests USING btree (worktree_id, completed_at DESC) WHERE (state = 'committed'::text)",
"persistence_requests_database_pending": "CREATE INDEX persistence_requests_database_pending ON public.persistence_requests USING btree (source_incarnation, sequence) WHERE ((worktree_id IS NULL) AND (state = ANY (ARRAY['queued'::text, 'running'::text, 'recovering'::text])))",
"persistence_requests_pending": "CREATE INDEX persistence_requests_pending ON public.persistence_requests USING btree (worktree_id, sequence) WHERE (state = ANY (ARRAY['queued'::text, 'running'::text, 'recovering'::text]))",
"persistence_requests_pkey": "CREATE UNIQUE INDEX persistence_requests_pkey ON public.persistence_requests USING btree (id)",
@@ -2464,6 +2471,26 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "persistence_consumers": {
+ "columns": [
+ "1 host_id uuid/uuid NOT NULL",
+ "2 pid integer/int4 NOT NULL",
+ "3 nonce text/text NOT NULL",
+ "4 pid_ns text/text NULL",
+ "5 kind text/text NOT NULL",
+ "6 mode text/text NOT NULL",
+ "7 started_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "9 restart_required boolean/bool NOT NULL DEFAULT false",
+ "10 root_barrier_age_ms integer/int4 NULL",
+ "11 pool jsonb/jsonb NULL",
+ "12 host_json_path text/text NOT NULL",
+ "13 persistence_home text/text NOT NULL",
+ "14 minted_under jsonb/jsonb NULL",
+ "15 version text/text NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"persistence_counters": {
"columns": [
"1 key text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
index 21e5b03dc4..88e026d8d9 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -211,6 +211,8 @@
"persistence_brain.persistence_brain_pkey": "p PRIMARY KEY (singleton)",
"persistence_brain.persistence_brain_singleton_check": "c CHECK ((singleton = 1))",
"persistence_brain.persistence_brain_writer_protocol_floor_check": "c CHECK ((writer_protocol_floor = ANY (ARRAY[1, 2])))",
+ "persistence_consumers.persistence_consumers_mode_check": "c CHECK ((mode = ANY (ARRAY['probing'::text, 'full'::text, 'waiter_only'::text, 'promoted'::text])))",
+ "persistence_consumers.persistence_consumers_pkey": "p PRIMARY KEY (host_id, pid, nonce)",
"persistence_counters.persistence_counters_intent_bytes_check": "c CHECK ((intent_bytes >= 0))",
"persistence_counters.persistence_counters_lifetime_ids_check": "c CHECK ((lifetime_ids >= 0))",
"persistence_counters.persistence_counters_outstanding_count_check": "c CHECK ((outstanding_count >= 0))",
@@ -629,6 +631,9 @@
"persistence_brain": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "persistence_consumers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"persistence_counters": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1037,6 +1042,7 @@
"pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
+ "persistence_consumers_pkey": "CREATE UNIQUE INDEX persistence_consumers_pkey ON public.persistence_consumers USING btree (host_id, pid, nonce)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
"persistence_effects_parked": "CREATE INDEX persistence_effects_parked ON public.persistence_effects USING btree (id) WHERE (data ? 'parked'::text)",
"persistence_effects_pending": "CREATE INDEX persistence_effects_pending ON public.persistence_effects USING btree (next_attempt_at, id) WHERE (state = ANY (ARRAY['queued'::text, 'running'::text]))",
@@ -1047,6 +1053,7 @@
"persistence_host_bindings_pkey": "CREATE UNIQUE INDEX persistence_host_bindings_pkey ON public.persistence_host_bindings USING btree (worktree_id, host_id)",
"persistence_local_writers_credential_hash_key": "CREATE UNIQUE INDEX persistence_local_writers_credential_hash_key ON public.persistence_local_writers USING btree (credential_hash)",
"persistence_local_writers_pkey": "CREATE UNIQUE INDEX persistence_local_writers_pkey ON public.persistence_local_writers USING btree (id)",
+ "persistence_requests_committed_watermark": "CREATE INDEX persistence_requests_committed_watermark ON public.persistence_requests USING btree (worktree_id, completed_at DESC) WHERE (state = 'committed'::text)",
"persistence_requests_database_pending": "CREATE INDEX persistence_requests_database_pending ON public.persistence_requests USING btree (source_incarnation, sequence) WHERE ((worktree_id IS NULL) AND (state = ANY (ARRAY['queued'::text, 'running'::text, 'recovering'::text])))",
"persistence_requests_pending": "CREATE INDEX persistence_requests_pending ON public.persistence_requests USING btree (worktree_id, sequence) WHERE (state = ANY (ARRAY['queued'::text, 'running'::text, 'recovering'::text]))",
"persistence_requests_pkey": "CREATE UNIQUE INDEX persistence_requests_pkey ON public.persistence_requests USING btree (id)",
@@ -2464,6 +2471,26 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "persistence_consumers": {
+ "columns": [
+ "1 host_id uuid/uuid NOT NULL",
+ "2 pid integer/int4 NOT NULL",
+ "3 nonce text/text NOT NULL",
+ "4 pid_ns text/text NULL",
+ "5 kind text/text NOT NULL",
+ "6 mode text/text NOT NULL",
+ "7 started_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "9 restart_required boolean/bool NOT NULL DEFAULT false",
+ "10 root_barrier_age_ms integer/int4 NULL",
+ "11 pool jsonb/jsonb NULL",
+ "12 host_json_path text/text NOT NULL",
+ "13 persistence_home text/text NOT NULL",
+ "14 minted_under jsonb/jsonb NULL",
+ "15 version text/text NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"persistence_counters": {
"columns": [
"1 key text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
index e76fa6938f..2e46cd0132 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -211,6 +211,8 @@
"persistence_brain.persistence_brain_pkey": "p PRIMARY KEY (singleton)",
"persistence_brain.persistence_brain_singleton_check": "c CHECK ((singleton = 1))",
"persistence_brain.persistence_brain_writer_protocol_floor_check": "c CHECK ((writer_protocol_floor = ANY (ARRAY[1, 2])))",
+ "persistence_consumers.persistence_consumers_mode_check": "c CHECK ((mode = ANY (ARRAY['probing'::text, 'full'::text, 'waiter_only'::text, 'promoted'::text])))",
+ "persistence_consumers.persistence_consumers_pkey": "p PRIMARY KEY (host_id, pid, nonce)",
"persistence_counters.persistence_counters_intent_bytes_check": "c CHECK ((intent_bytes >= 0))",
"persistence_counters.persistence_counters_lifetime_ids_check": "c CHECK ((lifetime_ids >= 0))",
"persistence_counters.persistence_counters_outstanding_count_check": "c CHECK ((outstanding_count >= 0))",
@@ -629,6 +631,9 @@
"persistence_brain": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "persistence_consumers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"persistence_counters": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1033,6 +1038,7 @@
"pages_source_path_name_idx": "CREATE INDEX pages_source_path_name_idx ON public.pages USING btree (source_id, regexp_replace(replace(btrim(source_path), chr(92), '/'::text), '^.*/'::text, ''::text)) WHERE (source_path IS NOT NULL)",
"pages_source_slug_key": "CREATE UNIQUE INDEX pages_source_slug_key ON public.pages USING btree (source_id, slug)",
"persistence_brain_pkey": "CREATE UNIQUE INDEX persistence_brain_pkey ON public.persistence_brain USING btree (singleton)",
+ "persistence_consumers_pkey": "CREATE UNIQUE INDEX persistence_consumers_pkey ON public.persistence_consumers USING btree (host_id, pid, nonce)",
"persistence_counters_pkey": "CREATE UNIQUE INDEX persistence_counters_pkey ON public.persistence_counters USING btree (key)",
"persistence_effects_parked": "CREATE INDEX persistence_effects_parked ON public.persistence_effects USING btree (id) WHERE (data ? 'parked'::text)",
"persistence_effects_pending": "CREATE INDEX persistence_effects_pending ON public.persistence_effects USING btree (next_attempt_at, id) WHERE (state = ANY (ARRAY['queued'::text, 'running'::text]))",
@@ -1043,6 +1049,7 @@
"persistence_host_bindings_pkey": "CREATE UNIQUE INDEX persistence_host_bindings_pkey ON public.persistence_host_bindings USING btree (worktree_id, host_id)",
"persistence_local_writers_credential_hash_key": "CREATE UNIQUE INDEX persistence_local_writers_credential_hash_key ON public.persistence_local_writers USING btree (credential_hash)",
"persistence_local_writers_pkey": "CREATE UNIQUE INDEX persistence_local_writers_pkey ON public.persistence_local_writers USING btree (id)",
+ "persistence_requests_committed_watermark": "CREATE INDEX persistence_requests_committed_watermark ON public.persistence_requests USING btree (worktree_id, completed_at DESC) WHERE (state = 'committed'::text)",
"persistence_requests_database_pending": "CREATE INDEX persistence_requests_database_pending ON public.persistence_requests USING btree (source_incarnation, sequence) WHERE ((worktree_id IS NULL) AND (state = ANY (ARRAY['queued'::text, 'running'::text, 'recovering'::text])))",
"persistence_requests_pending": "CREATE INDEX persistence_requests_pending ON public.persistence_requests USING btree (worktree_id, sequence) WHERE (state = ANY (ARRAY['queued'::text, 'running'::text, 'recovering'::text]))",
"persistence_requests_pkey": "CREATE UNIQUE INDEX persistence_requests_pkey ON public.persistence_requests USING btree (id)",
@@ -2460,6 +2467,26 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "persistence_consumers": {
+ "columns": [
+ "1 host_id uuid/uuid NOT NULL",
+ "2 pid integer/int4 NOT NULL",
+ "3 nonce text/text NOT NULL",
+ "4 pid_ns text/text NULL",
+ "5 kind text/text NOT NULL",
+ "6 mode text/text NOT NULL",
+ "7 started_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "9 restart_required boolean/bool NOT NULL DEFAULT false",
+ "10 root_barrier_age_ms integer/int4 NULL",
+ "11 pool jsonb/jsonb NULL",
+ "12 host_json_path text/text NOT NULL",
+ "13 persistence_home text/text NOT NULL",
+ "14 minted_under jsonb/jsonb NULL",
+ "15 version text/text NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"persistence_counters": {
"columns": [
"1 key text/text NOT NULL",