Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(migrations): v209 drops its placeholder name: page_facts_reconcile

time-attack192efe04da69
diff --git a/TODOS.md b/TODOS.md
index 4ddbb1c585..954b1abb5a 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -375,7 +375,7 @@ Spec: `docs/designs/AGENT_OPERATOR_WAVE.md` (Deferred list). Contract: `docs/pro
**What:** colon slugs such as `calendar:abc` are writable again, but on Windows a write whose file name would contain `:` is refused (`colon_slug_windows_write_through`) and sync skips such files. **Fix:** a reversible slug-to-filename escape for `:` so colon-slug brains stay portable to Windows checkouts. **Cons:** a filename mapping every reader and writer must agree on. **Effort:** M. **Priority:** P3.
- [ ] **P2 — #4951: PGLite `serve --http` wedges on stale planner statistics.**
**What:** a reporter saw `readAdjacencyBoosts` take about 72 s with nested-loop plans; a full `ANALYZE` on pages, links, sources, timeline_entries and content_chunks dropped it to 21 ms. PGLite has no autovacuum and runs queries on the main thread, so a slow plan looks like a wedge. Cause likely, unverified for `get_links`. **Fix:** run `ANALYZE` on the hot tables after migrations, bulk import or sync and periodically from the owner, plus a doctor check for stale `last_analyze`. **Effort:** S-M. **Priority:** P2.
-- [x] **P3 — #5190: pin `search_path` for the two fact functions.** **Completed: fix wave 9** — every gbrain plpgsql function pins `search_path` (definitions plus the `w9_f_function_search_path` migration); the fingerprint SQL functions schema-qualify their built-ins and stay inlinable.
+- [x] **P3 — #5190: pin `search_path` for the two fact functions.** **Completed: fix wave 9** — every gbrain plpgsql function pins `search_path` (definitions plus the `function_search_path` migration (v211)); the fingerprint SQL functions schema-qualify their built-ins and stay inlinable.
**What:** `gbrain_fact_fingerprint` and `gbrain_preserve_fact_withdrawal` (`src/core/facts/withdrawal-schema.ts`) have no pinned `search_path` (Supabase linter warning). `gbrain_fact_fingerprint` backs an index expression and must stay inlinable, so qualify its calls (`pg_catalog.`) instead of `SET search_path`; pin only the trigger function. **Effort:** S. **Priority:** P3.
- [x] **P2 — #5205: resident `serve` pool-size guidance.** **Completed: v0.60.36.0** — remediation recommends the resident floor of 6 and the boot-deadline line names the stuck phase and pool pressure.
**What:** a `serve` boot never completed at `GBRAIN_POOL_SIZE=2`, which our remediation text still recommends (`src/core/pg-access-classify.ts`, `src/commands/db-repair.ts`). The deadlock mechanism is unverified. **Fix:** measure the connection need of a resident `serve` first, then change the guidance (the reporter measured 6 as the minimum at which the projection worker drains) and fail fast with a pool-size message. **Effort:** S once measured. **Priority:** P2.
diff --git a/src/core/schema-migrations/registry.generated.ts b/src/core/schema-migrations/registry.generated.ts
index 65ec01c226..7775aa22ef 100644
--- a/src/core/schema-migrations/registry.generated.ts
+++ b/src/core/schema-migrations/registry.generated.ts
@@ -209,7 +209,7 @@ import { v205 } from './v205-minion-spend-authorization.ts';
import { v206 } from './v206-entity-mention-index.ts';
import { v207 } from './v207-retrieval-feedback.ts';
import { v208 } from './v208-delta-per-arm-cursor.ts';
-import { v209 } from './v209-w9-p-facts-reconcile.ts';
+import { v209 } from './v209-page-facts-reconcile.ts';
import { v210 } from './v210-clamp-oauth-token-ttl.ts';
import { v211 } from './v211-function-search-path.ts';
diff --git a/src/core/schema-migrations/v209-w9-p-facts-reconcile.ts b/src/core/schema-migrations/v209-page-facts-reconcile.ts
similarity index 97%
rename from src/core/schema-migrations/v209-w9-p-facts-reconcile.ts
rename to src/core/schema-migrations/v209-page-facts-reconcile.ts
index c5a8127726..f99cb74e19 100644
--- a/src/core/schema-migrations/v209-w9-p-facts-reconcile.ts
+++ b/src/core/schema-migrations/v209-page-facts-reconcile.ts
@@ -11,7 +11,7 @@ import type { Migration } from './types.ts';
// page_mention_state. Placeholder number: the fix wave 9 integrator renumbers it.
export const v209: Migration = {
version: 209,
- name: 'w9_p_facts_reconcile',
+ name: 'page_facts_reconcile',
idempotent: true,
sql: `
CREATE TABLE IF NOT EXISTS page_facts_reconcile (