Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(wakeshift): changelog entry, key-files for the PR 2 surface; regenerate Postgres and upgrade-replay goldens

garrytan61d7222f53be
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 00e93d0379..3b17399230 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,22 @@ credits are retained; no result has been reassigned to another provider. Origina
identifiers and attribution are available in the pre-removal Git revision
`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).
+## [Unreleased]
+
+**gbrain can now report back when a pending write settles or a cron run finishes, on brains shared with access members, and to OpenClaw and thin-client agents. Reporting back stays off until the brain owner turns it on.**
+
+Two new events join job completion. `watch_write_request` wakes the conversation when a `write_pending` write commits, fails, conflicts or is cancelled. It uses the same check as `get_write_request`, so someone else's request reads as not found. `watch_cron` wakes it after the next run of a cron the owner registered with `gbrain wakeshift cron add <name>`. The cron's own script ends with `gbrain wakeshift emit cron.finished --name <name> --status ok|failed`, which records the run and never blocks or fails the script. Every wake is still a pointer (ids, status and times), never page text or cron output. A brain with access members can now report back too. The owner gives their terms and privacy links to `gbrain wakeshift enable`, and each member's agent shows the agreement step and records acceptance before its first watch. Removing a member, revoking a token or deleting an OAuth client ends that principal's watches and asks Wakeshift to forget its user. Guide: docs/guides/wakeshift.md.
+
+### Itemized changes
+
+- New MCP tools `watch_write_request`, `watch_cron` and `accept_wakeshift_terms`, listed only while reporting back is on. `list_watches` and `unwatch` now cover every kind of watch.
+- New `gbrain wakeshift cron add | remove | list` and `gbrain wakeshift emit cron.finished`. `enable` takes `--terms-url` and `--privacy-url` (https), which a brain with access members needs. `status` and doctor say when gbrain's published events are older than the installed gbrain; run `gbrain wakeshift enable` again to publish the new ones.
+- New `gbrain wakeshift watch job <id> | write <request_id> | cron <name>`, which runs on a thin client (`gbrain init --mcp-only`). It prints Wakeshift's instructions as the last line and never saves a session key.
+- New `gbrain setup openclaw --wakeshift`. After consent, it installs and enables Wakeshift's OpenClaw plugin, pinned at `@wakeshift/[email protected]`. On a gateway that listens beyond the machine, it prints Wakeshift's question about the hooks endpoint and never answers it. A new doctor check `wakeshift_openclaw` warns when the installed plugin differs from the pin.
+- `gbrain setup claude-code` and `gbrain setup codex` show a "Report back (Wakeshift)" row in the first-run settings. After a remote `submit_job` or `submit_agent`, a once-per-session notice (`wakeshift_report_back`, muteable) says how to have the conversation woken. With reporting back on, the MCP instructions gain one sentence about it. With it off, the instructions are unchanged.
+- Fixed: Wakeshift's instructions in a watch result were cut at 2,000 characters, which dropped the step that starts Claude Code's listener. They now pass through whole, up to 16,000.
+- Schema migration v291 adds `wake_crons`, `wake_cron_runs`, `wake_terms_acceptances`, `wake_forgets` and `wake_subscriptions.target_ref`. All are empty unless reporting back is on, and repo-less brains get them unchanged.
+
## [0.60.589.0] - 2026-11-06
**gbrain can now wake an agent's conversation when a job it started finishes, through Wakeshift. It's off until the brain owner turns it on.**
diff --git a/docs/architecture/key-files/wakeshift.md b/docs/architecture/key-files/wakeshift.md
index a272a37cd3..e1ec8ccd60 100644
--- a/docs/architecture/key-files/wakeshift.md
+++ b/docs/architecture/key-files/wakeshift.md
@@ -3,4 +3,5 @@
[Subsystem index](../KEY_FILES.md). Read only the entries relevant to your change.
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` 7 d, insert, roll back on failure, wake at once when settled, Wakeshift's addition through `ctx.emitToolTail`); `ctx.mcpCaller` (client name, User-Agent, request `_meta`) is set by the stdio and both HTTP transports. `terms.ts` is the shared-brain agreement step: on a brain with live access members each principal's first `watch_*` returns it until `accept_wakeshift_terms` records (principal key, version = 16 hex of SHA-256 over the two operator links) in `wake_terms_acceptances`. `forget.ts` (`forgetWakePrincipal`, over the scalar SqlQuery) is called by `removeMember` (access/members.ts), `revokeLegacyTokenById` (token-mint.ts) and `auth revoke`/`revoke --id`/`revoke-client` (commands/auth.ts): it ends the principal's open rows (`principal_revoked`), drops its acceptance and queues `wake_forgets` for users not derived from a member that outlives the credential. `drain.ts` is pull reconciliation: `gbrain serve` and `MinionWorker.start` run a 5 s unref'd timer, `gbrain jobs work` (PGLite) a final pass; one candidate query LEFT JOINs each event family (`minion_jobs`, `persistence_requests` committed with no recovery record or failed/conflict/cancelled, the first `wake_cron_runs` row after the watch began), at most 20 leased rows a tick; the emit id `<event>:<target>:<marker>:<row>:<namespace>` (12 hex of the watch's user and creation time, so brains on one key never collide); the claim re-checking backoff and attempts, a settle only under the claim's lease, the principal re-checked before each emit (a revoked one ends and queues its forget), on a shared brain the terms acceptance re-checked (`terms_not_accepted` ends), 5 attempts on 30 s/2 m/8 m/30 m (429 honours Retry-After, other 4xx final), dead/revoked/expired rows ended at Wakeshift once; up to 10 leased queued forgets a tick on the same schedule. Payloads are pointers: ids, status, operation, times, next call; never page text, slugs or cron output. Tables: v290 `wake_subscriptions`, v291 `wake_crons`, `wake_cron_runs`, `wake_terms_acceptances`, `wake_forgets` and `wake_subscriptions.target_ref`. The CLI (`enable` with consent, the terms links on a shared brain, GET /app, the manifest merge and its stored hash; `disable`, `status` with the stale-manifest line, `test`, `cron add|remove|list`, `emit`; `watch` dispatches to `wakeshift-watch.ts`) is the only writer of the file-plane keys. Doctor warns on key mode, no usable key, members without terms links, dead and id_reused rows, forgets older than a day, unregistered cron emits and a stale manifest. Tests: `test/wakeshift-client.test.ts`, `test/wakeshift.serial.test.ts` and `test/wakeshift-pr2.serial.test.ts` (repo-less PGLite against `test/helpers/fake-wakeshift.ts`), `test/e2e/wakeshift-postgres.test.ts` and `test/e2e/wakeshift-pr2-postgres.test.ts`.
+- `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`.
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index a53fcdcefc..bf29c7e224 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -551,6 +551,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])))",
@@ -558,6 +566,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])))",
@@ -1141,9 +1152,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"
],
@@ -1647,10 +1670,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)",
@@ -1726,6 +1756,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",
@@ -4473,6 +4505,36 @@
],
"flags": "relkind=r rls=true 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)",
@@ -4491,7 +4553,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/postgres-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
index 0000e9004f..1c52c38a26 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -551,6 +551,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])))",
@@ -558,6 +566,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])))",
@@ -1141,9 +1152,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"
],
@@ -1647,10 +1670,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)",
@@ -1726,6 +1756,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",
@@ -4473,6 +4505,36 @@
],
"flags": "relkind=r rls=true 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)",
@@ -4491,7 +4553,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/postgres-engine-init-high-dims.json b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
index b09bcb6053..5cc4b6ad81 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -551,6 +551,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])))",
@@ -558,6 +566,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])))",
@@ -1141,9 +1152,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"
],
@@ -1643,10 +1666,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)",
@@ -1722,6 +1752,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",
@@ -4469,6 +4501,36 @@
],
"flags": "relkind=r rls=true 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)",
@@ -4487,7 +4549,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/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 0a6f87c019..6901d2d802 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -1083,7 +1083,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "RLS enabled on 173/173 public tables",
+ "message": "RLS enabled on 177/177 public tables",
"name": "rls",
"status": "ok"
},
@@ -1111,7 +1111,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 173 table(s) the applied migrations create exist.",
+ "message": "All 177 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
diff --git a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
index ba3f7b86f9..4c95e70947 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -549,6 +549,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])))",
@@ -556,6 +564,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])))",
@@ -1140,9 +1151,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"
],
@@ -1645,10 +1668,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)",
@@ -1725,6 +1755,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",
@@ -4478,6 +4510,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)",
@@ -4496,7 +4558,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"
},