Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(todos): file items 9 and 2 with their gate receipts

garrytan2e320056bd11
diff --git a/TODOS.md b/TODOS.md
index e468fa0f52..688e4b8248 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -10,7 +10,8 @@ Context: gbrain-evals `docs/plans/2026-10-15-lhf-wave-2/PLAN.md` ("NOT in scope"
- [ ] **P2 — Post-fusion read fan-out, fusion prefetch and the CLI config snapshot (from item 5).** **What:** item 5 kept the MCP per-request config snapshot, one settings statement per search, concurrent response-meta reads and concurrent entity resolve. These three each need their own failure-semantics and staleness design: one `Promise.all` must not become one failure domain for post-fusion ranking, the fan-out needs a pool-2 check, and a CLI snapshot needs a staleness rule for long-running commands. **Findings:** `eng-native.r1.md` F8, F9; `eng-outside.r1.md` F3, F11. **Effort:** M. **Priority:** P2.
- [ ] **P2 — Off-reply `mcp_request_log` insert (dropped from item 5).** **What:** writing the request-log row after the reply takes its insert off every MCP call's reply path, but a bounded queue can drop rows, and an in-memory drop counter in `serve --http` is invisible to `gbrain doctor` (another process) and resets on restart, while the admin dashboard, per-client usage and `last_used_at` read the table. **Fix:** persist losses (a summary row or a counter row doctor reads), a config switch for blocking inserts when an operator needs complete audit rows, usage reports qualified over incomplete windows, and shutdown that awaits in-flight inserts; test forced backpressure, insert failure and restart from a fresh process. **Findings:** `dx-native-1`, `dx-native-2`, `eng-native-9`, `eng-outside-9`, `dx-outside-3`. **Effort:** M. **Priority:** P2.
- [ ] **P2 — Automatic expression-statistics recovery on Postgres (item 6's heavier fix).** **What:** item 6 analyzes after every index build and recovers an already-present expression index automatically on PGLite; on Postgres doctor `planner_stats_stale` names it and an operator runs `gbrain repair planner-stats --apply`, because autovacuum waits for 10% of a table to change. **Fix:** a bounded maintenance owner (for example `post-upgrade` or the resident `serve` running `repairPlannerTable` once for flagged tables), with retry after a failed first ANALYZE, restricted roles kept as unknown, and no statement added to any search. **Findings:** `eng-native-7`, `ceo-outside-4`, `dx-outside-4`, `eng-outside-6`. **Effort:** S. **Priority:** P2.
-- [ ] **P3 — Broader attendance verbs behind an anchor-type guard (item 9's heavier fix).** **What:** item 9 added only unambiguous phrasings ("were present at", "was in the room for", "took part in", "participated in", "sat in on", "participants"). "joined", "was at" and "went to" would route employment, education and location questions to attendance unless guarded by the anchor's type, and a guard only in the resolver still changes keyword weights and title-mention ranking (`relational-plan.ts` `isRelationalQuery` feeds `hybrid/rank.ts` and `hybrid/request.ts`). The guard must also follow schema-pack aliases of meeting types instead of hardcoding `meeting`/`event` (`titleSeedTypes`). **Gate:** zero false routes on the competing-intent split measured on chosen relations and returned evidence, and final results equal to master on the negatives. **Findings:** `eng-outside-1`, `eng-native-13`, `ceo-native-11`, `ceo-outside.r1.md` F5. **Effort:** M. **Priority:** P3.
+- [ ] **P2 — Paraphrased attendance questions (item 9, dropped by its preregistered gate).** **What:** the narrowed lexicon ("were present at", "was in the room for", "took part in", "participated in", "sat in on", the "participants" noun frame, with a funding-object guard) fired the development paraphrase split 150 of 150 on world-v1-attendees (0 before; recall@5 on 0.530 to 0.707) but the held-out set of 30 independently written questions fired 18 of 90 runs (20%; base 6 of 90) against the 80% floor: 6 of 30 held-out questions parse as attendance (base 2). The held-out author used frames such as "showed up", "made it to", "turned out for", roster and guest-list nouns. One competing-intent question (school attendance) already routes to attendance on master. "joined", "was at" and "went to" would route employment, education and location questions unless guarded by the anchor's type, and a resolver-only guard still changes keyword weights and title-mention ranking (`relational-plan.ts` `isRelationalQuery` feeds `hybrid/rank.ts` and `hybrid/request.ts`); a guard must follow schema-pack aliases of meeting types. **Gate:** a fresh held-out set (the 2026-10-15 one is spent), zero false routes on chosen relations and returned evidence. **Receipt:** gbrain-evals `docs/benchmarks/2026-10-16-lhf-wave-2-attendance-preregistration.md` and its result. **Findings:** `eng-outside-1`, `eng-native-13`, `ceo-native-11`, `ceo-outside.r1.md` F5. **Effort:** M. **Priority:** P2.
+- [ ] **P3 — Saved-facts trigram index (item 2, dropped by its insert gate; from #6734 by @troyhoffman-oss).** **What:** a GIN trigram index on the saved-fact match expression serves master's unchanged statement after ANALYZE on both engines (p50 19.6 to 3.4 / 94 to 12 / 167 to 23 ms on PGLite at 10k/50k/100k facts; 32 to 4.9 / 87 to 12 / 83 to 21 ms on Postgres), but with `fastupdate=on` the pending list makes the planner pick a seq scan, `fastupdate=off` costs +27-40% insert p50 and -45% batch throughput, and a 256k-1MB pending list keeps p50/p95/p99 flat but costs -11-37% batch throughput and 15-30 ms flush spikes, so every configuration fails the +25% insert gate. A shelved patch (1MB pending list, own rebuild command, EXPLAIN test) is in the GBRA-107 thread. **Fix:** a cheaper write path (for example a separate narrow match table or an index on the fact text only) or a gate that weighs batch imports separately. **Effort:** M. **Priority:** P3.
- [ ] **P3 — Year tokens in planner anchors (old item 9b).** **What:** the planner refuses a quoted anchor before the year rule runs, so the year-title exception never applies to it; the fix needs anchor spans kept through the parser. **Findings:** `eng-native.r1.md` F16; `eng-outside.r1.md` F13. **Effort:** S. **Priority:** P3.
- [ ] **P2 — Type-filtered vector search through the index walk.** **What:** a `type`/`types`/date filter marks the vector statement narrowed and disables the walk (`vector-statement.ts`), so the planner seq-scans `content_chunks` and sorts every candidate: `searchVector` p50 with `types: ['email']` 462 ms against 56 ms unfiltered on Postgres 20k, 195 against 58 ms on PGLite 10k. The second half of the email-typed symptom in "Profile email-typed searches on a real-corpus slot". **Fix:** let the walk serve type filters, choosing by the filter's page share from `pg_stats`. **Source:** `audit/latency.md` §2. **Effort:** M. **Priority:** P2.
- [ ] **P3 — PGLite keyword arm computes `stale` for every matched chunk.** **What:** `pglite-engine.ts` evaluates `SELECT MAX(te.created_at) FROM timeline_entries` per chunk before `ORDER BY … LIMIT` (Postgres uses `false AS stale`); removing it took `searchKeyword(limit 60)` at 10k pages from 78.6 to 72.0 ms with an empty timeline. **Fix:** compute it in the outer per-page select, after the limit, with the existing stale-flag tests as the equivalence check. **Source:** `audit/latency.md` §10. **Effort:** S. **Priority:** P3.