← plans · search-matters-speed · NOS-21023 juil. 2026

search_matters speed — implementation plan

Status: In progress · Author: Claude (NOS-210 orchestrator) · Date: 2026-07-23 · Repo: north-os
Related: design spec 2026-07-23-search-matters-speed-design.html · Linear NOS-210

Goal: take search_matters from p50 3.3s to tens of ms on the real HSE corpus with byte-identical results, by restructuring one SQL query in packages/agent-runtime/src/tools/search-matters.ts. No schema changes on this branch.

Tasks

Invariants

Plan review (omp, GPT-5.6-Sol high — 2026-07-23)

No correctness or RLS blocker; core rewrite judged sound (MAX over the constant joined count is multiplication-safe; CTE keys match the original correlations; org-only policies on all three scanned tables; SET LOCAL is transaction-scoped and pool-compatible). Three MAJOR findings: