Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Regenerate the QM wave's contract and goldens, count both new carry tables, and add the combined changelog entry

garrytan1e064ad9c976
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5280a6ffb8..e2ba9df0e4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,35 @@ 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]
+
+**QM, the AI helper that uses gbrain as one of its memories, can now read a person's own brain safely, read shared rooms only as the room's audience, and suggest edits that wait for the brain owner's yes.** This lands the QM internal-provider chain (#8475, #8480, #8557, #8477, #8483, #8479, #8466) as one release. Nothing changes for a brain with no attested (`x-qm-actor`) client: unattested calls and member-bound credentials behave as before, and every new table is database state, so a repo-less brain works the same.
+
+### What changed
+
+| Area | Before | Now |
+|---|---|---|
+| Direct page writes from QM | an attested call could run `add_timeline_entry`, `add_link`, `put_page` and `edit_page` | refused (`actor_not_attested`, reason `op_not_attested`); `--attest-ops` refuses a list that names one, and a queued attested write of one fails when it publishes |
+| Reads that name sources | only `memory_recall` read named sources as their audience | `get_page`, `entity`, `whois`, `get_backlinks`, `get_timeline`, `find_experts`, `volunteer_context` and `query` do too: restricted pages and member pages read as missing, `__all__`/`all_sources` beside a named source is refused |
+| How a client reads named sources | always as the audience | `gbrain auth rescope --attest-read person\|scope\|none`; `scope` also refuses any call that names no person; `gbrain doctor` warns (`attest_read_shared_scope`) when a person client reads a source a scope client reads |
+| A person's own DM sources | every attested caller with the grant read every DM source in it | `gbrain access member source add\|remove\|list` binds a source to its member; an attested call reads its grant minus other members' personal sources, and a scope read reads no personal source at all |
+| QM contract | v1 and v2 | v3 (`docs/contracts/qm-memory-provider/v3.json`) adds the person's own-DM tools with frozen result shapes, `structuredContent` on attested personal reads (re-measured against the result cap), an `arm` (`own`/`ranked`) on each `memory_recall` fact, and an opt-in `memory_recall` `query_keep` (`head`/`tail`) that adds `query_truncated`; v1 and v2 are byte-identical |
+| Suggested edits | none | `memory_propose` holds one timeline entry or one link for the owner; `gbrain memory-proposals list\|show\|approve\|deny` on the brain host decides it, and approval publishes through the normal writer door with the member's id in its provenance |
+| Members | id and name | an operator-declared email (`gbrain access member add\|set --email`), and `gbrain access member link --email <addr> --qm <id>` |
+| Remote owner administration | a shell on the brain host | `gbrain mcp admin attest`, `member-add\|member-set\|member-disable\|member-enable\|members` and `link\|unlink\|links` over the owner-session routes `/admin/api/access/attest`, `/members` and `/member-links`; no OAuth token or MCP tool reaches them |
+
+### Itemized changes
+
+- `src/core/access/actor-model.ts`: the four page writes join `ACTOR_DEFERRED_OPS`; `docs/contracts/qm-memory-provider/v2.json` lists them in `deferred_ops` (a published-contract amendment).
+- `src/core/access/scope-read.ts` (new), `src/mcp/dispatch.ts`: `SCOPE_READ_ACCESS`, `SCOPE_READ_OPS`, `attestedReadMode`; `attest_read` on `access_tokens` and `oauth_clients` (migration v297).
+- `src/core/access/member-sources.ts` (new): `access_member_sources` (migration v298) and `attestedReadScope`, also applied to agent jobs submitted for an attested actor.
+- `src/core/ops/qm-memory.ts`, `scripts/build-qm-memory-contract.ts`: contract v3, `qmMemoryToolResult` for personal tools, recall arms, `query_keep`, and `boundRecallChars` trimming `facts_groups` and `entity_unspecified` to the facts it delivers.
+- `src/core/persistence/memory-proposals.ts` (new), `src/commands/memory-proposals.ts` (new): `memory_proposals` (migration v299), owner review, TTL and retention; a proposed link re-checks its target when it publishes.
+- `src/core/access/members.ts`, `src/core/access/actor.ts`, `src/commands/access.ts`, `src/commands/serve-http-access.ts`, `src/commands/mcp-admin.ts`: member email (migration v300), `linkMemberByEmail`, and the owner HTTP routes with an `access_admin` request-log row per applied change.
+- Inventories: `access_member_sources`, `memory_proposals` and the email column join the deletion and graduation inventories.
+- Docs: `docs/guides/qm.md` (reads that name sources, each person's own sources, proposed writes), `docs/mcp/ADMIN.md`, `docs/architecture/key-files/access.md`.
+- Tests: `test/qm-scope-read.test.ts`, `test/qm-personal-sources.test.ts`, `test/qm-personal-tools.test.ts`, `test/qm-memory-propose.test.ts`, `test/access-members.test.ts`, `test/serve-http-access.test.ts`, `test/mcp-admin-cli.serial.test.ts` (PGLite and Postgres where they touch the database).
+
## [0.60.626.0] - 2026-11-09
**`gbrain sources record-origin --remote` now locks down the existing checkout too, and on a managed brain it can no longer report success while a reclone still clones with git-lfs on.** On a managed brain the record took only the source row lock, so a reclone that had already read the source, or held its worktree locks, could clone with git-lfs downloads and hooks on after the command said the source was recorded. The record now takes the worktree locks and rows a reclone takes (refusing the id `source_busy` while one runs), and the reclone reads the record under its own locks. `--remote --apply` now also turns git-lfs downloads and hooks off in the existing checkout's `.git/config`, because a reclone only happens when a checkout is lost or replaced, and until then doctor read green while the checkout still fetched git-lfs objects and ran hooks. The git-lfs check now reads a committed `.gitattributes` under a directory whose name holds a tab (it was cut at the tab and skipped), ignores commented-out `filter=lfs` lines, says "declares a git-lfs filter" when a rule only declares one, and records a clone of an empty repository instead of telling the operator to restore an intact checkout. A failed write is reported for its own id instead of ending the run without saying which ids were recorded.
diff --git a/docs/contracts/qm-memory-provider/v3.json b/docs/contracts/qm-memory-provider/v3.json
index 428e51f1ef..44ebe24e27 100644
--- a/docs/contracts/qm-memory-provider/v3.json
+++ b/docs/contracts/qm-memory-provider/v3.json
@@ -341,6 +341,13 @@
"explain": {
"type": "boolean",
"description": "Include factor breakdown per result (expertise, recency, salience)."
+ },
+ "source_ids": {
+ "type": "array",
+ "description": "Narrow to these sources (omit or [] for all you can read).",
+ "items": {
+ "type": "string"
+ }
}
},
"required": []
@@ -706,6 +713,17 @@
"unknown",
"external_untrusted"
]
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Read only this source."
+ },
+ "source_ids": {
+ "type": "array",
+ "description": "Narrow to these sources (omit or [] for all you can read).",
+ "items": {
+ "type": "string"
+ }
}
},
"required": [
@@ -1042,6 +1060,13 @@
"days": {
"type": "number",
"description": "Stats window in days (default 30; stats mode only)."
+ },
+ "source_ids": {
+ "type": "array",
+ "description": "Narrow to these sources (omit or [] for all you can read).",
+ "items": {
+ "type": "string"
+ }
}
},
"required": []
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-default.json b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
index dd8c81132e..a57bef7c29 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-default.json
@@ -12,6 +12,7 @@
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
"access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
+ "access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
"access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
@@ -202,6 +203,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -852,6 +858,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1173,6 +1182,7 @@
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
"access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
"access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
+ "access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
"access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
@@ -1443,6 +1453,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1789,7 +1804,8 @@
"3 disabled_at timestamp with time zone/timestamptz NULL",
"4 tombstoned_at timestamp with time zone/timestamptz NULL",
"5 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 email text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -2903,6 +2919,35 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
index 8988cc2741..876be0a065 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-fts-portuguese.json
@@ -12,6 +12,7 @@
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
"access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
+ "access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
"access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
@@ -202,6 +203,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -852,6 +858,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1173,6 +1182,7 @@
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
"access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
"access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
+ "access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
"access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
@@ -1443,6 +1453,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1789,7 +1804,8 @@
"3 disabled_at timestamp with time zone/timestamptz NULL",
"4 tombstoned_at timestamp with time zone/timestamptz NULL",
"5 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 email text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -2903,6 +2919,35 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
index b5dbf6f14d..365464f1c7 100644
--- a/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/pglite-engine-init-high-dims.json
@@ -12,6 +12,7 @@
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
"access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
+ "access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
"access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
@@ -202,6 +203,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -852,6 +858,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1173,6 +1182,7 @@
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
"access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
"access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
+ "access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
"access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
@@ -1439,6 +1449,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1785,7 +1800,8 @@
"3 disabled_at timestamp with time zone/timestamptz NULL",
"4 tombstoned_at timestamp with time zone/timestamptz NULL",
"5 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 email text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -2899,6 +2915,35 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id 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 e4ecbb44f0..be99b70d55 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -12,6 +12,7 @@
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
"access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
+ "access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
"access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
@@ -205,6 +206,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -859,6 +865,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1174,6 +1183,7 @@
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
"access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
"access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
+ "access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
"access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
@@ -1446,6 +1456,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1790,7 +1805,8 @@
"3 disabled_at timestamp with time zone/timestamptz NULL",
"4 tombstoned_at timestamp with time zone/timestamptz NULL",
"5 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 email text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -2915,6 +2931,35 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id 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 b772e8a840..96dfceab80 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -12,6 +12,7 @@
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
"access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
+ "access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
"access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
@@ -205,6 +206,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -859,6 +865,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1174,6 +1183,7 @@
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
"access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
"access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
+ "access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
"access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
@@ -1446,6 +1456,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1790,7 +1805,8 @@
"3 disabled_at timestamp with time zone/timestamptz NULL",
"4 tombstoned_at timestamp with time zone/timestamptz NULL",
"5 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 email text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -2915,6 +2931,35 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id 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 4acd5bdd80..fa9d91c628 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -12,6 +12,7 @@
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
"access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
+ "access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
"access_pending_coverage.access_pending_coverage_pkey": "p PRIMARY KEY (source_id, prefix, reason)",
@@ -205,6 +206,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -859,6 +865,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1174,6 +1183,7 @@
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
"access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
"access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
+ "access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
"access_policy_migrations_pkey": "CREATE UNIQUE INDEX access_policy_migrations_pkey ON public.access_policy_migrations USING btree (id)",
@@ -1442,6 +1452,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1786,7 +1801,8 @@
"3 disabled_at timestamp with time zone/timestamptz NULL",
"4 tombstoned_at timestamp with time zone/timestamptz NULL",
"5 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
- "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ "6 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 email text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
@@ -2911,6 +2927,35 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id text/text NOT NULL",
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index 207aa73c5d..43bb2944f3 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 283832,
- "stdoutSha256": "0dc874e7174632c11a161c4c4f06f26512f4d13ba1da5c05f8478da75201c53c",
+ "stdoutBytes": 286966,
+ "stdoutSha256": "937a3cf33c41567fff0f041286ba19750cb910df266e5c08ac50ec14456c50fe",
"toolNames": [
"remember",
"entity",
@@ -164,6 +164,7 @@
"unpurge_page",
"memory_recall",
"memory_write",
+ "memory_propose",
"get_memory_settings",
"set_memory_writeback",
"memory_conversation_mode",
@@ -7447,6 +7448,7 @@
"acting_user": "string?",
"max_chars": "integer?",
"query": "string",
+ "query_keep": "string?",
"source_id": "string?",
"source_ids": "array?"
},
@@ -7465,6 +7467,14 @@
"description": "What the turn is about; ranks the facts.",
"type": "string"
},
+ "query_keep": {
+ "description": "Which end of a query over 2000 characters ranks the facts: head (the default) or tail. Sending it adds query_truncated.",
+ "enum": [
+ "head",
+ "tail"
+ ],
+ "type": "string"
+ },
"source_id": {
"description": "Read this one source as its audience (a shared scope): never the person's own facts.",
"type": "string"
@@ -7557,6 +7567,101 @@
},
"scope": "write"
},
+ {
+ "description": "Propose one timeline entry or link on a shared page for the person this call serves; the brain owner approves it before it is written. Needs an attested person. Poll get_write_request with the request_id; the same idempotency_key replays.",
+ "idempotent": true,
+ "local_only": false,
+ "mutating": true,
+ "name": "memory_propose",
+ "parameters": {
+ "acting_user": "string?",
+ "context": "string?",
+ "date": "string?",
+ "detail": "string?",
+ "expected_revision": "string?",
+ "idempotency_key": "string",
+ "kind": "string",
+ "link_type": "string?",
+ "source": "string?",
+ "summary": "string?",
+ "target": "string",
+ "to": "string?",
+ "valid_from": "string?",
+ "valid_until": "string?"
+ },
+ "required_scopes": [],
+ "schema": {
+ "properties": {
+ "acting_user": {
+ "description": "Set by the trusted system: equal to the x-qm-actor header, or omit.",
+ "type": "string"
+ },
+ "context": {
+ "description": "link: context.",
+ "type": "string"
+ },
+ "date": {
+ "description": "timeline: YYYY-MM-DD.",
+ "type": "string"
+ },
+ "detail": {
+ "description": "timeline: details.",
+ "type": "string"
+ },
+ "expected_revision": {
+ "description": "The revision shown to the person; refused when the page moved.",
+ "type": "string"
+ },
+ "idempotency_key": {
+ "description": "1-128 visible ASCII characters; the same key replays this proposal.",
+ "type": "string"
+ },
+ "kind": {
+ "description": "timeline (date, summary) or link (to).",
+ "enum": [
+ "timeline",
+ "link"
+ ],
+ "type": "string"
+ },
+ "link_type": {
+ "description": "link: a type the schema pack declares.",
+ "type": "string"
+ },
+ "source": {
+ "description": "timeline: where it came from.",
+ "type": "string"
+ },
+ "summary": {
+ "description": "timeline: one line.",
+ "type": "string"
+ },
+ "target": {
+ "description": "Slug the write lands on (a link's from page).",
+ "type": "string"
+ },
+ "to": {
+ "description": "link: the page it points to.",
+ "type": "string"
+ },
+ "valid_from": {
+ "description": "link: YYYY-MM-DD.",
+ "type": "string"
+ },
+ "valid_until": {
+ "description": "link: YYYY-MM-DD.",
+ "type": "string"
+ }
+ },
+ "required": [
+ "kind",
+ "target",
+ "idempotency_key"
+ ],
+ "type": "object"
+ },
+ "scope": "write"
+ },
{
"description": "Memory writeback settings: the mode agents follow, the exact rule text, every mode's rule, background capture state, and whether you may change it.",
"idempotent": true,
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index a9883f0157..4e641e98e5 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -1092,7 +1092,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "RLS enabled on 174/174 public tables",
+ "message": "RLS enabled on 176/176 public tables",
"name": "rls",
"status": "ok"
},
@@ -1120,7 +1120,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "All 174 table(s) the applied migrations create exist.",
+ "message": "All 176 table(s) the applied migrations create exist.",
"name": "schema_missing_tables",
"status": "ok"
},
@@ -2585,6 +2585,13 @@
"name": "decide_health",
"status": "ok"
},
+ {
+ "category": "brain",
+ "elapsed_ms": "<volatile>",
+ "message": "No memory proposals await the owner.",
+ "name": "memory_proposals_pending",
+ "status": "ok"
+ },
{
"category": "brain",
"details": {
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index fb075cb8f9..3895d7ac30 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -6841,7 +6841,7 @@
{
"kind": "class",
"members": [
- "canonical?: \"unknown\" | \"timeout\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"rate_limited\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | \"owner_marker_missing\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"absent_from_worktree\" | \"access_command_failed\" | \"access_member_disabled\" | \"on_behalf_of_invalid_audience\" | \"on_behalf_of_unknown_member\" | \"on_behalf_of_not_permitted\" | \"actor_not_attested\" | \"actor_unlinked\" | \"on_behalf_of_in_arguments\" | \"access_policy_invalid\" | \"access_policy_pending\" | \"access_policy_widening_held\" | \"access_policy_store_mismatch\" | \"access_rule_invalid\" | \"access_member_id_retired\" | \"access_member_invalid\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"admission_paused\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"atom_drain_incomplete\" | \"atom_drain_no_progress\" | \"atom_drain_provider_failure\" | \"autopilot_job_owned_by_other_brain\" | \"body_staging_expired\" | \"budget_below_recent_runtime\" | \"backup_dump_failed\" | \"backup_too_large\" | \"belief_coverage_required\" | \"belief_stale_preparation\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_cleanup_pending\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"valid_time_undeclared\" | \"coverage_from\" | \"coverage_gap\" | \"clock_mismatch\" | \"extract_write_lost\" | \"item_failures_systemic\" | \"known_as_of_unproven\" | \"cache_quota_exceeded\" | \"calendar_unreadable\" | \"capacity_paused\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"host_upgrade_required\" | \"change_reason_rejected\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkout_not_a_source\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_not_found\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"commit_lock_busy\" | \"commit_base_moved\" | \"commit_paths_invalid\" | \"commit_prestaged_paths\" | \"commit_outside_source_root\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"connection_lost\" | \"connector_access_denied\" | \"connector_auth_required\" | \"connector_binding_missing\" | \"connector_item_too_large\" | \"connector_response_too_large\" | \"connector_shape_drift\" | \"chunkless_pages_healable\" | \"consent_required\" | \"consent_timeout\" | \"consumers_without_heartbeat\" | \"content_repair_needs_human\" | \"content_null_bytes\" | \"content_rejected\" | \"continuation_unproven\" | \"corpus_chat_unavailable\" | \"corpus_window_backoff\" | \"corpus_window_dead_lettered\" | \"convergence_read_failed\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cursor_incarnation_retired\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"deleted_page_chunks_overdue\" | \"demo_graph_failed\" | \"downgrade_blocked_deferred_writes\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"drain_holder_stalled\" | \"drain_stalled\" | \"managed_sync_not_moving\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"doctor_tier_unavailable\" | \"effect_not_failed\" | \"embed_backfill_stalled\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_identity_unqualified\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_state_unknown\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"embedded_core_required\" | \"engine_embedding_mismatch\" | \"embedded_engine_required\" | \"engine_closed\" | \"engine_host_missing\" | \"engine_scope_missing\" | \"engine_scope_required\" | \"engine_settings_invalid\" | \"engine_graduated\" | \"entity_types_unavailable\" | \"eval_suite_unwired\" | \"explicit_tasks_conflict\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"fact_withdrawn\" | \"fact_rows_collide\" | \"fence_row_changed\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"file_database_drift\" | \"fix_not_writable\" | \"file_drift\" | \"file_drift_mixed_selection\" | \"file_drift_state_required\" | \"file_removed_during_scan\" | \"file_unreadable\" | \"file_wins_rewrite\" | \"file_too_large\" | \"follow_approval_required\" | \"forget_requires_owner\" | \"reserved_frontmatter_key\" | \"generation_fenced\" | \"generation_held\" | \"generation_live_conflict\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"ghost_mass_delete_refused\" | \"notifier_stalled\" | \"origin_twin_mass_merge_refused\" | \"ghost_storage_unknown\" | \"git_branch_unborn\" | \"git_durability_not_enabled\" | \"git_checkout_required\" | \"git_worktree_link_broken\" | \"hosted_repo_refused\" | \"git_detached_head\" | \"git_index_conflict\" | \"git_index_locked\" | \"git_index_stale\" | \"git_target_pending\" | \"git_operation_in_progress\" | \"git_push_unavailable\" | \"git_target_changed\" | \"git_target_ignored\" | \"git_target_unsafe\" | \"git_unavailable\" | \"git_object_missing\" | \"git_conversion_blocked\" | \"git_conversion_delta\" | \"conversion_file_in_source_root\" | \"git_conversion_incomplete\" | \"git_home_required\" | \"git_private_commit_refused\" | \"git_protocol_required\" | \"git_lfs_not_enabled\" | \"gitlink_not_followed\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"grant_scope\" | \"graph_incomplete\" | \"host_identity_mismatch\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"head_blocked\" | \"held_failed\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"integrate_conflict\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"unclosed_ambiguous_tail\" | \"tail_exposure_approval\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"ipc_path_too_long\" | \"legacy_twin_mass_merge_refused\" | \"legacy_twins_storage_unknown\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"legacy_lock_removal_refused\" | \"link_cursor_invalid\" | \"local_conflict\" | \"lock_busy\" | \"loops_extraction_skipped\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_failure_unsettled\" | \"managed_remedy_unavailable\" | \"memory_setting_write_outcome_unknown\" | \"merge_recommended\" | \"movement_unknown\" | \"managed_sync_flag_refused\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_declined\" | \"migration_failed\" | \"migration_host_work_pending\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_context_ceiling\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_converged\" | \"not_owner_host\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"page_body_rows_unreadable\" | \"page_projection_stale\" | \"page_shrink_refused\" | \"page_too_large_for_inline\" | \"parse_error\" | \"part_splits_code_point\" | \"part_too_large\" | \"frontmatter_alias_limit\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"path_not_utf8\" | \"pattern_claims_pending\" | \"patterns_min_interval\" | \"pending_verify\" | \"pending_writes\" | \"persistence_restart_required\" | \"pool_inflight_over_budget\" | \"deep_health_probe_failed\" | \"refresh_required\" | \"serve_self_exit_suppressed\" | \"serve_unhealthy_exit\" | \"persistence_write_stall\" | \"publish_secret_found\" | \"publish_scan_unreadable\" | \"push_unconfirmed\" | \"schema_lock_blocked\" | \"pg_connection_recovery_failed\" | \"pg_connection_stuck\" | \"pg_pool_stalled\" | \"pg_statement_build_failed\" | \"pglite_busy\" | \"pglite_vector_index_too_large\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"knock_on_exhausted\" | \"keyword_skipped_after_timeout\" | \"publication_pending\" | \"pull_blocked_local_changes\" | \"purge_blocked_pending_recovery\" | \"purge_lookup_timeout\" | \"purge_mirror_unwritable\" | \"question_not_found\" | \"question_owner_only\" | \"rank_entities_timeout\" | \"read_budget_exhausted\" | \"reason_purge_scan_capped\" | \"reason_purge_scan_failed\" | \"reason_scan_capped\" | \"reason_scan_failed\" | \"reason_trailer_secret\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"pat_file_unreadable\" | \"reconcile_host_required\" | \"reconcile_read_incomplete\" | \"recovery_prior_stage_unavailable\" | \"recovery_version_unsupported\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_lock_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"pending_import_expired\" | \"refresh_barrier_expired\" | \"refresh_source_changed\" | \"refresh_sync_timeout\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"rename_identity_unreadable\" | \"rename_reconcile_failed\" | \"repair_preview_timeout\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"restart_refused\" | \"restart_unverified\" | \"runtime_build_skew\" | \"reset_upstream_refused\" | \"resume_spec_mismatch\" | \"result_too_large\" | \"revision_backfill_pending\" | \"revision_unavailable\" | \"schema_owner_required\" | \"scope_missing\" | \"search_cursor_requires_keyword\" | \"search_mode_local_only\" | \"scorecard_group_by_local_only\" | \"search_offset_over_cap\" | \"segmented_mirror_writer_gate\" | \"serve_build_drift\" | \"serve_port_in_use\" | \"serve_status_only\" | \"settle_mismatch\" | \"setup_harness_unsupported\" | \"setup_hosted_connection\" | \"setup_owner_conflict\" | \"hook_session_cwd\" | \"turn_hook_not_loaded\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"slug_page_mismatch\" | \"slug_root_mode_mismatch\" | \"source_binding_required\" | \"source_id_taken\" | \"source_mismatch\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"sources_not_readable\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stable_channel_unresolved\" | \"stable_invalid\" | \"stable_missing\" | \"stable_unreadable\" | \"stale_unavailable\" | \"state_mismatch\" | \"store_unavailable\" | \"strict_requires_managed\" | \"sync_anchor_relative\" | \"sync_not_applicable\" | \"sync_admission_restricted\" | \"sync_deadline_stalled\" | \"sync_drain_lease_held\" | \"content_receipt_stale\" | \"sync_first_run_in_progress\" | \"sync_no_successful_sync\" | \"sync_cursor_replaced\" | \"sync_pass_superseded\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"readable_by_invalid\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"transcript_source_mismatch\" | \"triage_unreliable_backoff\" | \"trust_raise_refused\" | \"two_consumers_on_host\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unpriced_model\" | \"unmanaged_database_path\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"unsupported_path\" | \"upload_expired\" | \"upload_not_found\" | \"upload_protected_content\" | \"upload_too_many_parts\" | \"upstream\" | \"upstream_diverged\" | \"upstream_rewritten\" | \"upstream_unknown\" | \"vector_prewarm_extension_missing\" | \"vector_prewarm_unsupported_engine\" | \"vector_prewarm_wont_fit\" | \"verification_failed\" | \"visibility_noncanonical\" | \"visibility_not_applied\" | \"wakeshift_key_invalid\" | \"wakeshift_needs_conversation\" | \"wakeshift_not_enabled\" | \"wakeshift_refused\" | \"wakeshift_shared_brain\" | \"wakeshift_unavailable\" | \"withdrawal_capacity\" | \"withdrawal_mirror_failed\" | \"withdrawal_mirror_pending\" | \"withdrawal_provenance\" | \"write_capacity_low\" | \"write_gate_rejected\" | \"write_held\" | \"worktree_dirty\" | \"worktree_refreshing\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | \"schema_pack_too_large\" | \"schema_pack_emit_mismatch\" | undefined",
+ "canonical?: \"unknown\" | \"timeout\" | \"keyword_candidates_incomplete\" | \"projection_pending\" | \"rate_limited\" | \"embedding_disabled\" | \"writer_lock_unavailable\" | \"writer_pool_capacity\" | \"owner_unavailable\" | \"recovery_required\" | \"queue_capacity\" | \"write_quota_exhausted\" | \"write_quota_insufficient\" | \"write_capacity_backpressure\" | \"revision_required\" | \"revision_conflict\" | \"idempotency_conflict\" | \"source_changed\" | \"write_pending\" | \"storage_error\" | \"cancelled\" | \"permission_denied\" | \"scope_denied\" | \"invalid_params\" | \"not_found\" | \"page_not_found\" | \"page_identity_changed\" | \"write_claim_lost\" | \"request_too_large\" | \"response_too_large\" | \"writer_registration_required\" | \"writer_identity_invalid\" | \"writer_not_initialized\" | \"writer_coordinator_required\" | \"fact_already_expired\" | \"source_writeback_required\" | \"unsupported_mutation_protocol\" | \"writer_upgrade_required\" | \"writer_not_quiesced\" | \"skill_bundle_required\" | \"take_row_collision\" | \"invalid_source_uri\" | \"writer_admin_locked\" | \"connector_account_changed\" | \"connector_intent_outdated\" | \"checkpoint_validation_timeout\" | \"invalid_connector_text\" | \"connector_holds_exhausted\" | \"connector_fence_below_timeline\" | \"core_budget_exceeded\" | \"core_mark_owner_only\" | \"core_remote_edit_refused\" | \"core_delete_owner_only\" | \"timeline_rows_would_be_removed\" | \"purged_content\" | \"preparation_stalled\" | \"fence_unrenderable\" | \"page_body_segmented\" | \"revision_changed\" | \"tail_changed\" | \"write_outcome_unknown\" | \"write_interrupted\" | \"connection_inherited_read_only\" | \"owner_marker_missing\" | \"embedding_failed\" | \"bucket_not_found\" | \"database_error\" | \"unknown_transport\" | \"extraction_failed\" | \"fact_not_found\" | \"provenance_required\" | \"unavailable\" | \"budget_unsatisfiable\" | \"embedding_budget_below_worst_case\" | \"absent_from_worktree\" | \"access_command_failed\" | \"access_member_disabled\" | \"on_behalf_of_invalid_audience\" | \"on_behalf_of_unknown_member\" | \"on_behalf_of_not_permitted\" | \"actor_not_attested\" | \"actor_unlinked\" | \"on_behalf_of_in_arguments\" | \"access_policy_invalid\" | \"access_policy_pending\" | \"access_policy_widening_held\" | \"access_policy_store_mismatch\" | \"access_rule_invalid\" | \"access_member_id_retired\" | \"access_member_invalid\" | \"access_denied_test_user\" | \"access_env_missing\" | \"acknowledgment_unavailable\" | \"admin_policy_enforced\" | \"admission_paused\" | \"ambient_capture_off\" | \"ambiguous_id\" | \"ambiguous_ref\" | \"ambiguous_skill\" | \"answer_not_yours\" | \"answer_pending\" | \"answer_unavailable\" | \"api_not_enabled\" | \"approval_required\" | \"atom_drain_incomplete\" | \"atom_drain_no_progress\" | \"atom_drain_provider_failure\" | \"autopilot_job_owned_by_other_brain\" | \"body_staging_expired\" | \"budget_below_recent_runtime\" | \"backup_dump_failed\" | \"backup_too_large\" | \"belief_coverage_required\" | \"belief_stale_preparation\" | \"benchmark_duplicate_task_id\" | \"benchmark_empty\" | \"benchmark_exists\" | \"benchmark_judge_llm_no_rubric\" | \"benchmark_judge_qrels_no_expected\" | \"benchmark_judge_rule_no_checks\" | \"benchmark_judge_unknown_kind\" | \"benchmark_malformed\" | \"benchmark_missing_judge\" | \"benchmark_missing_task\" | \"benchmark_missing_task_id\" | \"benchmark_not_found\" | \"benchmark_rule_check_bad_arg\" | \"benchmark_rule_check_malformed\" | \"benchmark_rule_check_unknown_op\" | \"bootstrap_cleanup_pending\" | \"bootstrap_empty\" | \"bootstrap_pending_review\" | \"bridge_ownership_conflict\" | \"valid_time_undeclared\" | \"coverage_from\" | \"coverage_gap\" | \"clock_mismatch\" | \"extract_write_lost\" | \"item_failures_systemic\" | \"known_as_of_unproven\" | \"cache_quota_exceeded\" | \"calendar_unreadable\" | \"capacity_paused\" | \"catalog_capacity_exceeded\" | \"catalog_unavailable\" | \"host_upgrade_required\" | \"change_reason_rejected\" | \"changed_since_preview\" | \"chronicle_skipped\" | \"no_pricing\" | \"checkout_not_a_source\" | \"checkpoint_missing\" | \"claim_already_used\" | \"client_json_unreadable\" | \"client_json_wrong_type\" | \"client_not_found\" | \"client_shape_invalid\" | \"code_callees_requires_symbol\" | \"code_callers_requires_symbol\" | \"code_def_requires_symbol\" | \"code_refs_requires_symbol\" | \"code_reused\" | \"colon_slug_windows_write_through\" | \"command_failed\" | \"commit_lock_busy\" | \"commit_base_moved\" | \"commit_paths_invalid\" | \"commit_prestaged_paths\" | \"commit_outside_source_root\" | \"concurrent_write\" | \"config_error\" | \"confirmation_required\" | \"conflicting_source_scope\" | \"connection_lost\" | \"connector_access_denied\" | \"connector_auth_required\" | \"connector_binding_missing\" | \"connector_item_too_large\" | \"connector_response_too_large\" | \"connector_shape_drift\" | \"chunkless_pages_healable\" | \"consent_required\" | \"consent_timeout\" | \"consumers_without_heartbeat\" | \"content_repair_needs_human\" | \"content_null_bytes\" | \"content_rejected\" | \"continuation_unproven\" | \"corpus_chat_unavailable\" | \"corpus_window_backoff\" | \"corpus_window_dead_lettered\" | \"convergence_read_failed\" | \"cost_cap_exceeded\" | \"cost_preview_requires_yes\" | \"cursor_incarnation_retired\" | \"cycle_failed\" | \"d_sel_too_small\" | \"delta_cursor_upgrade_required\" | \"deleted_page_chunks_overdue\" | \"demo_graph_failed\" | \"downgrade_blocked_deferred_writes\" | \"demo_import_failed\" | \"demo_verification_failed\" | \"derived_cap_exhausted\" | \"destination_not_ready\" | \"drain_holder_stalled\" | \"drain_stalled\" | \"managed_sync_not_moving\" | \"dream_breaker_tripped\" | \"dirty_tree\" | \"doctor_tier_unavailable\" | \"effect_not_failed\" | \"embed_backfill_stalled\" | \"embedding_auth_failed\" | \"embedding_configuration\" | \"embedding_identity_unqualified\" | \"embedding_model_mismatch\" | \"embedding_plane_split\" | \"embedding_state_unknown\" | \"embedding_storage_unavailable\" | \"embedding_unavailable\" | \"embedding_unconfigured\" | \"embedding_width_mismatch\" | \"embedded_core_required\" | \"engine_embedding_mismatch\" | \"embedded_engine_required\" | \"engine_closed\" | \"engine_host_missing\" | \"engine_scope_missing\" | \"engine_scope_required\" | \"engine_settings_invalid\" | \"engine_graduated\" | \"entity_types_unavailable\" | \"eval_suite_unwired\" | \"explicit_tasks_conflict\" | \"export_limit\" | \"extractor_identity_mismatch\" | \"fact_withdrawn\" | \"fact_rows_collide\" | \"fence_row_changed\" | \"facts_absorb_write_refused\" | \"facts_backstop_skipped\" | \"facts_drain_deferred\" | \"facts_drain_job_failed\" | \"facts_payload_expired\" | \"feedback_disabled\" | \"feedback_not_authorized\" | \"fetch_failed\" | \"file_database_drift\" | \"fix_not_writable\" | \"file_drift\" | \"file_drift_mixed_selection\" | \"file_drift_state_required\" | \"file_removed_during_scan\" | \"file_unreadable\" | \"file_wins_rewrite\" | \"file_too_large\" | \"follow_approval_required\" | \"forget_requires_owner\" | \"reserved_frontmatter_key\" | \"generation_fenced\" | \"generation_held\" | \"generation_live_conflict\" | \"frontmatter_slug_conflict\" | \"full_resync_required\" | \"gate_failed\" | \"ghost_mass_delete_refused\" | \"notifier_stalled\" | \"origin_twin_mass_merge_refused\" | \"ghost_storage_unknown\" | \"git_branch_unborn\" | \"git_durability_not_enabled\" | \"git_checkout_required\" | \"git_worktree_link_broken\" | \"hosted_repo_refused\" | \"git_detached_head\" | \"git_index_conflict\" | \"git_index_locked\" | \"git_index_stale\" | \"git_target_pending\" | \"git_operation_in_progress\" | \"git_push_unavailable\" | \"git_target_changed\" | \"git_target_ignored\" | \"git_target_unsafe\" | \"git_unavailable\" | \"git_object_missing\" | \"git_conversion_blocked\" | \"git_conversion_delta\" | \"conversion_file_in_source_root\" | \"git_conversion_incomplete\" | \"git_home_required\" | \"git_private_commit_refused\" | \"git_protocol_required\" | \"git_lfs_not_enabled\" | \"gitlink_not_followed\" | \"graduation_drain_timeout\" | \"graduation_embedding_dimension_mismatch\" | \"graduation_foreign_host_binding\" | \"graduation_in_progress\" | \"graduation_interrupted\" | \"graduation_rollback_writes_lost\" | \"graduation_source_writer_held\" | \"graduation_split_brain\" | \"graduation_target_auth_failed\" | \"graduation_target_ddl_unreachable\" | \"graduation_target_not_empty\" | \"graduation_target_unsupported\" | \"graduation_unclassified_table\" | \"graduation_unsupported_platform\" | \"graduation_verify_failed\" | \"grant_scope\" | \"graph_incomplete\" | \"host_identity_mismatch\" | \"harness_hook_duplicates\" | \"harness_hook_unowned\" | \"head_blocked\" | \"held_failed\" | \"held_out_overlaps_benchmark\" | \"held_out_required_for_bundled\" | \"independent_principal_required\" | \"insufficient_scope\" | \"integrate_conflict\" | \"internal\" | \"internal_error\" | \"interrupted\" | \"invalid_acknowledgment\" | \"invalid_client\" | \"invalid_fence\" | \"unclosed_ambiguous_tail\" | \"tail_exposure_approval\" | \"sync_in_progress\" | \"invalid_frontmatter\" | \"invalid_grant_clock_skew\" | \"invalid_grant_revoked\" | \"invalid_grant_testing_expiry\" | \"invalid_rating\" | \"invalid_receipt\" | \"invalid_receipt_transition\" | \"invalid_request\" | \"invalid_source\" | \"invalid_source_pin\" | \"invalid_token\" | \"invalid_write_wait\" | \"ipc_path_too_long\" | \"legacy_twin_mass_merge_refused\" | \"legacy_twins_storage_unknown\" | \"legacy_job_selection_invalid\" | \"legacy_jobs_active\" | \"legacy_lock_removal_refused\" | \"link_cursor_invalid\" | \"local_conflict\" | \"lock_busy\" | \"loops_extraction_skipped\" | \"maintenance_backpressure\" | \"maintenance_lock_busy\" | \"managed_failure_unsettled\" | \"managed_remedy_unavailable\" | \"memory_setting_write_outcome_unknown\" | \"merge_recommended\" | \"movement_unknown\" | \"managed_sync_flag_refused\" | \"managed_pull_skipped\" | \"manual_only_skipped\" | \"membership_inactive\" | \"membership_not_found\" | \"method_not_allowed\" | \"migration_lease_lost\" | \"migration_declined\" | \"migration_failed\" | \"migration_host_work_pending\" | \"migrations_pending\" | \"migrations_running\" | \"missing_source_scope\" | \"missing_source_value\" | \"models_strict_violation\" | \"no_context_ceiling\" | \"no_refresh_token\" | \"no_routing_eval\" | \"no_skill_md\" | \"no_worker\" | \"no_worker_surface\" | \"not_a_git_repo\" | \"not_converged\" | \"not_owner_host\" | \"not_connected\" | \"no_brain\" | \"overlapping_path\" | \"page_projection_conflict\" | \"page_body_rows_unreadable\" | \"page_projection_stale\" | \"page_shrink_refused\" | \"page_too_large_for_inline\" | \"parse_error\" | \"part_splits_code_point\" | \"part_too_large\" | \"frontmatter_alias_limit\" | \"parser_regression\" | \"pasted_wrong_url\" | \"payload_too_large\" | \"path_not_utf8\" | \"pattern_claims_pending\" | \"patterns_min_interval\" | \"pending_verify\" | \"pending_writes\" | \"persistence_restart_required\" | \"pool_inflight_over_budget\" | \"deep_health_probe_failed\" | \"refresh_required\" | \"serve_self_exit_suppressed\" | \"serve_unhealthy_exit\" | \"persistence_write_stall\" | \"publish_secret_found\" | \"publish_scan_unreadable\" | \"push_unconfirmed\" | \"schema_lock_blocked\" | \"pg_connection_recovery_failed\" | \"pg_connection_stuck\" | \"pg_pool_stalled\" | \"pg_statement_build_failed\" | \"pglite_busy\" | \"pglite_vector_index_too_large\" | \"plan_output_failed\" | \"plan_stale\" | \"port_in_use\" | \"preview_changed\" | \"profile_incompatible\" | \"projection_owner_resident\" | \"knock_on_exhausted\" | \"keyword_skipped_after_timeout\" | \"proposal_closed\" | \"proposal_expired\" | \"proposals_pending_limit\" | \"publication_pending\" | \"pull_blocked_local_changes\" | \"purge_blocked_pending_recovery\" | \"purge_lookup_timeout\" | \"purge_mirror_unwritable\" | \"question_not_found\" | \"question_owner_only\" | \"rank_entities_timeout\" | \"read_budget_exhausted\" | \"reason_purge_scan_capped\" | \"reason_purge_scan_failed\" | \"reason_scan_capped\" | \"reason_scan_failed\" | \"reason_trailer_secret\" | \"receipt_conflict\" | \"receipt_fence_changed\" | \"receipt_fence_required\" | \"receipt_identity_mismatch\" | \"pat_file_unreadable\" | \"reconcile_host_required\" | \"reconcile_read_incomplete\" | \"recovery_prior_stage_unavailable\" | \"recovery_version_unsupported\" | \"redirect_uri_mismatch\" | \"ref_not_in_answer\" | \"refresh_dirty\" | \"refresh_diverged\" | \"refresh_drain_timeout\" | \"refresh_lock_timeout\" | \"refresh_no_upstream\" | \"refresh_not_managed\" | \"refresh_not_owner\" | \"pending_import_expired\" | \"refresh_barrier_expired\" | \"refresh_source_changed\" | \"refresh_sync_timeout\" | \"relay_disabled\" | \"relay_session_expired\" | \"relay_unreachable\" | \"rename_held\" | \"rename_identity_unreadable\" | \"rename_reconcile_failed\" | \"repair_preview_timeout\" | \"request_already_submitted\" | \"requirements_changed\" | \"requires_local_engine\" | \"restart_refused\" | \"restart_unverified\" | \"runtime_build_skew\" | \"reset_upstream_refused\" | \"resume_spec_mismatch\" | \"result_too_large\" | \"revision_backfill_pending\" | \"revision_unavailable\" | \"schema_owner_required\" | \"scope_missing\" | \"search_cursor_requires_keyword\" | \"search_mode_local_only\" | \"scorecard_group_by_local_only\" | \"search_offset_over_cap\" | \"segmented_mirror_writer_gate\" | \"serve_build_drift\" | \"serve_port_in_use\" | \"serve_status_only\" | \"settle_mismatch\" | \"setup_harness_unsupported\" | \"setup_hosted_connection\" | \"setup_owner_conflict\" | \"hook_session_cwd\" | \"turn_hook_not_loaded\" | \"shared_skills_unavailable\" | \"shared_skills_unsupported\" | \"skill_asset_not_found\" | \"skill_candidate_invalid\" | \"skill_not_found\" | \"skill_retention_capacity\" | \"skill_unavailable\" | \"slug_page_mismatch\" | \"slug_root_mode_mismatch\" | \"source_binding_required\" | \"source_id_taken\" | \"source_mismatch\" | \"source_not_ready\" | \"source_profile_no_backfill\" | \"source_referenced\" | \"source_root_conflict\" | \"sources_not_readable\" | \"split_bad_ratio\" | \"split_unparseable\" | \"stable_channel_unresolved\" | \"stable_invalid\" | \"stable_missing\" | \"stable_unreadable\" | \"stale_unavailable\" | \"state_mismatch\" | \"store_unavailable\" | \"strict_requires_managed\" | \"sync_anchor_relative\" | \"sync_not_applicable\" | \"sync_admission_restricted\" | \"sync_deadline_stalled\" | \"sync_drain_lease_held\" | \"content_receipt_stale\" | \"sync_first_run_in_progress\" | \"sync_no_successful_sync\" | \"sync_cursor_replaced\" | \"sync_pass_superseded\" | \"sync_parser_regression\" | \"target_escape\" | \"timeline_comment_markup\" | \"readable_by_invalid\" | \"topology_change_required\" | \"transcript_secret_exposure\" | \"transcript_source_mismatch\" | \"triage_unreliable_backoff\" | \"trust_raise_refused\" | \"two_consumers_on_host\" | \"trusted_local_only\" | \"unexpected_file_bytes\" | \"unexpected_staging_bytes\" | \"unknown_command\" | \"unknown_flag\" | \"unknown_method\" | \"unknown_source\" | \"unknown_tool\" | \"unpriced_model\" | \"unmanaged_database_path\" | \"unmanaged_path\" | \"unsupported_export_data\" | \"unsupported_path\" | \"upload_expired\" | \"upload_not_found\" | \"upload_protected_content\" | \"upload_too_many_parts\" | \"upstream\" | \"upstream_diverged\" | \"upstream_rewritten\" | \"upstream_unknown\" | \"vector_prewarm_extension_missing\" | \"vector_prewarm_unsupported_engine\" | \"vector_prewarm_wont_fit\" | \"verification_failed\" | \"visibility_noncanonical\" | \"visibility_not_applied\" | \"wakeshift_key_invalid\" | \"wakeshift_needs_conversation\" | \"wakeshift_not_enabled\" | \"wakeshift_refused\" | \"wakeshift_shared_brain\" | \"wakeshift_unavailable\" | \"withdrawal_capacity\" | \"withdrawal_mirror_failed\" | \"withdrawal_mirror_pending\" | \"withdrawal_provenance\" | \"write_capacity_low\" | \"write_gate_rejected\" | \"write_held\" | \"worktree_dirty\" | \"worktree_refreshing\" | \"writer_admin_intent_required\" | \"writer_admin_state_changed\" | \"writer_busy\" | \"writer_identity_publish_failed\" | \"writer_manifest_mismatch\" | \"writer_manifest_rescope_required\" | \"writer_manifest_unsafe\" | \"writer_regrant_required\" | \"writer_transfer_conflict\" | \"writer_transfer_required\" | \"wrong_account_consented\" | \"schema_pack_too_large\" | \"schema_pack_emit_mismatch\" | undefined",
"canonicalCode: string",
"cause?: unknown",
"code: ErrorCode",
diff --git a/test/fixtures/goldens/migrations/records.json b/test/fixtures/goldens/migrations/records.json
index d9e20155ce..7b22368c3a 100644
--- a/test/fixtures/goldens/migrations/records.json
+++ b/test/fixtures/goldens/migrations/records.json
@@ -1,6 +1,6 @@
{
"golden": {
- "count": 293,
+ "count": 295,
"gaps": [
17,
18,
@@ -97,7 +97,7 @@
"verifyProjectionStatistics": "0d231b04ecfbc5a4109d6fca9567bf4e8c9e9db6c3fbbb35212e026579ed6f67",
"withSchemaLockTimeout": "95605bd3004955e11e936c7a4aa6889319b401098abf9db18ef3e48da2c3fc59"
},
- "latest": 298,
+ "latest": 300,
"records": [
{
"handler": {
@@ -4852,6 +4852,32 @@
"transaction": "absent",
"verify": "absent",
"version": 298
+ },
+ {
+ "handler": "absent",
+ "idempotent": true,
+ "name": "memory_proposals",
+ "sql": {
+ "length": 1783,
+ "sha256": "4c55717114ac37759287596768d2dbe2b36b20a57b3ce9605b8ccaa8aef741ef"
+ },
+ "sqlFor": "absent",
+ "transaction": "absent",
+ "verify": "absent",
+ "version": 299
+ },
+ {
+ "handler": "absent",
+ "idempotent": true,
+ "name": "member_email",
+ "sql": {
+ "length": 247,
+ "sha256": "1b29d7c6c2eb5da8c9a81d5580526d5e408a6dd1405b24e0aa24a153d30944c9"
+ },
+ "sqlFor": "absent",
+ "transaction": "absent",
+ "verify": "absent",
+ "version": 300
}
],
"versions": [
@@ -5147,7 +5173,9 @@
295,
296,
297,
- 298
+ 298,
+ 299,
+ 300
]
},
"normalizer": "migrations-record-v1"
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 81f179bbce..c0cff47833 100644
--- a/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
+++ b/test/fixtures/goldens/pglite-upgrade-replay/catalog-after-boot.json
@@ -10,6 +10,8 @@
"access_member_links.access_member_links_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
"access_member_links.access_member_links_pkey": "p PRIMARY KEY (system, external_id)",
"access_member_links.access_member_links_system_check": "c CHECK ((system ~ '^[a-z][a-z0-9_-]{0,31}$'::text))",
+ "access_member_sources.access_member_sources_member_id_fkey": "f FOREIGN KEY (member_id) REFERENCES access_members(id) ON DELETE CASCADE",
+ "access_member_sources.access_member_sources_pkey": "p PRIMARY KEY (member_id, source_id)",
"access_members.access_members_email_check": "c CHECK (((email IS NULL) OR ((length(email) <= 254) AND (email ~ '^[^@[:space:]]+@[^@[:space:]]+$'::text))))",
"access_members.access_members_id_check": "c CHECK ((id ~ '^[a-z0-9][a-z0-9._-]{0,63}$'::text))",
"access_members.access_members_pkey": "p PRIMARY KEY (id)",
@@ -201,6 +203,11 @@
"mcp_spend_reservations.mcp_spend_reservations_one_budget_owner": "c CHECK (((client_id IS NULL) <> (budget_key IS NULL)))",
"mcp_spend_reservations.mcp_spend_reservations_pkey": "p PRIMARY KEY (reservation_id)",
"mcp_spend_reservations.mcp_spend_reservations_status_check": "c CHECK ((status = ANY (ARRAY['pending'::text, 'settled'::text, 'expired'::text])))",
+ "memory_proposals.memory_proposals_kind_check": "c CHECK ((kind = ANY (ARRAY['timeline'::text, 'link'::text])))",
+ "memory_proposals.memory_proposals_operation_check": "c CHECK ((operation = ANY (ARRAY['add_timeline_entry'::text, 'add_link'::text])))",
+ "memory_proposals.memory_proposals_pkey": "p PRIMARY KEY (principal_kind, principal_id, request_id)",
+ "memory_proposals.memory_proposals_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "memory_proposals.memory_proposals_state_check": "c CHECK ((state = ANY (ARRAY['awaiting_owner'::text, 'approved'::text, 'denied'::text, 'expired'::text, 'cancelled'::text, 'failed'::text, 'conflict'::text])))",
"mention_gazetteer_entries.mention_gazetteer_entries_pkey": "p PRIMARY KEY (source_id, name_norm, target_slug, case_sensitive)",
"mention_gazetteer_entries.mention_gazetteer_entries_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"mention_index_status.mention_index_status_pkey": "p PRIMARY KEY (source_id)",
@@ -641,6 +648,9 @@
"access_member_links": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "access_member_sources": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"access_members": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -848,6 +858,9 @@
"mcp_spend_reservations": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "memory_proposals": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"mention_gazetteer_entries": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1167,6 +1180,8 @@
"access_groups_pkey": "CREATE UNIQUE INDEX access_groups_pkey ON public.access_groups USING btree (id)",
"access_member_links_member_idx": "CREATE INDEX access_member_links_member_idx ON public.access_member_links USING btree (member_id)",
"access_member_links_pkey": "CREATE UNIQUE INDEX access_member_links_pkey ON public.access_member_links USING btree (system, external_id)",
+ "access_member_sources_pkey": "CREATE UNIQUE INDEX access_member_sources_pkey ON public.access_member_sources USING btree (member_id, source_id)",
+ "access_member_sources_source_idx": "CREATE INDEX access_member_sources_source_idx ON public.access_member_sources USING btree (source_id)",
"access_members_email_key": "CREATE UNIQUE INDEX access_members_email_key ON public.access_members USING btree (email)",
"access_members_pkey": "CREATE UNIQUE INDEX access_members_pkey ON public.access_members USING btree (id)",
"access_pending_coverage_pkey": "CREATE UNIQUE INDEX access_pending_coverage_pkey ON public.access_pending_coverage USING btree (source_id, prefix, reason)",
@@ -1438,6 +1453,11 @@
"mcp_request_log_pkey": "CREATE UNIQUE INDEX mcp_request_log_pkey ON public.mcp_request_log USING btree (id)",
"mcp_spend_log_pkey": "CREATE UNIQUE INDEX mcp_spend_log_pkey ON public.mcp_spend_log USING btree (id)",
"mcp_spend_reservations_pkey": "CREATE UNIQUE INDEX mcp_spend_reservations_pkey ON public.mcp_spend_reservations USING btree (reservation_id)",
+ "memory_proposals_closed_idx": "CREATE INDEX memory_proposals_closed_idx ON public.memory_proposals USING btree (decided_at) WHERE (state <> 'awaiting_owner'::text)",
+ "memory_proposals_pending_actor_idx": "CREATE INDEX memory_proposals_pending_actor_idx ON public.memory_proposals USING btree (principal_kind, principal_id, member_id, expires_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pending_source_idx": "CREATE INDEX memory_proposals_pending_source_idx ON public.memory_proposals USING btree (source_id, created_at) WHERE (state = 'awaiting_owner'::text)",
+ "memory_proposals_pkey": "CREATE UNIQUE INDEX memory_proposals_pkey ON public.memory_proposals USING btree (principal_kind, principal_id, request_id)",
+ "memory_proposals_request_idx": "CREATE INDEX memory_proposals_request_idx ON public.memory_proposals USING btree (request_id)",
"mention_gazetteer_entries_pkey": "CREATE UNIQUE INDEX mention_gazetteer_entries_pkey ON public.mention_gazetteer_entries USING btree (source_id, name_norm, target_slug, case_sensitive)",
"mention_index_status_pkey": "CREATE UNIQUE INDEX mention_index_status_pkey ON public.mention_index_status USING btree (source_id)",
"migration_impact_log_attribution_idx": "CREATE INDEX migration_impact_log_attribution_idx ON public.migration_impact_log USING btree (job_id, source_id) WHERE (job_id IS NOT NULL)",
@@ -1769,6 +1789,14 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "access_member_sources": {
+ "columns": [
+ "1 member_id text/text NOT NULL",
+ "2 source_id text/text NOT NULL",
+ "3 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"access_members": {
"columns": [
"1 id text/text NOT NULL",
@@ -1862,7 +1890,8 @@
"18 may_act_for ARRAY/_text NULL",
"19 attest_actor text/text NULL",
"20 attest_ops ARRAY/_text NULL",
- "21 attest_sources ARRAY/_text NULL"
+ "21 attest_sources ARRAY/_text NULL",
+ "22 attest_read text/text NULL"
],
"flags": "relkind=r rls=false force_rls=false"
},
@@ -2890,6 +2919,35 @@
],
"flags": "relkind=r rls=false force_rls=false"
},
+ "memory_proposals": {
+ "columns": [
+ "1 principal_kind text/text NOT NULL",
+ "2 principal_id text/text NOT NULL",
+ "3 request_id uuid/uuid NOT NULL",
+ "4 system text/text NOT NULL",
+ "5 external_id text/text NOT NULL",
+ "6 member_id text/text NOT NULL",
+ "7 source_id text/text NOT NULL",
+ "8 source_incarnation uuid/uuid NOT NULL",
+ "9 kind text/text NOT NULL",
+ "10 operation text/text NOT NULL",
+ "11 slug text/text NOT NULL",
+ "12 to_slug text/text NULL",
+ "13 payload jsonb/jsonb NULL",
+ "14 payload_digest text/text NOT NULL",
+ "15 expected_revision text/text NULL",
+ "16 authority jsonb/jsonb NOT NULL",
+ "17 state text/text NOT NULL DEFAULT 'awaiting_owner'::text",
+ "18 reason text/text NULL",
+ "19 error_code text/text NULL",
+ "20 decided_by text/text NULL",
+ "21 decided_at timestamp with time zone/timestamptz NULL",
+ "22 created_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "23 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "24 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"mention_gazetteer_entries": {
"columns": [
"1 source_id text/text NOT NULL",
@@ -3103,7 +3161,8 @@
"35 may_act_for ARRAY/_text NULL",
"36 attest_actor text/text NULL",
"37 attest_ops ARRAY/_text NULL",
- "38 attest_sources ARRAY/_text NULL"
+ "38 attest_sources ARRAY/_text NULL",
+ "39 attest_read text/text NULL"
],
"flags": "relkind=r rls=true force_rls=false"
},
diff --git a/test/graduation-inventory.test.ts b/test/graduation-inventory.test.ts
index a4ad6d00b2..f4384c52bc 100644
--- a/test/graduation-inventory.test.ts
+++ b/test/graduation-inventory.test.ts
@@ -60,7 +60,7 @@ describe('graduation inventory', () => {
expect(new Set(names).size).toBe(names.length);
const counts: Record<string, number> = {};
for (const e of GRADUATION_INVENTORY.entries) counts[e.class] = (counts[e.class] ?? 0) + 1;
- expect(counts).toEqual({ carry: 160, rebind: 2, rebuild: 3, discard: 9, schema_owned: 4 });
+ expect(counts).toEqual({ carry: 161, rebind: 2, rebuild: 3, discard: 9, schema_owned: 4 });
for (const e of GRADUATION_INVENTORY.entries) {
expect({ relation: e.relation, reason: e.reason.length > 5, present: e.engines.pglite || e.engines.postgres })
.toEqual({ relation: e.relation, reason: true, present: true });