Files
loki/scripts
CatoandClaude Opus 5.5 14b99e766e One slip in a name still finds it, on every search box (searchkit) (#1172)
* feat(search): one slip in a name still finds it, on every search box

Every search box in Loki matched the exact letters typed — `includes(q)` in
the lists, `ILIKE '%q%'` for people — so "lkoi" emptied the ⌘K palette and
"jonh" found nobody in a book that had John in it. They now go through
@bitbaum/searchkit (typo budget by word length, prefix while typing, accent
and joined-word folding, tie-break ranking), via src/lib/search.ts, in one
of two ways:

- rankByQuery, best match first: ⌘K (with matched label parts marked), its
  project picker, the prompt library and picker (marked), the chat project
  filter and picker, the GitHub repo picker.
- filterByQuery, matches in the list's own order, where the order is the
  operator's choice or the point: Projects, Control's "Find project" (the
  rail order is frozen on purpose), the model store, events (deadlines),
  chats (recency), essays, the goal tree (lib/goal-search.ts).

People stay in Postgres for recall: /api/people also searches the user's
person names and aliases in memory (lib/people-search.ts), ORs the ids it
finds into the ILIKE filter, orders those first, then reranks the page.
The assistant's lookups keep the exact behaviour: they pick one person to
message, and a forgiven name there could become the wrong person.

Matches are marked with a new ui-search-mark class (weight and a quiet
accent wash, not the browser's yellow).

Not converted, each with a one-line comment: site paths (substring on URLs),
robots (a handful of rows), the public fleet register (listkit owns its q).

Generated typo suites (typoCases + evaluate) pin it: palette projects 566
cases success@1 0.989, palette pages 1339 cases 0.998, people 1798 cases
0.999, prompts 4901 cases 0.993; every remaining miss is a listed collision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* chore(deps): add @bitbaum/searchkit, pinned to orangecat a868c0a9

The fleet's one search package, installed from orangecat by commit
(packages/searchkit). It ships compiled dist/, so no transpile step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* chore(deps): searchkit 0.2.1 (orangecat 6da45621)

Two ranking fixes found by the fleet: the typo budget is the written
word's, and a field is covered only when every typed word landed in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* chore(deps): searchkit 0.2.2 (orangecat e6cda794)

When no item has every typed word, keep the words some item has rather
than dropping the last one; two words the text wrote apart, matched as
one, rank as a typo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-12 10:48:03 -07:00
..
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00