Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Wakeshift PR 2: classify the three new tools for enforced members, list serial tests in the lane manifest (three move to the parallel lane), refresh PGLite goldens
garrytanac3a2c32dafd
diff --git a/docs/architecture/key-files/wakeshift.md b/docs/architecture/key-files/wakeshift.mdindex e1ec8ccd60..4d108390b8 100644--- a/docs/architecture/key-files/wakeshift.md+++ b/docs/architecture/key-files/wakeshift.md@@ -4,4 +4,4 @@Current behavior and load-bearing invariants; history belongs in Git and CHANGELOG.- `src/core/ops/wakeshift.ts` + `src/core/wakeshift/{client,config,events,drain,terms,forget}.ts` + `src/core/wakeshift-env-key.ts` + `src/commands/wakeshift.ts` + `src/commands/doctor/checks/wakeshift.ts` — report back to agent conversations through Wakeshift (docs/guides/wakeshift.md), off by default. `client.ts` is the in-repo HTTP client (no SDK): key parsing (`wst_` + 50 base58 with a CRC32; legacy formats refused), a fresh EdDSA `app+jwt` assertion per request, one `fetch` with a 10 s timeout and no retry, loopback-only http; endpoints subscribe, unsubscribe, end, emit, manifest merge and `/users/forget`. `config.ts` holds the host-only state: `wakeshift.enabled`/`url`/`terms_url`/`privacy_url`/`manifest_hash` in the file plane, the key (WAKESHIFT_API_KEY, which `wakeshift-env-key.ts` moves out of the environment on every config load so children never inherit it, the first value seen winning; else a 0600 `~/.gbrain/wakeshift.key`), the 0600 HMAC secret and the opaque Wakeshift user (HMAC over brain and principal key: `member:<id>` when bound, else `<kind>:<id>`); `wakeshiftRuntime().file` carries the file plane to the ops and the drainer, so core never reads config twice; `wakeshiftPublished` is publish gate `mcp.publish_wakeshift`, which `mcp/publish-gates.ts` resolves from the file plane and key presence only (never the DB plane; not in `PUBLISH_GATE_KEYS`). Three events (`events.ts`): `gbrain.job.finished` (`watch_job`, the get_job owner fence from `ops/jobs.ts`), `gbrain.write.settled` (`watch_write_request`, write scope, the receipt read path `receiptAccess`/`receiptVisible`/`receiptNotFound` exported from `ops/persistence.ts`, so a foreign id reads exactly like get_write_request's not_found; `target_ref` holds the `persistence_requests.id`), `gbrain.cron.finished` (`watch_cron`, admin scope, names in `wake_crons`; `gbrain wakeshift emit cron.finished` only inserts a `wake_cron_runs` row and exits 0). Every watch goes through `openWatch` (subscribe `once`... (line truncated to 2000 chars)-- `src/commands/wakeshift-watch.ts` + `src/commands/setup-openclaw-wakeshift.ts` + `src/core/report-back-notice.ts` + `src/commands/doctor/checks/wakeshift-openclaw.ts` — the agent-facing edges of reporting back. `wakeshift-watch.ts` is `gbrain wakeshift watch job|write|cron` (the only `wakeshift` subcommand a thin client routes, through `callRemoteTool`; locally it calls the op with `remote: false`, whose refusal names `gbrain jobs wait`); Wakeshift's addition is always the last stdout line and a `--session-key` is passed through, never stored. `setup-openclaw-wakeshift.ts` is `gbrain setup openclaw --wakeshift`: `requireConsent` (persistent_install, egress), then OpenClaw's own installer for the one pinned `WAKESHIFT_OPENCLAW_VERSION`, an injectable runner, Wakeshift's allowNetworkHooks question printed on a non-loopback gateway and never answered; `wakeshift-openclaw.ts` warns when the installed plugin differs from the pin. `report-back-notice.ts` is the muteable `wakeshift_report_back` coaching notice after a remote `submit_job`/`submit_agent` (the notice ledger's once-per-session dedupe); `mcp/instructions.ts` adds one sentence only while `watch_job` is callable. Tests: `test/wakeshift-watch.serial.test.ts`, `test/setup-openclaw-wakeshift.serial.test.ts`, `test/wakeshift-nudge.serial.test.ts`.+- `src/commands/wakeshift-watch.ts` + `src/commands/setup-openclaw-wakeshift.ts` + `src/core/report-back-notice.ts` + `src/commands/doctor/checks/wakeshift-openclaw.ts` — the agent-facing edges of reporting back. `wakeshift-watch.ts` is `gbrain wakeshift watch job|write|cron` (the only `wakeshift` subcommand a thin client routes, through `callRemoteTool`; locally it calls the op with `remote: false`, whose refusal names `gbrain jobs wait`); Wakeshift's addition is always the last stdout line and a `--session-key` is passed through, never stored. `setup-openclaw-wakeshift.ts` is `gbrain setup openclaw --wakeshift`: `requireConsent` (persistent_install, egress), then OpenClaw's own installer for the one pinned `WAKESHIFT_OPENCLAW_VERSION`, an injectable runner, Wakeshift's allowNetworkHooks question printed on a non-loopback gateway and never answered; `wakeshift-openclaw.ts` warns when the installed plugin differs from the pin. `report-back-notice.ts` is the muteable `wakeshift_report_back` coaching notice after a remote `submit_job`/`submit_agent` (the notice ledger's once-per-session dedupe); `mcp/instructions.ts` adds one sentence only while `watch_job` is callable. Tests: `test/wakeshift-watch.test.ts`, `test/setup-openclaw-wakeshift.test.ts`, `test/wakeshift-nudge.test.ts`.diff --git a/scripts/serial-files.tsv b/scripts/serial-files.tsvindex 4b66e7c414..177cc3c728 100644--- a/scripts/serial-files.tsv+++ b/scripts/serial-files.tsv@@ -465,3 +465,4 @@ test/search/slug-handles.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME)test/launcher-lanes-bunfig.serial.test.ts global-state global-state: spawns gbrain serve subprocesses against one shared PGLite brain and its data-dir lock; withEnv scopes HOME, GBRAIN_HOME and CODEX_HOME around the bootstrap and setup writerstest/extraction-review-door.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME) around real git subprocesses against tmp repos for the page-door review decisionstest/release-channel-w1.serial.test.ts R1 R1: mutates process.env (GBRAIN_HOME, GBRAIN_RELEASE_CHANNEL) and stubs globalThis.fetch+test/wakeshift-pr2.serial.test.ts global-state global-state: R3: constructs a second PGLiteEngine inside a test (the git-backed brain for write.settled); binds a fake Wakeshift HTTP listenerdiff --git a/src/cli/enforced-member-classes.ts b/src/cli/enforced-member-classes.tsindex f15d49f520..6b0a7c71d4 100644--- a/src/cli/enforced-member-classes.ts+++ b/src/cli/enforced-member-classes.ts@@ -48,7 +48,7 @@ const REFUSED_OPS = [// hidden operations: no CLI path reaches them (their CLI names are CLI-only commands or gbrain call)'advisor', 'code_blast', 'code_callees', 'code_callers', 'code_def', 'code_flow', 'code_refs', 'find_anomalies','find_experts', 'find_orphans', 'get_recent_salience', 'sources_list', 'sources_resolve_path', 'sources_status', 'think',- 'capture', 'list_page_purges', 'list_watches', 'purge_fact', 'unpurge_page', 'unwatch', 'watch_job', 'connectors_status',+ 'capture', 'list_page_purges', 'list_watches', 'purge_fact', 'unpurge_page', 'unwatch', 'watch_job', 'watch_write_request', 'watch_cron', 'accept_wakeshift_terms', 'connectors_status','get_recent_transcripts', 'sources_inspect', 'sources_add', 'sources_remove', 'connector_sync','code_traversal_cache_clear', 'migrate_embeddings', 'purge_deleted_pages', 'sync_brain',// writes outside the checked set: batch, upload, label, history, fact and queue writesdiff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.jsonindex d4953b0ebc..c5009be4fb 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json@@ -565,6 +565,14 @@"trust_proposals.trust_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","trust_proposals.trust_proposals_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'accepted'::text, 'rejected'::text, 'undone'::text, 'superseded'::text])))","trust_proposals.trust_proposals_target_table_check": "c CHECK ((target_table = ANY (ARRAY['facts'::text, 'takes'::text, 'timeline_entries'::text, 'pages'::text])))",+ "wake_cron_runs.wake_cron_runs_name_check": "c CHECK ((name ~ '^[a-z0-9._-]{1,64}$'::text))",+ "wake_cron_runs.wake_cron_runs_pkey": "p PRIMARY KEY (id)",+ "wake_cron_runs.wake_cron_runs_status_check": "c CHECK ((status = ANY (ARRAY['ok'::text, 'failed'::text])))",+ "wake_crons.wake_crons_name_check": "c CHECK ((name ~ '^[a-z0-9._-]{1,64}$'::text))",+ "wake_crons.wake_crons_pkey": "p PRIMARY KEY (name)",+ "wake_forgets.wake_forgets_pkey": "p PRIMARY KEY (id)",+ "wake_forgets.wake_forgets_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'done'::text, 'dead'::text])))",+ "wake_forgets.wake_forgets_wake_user_check": "c CHECK ((wake_user ~ '^[0-9a-f]{32}$'::text))","wake_subscriptions.wake_subscriptions_event_check": "c CHECK ((event ~ '^gbrain\\.[a-z][a-z0-9._]{0,47}$'::text))","wake_subscriptions.wake_subscriptions_pkey": "p PRIMARY KEY (id)","wake_subscriptions.wake_subscriptions_principal_kind_check": "c CHECK ((principal_kind = ANY (ARRAY['oauth_client'::text, 'legacy_token'::text, 'local_stdio'::text])))",@@ -572,6 +580,9 @@"wake_subscriptions.wake_subscriptions_target_check": "c CHECK (((length(target) >= 1) AND (length(target) <= 128)))","wake_subscriptions.wake_subscriptions_wake_user_check": "c CHECK ((wake_user ~ '^[0-9a-f]{32}$'::text))","wake_subscriptions.wake_subscriptions_ws_subscription_id_check": "c CHECK (((length(ws_subscription_id) >= 1) AND (length(ws_subscription_id) <= 200)))",+ "wake_terms_acceptances.wake_terms_acceptances_pkey": "p PRIMARY KEY (principal_key, terms_version)",+ "wake_terms_acceptances.wake_terms_acceptances_principal_key_check": "c CHECK (((length(principal_key) >= 1) AND (length(principal_key) <= 300)))",+ "wake_terms_acceptances.wake_terms_acceptances_terms_version_check": "c CHECK ((terms_version ~ '^[0-9a-f]{16}$'::text))","wanted_links.wanted_links_origin_page_id_fkey": "f FOREIGN KEY (origin_page_id) REFERENCES pages(id) ON DELETE CASCADE","wanted_links.wanted_links_pkey": "p PRIMARY KEY (id)","wanted_links.wanted_links_producer_check": "c CHECK ((producer = ANY (ARRAY['body'::text, 'frontmatter'::text])))",@@ -1175,9 +1186,21 @@"trust_proposals": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "wake_cron_runs": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "wake_crons": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "wake_forgets": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"wake_subscriptions": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "wake_terms_acceptances": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"wanted_links": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1695,10 +1718,17 @@"uniq_minion_attachments_job_filename": "CREATE UNIQUE INDEX uniq_minion_attachments_job_filename ON public.minion_attachments USING btree (job_id, filename)","uniq_minion_jobs_idempotency": "CREATE UNIQUE INDEX uniq_minion_jobs_idempotency ON public.minion_jobs USING btree (idempotency_key) WHERE (idempotency_key IS NOT NULL)","uniq_subagent_messages_idx": "CREATE UNIQUE INDEX uniq_subagent_messages_idx ON public.subagent_messages USING btree (job_id, message_idx)",+ "wake_cron_runs_name_idx": "CREATE INDEX wake_cron_runs_name_idx ON public.wake_cron_runs USING btree (name, finished_at)",+ "wake_cron_runs_pkey": "CREATE UNIQUE INDEX wake_cron_runs_pkey ON public.wake_cron_runs USING btree (id)",+ "wake_crons_pkey": "CREATE UNIQUE INDEX wake_crons_pkey ON public.wake_crons USING btree (name)",+ "wake_forgets_due_idx": "CREATE INDEX wake_forgets_due_idx ON public.wake_forgets USING btree (next_attempt_at) WHERE (state = 'pending'::text)",+ "wake_forgets_pending_unique": "CREATE UNIQUE INDEX wake_forgets_pending_unique ON public.wake_forgets USING btree (wake_user) WHERE (state = 'pending'::text)",+ "wake_forgets_pkey": "CREATE UNIQUE INDEX wake_forgets_pkey ON public.wake_forgets USING btree (id)","wake_subscriptions_open_idx": "CREATE INDEX wake_subscriptions_open_idx ON public.wake_subscriptions USING btree (next_attempt_at) WHERE (state = 'open'::text)","wake_subscriptions_open_unique": "CREATE UNIQUE INDEX wake_subscriptions_open_unique ON public.wake_subscriptions USING btree (wake_user, ws_subscription_id) WHERE (state = 'open'::text)","wake_subscriptions_pkey": "CREATE UNIQUE INDEX wake_subscriptions_pkey ON public.wake_subscriptions USING btree (id)","wake_subscriptions_principal_idx": "CREATE INDEX wake_subscriptions_principal_idx ON public.wake_subscriptions USING btree (principal_kind, principal_id, created_at DESC)",+ "wake_terms_acceptances_pkey": "CREATE UNIQUE INDEX wake_terms_acceptances_pkey ON public.wake_terms_acceptances USING btree (principal_key, terms_version)","wanted_links_pkey": "CREATE UNIQUE INDEX wanted_links_pkey ON public.wanted_links USING btree (id)","wanted_links_reference_unique": "CREATE UNIQUE INDEX wanted_links_reference_unique ON public.wanted_links USING btree (origin_page_id, producer, ref_kind, target_source_id, target_ref)","wanted_links_source_idx": "CREATE INDEX wanted_links_source_idx ON public.wanted_links USING btree (source_id)",@@ -1775,6 +1805,8 @@"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",+ "wake_cron_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_cron_runs.id",+ "wake_forgets_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_forgets.id","wake_subscriptions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_subscriptions.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",@@ -4600,6 +4632,36 @@],"flags": "relkind=r rls=false force_rls=false"},+ "wake_cron_runs": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('wake_cron_runs_id_seq'::regclass)",+ "2 name text/text NOT NULL",+ "3 status text/text NOT NULL",+ "4 finished_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_crons": {+ "columns": [+ "1 name text/text NOT NULL",+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_forgets": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('wake_forgets_id_seq'::regclass)",+ "2 wake_user text/text NOT NULL",+ "3 state text/text NOT NULL DEFAULT 'pending'::text",+ "4 attempts integer/int4 NOT NULL DEFAULT 0",+ "5 next_attempt_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "6 lease_until timestamp with time zone/timestamptz NULL",+ "7 last_error text/text NULL",+ "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "9 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"wake_subscriptions": {"columns": ["1 id bigint/int8 NOT NULL DEFAULT nextval('wake_subscriptions_id_seq'::regclass)",@@ -4618,7 +4680,16 @@"14 last_error text/text NULL","15 expires_at timestamp with time zone/timestamptz NOT NULL","16 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",- "17 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ "17 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "18 target_ref text/text NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_terms_acceptances": {+ "columns": [+ "1 principal_key text/text NOT NULL",+ "2 terms_version text/text NOT NULL",+ "3 accepted_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.jsonindex c95efbda38..fa4a494240 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json@@ -565,6 +565,14 @@"trust_proposals.trust_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","trust_proposals.trust_proposals_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'accepted'::text, 'rejected'::text, 'undone'::text, 'superseded'::text])))","trust_proposals.trust_proposals_target_table_check": "c CHECK ((target_table = ANY (ARRAY['facts'::text, 'takes'::text, 'timeline_entries'::text, 'pages'::text])))",+ "wake_cron_runs.wake_cron_runs_name_check": "c CHECK ((name ~ '^[a-z0-9._-]{1,64}$'::text))",+ "wake_cron_runs.wake_cron_runs_pkey": "p PRIMARY KEY (id)",+ "wake_cron_runs.wake_cron_runs_status_check": "c CHECK ((status = ANY (ARRAY['ok'::text, 'failed'::text])))",+ "wake_crons.wake_crons_name_check": "c CHECK ((name ~ '^[a-z0-9._-]{1,64}$'::text))",+ "wake_crons.wake_crons_pkey": "p PRIMARY KEY (name)",+ "wake_forgets.wake_forgets_pkey": "p PRIMARY KEY (id)",+ "wake_forgets.wake_forgets_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'done'::text, 'dead'::text])))",+ "wake_forgets.wake_forgets_wake_user_check": "c CHECK ((wake_user ~ '^[0-9a-f]{32}$'::text))","wake_subscriptions.wake_subscriptions_event_check": "c CHECK ((event ~ '^gbrain\\.[a-z][a-z0-9._]{0,47}$'::text))","wake_subscriptions.wake_subscriptions_pkey": "p PRIMARY KEY (id)","wake_subscriptions.wake_subscriptions_principal_kind_check": "c CHECK ((principal_kind = ANY (ARRAY['oauth_client'::text, 'legacy_token'::text, 'local_stdio'::text])))",@@ -572,6 +580,9 @@"wake_subscriptions.wake_subscriptions_target_check": "c CHECK (((length(target) >= 1) AND (length(target) <= 128)))","wake_subscriptions.wake_subscriptions_wake_user_check": "c CHECK ((wake_user ~ '^[0-9a-f]{32}$'::text))","wake_subscriptions.wake_subscriptions_ws_subscription_id_check": "c CHECK (((length(ws_subscription_id) >= 1) AND (length(ws_subscription_id) <= 200)))",+ "wake_terms_acceptances.wake_terms_acceptances_pkey": "p PRIMARY KEY (principal_key, terms_version)",+ "wake_terms_acceptances.wake_terms_acceptances_principal_key_check": "c CHECK (((length(principal_key) >= 1) AND (length(principal_key) <= 300)))",+ "wake_terms_acceptances.wake_terms_acceptances_terms_version_check": "c CHECK ((terms_version ~ '^[0-9a-f]{16}$'::text))","wanted_links.wanted_links_origin_page_id_fkey": "f FOREIGN KEY (origin_page_id) REFERENCES pages(id) ON DELETE CASCADE","wanted_links.wanted_links_pkey": "p PRIMARY KEY (id)","wanted_links.wanted_links_producer_check": "c CHECK ((producer = ANY (ARRAY['body'::text, 'frontmatter'::text])))",@@ -1175,9 +1186,21 @@"trust_proposals": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "wake_cron_runs": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "wake_crons": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "wake_forgets": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"wake_subscriptions": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "wake_terms_acceptances": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"wanted_links": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1695,10 +1718,17 @@"uniq_minion_attachments_job_filename": "CREATE UNIQUE INDEX uniq_minion_attachments_job_filename ON public.minion_attachments USING btree (job_id, filename)","uniq_minion_jobs_idempotency": "CREATE UNIQUE INDEX uniq_minion_jobs_idempotency ON public.minion_jobs USING btree (idempotency_key) WHERE (idempotency_key IS NOT NULL)","uniq_subagent_messages_idx": "CREATE UNIQUE INDEX uniq_subagent_messages_idx ON public.subagent_messages USING btree (job_id, message_idx)",+ "wake_cron_runs_name_idx": "CREATE INDEX wake_cron_runs_name_idx ON public.wake_cron_runs USING btree (name, finished_at)",+ "wake_cron_runs_pkey": "CREATE UNIQUE INDEX wake_cron_runs_pkey ON public.wake_cron_runs USING btree (id)",+ "wake_crons_pkey": "CREATE UNIQUE INDEX wake_crons_pkey ON public.wake_crons USING btree (name)",+ "wake_forgets_due_idx": "CREATE INDEX wake_forgets_due_idx ON public.wake_forgets USING btree (next_attempt_at) WHERE (state = 'pending'::text)",+ "wake_forgets_pending_unique": "CREATE UNIQUE INDEX wake_forgets_pending_unique ON public.wake_forgets USING btree (wake_user) WHERE (state = 'pending'::text)",+ "wake_forgets_pkey": "CREATE UNIQUE INDEX wake_forgets_pkey ON public.wake_forgets USING btree (id)","wake_subscriptions_open_idx": "CREATE INDEX wake_subscriptions_open_idx ON public.wake_subscriptions USING btree (next_attempt_at) WHERE (state = 'open'::text)","wake_subscriptions_open_unique": "CREATE UNIQUE INDEX wake_subscriptions_open_unique ON public.wake_subscriptions USING btree (wake_user, ws_subscription_id) WHERE (state = 'open'::text)","wake_subscriptions_pkey": "CREATE UNIQUE INDEX wake_subscriptions_pkey ON public.wake_subscriptions USING btree (id)","wake_subscriptions_principal_idx": "CREATE INDEX wake_subscriptions_principal_idx ON public.wake_subscriptions USING btree (principal_kind, principal_id, created_at DESC)",+ "wake_terms_acceptances_pkey": "CREATE UNIQUE INDEX wake_terms_acceptances_pkey ON public.wake_terms_acceptances USING btree (principal_key, terms_version)","wanted_links_pkey": "CREATE UNIQUE INDEX wanted_links_pkey ON public.wanted_links USING btree (id)","wanted_links_reference_unique": "CREATE UNIQUE INDEX wanted_links_reference_unique ON public.wanted_links USING btree (origin_page_id, producer, ref_kind, target_source_id, target_ref)","wanted_links_source_idx": "CREATE INDEX wanted_links_source_idx ON public.wanted_links USING btree (source_id)",@@ -1775,6 +1805,8 @@"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",+ "wake_cron_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_cron_runs.id",+ "wake_forgets_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_forgets.id","wake_subscriptions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_subscriptions.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",@@ -4600,6 +4632,36 @@],"flags": "relkind=r rls=false force_rls=false"},+ "wake_cron_runs": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('wake_cron_runs_id_seq'::regclass)",+ "2 name text/text NOT NULL",+ "3 status text/text NOT NULL",+ "4 finished_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_crons": {+ "columns": [+ "1 name text/text NOT NULL",+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_forgets": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('wake_forgets_id_seq'::regclass)",+ "2 wake_user text/text NOT NULL",+ "3 state text/text NOT NULL DEFAULT 'pending'::text",+ "4 attempts integer/int4 NOT NULL DEFAULT 0",+ "5 next_attempt_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "6 lease_until timestamp with time zone/timestamptz NULL",+ "7 last_error text/text NULL",+ "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "9 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"wake_subscriptions": {"columns": ["1 id bigint/int8 NOT NULL DEFAULT nextval('wake_subscriptions_id_seq'::regclass)",@@ -4618,7 +4680,16 @@"14 last_error text/text NULL","15 expires_at timestamp with time zone/timestamptz NOT NULL","16 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",- "17 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ "17 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "18 target_ref text/text NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_terms_acceptances": {+ "columns": [+ "1 principal_key text/text NOT NULL",+ "2 terms_version text/text NOT NULL",+ "3 accepted_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.jsonindex e5dcfae3e2..35324ead22 100644--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json@@ -565,6 +565,14 @@"trust_proposals.trust_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE","trust_proposals.trust_proposals_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'accepted'::text, 'rejected'::text, 'undone'::text, 'superseded'::text])))","trust_proposals.trust_proposals_target_table_check": "c CHECK ((target_table = ANY (ARRAY['facts'::text, 'takes'::text, 'timeline_entries'::text, 'pages'::text])))",+ "wake_cron_runs.wake_cron_runs_name_check": "c CHECK ((name ~ '^[a-z0-9._-]{1,64}$'::text))",+ "wake_cron_runs.wake_cron_runs_pkey": "p PRIMARY KEY (id)",+ "wake_cron_runs.wake_cron_runs_status_check": "c CHECK ((status = ANY (ARRAY['ok'::text, 'failed'::text])))",+ "wake_crons.wake_crons_name_check": "c CHECK ((name ~ '^[a-z0-9._-]{1,64}$'::text))",+ "wake_crons.wake_crons_pkey": "p PRIMARY KEY (name)",+ "wake_forgets.wake_forgets_pkey": "p PRIMARY KEY (id)",+ "wake_forgets.wake_forgets_state_check": "c CHECK ((state = ANY (ARRAY['pending'::text, 'done'::text, 'dead'::text])))",+ "wake_forgets.wake_forgets_wake_user_check": "c CHECK ((wake_user ~ '^[0-9a-f]{32}$'::text))","wake_subscriptions.wake_subscriptions_event_check": "c CHECK ((event ~ '^gbrain\\.[a-z][a-z0-9._]{0,47}$'::text))","wake_subscriptions.wake_subscriptions_pkey": "p PRIMARY KEY (id)","wake_subscriptions.wake_subscriptions_principal_kind_check": "c CHECK ((principal_kind = ANY (ARRAY['oauth_client'::text, 'legacy_token'::text, 'local_stdio'::text])))",@@ -572,6 +580,9 @@"wake_subscriptions.wake_subscriptions_target_check": "c CHECK (((length(target) >= 1) AND (length(target) <= 128)))","wake_subscriptions.wake_subscriptions_wake_user_check": "c CHECK ((wake_user ~ '^[0-9a-f]{32}$'::text))","wake_subscriptions.wake_subscriptions_ws_subscription_id_check": "c CHECK (((length(ws_subscription_id) >= 1) AND (length(ws_subscription_id) <= 200)))",+ "wake_terms_acceptances.wake_terms_acceptances_pkey": "p PRIMARY KEY (principal_key, terms_version)",+ "wake_terms_acceptances.wake_terms_acceptances_principal_key_check": "c CHECK (((length(principal_key) >= 1) AND (length(principal_key) <= 300)))",+ "wake_terms_acceptances.wake_terms_acceptances_terms_version_check": "c CHECK ((terms_version ~ '^[0-9a-f]{16}$'::text))","wanted_links.wanted_links_origin_page_id_fkey": "f FOREIGN KEY (origin_page_id) REFERENCES pages(id) ON DELETE CASCADE","wanted_links.wanted_links_pkey": "p PRIMARY KEY (id)","wanted_links.wanted_links_producer_check": "c CHECK ((producer = ANY (ARRAY['body'::text, 'frontmatter'::text])))",@@ -1175,9 +1186,21 @@"trust_proposals": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "wake_cron_runs": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "wake_crons": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],+ "wake_forgets": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"wake_subscriptions": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],+ "wake_terms_acceptances": [+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"+ ],"wanted_links": ["<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"],@@ -1691,10 +1714,17 @@"uniq_minion_attachments_job_filename": "CREATE UNIQUE INDEX uniq_minion_attachments_job_filename ON public.minion_attachments USING btree (job_id, filename)","uniq_minion_jobs_idempotency": "CREATE UNIQUE INDEX uniq_minion_jobs_idempotency ON public.minion_jobs USING btree (idempotency_key) WHERE (idempotency_key IS NOT NULL)","uniq_subagent_messages_idx": "CREATE UNIQUE INDEX uniq_subagent_messages_idx ON public.subagent_messages USING btree (job_id, message_idx)",+ "wake_cron_runs_name_idx": "CREATE INDEX wake_cron_runs_name_idx ON public.wake_cron_runs USING btree (name, finished_at)",+ "wake_cron_runs_pkey": "CREATE UNIQUE INDEX wake_cron_runs_pkey ON public.wake_cron_runs USING btree (id)",+ "wake_crons_pkey": "CREATE UNIQUE INDEX wake_crons_pkey ON public.wake_crons USING btree (name)",+ "wake_forgets_due_idx": "CREATE INDEX wake_forgets_due_idx ON public.wake_forgets USING btree (next_attempt_at) WHERE (state = 'pending'::text)",+ "wake_forgets_pending_unique": "CREATE UNIQUE INDEX wake_forgets_pending_unique ON public.wake_forgets USING btree (wake_user) WHERE (state = 'pending'::text)",+ "wake_forgets_pkey": "CREATE UNIQUE INDEX wake_forgets_pkey ON public.wake_forgets USING btree (id)","wake_subscriptions_open_idx": "CREATE INDEX wake_subscriptions_open_idx ON public.wake_subscriptions USING btree (next_attempt_at) WHERE (state = 'open'::text)","wake_subscriptions_open_unique": "CREATE UNIQUE INDEX wake_subscriptions_open_unique ON public.wake_subscriptions USING btree (wake_user, ws_subscription_id) WHERE (state = 'open'::text)","wake_subscriptions_pkey": "CREATE UNIQUE INDEX wake_subscriptions_pkey ON public.wake_subscriptions USING btree (id)","wake_subscriptions_principal_idx": "CREATE INDEX wake_subscriptions_principal_idx ON public.wake_subscriptions USING btree (principal_kind, principal_id, created_at DESC)",+ "wake_terms_acceptances_pkey": "CREATE UNIQUE INDEX wake_terms_acceptances_pkey ON public.wake_terms_acceptances USING btree (principal_key, terms_version)","wanted_links_pkey": "CREATE UNIQUE INDEX wanted_links_pkey ON public.wanted_links USING btree (id)","wanted_links_reference_unique": "CREATE UNIQUE INDEX wanted_links_reference_unique ON public.wanted_links USING btree (origin_page_id, producer, ref_kind, target_source_id, target_ref)","wanted_links_source_idx": "CREATE INDEX wanted_links_source_idx ON public.wanted_links USING btree (source_id)",@@ -1771,6 +1801,8 @@"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",+ "wake_cron_runs_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_cron_runs.id",+ "wake_forgets_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_forgets.id","wake_subscriptions_id_seq": "bigint start=1 min=1 max=9223372036854775807 increment=1 cycle=false cache=1 owned_by=wake_subscriptions.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",@@ -4596,6 +4628,36 @@],"flags": "relkind=r rls=false force_rls=false"},+ "wake_cron_runs": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('wake_cron_runs_id_seq'::regclass)",+ "2 name text/text NOT NULL",+ "3 status text/text NOT NULL",+ "4 finished_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_crons": {+ "columns": [+ "1 name text/text NOT NULL",+ "2 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_forgets": {+ "columns": [+ "1 id bigint/int8 NOT NULL DEFAULT nextval('wake_forgets_id_seq'::regclass)",+ "2 wake_user text/text NOT NULL",+ "3 state text/text NOT NULL DEFAULT 'pending'::text",+ "4 attempts integer/int4 NOT NULL DEFAULT 0",+ "5 next_attempt_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "6 lease_until timestamp with time zone/timestamptz NULL",+ "7 last_error text/text NULL",+ "8 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "9 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },"wake_subscriptions": {"columns": ["1 id bigint/int8 NOT NULL DEFAULT nextval('wake_subscriptions_id_seq'::regclass)",@@ -4614,7 +4676,16 @@"14 last_error text/text NULL","15 expires_at timestamp with time zone/timestamptz NOT NULL","16 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",- "17 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"+ "17 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",+ "18 target_ref text/text NULL"+ ],+ "flags": "relkind=r rls=true force_rls=false"+ },+ "wake_terms_acceptances": {+ "columns": [+ "1 principal_key text/text NOT NULL",+ "2 terms_version text/text NOT NULL",+ "3 accepted_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"],"flags": "relkind=r rls=true force_rls=false"},diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.jsonindex 3b272ef293..ed543da974 100644--- a/test/fixtures/goldens/doctor/content-pglite-human.json+++ b/test/fixtures/goldens/doctor/content-pglite-human.json@@ -98,7 +98,7 @@" [OK] database_encoding: Skipped (PGLite is always UTF8)"," [OK] schema_version: Version <latest> (latest: <latest>)"," [OK] schema_columns: 1393 column(s) verified against live schema",- " [OK] schema_missing_tables: All 178 table(s) the applied migrations create exist.",+ " [OK] schema_missing_tables: All 182 table(s) the applied migrations create exist."," [OK] rls_event_trigger: Skipped (PGLite — no event trigger support)"," [INFO] embeddings: Not applicable: embeddings are disabled on this brain (keyword search keeps working)."," [INFO] embedding_provider: Not probed: embeddings are disabled on this brain by choice (keyword search keeps working).",diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.jsonindex 7b9a5d1f5d..8bf164b751 100644--- a/test/fixtures/goldens/doctor/content-pglite-json.json+++ b/test/fixtures/goldens/doctor/content-pglite-json.json@@ -1149,7 +1149,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 178 table(s) the applied migrations create exist.",+ "message": "All 182 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex 1a48759622..3025f9317d 100644--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json@@ -1220,7 +1220,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 178 table(s) the applied migrations create exist.",+ "message": "All 182 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -6343,7 +6343,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 178 table(s) the applied migrations create exist.",+ "message": "All 182 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex 33216de7b1..3c03ceaaff 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -1062,7 +1062,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 178 table(s) the applied migrations create exist.",+ "message": "All 182 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 932946be75..2bf8746763 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -1109,7 +1109,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 178 table(s) the applied migrations create exist.",+ "message": "All 182 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.jsonindex 50a0c623f6..b2ba791cba 100644--- a/test/fixtures/goldens/migrations/records.json+++ b/test/fixtures/goldens/migrations/records.json@@ -1,6 +1,6 @@{"golden": {- "count": 302,+ "count": 303,"gaps": [17,18,@@ -103,7 +103,7 @@"widenIdentityIndex": "86a6176bd7637d964dbc1d3cd3b1bdfa3ca0161e1ee248c37d7380a1471282e6","withSchemaLockTimeout": "95605bd3004955e11e936c7a4aa6889319b401098abf9db18ef3e48da2c3fc59"},- "latest": 307,+ "latest": 308,"records": [{"handler": {@@ -5002,6 +5002,19 @@"transaction": "absent","verify": "absent","version": 307+ },+ {+ "handler": "absent",+ "idempotent": true,+ "name": "wake_events",+ "sql": {+ "length": 1942,+ "sha256": "52ee16786f69608de107d1e9df7d13841b65654ee954fbca8fbc87fa0cbdcb4e"+ },+ "sqlFor": "absent",+ "transaction": "absent",+ "verify": "absent",+ "version": 308}],"versions": [@@ -5306,7 +5319,8 @@304,305,306,- 307+ 307,+ 308]},"normalizer": "migrations-record-v1"diff --git a/test/setup-openclaw-wakeshift.serial.test.ts b/test/setup-openclaw-wakeshift.test.tssimilarity index 100%rename from test/setup-openclaw-wakeshift.serial.test.tsrename to test/setup-openclaw-wakeshift.test.tsdiff --git a/test/wakeshift-nudge.serial.test.ts b/test/wakeshift-nudge.test.tssimilarity index 100%rename from test/wakeshift-nudge.serial.test.tsrename to test/wakeshift-nudge.test.tsdiff --git a/test/wakeshift-watch.serial.test.ts b/test/wakeshift-watch.test.tssimilarity index 100%rename from test/wakeshift-watch.serial.test.tsrename to test/wakeshift-watch.test.ts