Rework omni search onto a typed search contract and add a TUI artifacts view

Protocol: replace the loose Query/Kind/Matches/Limit search fields with a Search request object and a SearchResults response, and have the server answer search from Store.Search over the shared run projections (runFrom/runStamps).

CLI: add the read-only 'pipelines search QUERY [--type KIND] [--limit N] [--json]' command with usage/help, and document the typed targets, ranking and bounds in docs/cli.md.

TUI: the '/' popup keeps type-to-search, up/down, Enter and Esc, renders one ranked list with kind badges and a bracketed (non-colour) match snippet, and Enter opens the matched pipeline, run, step, artifact or field; footer text updated to match.

TUI: add a dedicated run artifacts view ('A') with open/copy of recorded files, and move artifacts out of the run-detail File changes section (artifactCaptureNotes).

Tests: add Store.OpenReadOnly for read-only inspection of a live database plus pipeline/server/TUI search tests and artifacts tests, including env-gated live checks.
This commit is contained in:
2026-10-16 23:48:38 +01:00
parent fae1005962
commit 865993b200
24 changed files with 1761 additions and 68 deletions
+13 -6
View File
@@ -217,14 +217,21 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
} else {
response.Pipelines = items
}
} else if request.Type == protocol.Search && len(stores) > 0 && runs != nil {
response.Type = protocol.SearchResults
matches, err := runs.search(request)
if err != nil {
} else if request.Type == protocol.Search {
if len(stores) == 0 {
response.Type = protocol.Error
response.Error = err.Error()
response.Error = "search unavailable: no store"
} else if request.Search == nil {
response.Type = protocol.Error
response.Error = "search requires a query"
} else {
response.Matches = matches
response.Type = protocol.SearchResults
var err error
response.SearchResults, err = stores[0].Search(ctx, *request.Search, time.Now())
if err != nil {
response.Type = protocol.Error
response.Error = err.Error()
}
}
} else if runs != nil && (request.Type == protocol.RunPipeline || request.Type == protocol.RetryRun || request.Type == protocol.ListRuns || request.Type == protocol.GetRun || request.Type == protocol.CancelRun || request.Type == protocol.DecideRun || request.Type == protocol.SetRunTitle || request.Type == protocol.GetRunEvidence) {
var err error