Let runs carry an operator title shown in the CLI and TUI

Add a bounded, never-empty title to every run. `pipelines run --title "..."`
sets it explicitly and skips model generation; otherwise the server generates
it from the prompt through the shared summariser and falls back to the prompt's
first line, recording title_source (model/fallback/explicit) and title_model.

- protocol/store: RunSummary.Title plus Label(), a set_run_title message, title
  columns with an idempotent migration, CreateRunTitled, and SetRunTitle renames.
- summarise: Title/GenerateTitle/DeriveTitle/ExplicitTitle bounded to TitleCap.
- runner: generate the title outside the admission lock and only for a request
  that starts a run; a replay reuses the stored title and an explicit title
  skips the model entirely.
- CLI: `--title` on run and a `title <run-id> "<title>"` rename command; human
  `runs` and `inspect` show the title beside the pipeline name and version.
- TUI: the run list row, run detail header, Home run cards and last-run line,
  and the pipeline Results line show the title via Label().

Tests cover storage/migration/fallback, explicit-title and rename, the
end-to-end CLI flow, and title rendering; CLI and operations docs updated.
This commit is contained in:
2026-10-16 13:35:43 +01:00
parent 0e6fbcc062
commit f3e0593f4d
23 changed files with 916 additions and 74 deletions
+14 -1
View File
@@ -198,8 +198,9 @@ Submitting activates included schedules, so review them before publishing.
| Browse templates/source | `templates --json`, `template KEY --source` |
| Create or edit a definition | `new`, `edit`, `drafts` |
| Validate and publish | `validate FILE`, `submit FILE` |
| Start a run | `run NAME PROMPT --yes --json` |
| Start a run | `run NAME PROMPT [--title TITLE] --yes --json` |
| Run history/inspection | `runs --json`, `inspect ID --json` |
| Rename a run | `title ID "TITLE" --json` |
| Cancel | `cancel ID --json` |
| Connection and phone settings | `connection --json`, `ping --json` |
| Server/ntfy status popup | `status --json` |
@@ -224,6 +225,18 @@ transient client logs are presentation, not separate server capabilities.
## Scripted runs
Every run records a short, single-line `title` saying what it was for. `pipelines
run --title "..."` sets it explicitly; otherwise the server generates it from the
prompt with the configured default harness. It is never empty: when generation is
unavailable or times out, the server derives the prompt's first line, and
`title_source` (`model`, `fallback`, or `explicit` for an operator-set title) plus
`title_model` record how it was produced so a diagnosis can tell them apart.
`pipelines runs` shows the title beside the pipeline name and version, and
`pipelines inspect` returns the title, name and version, so two runs of one
pipeline are distinguishable. Rename after the fact with `pipelines title
<run-id> "<title>"`; the run's input, steps and execution are unchanged. The
stored prompt is unchanged, and listing/renaming never calls a model.
On either the runs list or run inspector, press `P` (or use `:pipeline`) to open
the selected run's exact pipeline version. Navigation does not cancel the run.