Report a stale client and refuse an unreadable newer server

Exchange a build/protocol identity so an older CLI can no longer talk to a
newer native server silently:

- protocol carries ProtocolVersion and every server frame (including the
  unsolicited welcome) is stamped with the server build and protocol, so a
  client that never pings still learns the server identity.
- buildinfo.Compare classifies the relationship as InSync/Warn/Refuse and
  names both builds; the client Watch reports one warning per connection and
  returns a hard error when the server speaks a newer, uninterpretable
  protocol so the caller never acts on the frame.
- client.ReceiveNotice decodes the raw frame so an unmodeled top-level field
  produces a one-time "unrecognized field(s)" notice instead of being dropped
  silently (the case that hid the artifacts field).
- CLI routes warnings to stderr, keeps machine JSON stdout clean and fails
  non-zero on a refused mismatch; ping/connection print the client/server
  relationship. The TUI surfaces the same notices through the shared log.
- scripts/setup-native.py now warns when an older `pipelines` earlier on PATH
  shadows prefix/bin/pipelines, naming both paths and versions, without
  installing or modifying anything else.
- Docs, the packaged debugging skill reference and README no longer imply the
  installed CLI always matches the server.

Tests cover the comparison table, unknown-field detection and caching, the
server identity stamping on pong and welcome, the CLI/TUI reporting paths and
the installer PATH shadowing warning.
This commit is contained in:
2026-10-16 18:37:01 +01:00
parent 98bbc2deac
commit 8c1eea53a9
25 changed files with 1239 additions and 81 deletions
+15 -6
View File
@@ -66,7 +66,10 @@ cd pipelines
Native setup reuses your existing host OpenCode login and never installs,
upgrades or downloads OpenCode/Pi. It writes host harness profiles (no Docker
link) for the harnesses it detects, so authoring works immediately, and clears a
stale Docker link when migrating a Docker install. Start it with
stale Docker link when migrating a Docker install. After building, it warns if a
**different** `pipelines` resolves earlier on PATH than `<prefix>/bin/pipelines`,
naming that path and both versions, so a stale CLI is not left in front of a newer
server (it never modifies or upgrades that other binary). Start it with
`PIPELINES_PREFIX=~/.local/share/pipelines ~/.local/share/pipelines/bin/pipelines start`.
When Docker volumes are present it migrates the existing database and ntfy auth
store (never overwriting newer native data; use `--replace-data` to opt in). See
@@ -93,7 +96,9 @@ Prefer the installer-saved configured endpoint when present; never replace it wi
a guessed default.
Go uses `GOBIN` or its normal `GOPATH/bin` default; put that directory on PATH.
The Docker installer automatically detects/configures LAN networking for ntfy;
Running `pipelines` also compares its build/protocol with the server and warns (or
fails on a newer protocol) instead of dropping fields it does not model. The
Docker installer automatically detects/configures LAN networking for ntfy;
you do not need to look up your IP or supply a URL/listen address.
Both Docker services bind `0.0.0.0`; reinstall normalizes those bind settings
without replacing your URLs, timezone, ports or credentials.
@@ -205,8 +210,11 @@ pipelines
retry requires confirmation and restarts the pinned workflow, so earlier side
effects may happen again.
Home shows only **/** search and **:** commands as action hints; use the command
palette for creation, drafts, templates, history, status, logs, and quitting.
Home shows only **/** search and **:** commands as action hints; **/** opens the omni
popup, which finds pipelines, versions, runs, stages/visits, artifact names and the
text of stage inputs, outputs and evidence, and Enter opens the chosen result. Use
the command palette for creation, drafts, templates, history, status, logs, and
quitting.
Quit with **:quit**; **q** does not exit. For a terminal-only run after publication:
@@ -357,8 +365,9 @@ run resumes along that edge. The wait is persisted, so it survives a server
restart; an unknown option is refused with the valid list, a stage that is not
waiting is refused, and a repeated decision does not double-apply. **cancel** and
**retry** keep working while waiting and after a decision.
On Home, **r** opens global run history; **/** fuzzy-searches it. Inside a pipeline,
**r** / **:runs** opens only that pipeline's history.
On Home, **r** opens global run history; **/** opens the omni search popup over
pipelines, versions, runs, stages/visits, artifacts and stage input/output/evidence
text. Inside a pipeline, **r** / **:runs** opens only that pipeline's history.
Quit the TUI with **:quit**; **q** does not exit. **Ctrl+C** remains an interrupt.
Starting/retrying/canceling runs and deleting drafts require confirmation. CLI
publication also prompts; use `--yes` only for explicitly approved automation.