Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

TODOS: P2 analyze pages after the v240 name-lookup indexes on upgraded PGLite brains

garrytana798de1f966d
diff --git a/TODOS.md b/TODOS.md
index 4c65f5a263..43c64cf616 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -20,6 +20,7 @@ Context: gbrain-evals `docs/plans/2026-10-07-cat40-hard-fix/PLAN.md`; this wave
- [ ] **P3 — Show the keyword count and `next` in CLI `gbrain search` output.** **Effort:** S. **Priority:** P3.
- [ ] **P2 — Measure the keyword count at scale.** **What:** on PGLite the count runs serially with the search (one connection). **Gate:** `keyword_count_unavailable` under 1% of searches and added p50 under 100 ms on a 55k calibration slot; otherwise skip the count on large PGLite brains. **Effort:** S. **Priority:** P2.
- [ ] **P2 — Quarantined referrers still appear in card `edges[]` (`context_pack` and `entity`).** **What:** the inbound edge read in `src/core/verbs/entity-card.ts` applies the private-page and private-origin filters but not the quarantine filter or the caller's trust floor, so an untrusted caller's `context_pack` card (and full `entity` card) lists a quarantined referrer's slug, link type and `links.context` sentence in `edges[]`, and a below-floor referrer on `context_pack`, while `records[]`, `referenced_by`, `newer_mentions` and F3 `page_status` leave them out (seen on the entity-records test world: `contracts/acme-quarantined` in `edges[]`, absent from `records`). Left as is in Cat 40 next wave Part 1. **Fix:** apply `quarantineFilterFragment` (unless an authorized `include_quarantined` read) and the pack's eligibility to the inbound edge query and `backlink_count`, with a hidden-referrer test on both engines. **Effort:** S. **Priority:** P2.
+- [ ] **P2 — Analyze `pages` after the v240 name-lookup indexes on an upgraded PGLite brain.** **What:** v240 builds `idx_pages_source_title_lower` and `idx_pages_slug_trgm` without refreshing planner statistics, and PGLite runs no autovacuum. On the 55,838-page World M PGLite brain with the indexes freshly built, a 50-name `entity names` batch took p50 5,378 ms on master `09d21554d`, and 1,200 ms after `ANALYZE pages` (1 name: 89 → 42 ms; 10 names: 1,128 → 276 ms). The pre-index path took 17,728 ms. **Fix:** `ANALYZE pages` after the v240 handler on PGLite, or a planner-stats refresh like `plannerStatsForLinkDrain`, with a plan test on an upgraded brain. **Effort:** S. **Priority:** P2.
## CI runtime follow-ups (filed 2026-10-09, GBRA-64)