Repository navigation
feat(admin-console): search run comments and annotation text (CHE-1478) [squash] - #353
Merged
Merged
Conversation
Index comment and annotation bodies in runs_fts (new notes column, catalog revision 2) and keep them current with triggers on the notes tables. Note matches rank after goal matches. Snippets for note-only matches are built after the visibility join and redacted for read-only runs.
Base automatically changed from
agent/x99-claude-sonnet/che-9324-2b1ec5ad4321
to
main
November 27, 2026 04:58
added 2 commits
December 2, 2026 20:10
…ch (CHE-1478) Filter read-only FTS hits against non-word-masked note and prompt text inside the catalog read snapshot so redacted credentials never affect search membership, total counts, cursors or snippets.
… search (CHE-1478)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Draft PR for CHE-1478 (stage 6 of 6 of CHE-1364) at head
61680f45ccef975016143f812efb47840fe01c36on basemain. Run search indexes comment and annotation text in FTS5 (runs_fts.notes). Read-only search filters matches against redacted prompt and note text across both FTS5 and substring fallback modes before counting, ranking or paging.Conditions
runs_fts.notesin sync on insert,UPDATE OF bodyand delete.backlogunder CHE-1364. CHE-1364 resolves once those stages land.324c9699-f2a3-4a34-99af-52a2b76ab43a,11942989-c420-4c9a-bd82-1acf8640bb66.Change
notesas the third column ofruns_fts(run_catalog_ftsrevision 2, WAL-aware backup viaschema_revisions).run_catalog.migrate_notes(run_catalog_notesrevision 1), called fromnotes.migrateonce bothrun_commentsandrun_annotationsexist.migrate_notesinstalls insert,UPDATE OF bodyand delete triggers.migrate_notesrebuildsruns_ftswithgroup_concatof each run's note bodies.goal_missunchanged,bm25(runs_fts, 10.0, 1.0, 1.0)).run_catalog_repo.note_textsandrun_catalog.note_snippet), redacted for read-only runs. Skip synthetic[REDACTED]markers when matching literalredacted.01a22d4c-9ad8-78f9-9850-4a03546e19c7) and F2 (01a2377b-dc52-752e-b3b9-2a53f6076d57) insideRunCatalogRepository.list_runs's read snapshot. Unify prompt and note redaction predicates with_present'sread_onlyrule (scope=everyoneand non-ownerscope=available). Mask secrets with internal Unicode noncharacters (\ufdd0). Verify FTS5 hits in:memory:(including goal-rank demotion when a prompt matches only through redacted text). Verify substring fallback hits via SQLiteLIKE ... ESCAPE '\'before computingtotal,runs,next_cursoror cursor validity.Blast Radius
/api/runssearch results, counts, ranking, cursors and snippets, plusnotes.migrateandrun_catalog.migrateupgrades on SQLite databases.tests/unit/admin_console/test_run_notes_search.py,test_run_catalog_api.py,test_run_list_filters.py,test_run_ownership.pyandtests/unit/data_engine/test_run_catalog_schema.pyfail.Cost delta
cheese-x99). Read-only search adds one in-memory SQLite FTS5 orLIKEcheck over matched candidate rows (<1 ms locally).sqlite3.connectwriters (CLI, migrations and repository callers) lack registered Python functions and would fail withOperationalError, and index-time redaction would break owner search inscope=mine. Query-time verification on read-only hits keeps triggers pure SQL and leavesscope=mineuntouched./api/runslatency and error logs plus the daily usage report (CHE-4324). Roll back by reverting the PR if/api/runs?q=p95 latency regresses above 200 ms or any SQLite migration error appears.Evidence
tests/unit/admin_console/test_run_notes_search.py):4 failed, 13 passedonb442fb72e7fe15e2ea2164228826aa75c75aad13, then17 passedonf6db06aa3bfcebae6a992ff826300029993a2e88.tests/unit/admin_console/test_run_notes_search.pyandtest_run_ownership.py):7 failed, 19 passedonf6db06aa3bfcebae6a992ff826300029993a2e88, then25 passedintest_run_notes_search.pyand777 passedacross all 21 run/spaces/chat/redaction admin-console suites on61680f45ccef975016143f812efb47840fe01c36..venv/bin/pytest tests/unit/data_engine tests/unit/test_logging_redaction.py -qOutput:
222 passed, 1 skipped in 10.77s.venv/bin/ruff format --check . && .venv/bin/ruff check . && .venv/bin/python scripts/quality_ratchet.py && .venv/bin/pyright --project pyright-core.jsonOutput:
1050 files already formatted,All checks passed!,quality ratchet passed,0 errors, 0 warnings, 0 informationsPart of CHE-1364
Closes CHE-1478