Add service status and usage dashboard, refresh externally published edits

This commit is contained in:
2026-10-09 20:20:44 +01:00
parent 67ac79765f
commit a50e8648f6
31 changed files with 1283 additions and 42 deletions
+40 -2
View File
@@ -8,6 +8,34 @@ service manager directly. Legacy Python-managed installations require an explici
For source development, use `go run ./cmd/pipelines help`; start the native server
separately. Set `PIPELINES_URL` or pass `--url` to select another server.
## Dashboard and status
Home's `r` opens **all** recent runs (latest 50), not only failures. Wide terminals
show runs and pipelines side by side, with stacked panels on narrow terminals.
Run cards show status, duration, start time and the current stage when active.
The usage summary is aggregated over all stored history, including retry attempts:
total/active runs, outcomes, success rate, average completed duration, pipeline
usage and a zero-filled 14-day daily activity chart (UTC). Success rate is
succeeded / (succeeded + failed); active, canceled and interrupted runs are excluded.
The average includes all runs with a finish timestamp. No model cost/token counts
are inferred from missing data. `pipelines stats --json` exposes these aggregates.
Use `:status` on any TUI page to open server and ntfy information. Scroll with
arrows or `j/k`, PgUp/PgDn; `r` refreshes and Esc closes without changing the page.
`pipelines status [--json]` returns the same server data, including hostname,
start/uptime, the connected server endpoint/port, active interface IPs, ntfy
publishing health, public phone URL/topic/port and candidate URLs. It does not
start services or send a notification. The ntfy health probe has a two-second
deadline; it checks the publishing server, not phone reachability.
IPs belong to the **server computer or container**, not necessarily the client.
Candidate IP/port combinations are not reachability checks: loopback bindings,
firewalls, container port mapping and TLS can prevent access. ntfy candidates
are only derived when a configured endpoint identifies this computer; remote
ntfy hosts are not misrepresented as local. Publishing URLs and credentials are
never returned. Missing public phone configuration is labeled explicitly.
`pipelines service status` remains the separate OS autostart status command.
## Draft-first OpenCode workflow
```sh
@@ -42,6 +70,13 @@ the existing draft, `v` for server validation, and `s` for submission confirmati
`r` refreshes the list. Submission preserves create-only/version guards and rejects
drafts belonging to another server. An unnamed draft must be named through OpenCode
or CLI `submit --name`. Draft selection/editor completion never publishes it.
On editor exit, the connected TUI checks the authoritative server before asking
to submit. If the draft source is already published (including a newer version
after the draft's base that was subsequently superseded), it skips confirmation
and reloads the latest pipeline/page and Home list. Local-only changes still need
explicit submission. A failed check retains the draft and says publication could
not be verified; it never assumes publication from an editor's exit code. Original
draft conflict guards and retained draft files remain unchanged.
New unnamed drafts open OpenCode so the skill can name them. For named drafts,
the default editor is OpenCode; explicit `VISUAL`/`EDITOR` overrides remain.
@@ -81,7 +116,9 @@ Submitting activates included schedules, so review them before publishing.
| Run history/inspection | `runs --json`, `inspect ID --json` |
| Cancel | `cancel ID --json` |
| Connection and phone settings | `connection --json`, `ping --json` |
| Operational diagnostics | installed `logs`, `status`, `doctor` |
| Server/ntfy status popup | `status --json` |
| Usage statistics/charts | `stats --json` |
| Legacy operational diagnostics | managed `logs`, `doctor` |
The TUI does not spawn CLI processes for each request. Both front ends share
`internal/client`'s command transport and `internal/draft`'s persisted drafts;
@@ -94,7 +131,8 @@ printf '%s' '{"type":"get_pipeline","pipeline_id":1,"version":1}' | pipelines rp
Existing protocol commands: `ping`, `list_pipelines`, `get_pipeline`,
`list_templates`, `validate`, `submit`, `run_pipeline`, `list_runs`, `get_run`,
`cancel_run`, `retry_run`. See `internal/protocol/message.go` for JSON envelopes. Mutating RPCs
`cancel_run`, `retry_run`, `get_status`. `list_runs` also returns all-history `usage`
aggregates. See `internal/protocol/message.go` for JSON envelopes. Mutating RPCs
have real effects; they are not previews. TUI-only animation, scrolling, and
transient client logs are presentation, not separate server capabilities.
+19
View File
@@ -85,3 +85,22 @@ and optional file/command permission rules. A native stable no-inference live
contract test accepted a `json_schema` message with `retryCount=0` and `noReply`.
Real model-driven schema generation, formatter behavior and tool-permission
enforcement remain **not tested**.
Status/dashboard checks execute server and fake ntfy HTTP health endpoints,
CLI JSON/plain status and statistics, all-history SQL aggregation with more than
50 runs, interrupted/unused pipeline counts, zero-filled daily activity, responsive
dashboard columns, and status popup navigation from a run without losing its
selection. Compiled-binary PTY integration also exercises `pipelines status`,
`pipelines stats`, `:status`, dashboard activity and Home's all-runs `r` shortcut.
Candidate URL reachability and phone reception are **not tested** and are not
reported as verified by the UI.
Editor-return checks query actual published history before showing confirmation;
tests cover a submitted draft followed by a newer publication, unsent edits,
failed/stale verification, and immutable history. Compiled CLI/TUI PTY integration
uses a mock OpenCode editor that submits with the real CLI, then verifies automatic
reload to version 2 without another submission prompt. Another mock editor only
saves changes and still requires confirmation. A real local V2 no-inference
create/wait/delete contract succeeded; the reported remote planner `/wait` failure
could not be reproduced here. Safe CLI failure classification/exit-code reporting
was executed with a failing subprocess fixture.
+6
View File
@@ -41,6 +41,12 @@ Repair records include the original/candidate response, parsing diagnostic,
method and acceptance flag in the bounded transcript preview. `pipelines
inspect <run-id> --json` and the TUI evidence section expose these records.
OpenCode CLI failures include the HTTP status when supplied, process exit code,
and a recognized safe error category (such as session not found or service
unavailable). Arbitrary stderr, provider messages and response bodies are not
copied into the diagnostic. A `/wait` command failure is not evidence that the
agent prompt failed to start, and does not trigger replay of stage work.
## Optional machine-readable restrictions
`tools` enables actions per stage. A stage can narrow edit paths and shell