Skip to content

Slice 031: Session search (FTS5) - #38

Merged
HackTuah merged 7 commits into
mainfrom
slice/031-session-search-fts
Sep 21, 2026
Merged

HackTuah merged 7 commits into
mainfrom
slice/031-session-search-fts

Conversation

@HackTuah

Copy link
Copy Markdown
Member

Full-text search over every message: an FTS5 table with porter stemming kept by triggers on SQLite, a generated tsvector column with a GIN index on Postgres, Trinity.Memory.Search.messages/2 over both (the query bound as a parameter, FTS5 terms quoted so operators are text), mix trinity.search.reindex, the session_search core read tool, and the /search page whose hits deep-link into the session at the message.

Measured before code: exqlite 0.40.0's SQLite 3.53.4 carries FTS5; porter stems "running" to "runs" and not to "ran" (no stemmer maps an irregular past tense), so AC2's "ran" half is asserted as not found, with the reason. Reindex of 10,000 rows: 32 to 46 ms here; nothing to rebuild on Postgres.

Manual halves in proof/: the GIF of nvidia:nemotron calling session_search and answering "October 21st" from a session seeded a week earlier; the search page with marked hits; the deep link into the older session. PROOF.md at slices/031-session-search-fts/PROOF.md.

Signed-off-by: Ayla Croft aylacroft@proton.me

…slice opens

ROADMAP row 031 to in_progress. NOTES.md records that exqlite 0.40.0's
SQLite 3.53.4 carries FTS5 and that porter stems running to runs and
not to ran, then the six-line build plan, the two-item manual queue
and three deviations stated before any code. plan_check: PASS.

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…ty.Memory.Search, the reindex task

Migration branching on the adapter: messages_fts with porter unicode61
and three triggers plus a backfill on SQLite, a generated content_tsv
column with a GIN index on Postgres. Search.messages/2 with bound
parameters, FTS5 terms quoted, filters, limit capped; reindex/0.
Tests: AC1 on insert, update and delete; AC2 as measured (runs, not
ran); filters and operator-shaped queries; AC3 over 10,000 rows with
the counts equal and the time printed (32 ms here).

Signed-off-by: Ayla Croft <aylacroft@proton.me>
… Memory

Trinity.Tools.SessionSearch (risk read, effect none, query and limit
capped at 50), registered in every environment; hits as text the model
reads, wrapped untrusted. The Tools boundary gains Memory (docs/01 row
as built). Tests: registered as a core read outside the catalog; at
most limit hits with snippets through the runner in force, with the
decision and query receipts; the no-hit text; a limit past the schema
refused.

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…s built

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…ts it

Signed-off-by: Ayla Croft <aylacroft@proton.me>
PROOF.md with every criterion's evidence by test name against run
35545182679 (gate, postgres and fips green; the postgres job's
generated column doing AC1 and AC3's work). The manual halves in
proof/: the GIF of nvidia:nemotron calling session_search and
answering from last week's session, the search page with marked
hits, and the deep link into the older session. NOTES.md: seven
findings, three follow-ups. ROADMAP row 031 to done; coverage.tsv row
76.96 %.

Signed-off-by: Ayla Croft <aylacroft@proton.me>
Signed-off-by: Ayla Croft <aylacroft@proton.me>
@HackTuah
HackTuah merged commit eba63b5 into main Sep 21, 2026
8 checks passed
@HackTuah
HackTuah deleted the slice/031-session-search-fts branch September 21, 2026 00:33
@HackTuah HackTuah mentioned this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant