Skip to content

feat(admin-console): run search snippets built after the visibility join (CHE-9324) [squash] - #341

Merged
congvc-dev merged 1 commit into
mainfrom
agent/x99-claude-sonnet/che-9324-2b1ec5ad4321
Nov 27, 2026
Merged

congvc-dev merged 1 commit into
mainfrom
agent/x99-claude-sonnet/che-9324-2b1ec5ad4321

Conversation

@congvc-bot-x99

Copy link
Copy Markdown

Status

Draft. Stage 3b of CHE-1471. Stage 3a (PR #329) is on main. Independent different-lab review (RGS-1) is pending, so this PR stays draft until a PASS.

Conditions

  • Backend only. No UI, no new route.
  • Out of scope: comment and annotation text (CHE-1478), verdict (CHE-1331), UI (CHE-1474).

Change

  • GET /api/runs with q returns snippet on each run: {"field", "text"}, or null when no displayed field holds a query term.
  • search_snippet() in artemis/data_engine/run_catalog.py picks the first field, in search priority order, that holds a term. It cuts the value to about 40 characters either side of the match.
  • The router builds the snippet from the page after the visibility join and after _present redaction. A snippet is never read from the index, so it cannot expose a hidden or removed run, and a read-only viewer sees the redacted goal text.
  • Works in FTS mode and in substring-fallback mode.
  • docs/board-api.md "Run search" describes the snippet field.

Blast Radius

  • Callers: every reader of GET /api/runs. The change adds one key, snippet, and only when q is set. Existing keys are unchanged.
  • Detection: test_run_catalog_api.py snippet tests fail if a hidden run leaks, if redaction is skipped or if the key appears without q.
  • Proof level: 2 (unit and API tests through HTTP; no pre-production run).

Evidence

Red first: 4 of the 7 new tests failed before the change. The other 3 are no-leak checks that pass without a snippet.

Command: uv run --frozen pytest tests/unit/admin_console tests/unit/data_engine -q

Result after the change: 2458 passed, 5 skipped, 1 deselected, with one later test fix (the redaction test) re-run green: uv run --frozen pytest tests/unit/admin_console/test_run_catalog_api.py tests/unit/admin_console/test_run_list_filters.py tests/unit/data_engine/test_run_catalog_schema.py -q gives 111 passed.

ruff check and ruff format are clean on the changed files.

Not run: gstack-checks (hangs on X99), Karma, GitHub CI.

Refs CHE-1471

@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 26, 2026 12:48
@congvc-dev
congvc-dev added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 064d821 Nov 27, 2026
8 checks passed
@congvc-dev
congvc-dev deleted the agent/x99-claude-sonnet/che-9324-2b1ec5ad4321 branch November 27, 2026 04:58
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