Merge lane-go: titles, verdicts, human stage, line result format, stale-client guard
Integrates nine commits of reviewed work from the lane-go branch after the automated resolver failed on this merge five times (each attempt dying on the malformed-result defect whose fix is contained in this same merge). Integration decisions: - Search: kept main's shipped design (Store.Search + SearchResponse.Results) and dropped lane-go's parallel, older attempt (an unused Message.Matches field, an absent runs.search, and two partial TUI plumbing blocks). lane-go itself did not compile: protocol.SearchMatch was undefined and model.go referenced searchNav, requestSearch and applyRunNav, which exist nowhere. Those partial TUI blocks are removed; the queued TUI omni-search item will implement the surface properly on main's design. - Both sides' additions are kept where they are independent: run titles and provenance, the human decision stage and its CLI/TUI surface, the derived stage verdict, the stale-client guard, the line-oriented result format, and main's search command. - The search key's help label is now "/ omni search"; the two tests asserting the old label are updated rather than the label reverted. - docs/cli.md and the packaged operations reference carry both sides' text. Verified: go build ./... , go vet ./... and the full go test ./... suite pass.
This commit is contained in:
+59
-7
@@ -23,10 +23,23 @@ running server's compiled `build.version`, full Git `build.commit`, and
|
||||
`build.dirty`. Uncommitted builds have a `-dirty` suffix. Missing metadata is
|
||||
explicit (`commit: "unknown"`, `dirty: null`); older servers omit `build`.
|
||||
This identifies the server binary, not the CLI or files mounted into the container.
|
||||
Plain `ping` also prints the server version/commit. `pipelines version --json`
|
||||
Plain `ping` also prints the server version/commit and, beside the local client
|
||||
build, the client/server relationship. `pipelines version --json`
|
||||
(or `pipelines --version`) identifies the local client without connecting to a
|
||||
server. Include both identities when reporting a problem; they can differ.
|
||||
|
||||
`ping`, `connection`, `status` and every server command now check that relationship.
|
||||
The server stamps its `build` and integer `protocol` onto each response (the
|
||||
unsolicited welcome envelope too). The client compares this build against the
|
||||
server: a same-protocol build mismatch prints exactly one `warning:` on stderr
|
||||
(stdout JSON stays parseable) and a server speaking a newer protocol fails the
|
||||
command non-zero before it acts on the frame. If a response carries a top-level
|
||||
field this client does not model — for example an `artifacts` field from a newer
|
||||
server — the client prints a one-time `server sent unrecognized top-level field(s)
|
||||
...` notice instead of silently appearing to have no data. Rebuild or reinstall the
|
||||
CLI so it matches the server; the installer also warns when a different `pipelines`
|
||||
resolves earlier on PATH than the freshly installed binary.
|
||||
|
||||
|
||||
Home's `r` opens **all** runs, not only failures or the newest 50. Inside a pipeline,
|
||||
`r` and `:runs` show only that pipeline's runs across its versions. In any run list,
|
||||
@@ -34,6 +47,14 @@ press `/` for fuzzy search, type to filter, and Enter to return to the results.
|
||||
Search includes pipeline name, version, status, outcome, stage and diagnostic;
|
||||
`#123` searches run-ID prefixes. Esc while searching clears the filter without
|
||||
closing the list. The filter survives inspection/back and live list refreshes.
|
||||
Home's `/` instead opens the omni popup, which searches pipelines, versions, runs,
|
||||
stages/visits, artifact names, and the text of stage inputs, outputs and evidence.
|
||||
A bare status word (`queued`, `running`, `succeeded`, `failed`, `canceled`,
|
||||
`interrupted`) or a date (`today`, `yesterday`, `this week`, or `YYYY-MM-DD`
|
||||
interpreted in UTC) selects runs, and a leading `pipeline:`/`version:`/`run:`/
|
||||
`step:`/`field:`/`artifact:`/`match:` prefix narrows the result kind. Enter opens
|
||||
the matched pipeline, run, stage visit, artifact or field; unrecognised words
|
||||
remain text.
|
||||
Wide terminals
|
||||
show runs and pipelines side by side, with stacked panels on narrow terminals.
|
||||
Home run cards prioritize reported results, status, completed visits and duration;
|
||||
@@ -235,8 +256,10 @@ 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` |
|
||||
| Decide a waiting human stage | `decide ID [STAGE] --option KEY [--feedback TEXT] --json` |
|
||||
| Cancel | `cancel ID --json` |
|
||||
| Connection and phone settings | `connection --json`, `ping --json` |
|
||||
| Server/ntfy status popup | `status --json` |
|
||||
@@ -254,14 +277,28 @@ 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`, `get_status`, `search`. `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.
|
||||
`cancel_run`, `retry_run`, `decide_run`, `set_run_title`, `get_run_evidence`,
|
||||
`get_status`, `search`. `search` takes `query` and an
|
||||
optional `kind` and `limit` and returns ranked typed `matches`, each with a stable
|
||||
`target` the client can open. `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.
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -282,6 +319,21 @@ Retry is hidden and rejected while a run is executing or agent cleanup remains
|
||||
active, even if a terminal status was already persisted. Run RPCs report
|
||||
`executing` alongside status so clients can distinguish cleanup from completion.
|
||||
|
||||
A pipeline may contain a `type=human` decision stage (see the authoring skill's
|
||||
`references/format.md`). Its step becomes `waiting`, the run reports that it is
|
||||
waiting on a person, and no later stage runs. `runs`/`inspect --json` show the
|
||||
`waiting` status, the stage and its recorded instructions and options. Answer it
|
||||
with `pipelines decide <run-id> [stage] --option KEY [--feedback TEXT] [--json]`
|
||||
or, in the run inspector, press `c` to open the option picker, choose with
|
||||
`↑/↓`, type optional feedback with `Tab`, and confirm with Enter. The choice and
|
||||
feedback are recorded as the step's evidence and the run resumes along
|
||||
`edges[KEY]`. An unknown option is refused with the valid list, a decision to a
|
||||
stage that is not waiting is refused, and a repeated decision for an
|
||||
already-decided visit does not double-apply. The wait is persisted in the run
|
||||
rows, so it survives a server restart and `decide` still works afterwards;
|
||||
`cancel` and `retry` keep working while waiting and after a decision, and a
|
||||
human stage is never killed by a stage timeout or `max_visits`.
|
||||
|
||||
The run inspector's upper half shows the entire graph from the run's immutable
|
||||
pinned version using the shared renderer and viewport. Executed stages and taken
|
||||
routes retain their colors; unexecuted stages, unchosen routes and unreached
|
||||
|
||||
@@ -36,6 +36,14 @@ manifest is what `scripts/manage.py` and the Go CLI load. Provider/model default
|
||||
are never invented: your existing host OpenCode configuration is reused (an
|
||||
explicit `--model` is recorded if supplied), and setup never starts a picker.
|
||||
|
||||
After the build, setup checks whether a **different** `pipelines` resolves earlier
|
||||
on PATH than `<prefix>/bin/pipelines` (the common cause of a stale CLI talking to a
|
||||
newer server). When it does, setup prints a `WARNING` naming that absolute path and
|
||||
both versions (`version --json` on each binary, read-only) and tells you to put
|
||||
`<prefix>/bin` first on PATH. It never modifies, moves, deletes or upgrades that
|
||||
other binary, and it installs no unrelated tool; the manifest keeps
|
||||
`<prefix>/bin` first on the recorded PATH.
|
||||
|
||||
The native install also writes **host** harness profiles for the harnesses it
|
||||
detects into XDG config home's `pipelines/harnesses.json` (no
|
||||
`docker_directory`), defaulting to the detected OpenCode profile rather than a
|
||||
|
||||
@@ -23,6 +23,45 @@ is not evidence of a real tool invocation and cannot be accepted as a result.
|
||||
Flattened output fields are rejected, not guessed into a new envelope. Invalid
|
||||
responses are retained even when they are not eligible for syntax repair.
|
||||
|
||||
## Line-oriented result format
|
||||
|
||||
Model and agent stages also accept a line-oriented result format. The response is
|
||||
a markdown-ish document whose first non-empty line is the outcome, followed by
|
||||
sections introduced with `# <heading>`.
|
||||
|
||||
```
|
||||
success
|
||||
|
||||
# output
|
||||
{"task": "x"}
|
||||
|
||||
# findings
|
||||
- prose, code fences, quotes and embedded JSON need no escaping
|
||||
```
|
||||
|
||||
Only the first non-empty line and a `# output` section are required. The body of
|
||||
`# output` must be a JSON object; it becomes the stage's `output` map. Every other
|
||||
heading becomes an evidence field keyed by the normalised heading text (lowercased,
|
||||
spaces to underscores). Extra sections are stored verbatim and are best-effort: an
|
||||
empty heading, an odd heading, or a very large section must never fail the stage.
|
||||
If the outcome is missing, not one of the declared edges, or `# output` is absent,
|
||||
the stage fails with `FINAL RESULT VALIDATION` and still retains whatever sections
|
||||
were salvaged.
|
||||
|
||||
The parser decides between the legacy JSON envelope and the line-oriented format by
|
||||
precedence. If the response's first non-empty character is `{` after stripping an
|
||||
optional surrounding markdown fence, it keeps the unchanged JSON path. If a `# `
|
||||
heading appears before any `{`, it uses the line-oriented path. This preserves all
|
||||
existing JSON responses, including fenced JSON or short prose prefixes, while
|
||||
allowing new line-format responses to coexist.
|
||||
|
||||
The full raw response is written to the stage's artifacts directory as
|
||||
`raw-output.md` before parsing, so the closest record of what the model produced is
|
||||
always retained and appears in the step's artifact inventory automatically. The
|
||||
parse status is recorded in the step's output map under the reserved key
|
||||
`result_parse`: `parsed` (both required parts OK), `partial` (required parts OK but
|
||||
some extra section unusable), or `failed` (a required part missing or invalid).
|
||||
|
||||
## Format recovery is not execution retry
|
||||
|
||||
Parser errors retain their diagnostic and byte offset: for example, `missing
|
||||
|
||||
Reference in New Issue
Block a user