Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

notifier: docs, behavior rows, sync.on_commit.sources key, Postgres goldens

garrytan500c0a0c48d4
diff --git a/docs/architecture/key-files/commit-notifier.md b/docs/architecture/key-files/commit-notifier.md
new file mode 100644
index 0000000000..b9fba5319d
--- /dev/null
+++ b/docs/architecture/key-files/commit-notifier.md
@@ -0,0 +1,10 @@
+# Key files: Commit notifier
+
+[Subsystem index](../KEY_FILES.md). Read only the entries relevant to your change.
+Current behavior and load-bearing invariants; history belongs in Git and CHANGELOG.
+
+- `src/core/commit-notifier.ts` — the notifier core, pure over its seams (store, git reads, the runner). One loop per resident: claims the host lease every heartbeat (`GBRAIN_NOTIFIER_HEARTBEAT_MS`, default 10 s, lease two heartbeats; PGLite has no lease and the brain's holder owns), re-reads `sync.on_commit` and `sync.on_commit.sources` every 30 s (`parseOnCommit` is the one parser), lists the host's sources every 60 s, reads HEAD every poll (`GBRAIN_NOTIFIER_POLL_MS`, 3 s; a watch only nudges), and scans wanted markers every 15 s or on a nudge, with the flag off too. Starts on the leading edge of a quiet HEAD move (no rebase/merge/cherry-pick marker, no `index.lock`), then a 400 ms trailing window (`GBRAIN_NOTIFIER_QUIET_MS`). Per-source single flight under a host cap, least recently started first. Keeps a source due across refused starts, failed or blocked runs and resumable stops; retries at `RETRY_BACKOFF_MS` (5 s, 15 s, 1 min, 5 min) and reports `notifier_stalled` past the last tier without progress; `operator_blocked` waits for HEAD to move. Checks the fence before each start. Every decision is recorded (`decisions`) for tests; state and coverage rows are written on change only. Managed sources never take pull markers. Tests: `test/serve-head-watcher.test.ts` (memory store, `test/helpers/notifier-memory-store.ts`).
+- `src/core/notifier/store.ts` — the durable rows (migration `v261-commit-notifier.ts`): `sync_wanted_markers` (source + intent freshness|pull|full, `generation` bumped on every upsert, `first_due_at` kept), `sync_notifier_leases` (one owner per host, fence bumped on takeover, release expires it now), `sync_notifier_sources` (state, retry schedule, last error and trace path, classic syncer host, coverage record). A drainer deletes only `WHERE generation =` the value it read (`clearMarker`, `settleMarkers`); freshness is due while `wanted_head IS DISTINCT FROM last_commit` (no ancestry assumption). `recordLocalSyncer` runs where `writeSyncAnchor` advances `last_commit`: records the syncer host and prunes satisfied markers (the CLI's re-check). `missingTable` lets callers on a pre-v261 brain read "nothing monitored".
+- `src/core/notifier/resident.ts` + `src/core/notifier/detect.ts` — production seams and the one start path for every resident (`startResidentNotifier`: serve, serve --http through `src/core/serve-head-watcher.ts`, `gbrain jobs work`, the autopilot daemon). Never awaits: the first pass runs in the background. `GBRAIN_NOTIFIER=0` turns it off per process. Lists managed sources whose worktree this host owns and classic sources whose recorded syncer is this host (or `GBRAIN_NOTIFIER_CLASSIC_SOURCES`), skipping the rest with a reason. Starts syncs through the in-process delegated runner. Trace per source at `<gbrain home>/notifier/<source>.jsonl`. `detect.ts` resolves `--absolute-git-dir` / `--git-common-dir` (linked worktrees) and the quiet predicate. Tests: `test/pathological/s-notifier-classic-serve.test.ts`, `test/pathological/s-notifier-residents.test.ts`.
+- `src/core/notifier/nudge.ts` + `src/core/notifier/handoff.ts` + `src/commands/sync/trigger.ts` — submitters and drainers of wanted markers. `recordTriggerMarker` picks the intent (managed: freshness at the checkout HEAD; classic: pull) and `recordSyncNudge` answers the versioned, acknowledged `sync_nudge` IPC kind (`src/core/context/sync-ipc.ts`, `resolve-ipc.ts`, bound in `src/mcp/resolve-ipc-binding.ts`). `handoff.ts` is the post-run re-check of the `sync` job handler and the serve's delegated runner: read before the run, settle after, at most one follow-up (a queued job with `maxWaiting: 1`, or a nudge); a lock-busy skip records a marker and completes. `gbrain sync trigger` answers queued / coalesced (`maxPending: 1`) / nudged / no_resident (exit 3); on PGLite a live serve takes it over IPC (`maybeTriggerThroughServe` in `src/commands/sync-delegate.ts`, which also records a busy delegated sync). The GitHub push webhook (`submitGitHubPush` in `src/commands/serve-http-webhooks.ts`) records the pushed sha first; a managed source answers 409 `refresh_required`. Tests: `test/pathological/s-notifier-marker-handoff.test.ts`.
+- `src/core/notifier/status.ts` — what users and agents see, from rows only (no git call): `readSourceFreshness` feeds the `freshness` entry of search and query responses (`src/core/ops/search.ts` `buildRetrievalResponseMeta`; current, behind, syncing, unknown, not_monitored), and `readNotifierBlock` / `formatNotifierBlock` the notifier block for sync status and doctor (resident or none with the `gbrain sync --source <id> --no-pull` fix; remote callers get no trace path, pid or host id). An owner is live by its unexpired lease (Postgres) or a running pid on this host (PGLite). Tests: `test/pathological/s-notifier-freshness-status.test.ts`.
diff --git a/docs/architecture/key-files/core-services-2.md b/docs/architecture/key-files/core-services-2.md
index ba6a597c12..bd4d246430 100644
--- a/docs/architecture/key-files/core-services-2.md
+++ b/docs/architecture/key-files/core-services-2.md
@@ -56,3 +56,4 @@ Fact and page purge modules (`src/core/facts/purge*.ts`, `deletion-inventory.ts`
- `src/core/ops/sources.ts` — `sources_remove` is confined to the caller's WRITE authority via `assertSourceInCallerWriteScope(ctx, id)` (context.ts): an untrusted caller may hard-remove only its own write source; a federated read grant naming a source does not make it removable; any other id answers `OperationError('not_found', 'Unknown source: <id>')`, byte-identical to a nonexistent source so the error is not an existence oracle. `sources_status` keeps the read-scope helper (`assertSourceInCallerScope`), so a federated grant can still diagnose a source it cannot remove. Trusted local CLI keeps the full operator view. Over HTTP every client carries a write source (registration default `default`) and its own `oauth_clients.source_id` row FK-RESTRICTs removing that source, so hard removal is effectively an operator action (`gbrain sources remove`); a source a remote `sources_admin` caller just created via `sources_add` stays outside its authority until the operator rescopes the client. There is no `sources_archive` op — archive lives in the CLI (`gbrain sources archive`). Pinned by `test/sources-mcp.test.ts` (federated-read-only id → not_found while status still answers; write-source id → removed; unbound → any; local → any; `remote: undefined` fail-closed) and `test/e2e/sources-remote-mcp.test.ts` (real server: not_found before AND after a read-grant widen; operator CLI completes; rescoping `--source` moves the authority).
- `src/core/page-summary.ts` — `generatePerChunkSynopsis`: the per-chunk synopsis call (utility-tier default, `thinking: 'off'`, `SYNOPSIS_DOC_MAX_CHARS` surrogate-safe head truncation, D27 failure envelope). One user message of TWO text blocks (PR #6341): the stable title + document block flagged `cache: true` (the only prefix every chunk of a page shares) and the per-chunk block; joined with `\n` they equal the former single string, so `SYNOPSIS_PROMPT_VERSION` stays 1. Pinned by `test/page-summary-prompt-cache.test.ts`.
+- `src/core/notifier/` + `src/core/commit-notifier.ts` — the commit notifier, wanted markers, residents and search freshness: [Commit notifier](commit-notifier.md).
diff --git a/docs/guides/on-commit-sync.md b/docs/guides/on-commit-sync.md
index 4112e210e7..13faab0cee 100644
--- a/docs/guides/on-commit-sync.md
+++ b/docs/guides/on-commit-sync.md
@@ -1,48 +1,156 @@
# On-commit sync
-On a managed brain, `gbrain serve` can sync a source as soon as a commit lands
-in its checkout, instead of waiting for the next scheduled sync. It is off by
-default; turn it on with:
+A resident gbrain process can sync a source as soon as a commit lands in its
+checkout, instead of waiting for the next scheduled sync. Watching commits is
+off by default; turn it on with:
```bash
gbrain config set sync.on_commit true
```
-The serve reads the flag every 30 seconds, so no restart is needed in either
-direction. While it is on, the serve polls `git rev-parse HEAD` in the checkout
-of every managed source this host owns, every 3 seconds
-(`GBRAIN_SERVE_HEAD_POLL_MS`, 1 to 30 s), with a file watch on the git directory
-that only brings the next poll forward. When HEAD has stopped moving for 3
-seconds (`GBRAIN_SERVE_HEAD_DEBOUNCE_MS`) and differs from what the source last
-synced, the serve runs one managed sync (`--no-pull`) as this host's CLI writer.
+Residents read the flag every 30 seconds, so no restart is needed in either
+direction. Requests you make explicitly (gbrain sync trigger, a GitHub push
+webhook, a delegated sync that found another sync running) are recorded and
+synced whether or not the flag is on.
+
+## Residents
+
+Four processes are residents: gbrain serve, gbrain serve --http, gbrain jobs
+work and the autopilot daemon. Each one starts the commit notifier; one of them
+owns it per host (a lease in the database on Postgres; on PGLite the process
+that holds the brain owns it). The others forward what they see to the owner.
+When the owner stops cleanly the next resident takes over at its next heartbeat
+(10 s, GBRAIN_NOTIFIER_HEARTBEAT_MS); when it dies without releasing, the next
+resident takes over once its lease (two heartbeats) has expired.
+
+A resident never waits for the notifier when it starts: the first pass runs in
+the background, so an MCP handshake or a worker's first job is not delayed by
+git or a catch-up sync. Commits made while no resident ran are synced by that
+first pass.
+
+The notifier watches:
+
+- every managed source whose worktree this host owns;
+- every classic source last synced on this host (recorded when a sync advances
+ its last_commit), or bound to this host with
+ GBRAIN_NOTIFIER_CLASSIC_SOURCES=<id>,<id>. A classic source last synced on
+ another host is skipped with that reason; that host's resident syncs it.
+
+It never pulls: it syncs the commit your checkout already has.
+
+## Detection and expected latency
+
+The notifier resolves each checkout's git directories (linked worktrees
+included), watches them, and reads HEAD with git rev-parse every 3 seconds
+(GBRAIN_NOTIFIER_POLL_MS, alias GBRAIN_SERVE_HEAD_POLL_MS). The poll is the
+source of truth; the watch only brings the next read forward. When a watch
+cannot be set up the source falls back to poll mode, and
+GBRAIN_NOTIFIER_DETECTION=poll forces it. sync status and search results name
+the mode.
+
+A moved HEAD starts a sync at once when the checkout is quiet (no rebase, merge
+or cherry-pick in progress and no index.lock); commits that keep arriving during
+a run get one more sync after a 400 ms quiet window (GBRAIN_NOTIFIER_QUIET_MS,
+alias GBRAIN_SERVE_HEAD_DEBOUNCE_MS, which used to be a fixed 3 s debounce).
+
+For a small page, expect a commit to be searchable within a few seconds in
+watch mode, and within the 3 s poll plus the sync in poll mode.
+
A sync that is already running, here or in another process, is never doubled:
-the commit waits and gets one more sync when that one ends. A sync that stops
-resumable is resumed up to three times. Nothing is written into the checkout or
-`.git`, and an idle poll costs one git call per checkout. Both `gbrain serve`
-and `gbrain serve --http` run the watcher.
-
-For a small page, expect a commit to be searchable in about 5 to 15 seconds: up
-to 3 s to notice, the 3 s debounce, then the page write. The write queues an
-`embedding` publication effect that the serve runs right after it, so a small
-page is embedded about a second later, under the same consent and spend gates as
-any managed write; there is no separate inline-embed setting. A sync run with
-`--no-embed`, or one whose cost gate deferred embedding, queues no such effect: its
-pages stay stale for `embed-backfill` and make no provider call.
-
-Each managed source's freshness over the last 24 hours shows in `gbrain sync
-status --source <id>` (the `freshness` block in `--json`) and in `gbrain
-status`: p50 and p95 of commit→searchable (from the commit's committer time to
-the page write's `completed_at`) and commit→embedded (to the page's last chunk
-embedding, counted only while that write is still the page's current revision
-and only for an embedding after the write). A first sync and working-tree
+the commit waits and gets one more sync when that one ends. A start that fails,
+is refused, or ends with an error stays due and is retried after 5 s, 15 s,
+1 min and then every 5 min; a run that stops resumable is resumed for as long as
+it makes progress. Nothing is written into the checkout or .git, and an idle
+poll costs one git call per checkout.
+
+The managed sync writes queue an embedding publication effect, so a small page
+is embedded about a second after it is searchable, under the same consent and
+spend gates as any managed write. A sync run with --no-embed, or one whose cost
+gate deferred embedding, queues no such effect.
+
+## Requests that are never dropped
+
+Every request to sync a source is recorded as a wanted marker (one per source
+and intent: freshness, pull or full) before anything runs. Whoever syncs the
+source re-checks the markers when it finishes and clears only the ones it
+satisfied and nobody re-recorded meanwhile; anything left gets one more run.
+Residents also scan the markers every 15 seconds, so a request that lands while
+a sync is finishing is still served.
+
+- gbrain sync trigger --source <id> [--json] records the request and answers
+ queued (a job was queued; stdout keeps job_id=N), coalesced (a job for the
+ source is already waiting or running), nudged (a running gbrain serve on
+ PGLite took it and its notifier starts the sync) or no_resident.
+- A GitHub push for a classic source queues one sync per source; a second push
+ while that job waits joins it and the newer commit is kept.
+- gbrain sync while a serve on the same PGLite brain is already syncing records
+ the request with that serve instead of failing (except --dry-run, which stays
+ read-only).
+
+## Kill switches and knobs
+
+| Setting | Effect |
+|---|---|
+| sync.on_commit (config, default false) | Watch commits on this brain's sources |
+| sync.on_commit.sources (config) | Comma-separated source ids never watched for commits |
+| GBRAIN_NOTIFIER=0 | No notifier in this process |
+| GBRAIN_NOTIFIER_DETECTION=poll | Never use file watches |
+| GBRAIN_NOTIFIER_POLL_MS | HEAD poll interval (default 3000) |
+| GBRAIN_NOTIFIER_QUIET_MS | Trailing quiet window (default 400) |
+| GBRAIN_NOTIFIER_HEARTBEAT_MS | Lease heartbeat (default 10000) |
+| GBRAIN_NOTIFIER_CLASSIC_SOURCES | Classic source ids this host syncs without a recorded run |
+
+## Check it
+
+```bash
+gbrain config get sync.on_commit
+gbrain sync status --source <id> --json
+gbrain sync trigger --source <id> --json
+```
+
+Search and query responses carry a freshness entry per source (current, behind,
+syncing, unknown or not_monitored, with the observed HEAD, when it was observed,
+the detection mode and the held-file count). not_monitored means no resident is
+watching the source: nothing will sync a new commit until one starts.
+
+<a id="no-resident"></a>
+## no_resident
+
+gbrain sync trigger recorded the request, but no resident runs on this brain to
+sync it. Run gbrain sync --source <id> --no-pull now, or start gbrain serve (or
+gbrain jobs work, or the autopilot daemon); the first resident that starts drains
+the recorded request. No service is installed for you.
+
+<a id="notifier-stalled"></a>
+## notifier_stalled
+
+The notifier kept retrying a source for more than five minutes without progress.
+sync status names the last error and the trace file
+(<gbrain home>/notifier/<source>.jsonl, local callers only). Run
+gbrain sync --source <id> --no-pull to see the error in the foreground, fix it,
+and the notifier resumes on its next retry.
+
+<a id="refresh-required"></a>
+## refresh_required
+
+A GitHub push arrived for a managed source. A managed source never pulls, so the
+push's commit is recorded as wanted and the webhook answers 409 refresh_required
+instead of queueing a sync that cannot import it. Run
+gbrain sources refresh <id> on the brain host; the resident notifier then syncs
+the refreshed checkout.
+
+## Freshness numbers
+
+Each managed source's freshness over the last 24 hours shows in gbrain sync
+status --source <id> (the freshness block in --json) and in gbrain status: p50
+and p95 of commit to searchable (from the commit's committer time to the page
+write's completed_at) and commit to embedded. A first sync and working-tree
entries are not counted, and a run that spans several commits is dated by its
-newest. Doctor `managed_sync_latency` warns when p95 commit→searchable is over
-`sync.freshness_target_seconds` (default 300) and fails over one hour; it grades
-only a brain with `sync.on_commit` on or a target set, and otherwise reports the
-numbers. With grading on, it also warns when the synced commits are not in this
-host's git checkout, so their latency cannot be measured. `gbrain doctor
---source <id>` grades only that source. A stopped or stalled sync is reported by
-doctor `managed_sync_not_moving`, not by this check.
+newest. Doctor managed_sync_latency warns when p95 commit to searchable is over
+sync.freshness_target_seconds (default 300) and fails over one hour; it grades
+only a brain with sync.on_commit on or a target set, and otherwise reports the
+numbers. gbrain doctor --source <id> grades only that source. A stopped or
+stalled sync is reported by doctor managed_sync_not_moving, not by this check.
The rest of managed sync (backlogs, holds, the drain) is in
[live sync](live-sync.md).
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 9347a38d1b..b71f0cf7d9 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -912,6 +912,10 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
{ since: '0.60.309.0', text: 'A brain without an embedding provider no longer queues embed-backfill jobs; one already queued ends once with the notice `embed_backfill_skipped`. A managed sync job submitted without pull options imports the checkout HEAD instead of failing permanently. A mention whose link target is not a valid slug is skipped instead of failing the links effect (#7008).' },
{ since: '0.60.309.0', text: '`gbrain backup check` reads a dirty tree as dirty however long its status listing is (a listing over 1 MiB used to read `probe_failed`), the remote probe timeout is configurable with `backup.remote_timeout_ms` (or GBRAIN_BACKUP_REMOTE_TIMEOUT_MS, 0.5 to 30 s, default 2 s), and a timed-out probe is counted in `totals.remote_timeouts` and named as a timeout, not as a missing backup (#6907).' },
{ since: '0.60.309.0', text: 'Managed dream synthesis counts a transcript a pre-managed run already synthesised as done while a dream-generated page naming that transcript still exists in the same source, so upgrading to managed mode no longer re-synthesises old transcripts (#6924).' },
+ // GBRA-133 PR 2a (commit triggers that never drop a commit). `since` is restamped at the merge slot.
+ { since: '0.60.309.0', text: 'With `sync.on_commit` on, the commit watcher now runs in every resident (gbrain serve, serve --http, gbrain jobs work and the autopilot daemon; one owns it per host), watches classic sources last synced on this host as well as managed ones, starts a sync as soon as a quiet HEAD moves (the fixed 3 s debounce is now a 400 ms trailing window, `GBRAIN_NOTIFIER_QUIET_MS`), and keeps a source due across failed or refused starts with retries at 5 s, 15 s, 1 min and 5 min (`notifier_stalled` after that). `GBRAIN_NOTIFIER=0` turns it off per process; `sync.on_commit.sources` excludes sources.' },
+ { since: '0.60.309.0', text: 'A sync request is now recorded before it runs and is never dropped: `gbrain sync trigger` answers queued, coalesced, nudged or no_resident (exit 3, with `--json`), a second GitHub push while the first job waits joins it instead of being ignored for 30 s, and requests are drained by residents even with `sync.on_commit` off. A push for a managed source answers 409 `refresh_required` with the `gbrain sources refresh` fix instead of queueing a sync that cannot import it.' },
+ { since: '0.60.309.0', text: 'Search and query responses carry a `freshness` entry per source (current, behind, syncing, unknown or not_monitored, the observed HEAD and time, the detection mode and the held-file count), read from the notifier\'s record without a git call.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/src/core/config.ts b/src/core/config.ts
index 1d5f9e15ea..19b968595e 100644
--- a/src/core/config.ts
+++ b/src/core/config.ts
@@ -1730,7 +1730,7 @@ export const KNOWN_CONFIG_KEYS: readonly string[] = [
'sync.bulk',
'sync.bulk_size',
// #6858 ask 6: on-commit sync in the resident serve and its freshness target (src/core/sync-config-keys.ts).
- 'sync.on_commit', 'sync.freshness_target_seconds',
+ 'sync.on_commit', 'sync.freshness_target_seconds', 'sync.on_commit.sources', // GBRA-133 PR 2a: notifier exclusions (notifier/resident.ts)
// #6712 PR 2: rollback keys (src/core/sync-config-keys.ts; windows in wire-skew.ts): readable and honored, not tunables.
'sync.job_drain', 'sync.waive_batch', 'sync.foreground_priority',
'sync.lanes', 'persistence.single_write_group', 'persistence.preadmit_cache', // the last two: write-path kill switches (persistence/switches.ts)
diff --git a/test/fixtures/goldens/catalog/postgres-db-initschema.json b/test/fixtures/goldens/catalog/postgres-db-initschema.json
index 157c04995e..0ab84505e5 100644
--- a/test/fixtures/goldens/catalog/postgres-db-initschema.json
+++ b/test/fixtures/goldens/catalog/postgres-db-initschema.json
@@ -329,6 +329,14 @@
"subagent_tool_executions.subagent_tool_executions_job_id_fkey": "f FOREIGN KEY (job_id) REFERENCES minion_jobs(id) ON DELETE CASCADE",
"subagent_tool_executions.subagent_tool_executions_pkey": "p PRIMARY KEY (id)",
"subagent_tool_executions.subagent_tool_executions_stable_id": "u UNIQUE (job_id, message_idx, ordinal)",
+ "sync_notifier_leases.sync_notifier_leases_pkey": "p PRIMARY KEY (host_id)",
+ "sync_notifier_sources.sync_notifier_sources_detection_mode_check": "c CHECK ((detection_mode = ANY (ARRAY['watch'::text, 'poll'::text])))",
+ "sync_notifier_sources.sync_notifier_sources_pkey": "p PRIMARY KEY (source_id)",
+ "sync_notifier_sources.sync_notifier_sources_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "sync_notifier_sources.sync_notifier_sources_state_check": "c CHECK ((state = ANY (ARRAY['idle'::text, 'due'::text, 'running'::text, 'retry'::text, 'operator_blocked'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_intent_check": "c CHECK ((intent = ANY (ARRAY['freshness'::text, 'pull'::text, 'full'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_pkey": "p PRIMARY KEY (source_id, intent)",
+ "sync_wanted_markers.sync_wanted_markers_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"tags.tags_page_id_fkey": "f FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE",
"tags.tags_page_id_tag_key": "u UNIQUE (page_id, tag)",
"tags.tags_pkey": "p PRIMARY KEY (id)",
@@ -716,6 +724,15 @@
"subagent_tool_executions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "sync_notifier_leases": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_notifier_sources": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_wanted_markers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"tags": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1042,6 +1059,9 @@
"subagent_rate_leases_pkey": "CREATE UNIQUE INDEX subagent_rate_leases_pkey ON public.subagent_rate_leases USING btree (id)",
"subagent_tool_executions_pkey": "CREATE UNIQUE INDEX subagent_tool_executions_pkey ON public.subagent_tool_executions USING btree (id)",
"subagent_tool_executions_stable_id": "CREATE UNIQUE INDEX subagent_tool_executions_stable_id ON public.subagent_tool_executions USING btree (job_id, message_idx, ordinal)",
+ "sync_notifier_leases_pkey": "CREATE UNIQUE INDEX sync_notifier_leases_pkey ON public.sync_notifier_leases USING btree (host_id)",
+ "sync_notifier_sources_pkey": "CREATE UNIQUE INDEX sync_notifier_sources_pkey ON public.sync_notifier_sources USING btree (source_id)",
+ "sync_wanted_markers_pkey": "CREATE UNIQUE INDEX sync_wanted_markers_pkey ON public.sync_wanted_markers USING btree (source_id, intent)",
"tags_page_id_tag_key": "CREATE UNIQUE INDEX tags_page_id_tag_key ON public.tags USING btree (page_id, tag)",
"tags_pkey": "CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id)",
"take_grade_cache_applied_idx": "CREATE INDEX take_grade_cache_applied_idx ON public.take_grade_cache USING btree (take_id, applied)",
@@ -2876,6 +2896,59 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "sync_notifier_leases": {
+ "columns": [
+ "1 host_id text/text NOT NULL",
+ "2 owner_id text/text NOT NULL",
+ "3 fence bigint/int8 NOT NULL DEFAULT 1",
+ "4 resident_kind text/text NOT NULL",
+ "5 pid integer/int4 NULL",
+ "6 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "sync_notifier_sources": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 source_incarnation text/text NULL",
+ "3 syncer_host_id text/text NULL",
+ "4 syncer_recorded_at timestamp with time zone/timestamptz NULL",
+ "5 state text/text NOT NULL DEFAULT 'idle'::text",
+ "6 reason text/text NULL",
+ "7 first_due_at timestamp with time zone/timestamptz NULL",
+ "8 attempts integer/int4 NOT NULL DEFAULT 0",
+ "9 next_retry_at timestamp with time zone/timestamptz NULL",
+ "10 last_progress_at timestamp with time zone/timestamptz NULL",
+ "11 last_error_code text/text NULL",
+ "12 last_error text/text NULL",
+ "13 last_error_at timestamp with time zone/timestamptz NULL",
+ "14 trace_path text/text NULL",
+ "15 observed_head text/text NULL",
+ "16 observed_at timestamp with time zone/timestamptz NULL",
+ "17 detection_mode text/text NULL",
+ "18 owner_host_id text/text NULL",
+ "19 owner_kind text/text NULL",
+ "20 owner_pid integer/int4 NULL",
+ "21 owner_seen_at timestamp with time zone/timestamptz NULL",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
+ "sync_wanted_markers": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 intent text/text NOT NULL",
+ "3 source_incarnation text/text NULL",
+ "4 wanted_head text/text NULL",
+ "5 generation bigint/int8 NOT NULL DEFAULT 1",
+ "6 first_due_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 requested_by text/text NOT NULL",
+ "9 job_id bigint/int8 NULL"
+ ],
+ "flags": "relkind=r rls=false force_rls=false"
+ },
"tags": {
"columns": [
"1 id integer/int4 NOT NULL DEFAULT nextval('tags_id_seq'::regclass)",
diff --git a/test/fixtures/goldens/catalog/postgres-engine-init-default.json b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
index 5ed10941dc..ed2f7c8555 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-default.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-default.json
@@ -415,6 +415,14 @@
"subagent_tool_executions.subagent_tool_executions_job_id_fkey": "f FOREIGN KEY (job_id) REFERENCES minion_jobs(id) ON DELETE CASCADE",
"subagent_tool_executions.subagent_tool_executions_pkey": "p PRIMARY KEY (id)",
"subagent_tool_executions.subagent_tool_executions_stable_id": "u UNIQUE (job_id, message_idx, ordinal)",
+ "sync_notifier_leases.sync_notifier_leases_pkey": "p PRIMARY KEY (host_id)",
+ "sync_notifier_sources.sync_notifier_sources_detection_mode_check": "c CHECK ((detection_mode = ANY (ARRAY['watch'::text, 'poll'::text])))",
+ "sync_notifier_sources.sync_notifier_sources_pkey": "p PRIMARY KEY (source_id)",
+ "sync_notifier_sources.sync_notifier_sources_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "sync_notifier_sources.sync_notifier_sources_state_check": "c CHECK ((state = ANY (ARRAY['idle'::text, 'due'::text, 'running'::text, 'retry'::text, 'operator_blocked'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_intent_check": "c CHECK ((intent = ANY (ARRAY['freshness'::text, 'pull'::text, 'full'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_pkey": "p PRIMARY KEY (source_id, intent)",
+ "sync_wanted_markers.sync_wanted_markers_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"synthesis_evidence.synthesis_evidence_pkey": "p PRIMARY KEY (synthesis_page_id, take_page_id, take_row_num)",
"synthesis_evidence.synthesis_evidence_synthesis_page_id_fkey": "f FOREIGN KEY (synthesis_page_id) REFERENCES pages(id) ON DELETE CASCADE",
"synthesis_evidence.synthesis_evidence_take_page_id_take_row_num_fkey": "f FOREIGN KEY (take_page_id, take_row_num) REFERENCES takes(page_id, row_num) ON DELETE CASCADE",
@@ -924,6 +932,15 @@
"subagent_tool_executions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "sync_notifier_leases": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_notifier_sources": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_wanted_markers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"synthesis_evidence": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1386,6 +1403,9 @@
"subagent_rate_leases_pkey": "CREATE UNIQUE INDEX subagent_rate_leases_pkey ON public.subagent_rate_leases USING btree (id)",
"subagent_tool_executions_pkey": "CREATE UNIQUE INDEX subagent_tool_executions_pkey ON public.subagent_tool_executions USING btree (id)",
"subagent_tool_executions_stable_id": "CREATE UNIQUE INDEX subagent_tool_executions_stable_id ON public.subagent_tool_executions USING btree (job_id, message_idx, ordinal)",
+ "sync_notifier_leases_pkey": "CREATE UNIQUE INDEX sync_notifier_leases_pkey ON public.sync_notifier_leases USING btree (host_id)",
+ "sync_notifier_sources_pkey": "CREATE UNIQUE INDEX sync_notifier_sources_pkey ON public.sync_notifier_sources USING btree (source_id)",
+ "sync_wanted_markers_pkey": "CREATE UNIQUE INDEX sync_wanted_markers_pkey ON public.sync_wanted_markers USING btree (source_id, intent)",
"synthesis_evidence_pkey": "CREATE UNIQUE INDEX synthesis_evidence_pkey ON public.synthesis_evidence USING btree (synthesis_page_id, take_page_id, take_row_num)",
"tags_page_id_tag_key": "CREATE UNIQUE INDEX tags_page_id_tag_key ON public.tags USING btree (page_id, tag)",
"tags_pkey": "CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id)",
@@ -3688,6 +3708,59 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "sync_notifier_leases": {
+ "columns": [
+ "1 host_id text/text NOT NULL",
+ "2 owner_id text/text NOT NULL",
+ "3 fence bigint/int8 NOT NULL DEFAULT 1",
+ "4 resident_kind text/text NOT NULL",
+ "5 pid integer/int4 NULL",
+ "6 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "sync_notifier_sources": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 source_incarnation text/text NULL",
+ "3 syncer_host_id text/text NULL",
+ "4 syncer_recorded_at timestamp with time zone/timestamptz NULL",
+ "5 state text/text NOT NULL DEFAULT 'idle'::text",
+ "6 reason text/text NULL",
+ "7 first_due_at timestamp with time zone/timestamptz NULL",
+ "8 attempts integer/int4 NOT NULL DEFAULT 0",
+ "9 next_retry_at timestamp with time zone/timestamptz NULL",
+ "10 last_progress_at timestamp with time zone/timestamptz NULL",
+ "11 last_error_code text/text NULL",
+ "12 last_error text/text NULL",
+ "13 last_error_at timestamp with time zone/timestamptz NULL",
+ "14 trace_path text/text NULL",
+ "15 observed_head text/text NULL",
+ "16 observed_at timestamp with time zone/timestamptz NULL",
+ "17 detection_mode text/text NULL",
+ "18 owner_host_id text/text NULL",
+ "19 owner_kind text/text NULL",
+ "20 owner_pid integer/int4 NULL",
+ "21 owner_seen_at timestamp with time zone/timestamptz NULL",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "sync_wanted_markers": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 intent text/text NOT NULL",
+ "3 source_incarnation text/text NULL",
+ "4 wanted_head text/text NULL",
+ "5 generation bigint/int8 NOT NULL DEFAULT 1",
+ "6 first_due_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 requested_by text/text NOT NULL",
+ "9 job_id bigint/int8 NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"synthesis_evidence": {
"columns": [
"1 synthesis_page_id integer/int4 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 8ed3666a79..33de7d0a71 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-fts-portuguese.json
@@ -415,6 +415,14 @@
"subagent_tool_executions.subagent_tool_executions_job_id_fkey": "f FOREIGN KEY (job_id) REFERENCES minion_jobs(id) ON DELETE CASCADE",
"subagent_tool_executions.subagent_tool_executions_pkey": "p PRIMARY KEY (id)",
"subagent_tool_executions.subagent_tool_executions_stable_id": "u UNIQUE (job_id, message_idx, ordinal)",
+ "sync_notifier_leases.sync_notifier_leases_pkey": "p PRIMARY KEY (host_id)",
+ "sync_notifier_sources.sync_notifier_sources_detection_mode_check": "c CHECK ((detection_mode = ANY (ARRAY['watch'::text, 'poll'::text])))",
+ "sync_notifier_sources.sync_notifier_sources_pkey": "p PRIMARY KEY (source_id)",
+ "sync_notifier_sources.sync_notifier_sources_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "sync_notifier_sources.sync_notifier_sources_state_check": "c CHECK ((state = ANY (ARRAY['idle'::text, 'due'::text, 'running'::text, 'retry'::text, 'operator_blocked'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_intent_check": "c CHECK ((intent = ANY (ARRAY['freshness'::text, 'pull'::text, 'full'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_pkey": "p PRIMARY KEY (source_id, intent)",
+ "sync_wanted_markers.sync_wanted_markers_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"synthesis_evidence.synthesis_evidence_pkey": "p PRIMARY KEY (synthesis_page_id, take_page_id, take_row_num)",
"synthesis_evidence.synthesis_evidence_synthesis_page_id_fkey": "f FOREIGN KEY (synthesis_page_id) REFERENCES pages(id) ON DELETE CASCADE",
"synthesis_evidence.synthesis_evidence_take_page_id_take_row_num_fkey": "f FOREIGN KEY (take_page_id, take_row_num) REFERENCES takes(page_id, row_num) ON DELETE CASCADE",
@@ -924,6 +932,15 @@
"subagent_tool_executions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "sync_notifier_leases": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_notifier_sources": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_wanted_markers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"synthesis_evidence": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1386,6 +1403,9 @@
"subagent_rate_leases_pkey": "CREATE UNIQUE INDEX subagent_rate_leases_pkey ON public.subagent_rate_leases USING btree (id)",
"subagent_tool_executions_pkey": "CREATE UNIQUE INDEX subagent_tool_executions_pkey ON public.subagent_tool_executions USING btree (id)",
"subagent_tool_executions_stable_id": "CREATE UNIQUE INDEX subagent_tool_executions_stable_id ON public.subagent_tool_executions USING btree (job_id, message_idx, ordinal)",
+ "sync_notifier_leases_pkey": "CREATE UNIQUE INDEX sync_notifier_leases_pkey ON public.sync_notifier_leases USING btree (host_id)",
+ "sync_notifier_sources_pkey": "CREATE UNIQUE INDEX sync_notifier_sources_pkey ON public.sync_notifier_sources USING btree (source_id)",
+ "sync_wanted_markers_pkey": "CREATE UNIQUE INDEX sync_wanted_markers_pkey ON public.sync_wanted_markers USING btree (source_id, intent)",
"synthesis_evidence_pkey": "CREATE UNIQUE INDEX synthesis_evidence_pkey ON public.synthesis_evidence USING btree (synthesis_page_id, take_page_id, take_row_num)",
"tags_page_id_tag_key": "CREATE UNIQUE INDEX tags_page_id_tag_key ON public.tags USING btree (page_id, tag)",
"tags_pkey": "CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id)",
@@ -3688,6 +3708,59 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "sync_notifier_leases": {
+ "columns": [
+ "1 host_id text/text NOT NULL",
+ "2 owner_id text/text NOT NULL",
+ "3 fence bigint/int8 NOT NULL DEFAULT 1",
+ "4 resident_kind text/text NOT NULL",
+ "5 pid integer/int4 NULL",
+ "6 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "sync_notifier_sources": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 source_incarnation text/text NULL",
+ "3 syncer_host_id text/text NULL",
+ "4 syncer_recorded_at timestamp with time zone/timestamptz NULL",
+ "5 state text/text NOT NULL DEFAULT 'idle'::text",
+ "6 reason text/text NULL",
+ "7 first_due_at timestamp with time zone/timestamptz NULL",
+ "8 attempts integer/int4 NOT NULL DEFAULT 0",
+ "9 next_retry_at timestamp with time zone/timestamptz NULL",
+ "10 last_progress_at timestamp with time zone/timestamptz NULL",
+ "11 last_error_code text/text NULL",
+ "12 last_error text/text NULL",
+ "13 last_error_at timestamp with time zone/timestamptz NULL",
+ "14 trace_path text/text NULL",
+ "15 observed_head text/text NULL",
+ "16 observed_at timestamp with time zone/timestamptz NULL",
+ "17 detection_mode text/text NULL",
+ "18 owner_host_id text/text NULL",
+ "19 owner_kind text/text NULL",
+ "20 owner_pid integer/int4 NULL",
+ "21 owner_seen_at timestamp with time zone/timestamptz NULL",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "sync_wanted_markers": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 intent text/text NOT NULL",
+ "3 source_incarnation text/text NULL",
+ "4 wanted_head text/text NULL",
+ "5 generation bigint/int8 NOT NULL DEFAULT 1",
+ "6 first_due_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 requested_by text/text NOT NULL",
+ "9 job_id bigint/int8 NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"synthesis_evidence": {
"columns": [
"1 synthesis_page_id integer/int4 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 913b09d0d3..9599c17941 100644
--- a/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
+++ b/test/fixtures/goldens/catalog/postgres-engine-init-high-dims.json
@@ -415,6 +415,14 @@
"subagent_tool_executions.subagent_tool_executions_job_id_fkey": "f FOREIGN KEY (job_id) REFERENCES minion_jobs(id) ON DELETE CASCADE",
"subagent_tool_executions.subagent_tool_executions_pkey": "p PRIMARY KEY (id)",
"subagent_tool_executions.subagent_tool_executions_stable_id": "u UNIQUE (job_id, message_idx, ordinal)",
+ "sync_notifier_leases.sync_notifier_leases_pkey": "p PRIMARY KEY (host_id)",
+ "sync_notifier_sources.sync_notifier_sources_detection_mode_check": "c CHECK ((detection_mode = ANY (ARRAY['watch'::text, 'poll'::text])))",
+ "sync_notifier_sources.sync_notifier_sources_pkey": "p PRIMARY KEY (source_id)",
+ "sync_notifier_sources.sync_notifier_sources_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
+ "sync_notifier_sources.sync_notifier_sources_state_check": "c CHECK ((state = ANY (ARRAY['idle'::text, 'due'::text, 'running'::text, 'retry'::text, 'operator_blocked'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_intent_check": "c CHECK ((intent = ANY (ARRAY['freshness'::text, 'pull'::text, 'full'::text])))",
+ "sync_wanted_markers.sync_wanted_markers_pkey": "p PRIMARY KEY (source_id, intent)",
+ "sync_wanted_markers.sync_wanted_markers_source_id_fkey": "f FOREIGN KEY (source_id) REFERENCES sources(id) ON DELETE CASCADE",
"synthesis_evidence.synthesis_evidence_pkey": "p PRIMARY KEY (synthesis_page_id, take_page_id, take_row_num)",
"synthesis_evidence.synthesis_evidence_synthesis_page_id_fkey": "f FOREIGN KEY (synthesis_page_id) REFERENCES pages(id) ON DELETE CASCADE",
"synthesis_evidence.synthesis_evidence_take_page_id_take_row_num_fkey": "f FOREIGN KEY (take_page_id, take_row_num) REFERENCES takes(page_id, row_num) ON DELETE CASCADE",
@@ -924,6 +932,15 @@
"subagent_tool_executions": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
+ "sync_notifier_leases": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_notifier_sources": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
+ "sync_wanted_markers": [
+ "<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
+ ],
"synthesis_evidence": [
"<current_role> -> <current_role> WITH GRANT OPTION: DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE"
],
@@ -1382,6 +1399,9 @@
"subagent_rate_leases_pkey": "CREATE UNIQUE INDEX subagent_rate_leases_pkey ON public.subagent_rate_leases USING btree (id)",
"subagent_tool_executions_pkey": "CREATE UNIQUE INDEX subagent_tool_executions_pkey ON public.subagent_tool_executions USING btree (id)",
"subagent_tool_executions_stable_id": "CREATE UNIQUE INDEX subagent_tool_executions_stable_id ON public.subagent_tool_executions USING btree (job_id, message_idx, ordinal)",
+ "sync_notifier_leases_pkey": "CREATE UNIQUE INDEX sync_notifier_leases_pkey ON public.sync_notifier_leases USING btree (host_id)",
+ "sync_notifier_sources_pkey": "CREATE UNIQUE INDEX sync_notifier_sources_pkey ON public.sync_notifier_sources USING btree (source_id)",
+ "sync_wanted_markers_pkey": "CREATE UNIQUE INDEX sync_wanted_markers_pkey ON public.sync_wanted_markers USING btree (source_id, intent)",
"synthesis_evidence_pkey": "CREATE UNIQUE INDEX synthesis_evidence_pkey ON public.synthesis_evidence USING btree (synthesis_page_id, take_page_id, take_row_num)",
"tags_page_id_tag_key": "CREATE UNIQUE INDEX tags_page_id_tag_key ON public.tags USING btree (page_id, tag)",
"tags_pkey": "CREATE UNIQUE INDEX tags_pkey ON public.tags USING btree (id)",
@@ -3684,6 +3704,59 @@
],
"flags": "relkind=r rls=true force_rls=false"
},
+ "sync_notifier_leases": {
+ "columns": [
+ "1 host_id text/text NOT NULL",
+ "2 owner_id text/text NOT NULL",
+ "3 fence bigint/int8 NOT NULL DEFAULT 1",
+ "4 resident_kind text/text NOT NULL",
+ "5 pid integer/int4 NULL",
+ "6 renewed_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 expires_at timestamp with time zone/timestamptz NOT NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "sync_notifier_sources": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 source_incarnation text/text NULL",
+ "3 syncer_host_id text/text NULL",
+ "4 syncer_recorded_at timestamp with time zone/timestamptz NULL",
+ "5 state text/text NOT NULL DEFAULT 'idle'::text",
+ "6 reason text/text NULL",
+ "7 first_due_at timestamp with time zone/timestamptz NULL",
+ "8 attempts integer/int4 NOT NULL DEFAULT 0",
+ "9 next_retry_at timestamp with time zone/timestamptz NULL",
+ "10 last_progress_at timestamp with time zone/timestamptz NULL",
+ "11 last_error_code text/text NULL",
+ "12 last_error text/text NULL",
+ "13 last_error_at timestamp with time zone/timestamptz NULL",
+ "14 trace_path text/text NULL",
+ "15 observed_head text/text NULL",
+ "16 observed_at timestamp with time zone/timestamptz NULL",
+ "17 detection_mode text/text NULL",
+ "18 owner_host_id text/text NULL",
+ "19 owner_kind text/text NULL",
+ "20 owner_pid integer/int4 NULL",
+ "21 owner_seen_at timestamp with time zone/timestamptz NULL",
+ "22 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
+ "sync_wanted_markers": {
+ "columns": [
+ "1 source_id text/text NOT NULL",
+ "2 intent text/text NOT NULL",
+ "3 source_incarnation text/text NULL",
+ "4 wanted_head text/text NULL",
+ "5 generation bigint/int8 NOT NULL DEFAULT 1",
+ "6 first_due_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "7 updated_at timestamp with time zone/timestamptz NOT NULL DEFAULT now()",
+ "8 requested_by text/text NOT NULL",
+ "9 job_id bigint/int8 NULL"
+ ],
+ "flags": "relkind=r rls=true force_rls=false"
+ },
"synthesis_evidence": {
"columns": [
"1 synthesis_page_id integer/int4 NOT NULL",
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 9a3ffa3053..4c54c08493 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -928,7 +928,7 @@
{
"category": "ops",
"elapsed_ms": "<volatile>",
- "message": "RLS enabled on 148/148 public tables",
+ "message": "RLS enabled on 151/151 public tables",
"name": "rls",
"status": "ok"
},
@@ -942,7 +942,7 @@
{
"category": "meta",
"elapsed_ms": "<volatile>",
- "message": "1264 column(s) verified against live schema",
+ "message": "1302 column(s) verified against live schema",
"name": "schema_columns",
"status": "ok"
},