Make Pipelines Docker-only with OpenCode and Pi

Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers.

Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent.

Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
This commit is contained in:
2026-10-11 23:00:25 +01:00
parent c42a19f7d3
commit 05ae530442
131 changed files with 9297 additions and 355 deletions
+88 -47
View File
@@ -18,6 +18,16 @@ separately. Set `PIPELINES_URL` or pass `--url` to select another server.
## Dashboard and status
`pipelines --url ws://HOST:PORT/connect ping --json` returns `pong` with the
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`
(or `pipelines --version`) identifies the local client without connecting to a
server. Include both identities when reporting a problem; they can differ.
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,
press `/` for fuzzy search, type to filter, and Enter to return to the results.
@@ -51,26 +61,37 @@ 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
## Draft-first harness workflow
```sh
pipelines new # OpenCode asks what to build and names it
pipelines new # the configured harness asks what to build and names it
pipelines edit # fuzzy pipeline selection
pipelines edit "bug fix" # ask OpenCode what to change
pipelines edit "bug fix" # ask the harness what to change
pipelines edit "bug fix" "Add a review step"
pipelines new "release notes" "Summarize changes and notify my phone"
pipelines new "Text summary" --template summary
```
`new` opens OpenCode immediately when its name/request is omitted. The skill asks
only for missing decisions and records the chosen name in draft metadata. `edit`
accepts an exact name or ID, with names taking precedence over numeric IDs.
Both retain private drafts and launch the host interface once with a short
`@pipelines` reference and context-file path. There is no preliminary OpenCode
API call, temporary service, session creation, or instruction preload.
`install.sh` installs/updates the global skill and format reference. Plain
`new` opens the configured harness (Pi or OpenCode; Docker-linked by default)
immediately when its name/request is omitted. The skill asks only for missing
decisions and records the chosen name in draft metadata. `edit` accepts an exact
name or ID, with names taking precedence over numeric IDs. Both retain private
drafts and launch the harness once with a short `@pipelines` reference and
context-file path. There is no preliminary harness API call, temporary service,
session creation, or instruction preload. The prompt's CLI prefix is
Docker-aware: a Docker-linked profile embeds the in-container `pipelines`
executable and, for this Compose service's own loopback endpoint, scoped
transport aliases. Loopback is recognized only for parsed IP literals and the
exact `localhost` name (case-insensitive), so a remote DNS name such as
`127.remote.example` stays remote with no Docker probe. The single bounded
`docker compose port` probe must return a complete `host:port` binding that
covers the requested loopback address and port (wildcard or matching family);
malformed or non-matching bindings fail clearly, and a loopback `wss` endpoint
is rejected as having no supported local TLS mapping rather than downgraded to
plaintext. nvim remains a client-side editor.
`./install` installs/updates the global skill and format reference. Plain
`go install` users run `pipelines skill install` separately. Shared login/config
and user-modified skills are preserved; OpenCode permissions remain in effect.
and user-modified skills are preserved; harness permissions remain in effect.
The skill encourages editing only the draft, running server validation, summarizing
the changes, and leaving submission to the user. This is an instruction, not a
@@ -88,15 +109,15 @@ instead. Both paths inherit the configured default model and preserve existing
pipelines/history. The research starter requires configured web search support.
Home's `n` / `:new` and **Customize** (`e`) on a template first ask how to author the new
pipeline: **nvim** opens a retained Markdown draft file, or **OpenCode** opens
the collaborative harness with `@pipelines`. Tab/Shift+Tab or arrows select;
typing fuzzy-searches the choices; Enter launches and Esc cancels without
creating a draft. The choice overrides `VISUAL`/`EDITOR`. New drafts preserve
pipeline: **nvim** opens a retained Markdown draft file, or a configured harness
(Pi/OpenCode) opens the collaborative session with `@pipelines`. Tab/Shift+Tab or
arrows select; typing fuzzy-searches the choices; Enter launches and Esc cancels
without creating a draft. The choice overrides `VISUAL`/`EDITOR`. New drafts preserve
the create-only publication guard and still require explicit submission unless
you already published them from OpenCode. OpenCode can ask for a missing name;
for an unnamed nvim draft, `pipelines submit <draft.md> --name NAME` names and
publishes it. CLI `pipelines new` retains its existing direct-OpenCode behavior;
`--no-open` creates the file without launching an editor.
you already published them from the harness. The configured harness can ask for a
missing name; for an unnamed nvim draft, `pipelines submit <draft.md> --name NAME`
names and publishes it. CLI `pipelines new` retains its existing direct-harness
behavior; `--no-open` creates the file without launching an editor.
Press `d` on the dashboard or use `:drafts` to browse the same retained drafts as
`pipelines drafts`. Use `n/p` to select, `j/k` to scroll source, `e`/Enter to reopen
@@ -119,8 +140,10 @@ and reloads the latest pipeline/page and Home list. Local-only changes still nee
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.
New/edit drafts open the configured default harness; `--harness opencode|pi|nvim`
selects another configured harness or nvim. TUI pickers show only configured
harnesses, default first, plus nvim. See [harnesses and runtime control](harnesses-and-control.md)
for fuzzy model setup, separate defaults, shared memory and runner-owned limits.
For agents or scripts that should not open a terminal:
@@ -188,10 +211,10 @@ you invoked Pipelines from), alongside the task and any custom input fields.
It is recorded by the server and shown in the run's Input section.
Press `r` or use `:retry` on a failed run to restart it from the first stage.
CLI equivalent: `pipelines retry <run-id>` (optional `--yes`, `--json`, `--wait`, and
`--request-key`). The new attempt retains the initial input, directory, pinned
pipeline version, and edit scope, and records `retry_of`. Original history is
unchanged. Legacy runs gain `pwd` from their recorded workspace on retry.
CLI equivalent: `pipelines retry <run-id>` (optional `--yes`, `--json`, `--wait`,
`--wait-timeout`, and `--request-key`). The new attempt retains the initial input,
directory, pinned pipeline version, and edit scope, and records `retry_of`. Original
history is unchanged. Legacy runs gain `pwd` from their recorded workspace on retry.
Retry replays the entire workflow; earlier edits or notifications are not undone
and may happen again. A missing original directory blocks retry rather than
silently using your current directory.
@@ -244,33 +267,41 @@ keep both labels readable. Failure-bound error exits remain at the bottom.
Pipeline and run graph panes both center horizontally and vertically when the
diagram fits, and clamp scroll/pan offsets on resize or graph changes.
Press `a` to select the active/latest retained OpenCode agent session and open its
tool evidence. Session ID is available during execution; tool transcripts appear
when persisted (currently after generation). This does not attach a live OpenCode
client or stream its messages. Supporting live attachment consistently across the
shared and privately owned OpenCode backends is deliberately deferred.
Press `a` to select the active/latest retained configured-harness agent session and
open its tool evidence. Session ID is available during execution; tool transcripts
appear when persisted (currently after generation). This does not attach a live
harness client or stream its messages. Supporting live attachment consistently
across the shared and privately owned harness backends is deliberately deferred.
## Investigating runs in OpenCode
## Investigating runs with a configured harness
On the runs list or inspector, press `D` or use `:debug`; CLI equivalent:
`pipelines debug <run-id>`. This opens a fresh normal OpenCode conversation, not
the implementing session. It supplies exact commands for `inspect <run-id>
--json` (including stage history, inputs/outputs, diagnostics, notifications,
session IDs and transcripts), `show <pipeline-id> --version N --json`, and
`runs --pipeline <pipeline-id> --json`. All retrieval remains available through
the CLI and can be repeated while execution is active. No new model API or
live attachment integration is required.
`pipelines debug <run-id>`. This opens a fresh conversation in the configured
harness (Pi or OpenCode), not the implementing session. It supplies exact
commands for `inspect <run-id> --json` (including stage history, exact outputs,
diagnostics, notifications, session IDs and bounded transcript previews),
`show <pipeline-id> --version N --json`, and `runs --pipeline <pipeline-id>
--json`. The commands reuse the same Docker-aware CLI prefix as authoring, so a
Docker-linked profile runs them in-container against the original logical
endpoint. All retrieval remains available through the CLI and can be repeated
while execution is active. No new model API or live attachment integration is
required. The injected server-side session evidence is the latest bounded,
credential-redacted evidence for up to the 3 most recent session-bearing steps;
when a preview is bounded or omitted, inspect the retained session itself rather
than assuming a complete tool history.
`debug --json` returns the context and prompt without launching OpenCode;
`--no-open` prints the prompt. `--opencode` selects the executable. Debugging
`debug --json` returns the context and prompt without launching the harness;
`--no-open` prints the prompt. `--harness opencode|pi|nvim` selects a configured
harness or nvim; `--opencode` selects the host executable. Debugging
works for active and terminal runs and does not automatically retry, cancel,
or resume them. If the recorded directory is unavailable, OpenCode launches
or resume them. If the recorded directory is unavailable, the harness launches
from your current directory and retrieves historical evidence through the CLI.
## Editor choice and draft cleanup
On the pipeline detail page, `e` / `:edit` opens an editor picker: **nvim** or
**OpenCode**. Type to fuzzy-search; Tab/Shift+Tab (or arrows) choose; Enter opens;
the configured harness (Pi/OpenCode, default first). Type to fuzzy-search;
Tab/Shift+Tab (or arrows) choose; Enter opens;
Esc cancels without creating a draft. Explicit choice overrides VISUAL/EDITOR.
Both choices edit a retained copy with the normal version guard, never the
published definition. Submission remains separate and explicit.
@@ -287,7 +318,7 @@ also remove orphaned metadata when a draft source was already removed.
```sh
cd ~/repos/project
pipelines run "bug fix" "Fix the layout" --json
pipelines run "bug fix" "Fix the layout" --json --wait --timeout 10m
pipelines run "bug fix" "Fix the layout" --json --wait --wait-timeout 10m
pipelines run "bug fix" "Fix the layout" --json --request-key my-unique-task
```
@@ -300,8 +331,13 @@ actual tooling. `--write-paths` is an optional narrower scope, not a prerequisit
`--yes` skips action confirmation for explicitly approved automation;
`--allow-tools` remains a compatibility flag and is not required.
`--wait` polls until terminal status, returns nonzero on failure/cancellation,
and does not cancel a run when waiting times out. Reuse `--request-key` to prevent
duplicate work. A supplied pipeline/task opens an action-confirmation popup before
and does not cancel a run when waiting times out. `--wait-timeout` bounds only the
client wait after admission and is independent of the per-request `--timeout`; a
reached wait limit leaves the admitted run active and never cancels or replays it.
When it is reached, inspect read-only with `pipelines inspect <run-id> --json`, or
keep waiting by rerunning `--wait` and reusing the original `--request-key` rather
than starting a duplicate run. Reuse `--request-key` to prevent duplicate work.
A supplied pipeline/task opens an action-confirmation popup before
starting with a live inspector (unless `--yes` was supplied). When a task is omitted,
Enter inserts a newline and Ctrl+S opens the confirmation for the composed task.
There is no file-list question or typed RUN confirmation. Shell runs with your
@@ -317,8 +353,9 @@ Quit with `:quit`, not `q`; Ctrl+C remains an interrupt.
JSON results go to stdout, errors to stderr (JSON error envelopes when requested),
and failures exit nonzero. Export/template `--source` deliberately prints raw
Markdown. `--timeout` bounds each server request and the optional wait duration.
It does not change the stage execution timeout.
Markdown. `--timeout` bounds each server request; `--wait-timeout` bounds the
optional client wait independently and, when reached, leaves admitted work active.
Neither changes the stage execution timeout.
### Stage limits
@@ -350,6 +387,10 @@ retry potentially delivered notifications and do not accept model budgets.
Pinned definitions contain the configured limits. Run transcripts retain limits,
attempt counts and reported budget usage, also shown in the TUI's Evidence pane.
Exact stage outputs are authoritative; a transcript over the 32 KiB retained
bound is stored as a valid, credential-redacted preview envelope that preserves
available stage limits and failure/format diagnostics and names the retained
session instead of slicing to malformed JSON.
### Result-first views
+50 -17
View File
@@ -2,22 +2,28 @@
## Complete installer (recommended for both services in Docker)
Run `./install.sh` from an interactive terminal (Docker is the default). It handles Compose
Run `./install` from an interactive terminal (Docker is the default;
`./install.sh` remains a compatibility alias). It handles Compose
configuration, ntfy users/permissions/token, image build, container skill install,
first-time container OpenCode provider login, startup, and an authenticated test
notification. Choose your own provider in OpenCode; signup/login credentials stay
in the Docker volume, not your host OpenCode account. Re-run to update while
first-time container harness provider login (OpenCode by default; `./install
--harness pi` configures Pi and skips OpenCode login), startup, and an
authenticated test notification. Choose your own provider in the configured
harness; signup/login credentials stay in the Docker volume, not your host
account. Re-run to update while
preserving `.env`, tokens, histories and volumes. Use `--relogin` to connect another
provider. No fixed OpenCode Go login is required. Health/publishing checks do not
prove model inference or phone reception.
The phone-facing ntfy URL uses the detected LAN IP; both services bind `0.0.0.0` by default.
There are no networking questions. Advanced URL/bind/timezone flags remain optional.
The steps below are for manual setup or a local Pipelines server with Docker ntfy.
The steps below are for manual setup or a developer/legacy local Pipelines server
with Docker ntfy; they are **not** the supported installation and are not needed when
you use `./install`.
## Local pipeline server, Docker ntfy
## Manual developer/legacy: local pipeline server, Docker ntfy
To reuse your host OpenCode login without container authentication:
To reuse your host OpenCode login without container authentication (manual,
developer/legacy use—not a supported installation):
```sh
docker compose up -d ntfy
@@ -47,7 +53,10 @@ was accepted with a phone-facing attachment URL. The local server's WebSocket
advertised the public URL/topic and accepted the notification test pipeline.
Go race tests and vet passed. Pipeline-container startup/model authentication
and Android delivery are still **not tested**. Existing host history is preserved;
the local server was restarted with notification configuration.
the local server was restarted with notification configuration. The image now
also includes python3 so the installer regression suite can run inside the
container; a real 40x16/80x24/120x36 terminal UI review remains an independent
step.
## 1. Local settings
@@ -68,9 +77,11 @@ your actual IANA timezone). Rerun/edit settings if you move/change timezones.
The helper creates an empty, protected token file for bootstrap; no notifications
are sent until it is filled. `.env`, `secrets/`, and `data/` are git-ignored and
excluded from image builds. Default pipeline port is **8081**, bound to host
`0.0.0.0`, avoiding the existing native server on 8080. Android does not need
access to the unauthenticated pipeline API.
excluded from image builds. The container publishes port **8080**; the default
host mapping is **8081**, bound to host `0.0.0.0`, avoiding the existing native
server on 8080. Query the actual mapped port with
`docker compose port pipelines 8080`. Android does not need access to the
unauthenticated pipeline API.
Use HTTP only on a trusted LAN or encrypted VPN. For public access, use HTTPS
with a reverse proxy/VPN; configure the external URL in `NTFY_BASE_URL`. The
@@ -98,20 +109,26 @@ or paste them into a chat. Recreating/replacing the secret file requires restart
the pipeline container. The application accepts `_TOKEN_FILE` or `_TOKEN`, not
both, and never puts the token in model prompts, outputs, or diagnostics.
## 3. Authenticate OpenCode, then start the server
## 3. Authenticate the harness, then start the server
```sh
docker compose build pipelines
python3 scripts/build_metadata.py # resolve releases and stamp revision/dirty identity
docker compose stop --timeout 60 pipelines
# Default managed volumes only; never substitute a host bind mount for these paths.
docker compose run --rm --no-deps --user 0:0 --entrypoint sh pipelines -c \
'chown -R "$PIPELINES_UID:$PIPELINES_GID" /data /home/pipelines /workspace'
docker compose run --rm --no-deps --entrypoint opencode pipelines auth login
# Pi instead (no standalone auth login): docker compose run --rm --no-deps --entrypoint pi pipelines --tui-mode regular --no-extensions --no-skills --no-context-files --no-prompt-templates --no-tools
docker compose up -d
docker compose logs -f pipelines
```
Select your preferred provider and follow its authentication flow. Credentials are stored
Select your preferred provider and follow its authentication flow. For Pi, type
`/login` and choose an authentication method ("Sign in with an API key" for
provider API credentials; account and Radius remain your choice), then exit Pi
with `ctrl+c`/`ctrl+d`. Existing credentials stay in the volume and are reused by
exiting when no new sign-in is needed; completing a sign-in can update the
credentials stored in the volume. Credentials are stored
in the dedicated `opencode-home` volume, separate from your host account. These
interactive login is **not tested** in this regression. The Docker workspace/UID
checks were executed with the actual image and a mocked stage. The image includes
@@ -123,6 +140,7 @@ Connect the native TUI:
```sh
go run ./cmd/pipelines-tui -url ws://127.0.0.1:8081/connect
go run ./cmd/pipelines --url ws://127.0.0.1:8081/connect ping --json
```
If the TUI is on another machine, use an SSH/VPN tunnel instead of exposing the
@@ -152,9 +170,24 @@ container's `/data/pipelines.db`. Copying only a live `.db` without its WAL is
unsafe. Do not import over an existing container database without backing it up.
The database import and OpenCode session-recovery implications are **not tested**.
Rebuild executable changes with `docker compose up -d --build pipelines`.
Rebuild executable changes with `./install`; for a source-only refresh that still
resolves the current releases, use `python3 scripts/build_metadata.py`. A plain
`docker compose build` lacks the resolved OpenCode digest and cannot build now.
The workspace volume does not automatically replace its existing source tree
on image rebuild; back it up and update it explicitly if you need new source for
Go verification. Do not delete it casually: it may contain user-created artifacts.
`compose.yaml` currently uses ntfy's `latest` tag; pin a tested version/digest
before production. OpenCode is pinned to `2.0.20`.
`compose.yaml` still uses ntfy's `latest` tag; pin a tested version/digest before
production. OpenCode and Pi are not fixed version pins: `./install` resolves the
current supported OpenCode V2 release from the single documented complete
`GET /repos/{owner}/{repo}/git/matching-refs/tags/v2` response — a complete bounded
array with no page/per_page query and no `Link` pagination (never the moving
`latest` tag or the registry's insertion order) — and the current Pi release from
npm, then builds `FROM` the OpenCode image's immutable `sha256` digest and labels
the built image with the resolved versions, digest and source identity. It fails
closed (keeping the last verified Dockerfile fallback pins) rather than guessing or
silently substituting a stale pin when discovery, digest resolution, build or
compatibility verification fails. A full `./install` always invokes the Docker build
for a dirty source and relies on layer caching; a model/login-only reconfiguration
rebuilds only when the verified release image identity (versions/digest) no longer
matches the resolved releases, so a source change alone does not rebuild on
reconfigure.
+147
View File
@@ -0,0 +1,147 @@
# First-version tester walkthrough
Pipelines is a **single-user preview**, like other personal terminal tools—not a
multi-user service. The goal is useful, supervised workflows with inspectable
history. It is not a guarantee that a model completes every task correctly.
## Before installing
- Use a Git checkout (including `.git`) so Docker setup can stamp its build identity.
- **Docker is the only supported runtime installation.** The
[recommended installer](install.md) needs Docker Compose and Python 3; it builds
the Go CLI/TUI clients on the host only when Go 1.27+ is available.
- Docker setup starts services, asks for ntfy passwords, opens provider sign-in,
and then saves **two separate model defaults** (the interactive harness model and
the new-pipeline model) in two fuzzy pickers. Signing in to a provider is
separate from those saved defaults. Setup makes a small billable
provider-validation call and sends a setup alert. Docker provider sign-in is
separate from your host OpenCode login. Reopen login or the saved defaults later
with `./install --opencode` or `./install --pi`.
- Start with a **disposable repository with no valuable files or secrets**. Stage
tools can read/edit files and execute commands. Permissions and snapshots are not
an OS sandbox; an automatically mounted home directory is not isolation.
- The Pipelines API is unauthenticated. Use your own machine/trusted network only;
do not expose it to the Internet. No multi-user setup is required.
## Install and identify the build
From the checkout, run `./install`, then restart any existing TUI. Docker is the
only supported runtime installation; no mode flag is needed. The installer
requires a Git checkout; a standalone source archive cannot self-install.
Follow [installation](install.md) for PATH and provider setup.
Do not start a native server alongside your Docker server.
Host Go is **optional** and only needed for native host CLI/TUI binaries. Without
host Go you can still run the Docker-contained TUI/CLI against the running server.
Run Compose from the checkout with `--project-directory` (so it finds
`compose.yaml`) and `--workdir "$PWD"` (so the container keeps the actual
disposable workspace):
```sh
# TUI (allocate a TTY)
docker compose --project-directory /absolute/path/to/pipelines exec --workdir "$PWD" pipelines pipelines
# Plain CLI command (no TTY)
docker compose --project-directory /absolute/path/to/pipelines exec -T --workdir "$PWD" pipelines pipelines <command>
```
Any host client targets the mapped host port with
`--url ws://127.0.0.1:<actual-mapped-port>/connect`, reading the port from
`docker compose --project-directory /absolute/path/to/pipelines port pipelines 8080`.
The server listens on container port **8080**; only the default host mapping is
**8081**. Prefer the installer-saved configured endpoint when present; never
replace it with a guessed default.
Configuration, provider credentials, drafts, run history and ntfy data live in
Docker volumes and are reused across reinstalls/reconfigures; the visible flow
remains draft → validate → explicit publish → run → inspect. Developer/legacy
native-server instructions stay in the [installation guide](install.md) rather
than competing with first use.
```sh
pipelines version --json
pipelines ping --json
pipelines status --json
```
`version` identifies the client; `pong.build` identifies the running server.
The full commit is the primary identity. `-dirty` means uncommitted source was
included; two dirty builds at the same commit need not contain the same changes.
Missing `build`, `commit: "unknown"` or `dirty: null` is not an identifiable release.
Capture this information before reporting issues. `--url` and `PIPELINES_URL`
override the saved endpoint; check that you are connected to the intended server.
## First supervised run
1. Create a disposable repository, then launch `pipelines` **from that directory**.
Docker must see the same absolute path; repositories on another computer are
not uploaded automatically.
2. Use `:templates` and create the **summary** starter. Review its name and publish
explicitly. A fresh database is empty; templates are never auto-published.
3. Open the pipeline and use `:run` with a small task, such as summarizing a short
passage included in the task itself. Review the execution confirmation.
4. Read the retained report and recorded visits. For an editing workflow, inspect
File changes as well as actual file contents and any verification commands.
Model-written claims alone are not verification.
5. Create/edit a draft with `:new` or `:drafts`; validate it, then choose whether to
publish. Editing alone must not change the published definition.
6. Optionally exercise `:export` and `:import`. Identical definitions skip; differing
existing names offer keep existing, keep both, or use imported as a new version.
7. Quit with `:quit`; `q` intentionally does not quit. Reopen to inspect history.
Phone reception is a separate manual check. Install/subscribe in the ntfy app and
confirm receipt before depending on it. The installer confirms publishing, not
delivery to your phone. A summary starter does not send alerts automatically.
## Known boundaries
- Sequential stages only; no parallel execution or built-in human-approval stages.
- Cancellation/retry is **not rollback**. Retry starts from the entry stage with
fresh sessions and the pinned definition; earlier side effects can repeat.
- Diffs are bounded stage-start/stage-end observations, not full backups or proof
of exclusive authorship. Partial/missing captures must not mean “no edits.”
- ZIP bundles transfer definitions only. They do not back up history, drafts,
repositories, OpenCode credentials/sessions or ntfy storage. Preserve persistent
volumes/data; never use `docker compose down -v` as a routine reset/update.
- Token/USD budgets use reported usage and may overshoot in-flight. Prefer provider
account spending limits too; do not interpret these as a guaranteed bill ceiling.
- Live reference evidence is dated and narrow. An existing real run7
(2026-10-11) executed both configured harnesses, OpenCode 2.0.26 and Pi 1.1.0,
with `opencode-go/deepseek-v4.1-flash` stages, and both steps succeeded
(retained captures under `tmp/friend-ui-verification`); a current-source TUI
inspection of that run recorded actual 80x30 and 120x36 renderings. The earlier
[2026-10-10 OpenCode v2.0.20 trial](reference-workflow-results.md) remains the
previous dated evidence. The dated 2026-10-11 final install then completed the
new-source installer and installed-authoring verification: the runtime was
actually installed and used, with run17 executing both real harness stages (see
[installation verification](installation-verification.md)). Other providers, real
outages/long-stream interruption, fresh OAuth and phone delivery are still
pending and are not established by these runs. See
[dated results](reference-workflow-results.md), not just test pass counts.
- Windows-native installation, screen-reader accessibility and every Linux/macOS
terminal combination are not tested. This is not a stability promise for all hosts.
## Report a useful problem
Include client `version --json`, server `ping --json`, OS/architecture, install mode,
the exact command or key sequence, expected/actual behavior, and a minimal sanitized
definition/input. For a run failure include its ID and relevant inspect evidence.
Describe whether it reproduced in a disposable repository. Redact tokens, credentials,
private paths/prompts, file contents and patches before sharing; inspection output
is not automatically safe to post publicly. Do not export your database or OpenCode
credential/session storage as a bug report.
## Maintainer checks without inference or deployment
```sh
go test -race -count=1 ./...
go vet ./...
python3 -m unittest discover -s scripts -p 'test_*.py'
python3 scripts/smoke-first-install.py
```
The developer-only smoke check builds source binaries and installs the skill into a disposable directory,
starts an isolated loopback server/database, checks build identity, empty initial
state, five starters, draft/validate/publish, identical ZIP import and restart
persistence, then shuts it down and removes only its temporary directory. It does
not call models, send alerts, update your installed clients or deploy Docker services.
It does not replace real-provider, terminal interaction or fresh Docker-install tests.
Live inference remains [explicitly opt-in](reference-workflows.md).
+97
View File
@@ -0,0 +1,97 @@
# Harnesses and runner-owned control
Configure two independent model defaults:
```sh
./install --harness pi # Docker setup without OpenCode login
./install --opencode --default
./install --pi
pipelines harness
pipelines harness default pi
pipelines new --harness pi
pipelines debug 12 --harness nvim
```
Setup uses a styled onboarding wizard that shows authentication and model steps
and fuzzy-searchable catalogs; the live picker renders each numbered step with
its title and purpose (no duplicated numbered prose is printed outside it). It
preserves existing credentials and does not perform inference. The interactive
harness model is chosen first (`Step 1 of 2`) and the new-pipeline-stage model
second (`Step 2 of 2`), in two separate pickers with the saved value preselected
and marked `(current)`; typing filters, arrow keys or Tab navigate, Enter
confirms, and Esc cancels without changing anything. Pi signs in through
`/login` in a fresh, no-context, extension-free, no-prompt-templates, no-tools
session launched with `--tui-mode regular` so the handoff stays visible above
Pi's interface instead of the default fullscreen clear (there is no standalone
`pi auth login`); the handoff names `/login`, the authentication-method step
("Sign in with an API key" for provider API credentials; account and Radius stay
the user's choice), finishing provider sign-in and exiting Pi with
`ctrl+c`/`ctrl+d` to return to model configuration. Existing credentials stay in
the Docker volume and are reused by exiting when no new sign-in is needed;
completing a sign-in can update the credentials stored in the volume.
Canceling or failing either picker leaves saved preferences unchanged.
On existing Docker setups, the reconfiguration commands
resolve and verify the current OpenCode V2/Pi releases, then operate inside the
container without restarting it. A rebuild is required only when the verified
release image identity (versions/digest) differs from the resolved releases; a
model/login-only change does not rebuild. A full `./install` always invokes the
Docker build for a dirty source and relies on layer caching. Installation is
Docker-only; reconfiguration never falls back to host harness execution.
Container credentials and accounts are separate from host credentials and are
reused on reinstall/reconfigure.
Defaults affect only new drafts/starters, not existing immutable versions.
OpenCode uses `mini --model` to avoid changing unrelated host/project defaults.
Pi stage execution requires its profile on the server; interactive host and
execution-server credentials/settings remain separate.
The shared authoring/debug CLI prefix is Docker-aware: a loopback logical
`--url` is mapped to this Compose service only when a single bounded
`docker compose port` probe returns a `host:port` binding covering the requested
loopback address and port. Remote DNS names (including names such as
`127.remote.example` that merely begin with `127.`), malformed or non-matching
bindings, unmatched loopback endpoints and loopback `wss` endpoints fail safely
instead of being silently redirected or downgraded to plaintext. `provider-check`
on a Docker-linked profile runs in-container and preserves the caller's output
mode (`--json` only when requested) with exact stdout/exit propagation.
Put `harness=pi` in a model stage's configs to select Pi. nvim edits definitions
or displays debug evidence; it does not execute model stages.
For bounded review loops, add a fenced `limits` JSON object to the reviewer:
`{"max_visits":3,"on":["rejected"]}`. Its ordinary edges can be
`approved -> #success`, `rejected -> implement`, and `error -> #failure`.
On the third rejection the server terminates at failure regardless of model
counters. Approval on that visit can still succeed. Limits never enter prompts.
Add a fenced `memory` map such as
`{"task":"input.prompt","checks":"planner.checks"}` to select reviewer
input without previous verdicts. Implementers can select
`{"task":"input.prompt","plan":"planner.plan","feedback":"review.findings?"}`.
`?` means omit if unavailable. A memory block replaces the previous-stage input;
without it, existing previous-output handoffs are unchanged. Latest completed
outputs are shared only within this run. Read provenance and routing overrides
are retained in SQLite and exposed in run inspection/metadata.
These controls enforce counts/field selection, not semantic independence or every
prose guideline. AI-assisted guidelines validation is not implemented.
Verification: `go test` uses controlled RPC fixtures for Pi stage accounting,
results and timeout cleanup; `node --test scripts/test_pi_policy.mjs` exercises
policy gates. `python3 scripts/check-pi-rpc.py` checks installed Pi metadata RPC,
policy loading and idle lease cleanup without inference, also checked in an
isolated built Docker image non-root with networking disabled. Real-provider Pi
stage execution is now covered for the dated 2026-10-11 final install: run17 ran
both the OpenCode and Pi real stages on the installed runtime and each returned the
exact `pipelines-docker-verified` marker (see the dated install receipt in
`docs/installation-verification.md`). Active lease-expiry recovery, web tool
delivery and fresh interactive Docker Pi sign-in remain not tested. An additional
opt-in integration command,
`PIPELINES_PI_LOCAL=1 go test ./internal/stage -run TestPiInstalledLocalIntegration`,
exercised installed Pi with scripted loopback responses: actual permitted/denied
writes, budget exhaustion and active-shell cancellation without a delayed write.
It also covers isolated deny-all syntax repair and cumulative usage.
These are not real-provider results. Pi syntax-only formatting repair uses a separate deny-all
session, retains ownership and shares the budget; value changes are rejected
locally. Permission gates are not an OS sandbox.
Detailed packaged guidance: `internal/author/skill/references/control.md` and
`internal/author/skill/references/harnesses.md`.
+89 -35
View File
@@ -1,24 +1,64 @@
# Installation
`./install.sh` sets up **Docker server + ntfy** by default. Use `--native` for
native binaries only. Native installation requires Go; Docker setup requires Docker
Compose and Python 3, and includes OpenCode in the persistent server container.
To reconfigure login and separate interactive/new-pipeline models without a
service reinstall: `./install --opencode` or `./install --pi`.
See [configured harnesses](harnesses-and-control.md) for scope and verification limits.
`./install` sets up **Docker server + ntfy**, the only supported runtime installation.
It requires Docker Compose and Python 3 and includes OpenCode/Pi in the persistent
server container. Host Go builds the CLI/TUI clients, not a native server.
```sh
git clone https://git.a-wan.net/alan/pipelines.git
cd pipelines
./install.sh
# Explicit choices:
./install.sh --docker # complete server/ntfy setup, including provider login
./install.sh --native # binaries/skill only; honors GOBIN/GOPATH
./install
# Optional: choose Pi rather than OpenCode for setup:
./install --harness pi
```
Native mode installs `pipelines`, `pipelines-server`, and `pipelines-tui`. Go chooses the
destination using `GOBIN`, or the usual `GOPATH/bin` default. Put that directory
on PATH. No privileged operations, private dependency installation, login prompts,
Docker provisioning, service registration, or background processes are involved.
Re-running installation updates the binaries and bundled OpenCode skill without
changing databases, login, or OpenCode configuration files.
The installer builds host `pipelines` and `pipelines-tui` clients when Go is
available, using `GOBIN` or `GOPATH/bin`; put that directory on PATH. It does not
install a host server. Reconfiguration uses `./install --opencode` or `./install --pi`
inside the existing Docker installation and never falls back to host execution. It
resolves and verifies the same current releases and refuses to configure against an
image that does not match them (rebuild with `./install` first); it does not restart
or redeploy services.
Native Go builds embed VCS identity; Docker setup passes the checkout revision and
dirty state as compile-time build arguments (without copying `.git` into the image).
For a build-only refresh use `python3 scripts/build_metadata.py`; it resolves the
current OpenCode V2/Pi releases and runs `docker compose build` with the identity
arguments plus the resolved version/digest arguments, without restarting services.
A plain `docker compose build` cannot resolve the OpenCode image digest, so it must
be given `OPENCODE_VERSION`, `OPENCODE_DIGEST` and `PI_VERSION` through Docker
`--build-arg` flags (and `PIPELINES_VERSION`, `PIPELINES_COMMIT` and
`PIPELINES_DIRTY` outside a Git checkout); `./install` supplies all of them. After deployment,
`pipelines --url ws://HOST:PORT/connect ping --json` identifies the running server.
Docker setup checks that the started server's pong matches the source identity
passed to the build and fails setup if metadata is missing or mismatched.
Each setup resolves the current releases before touching settings or services: the
newest supported **OpenCode V2** release from the single documented complete
`GET .../git/matching-refs/tags/v2` response (a bounded complete array with no
pagination parameters; never the moving `latest` tag or the registry's insertion
order) and the current Pi release from npm. The image is built `FROM` the OpenCode
image's immutable `sha256` digest, resolved from GHCR, and labeled with the
resolved OpenCode/Pi versions, digest and source identity; the moving `latest` tag
and version-only references are never used. Setup verifies the built image reports
exactly those executable versions and a Node-compatible Pi engine, and stops with
a clear error (keeping the last verified Dockerfile fallback pins) when discovery,
resolution, build or compatibility fails rather than guessing or silently
installing stale or unchecked copies. A full install skips a rebuild only when the
release receipt **and** the actual built image's release and source identity labels
already match; a dirty source always invokes the Docker build and relies on layer
caching. A model/login-only reconfiguration compares only the verified release
image identity, so a changed source alone does not rebuild on reconfigure.
Setup writes that release receipt to the machine-local, generated root file
`.pipelines-releases.json` (with atomic `.pipelines-releases-*` temporary files)
and both are git-ignored, so a fresh clean checkout stays clean after setup and
reinstall still reuses the verified release/image identity. The actual built
image's labels stay authoritative, clean-checkout identities/reinstall reuse are
unchanged, and a dirty source still rebuilds.
Docker mode detects the computer's LAN IPv4 address and timezone automatically,
configures `http://LAN_IP:8090`, and binds both Docker services to `0.0.0.0` without asking
@@ -29,15 +69,22 @@ the publishing/phone accounts and publishing token, builds the server, installs
the skill inside the container, and opens **container OpenCode provider login**
on first setup. Choose any supported provider; signup is handled by that provider.
Provider credentials remain in the `opencode-home` volume. Reinstalls skip login
after completed setup; `./install.sh --relogin` opens it again without
deleting accounts. Setup asks which connected provider/model to validate, then
requires a real, small **tool-free model response** before marking setup complete
(provider charges may apply). `--model PROVIDER/MODEL` selects it explicitly;
reinstall retests the saved selection. Login, discovery and validation prime
after completed setup; `./install --relogin` opens it again without
deleting accounts. Setup then chooses **separate saved defaults** in order: first the
interactive OpenCode harness model, then the new-pipeline model, in two
fuzzy-searchable pickers: type to filter, arrow keys or Tab navigate, Enter confirms,
the saved value is preselected and marked `(current)`, and Esc cancels with nothing
changed. `--model PROVIDER/MODEL` and `--harness-model
PROVIDER/MODEL` set them explicitly; reinstall retests the saved selection. Container
credentials and accounts stay separate from host credentials and are reused on
reinstall/reconfigure. Picker
selection performs no inference; the OpenCode path then requires a real, small
**tool-free model response** for the new-pipeline model before marking setup complete
(provider charges may apply). Login, discovery and validation prime
OpenCode's integration catalog in their own container/service. Discovery retries empty model
reads in the same container, avoiding a cold-start empty-catalog response.
An empty catalog is not proof of an invalid key; saved credentials are retained.
New drafts/templates inherit this selection;
New drafts/templates inherit the new-pipeline selection;
published definitions and retry versions stay unchanged. Failed checks print
bounded, credential-redacted evidence and retain their OpenCode session.
The installer then starts/recreates the Compose services,
@@ -61,7 +108,7 @@ ownership to the image UID. Setup verifies that the server can enter the host
checkout before reporting completion.
For fresh configuration you can supply `--ntfy-url https://ntfy.example.com
--bind-address 127.0.0.1 --timezone Europe/London --port 8081` directly to `./install.sh`.
--bind-address 127.0.0.1 --timezone Europe/London --port 8081` directly to `./install`.
The defaults are ready for direct phone access on your trusted LAN. Only use
plain HTTP on a trusted network. Other existing `.env` settings are not replaced.
Docker is also the default without a terminal; setup fails rather than
@@ -73,16 +120,16 @@ set `PIPELINES_BIND_ADDRESS=127.0.0.1` after installation and use Compose direct
Ctrl+C cancels cleanly without deleting configuration, credentials or volumes.
If Go is available, Docker setup also updates standard host CLI/TUI binaries and
the skill. Restart an already-running TUI to load the changes. Without Go, the
installer explicitly warns that the host client was not updated; use native
installation when Go is available. See [Docker setup](docker.md).
installer explicitly warns that the host client was not updated; Docker still runs
the server, and you can build the client later with host Go. See [Docker setup](docker.md).
After ntfy verification, setup also checks the published Pipelines endpoint from
the host (when Go or a host CLI is available) and saves it in
`$XDG_CONFIG_HOME/pipelines/client.json`, or `~/.config/pipelines/client.json`.
Only `server_url` is updated; unrelated settings are preserved. CLI/TUI precedence
is `--url`, then `PIPELINES_URL`, then the saved default, then localhost:8080.
Docker defaults to port 8081, so an old native server on 8080 must not accidentally
become the client target. Setup warns if an environment override still selects
Docker's default host mapping is port 8081 (the container listens on 8080), so an
old native server on 8080 must not accidentally become the client target. Setup warns if an environment override still selects
another address; it does not stop or delete that other server.
If Status says ntfy is **not configured**, check which Pipelines server the client
@@ -134,11 +181,13 @@ To validate a model on the execution computer, run:
```sh
pipelines provider-check --model PROVIDER/MODEL
# Docker credentials are separate from host credentials:
docker compose exec pipelines pipelines provider-check --model PROVIDER/MODEL
# Docker credentials are separate from host credentials (plain CLI: no TTY):
docker compose exec -T pipelines pipelines provider-check --model PROVIDER/MODEL
```
For a private repository, use your normal Git credentials and `GOPRIVATE`:
For a developer or legacy host build, a private repository uses your normal Git
credentials and `GOPRIVATE` to compile the client/host binary (this is not a
supported server installation):
```sh
GOPRIVATE=git.a-wan.net go install git.a-wan.net/alan/pipelines/cmd/...@latest
@@ -150,10 +199,14 @@ into an administrator-selected bin directory using your normal system permission
Services and OpenCode accounts still run as the logged-in user, never as root.
The installer does not hardcode a system destination or run sudo.
## Start explicitly
## Developer/legacy host server (unsupported)
This explicit foreground server is for developing Pipelines itself or running a
previous native setup. It is **not** a supported installation; a fresh database
starts empty.
```sh
pipelines serve # foreground server; Ctrl+C stops it
pipelines serve # foreground developer/legacy server; Ctrl+C stops it
# In another terminal:
pipelines
```
@@ -169,7 +222,7 @@ selects another database, including an existing one; nothing is imported or move
automatically. `pipelines serve --help` prints the actual defaults on your machine.
Drafts use the OS user cache; `PIPELINES_DRAFT_DIR` overrides that location.
## Optional autostart
## Developer/legacy autostart (unsupported)
Stop any existing foreground or legacy server first, then explicitly configure
the OS user service:
@@ -204,10 +257,11 @@ macOS LaunchAgents likewise require a user login. Windows autostart is unsupport
Use `journalctl --user -u pipelines.service` for Linux logs. On macOS inspect
`pipelines service status`; run `pipelines serve` in the foreground for diagnostics.
## OpenCode
## OpenCode runtime (developer/legacy host)
Use your existing `opencode` on PATH, or set `PIPELINES_OPENCODE` to an explicit
executable. No OpenCode version is required just to install binaries. At runtime:
For a developer or legacy host server, use your existing `opencode` on PATH, or set
`PIPELINES_OPENCODE` to an explicit executable. No OpenCode version is required just
to install binaries. At runtime:
- The standard/native API release uses an owned, authenticated loopback
`opencode serve` process, scoped to the requested repository and using the
@@ -243,8 +297,8 @@ No login or provider credentials are copied or exported by Pipelines.
## Optional notifications
Full Docker installation configures this automatically via `./install.sh --docker`.
For native mode, use an existing ntfy server or the Docker setup in [docs/ntfy.md](ntfy.md).
Installation configures this automatically via `./install`.
For a developer/legacy host server, use an existing ntfy server or the Docker setup in [docs/ntfy.md](ntfy.md).
Configure `PIPELINES_NTFY_URL`, `PIPELINES_NTFY_PUBLIC_URL`, and a publishing token
via `PIPELINES_NTFY_TOKEN_FILE` in the server's environment. Keep secrets out of
pipeline definitions. Use HTTPS or an encrypted VPN for phone access; do not
+263 -2
View File
@@ -128,8 +128,11 @@ uses a mock OpenCode editor that submits with the real CLI, then verifies automa
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.
could not be reproduced here. Later dated evidence (2026-10-10) did confirm the
CLI-side V2 `.../wait` request timeout after about six minutes (HTTP 499) on a long
stage; current source therefore settles V2 sessions with bounded
`/api/session/active` polling instead. Safe CLI failure classification/exit-code
reporting was executed with a failing subprocess fixture.
New-pipeline picker checks cover both editor choices, fuzzy/Tab navigation,
cancel-without-creating, retained source/server/create-only metadata and template
@@ -144,3 +147,261 @@ dimensions, and local spinner animation across pending views without extra RPCs.
Actual sample-data renders can be exported with `PIPELINES_TUI_PREVIEW_DIR=PATH
go test -run TestSoftThemeRenderPreviews ./internal/tui` for Home, New and pipeline
views in both themes. Compiled CLI/TUI PTY integration passed with the new styling.
## 2026-10-11 picker, resolver and installer coverage
These items describe current source and its offline/structural regression tests
unless they explicitly name an executed live result; the independent live run for
this change is still pending.
- `resolve-releases` performs one bounded
`GET /repos/{owner}/{repo}/git/matching-refs/tags/v2` request, which the GitHub
REST docs describe as a complete array with no pagination parameters. Offline
fixtures cover a 100+ ref response, the explicit `MAX_REFS`/`MAX_BODY` caps,
ignored prerelease/build tags, malformed refs and a missing newest-tag digest
failing closed with no older-tag fallback. The `tags/list` cross-check and all
pagination (`per_page`/`page`/`Link`) claims are removed.
- `internal/harness` picker tests check that text cursor blinks and unrelated
messages preserve the selected index while a real filter change resets it, that
reduced ANSI output keeps the selected row readable (caret/bold, no colliding
background) while TrueColor keeps the adaptive background, and that
40x16/80x24/120x36 layouts stay within the measured height with the
step/heading and selected row visible, including a long no-match query.
- The compiled picker PTY check is opt-in (`PIPELINES_HARNESS_PTY_DIR`); it now
waits through blink intervals and asserts the exact saved and arrow-scrolled
model. It was not executed as part of this documentation change.
- `setup-docker.py` accepts OpenCode's actual `opencode v2.0.26` probe token and
compares source identity only for a full install; model/login-only
reconfiguration compares the verified release image identity, so a changed
source no longer forces a reconfigure rebuild while a dirty install still
always invokes the Docker build. The image now includes python3.
- Python fixtures bind temporary `HOME`/`USERPROFILE` directories, so the
installer/configure suites pass under the container default `/home/pipelines`
without weakening `host_workspaces` guards (which still reject `/`, `/data`,
`/workspace`, `/home/pipelines` and `home == repository`).
- Still not tested here: a real Docker rebuild/reconfigure against live
registries, a real 40x16/80x24/120x36 terminal capture of the compiled picker,
phone delivery, and real model inference.
## 2026-10-11 retained-run fixture isolation and final-validation envelope
Root-reported runtime evidence supplied for this change (not re-executed by the
authoring stages): the existing seeded-profile regression
`go test ./tmp/preview-verification -run TestServerCLIFixtureDoesNotInheritUserDockerProfile -count=1`
failed because the child `internal/server` integration test inherited the
caller's real Docker-linked `PIPELINES_HARNESS_CONFIG`, so the CLI `debug` prefix
failed closed ("refusing to redirect") against the test's ephemeral httptest
endpoint. Root's four preview tests for the bounded transcript helpers pass,
Root's full host race run showed no race warning and only this fixture failure,
and `go vet ./...` passed. Current source isolates the server CLI fixture with
the existing missing-temp-file
`t.Setenv("PIPELINES_HARNESS_CONFIG", filepath.Join(t.TempDir(), "harnesses.json"))`
pattern, leaving the production fail-closed redirect guard in
`internal/harness/prefix.go` and its regressions unchanged and keeping the
real-profile isolation regression meaningful rather than removed.
Current-source behavior, not a deployment: independent re-execution of the full
`go build`/`go vet`/`go test` matrix (Docker-only race results stay Docker-only)
and the final installed-host Docker install verification are **still pending**;
no installed/running server state is claimed here.
## 2026-10-11 run13 interruption, Docker race limitation and state separation
Four states are kept explicitly separate and must not be conflated:
1. **Current source** (this checkout, not deployed): the retained maintenance
changes are present here — `internal/stage/diagnostics.go`
`BoundTranscript`/`transcriptBound = 32<<10` turns an oversized transcript into
a valid, bounded JSON envelope with credential redaction applied before any head
is taken and a rune-safe 8 KiB preview; `internal/stage/evidence.go` scopes
session evidence as `latest_bounded_evidence` using the single bounded
`finalAssistantReadback` (never the recent-20 all-message fetch);
`internal/server/evidence.go` reads at most the 3 most recent session-bearing
steps; `settleV2Usage` in `internal/stage/agent.go` issues exactly one
2s-bounded session-aggregate read after an unbudgeted V2 agent stage and leaves
missing/invalid usage unknown; and the isolated server CLI fixture uses the
missing-temp-file `t.Setenv("PIPELINES_HARNESS_CONFIG", …)` pattern with the
production fail-closed redirect guard in `internal/harness/prefix.go` unchanged.
Pi JSONL is never parsed as one JSON object and native V1 keeps its existing
path.
2. **Host verification evidence independently recorded by Root**: after the
fixture fix, Root ran the full `go test -race -count=1 ./...` (no race warning,
only the fixture failure before the fix) and `go vet ./...`; after the three
harness-neutral evidence labels and Step wording changes Root re-ran the
affected `tui`/`author`/`cli` race and vet checks, the Python suite (80) and the
opt-in compiled picker PTY check (4). These are Root-recorded host results; this
authoring change did not re-execute them.
3. **Deployed old image**: the running Docker image predates these source changes,
so the deployed server does not include them.
4. **Pending final install**: the final install and installed authoring/provider
verification remain **pending**. An updated skill/client or source checkout is
not deployment evidence.
Docker race limitation (confirmed): the Docker runtime is built with
`CGO_ENABLED=0` (`Dockerfile`) and has **no C compiler** (the Alpine runtime stage
installs no GCC/musl-dev), so `go test -race` cannot run there. In-Docker reviewers
must use ordinary `go build`/`go test`/`go vet`; race coverage comes from the
independently executed host `-race` runs above. Race checks must not be attempted
in Docker and no compiler may be installed or searched for.
Run13 interruption (dated evidence, not a fix): the previous reviewer ran
`find /` looking for GCC; the tool timeout left a process in disk sleep, Docker
could not stop the container, and an approved Desktop restart recovered run13 as
interrupted (`executing=false`, every step `agent_active=false`) with **no
automatic replay**. Docker startup recovery already sets running steps to
`interrupted` with `agent_active=0`. This is an environment/interruption
observation only: no general cancellation fix is inferred and process termination
is unchanged.
## 2026-10-11 short-lived CLI inherited-pipe cancellation (current source)
**Current source** (this checkout, not deployed) adds one shared, dependency-free
constructor in `internal/opencode`: `CommandContext(ctx, executable, args...)`
sets the single finite `os/exec.Cmd.WaitDelay` constant
`ShortLivedWaitDelay = 250ms` and is the only place that value is defined. It is
reused by all three short-lived, context-controlled CLI call sites — the
`internal/stage` `OpenCodeClient.call()` API/agent path (including
`Interrupt`), `opencode.Detect()`'s `--help` probe and the native
`Connection.Messages()` export fallback. It bounds **draining of inherited
output pipes only**: after the child exits, os/exec waits at most the grace for
descendants that still hold the inherited stdout/stderr pipes, then closes them
and reports `exec.ErrWaitDelay`. It does not terminate, signal or confirm cleanup
of descendants.
Existing identities and bounds are preserved: `context.Canceled` and
`context.DeadlineExceeded` are returned unchanged when the context is done,
`exec.ErrWaitDelay` survives on the sanitized `openCodeError` cause and on the
`Detect`/`Messages` errors, request (≤64 KiB), response (≤1 MiB), 8 KiB stderr and
`boundedBuffer`/`boundedOutput` drain-with-overflow behavior are unchanged, error
text stays free of provider bodies/prompts/credentials/CLI logs, and a failed
interrupt still leaves the session active and joins `ErrStageCleanup` with no
replay. A successful parent exit whose partial stdout is still held open by a
descendant is never parsed as a successful result. No new module dependency is
added.
**Dated synthetic reproduction** (`tmp/interrupt-verification`, synthetic
real-subprocess diagnostics, not provider evidence): Root waited for the
descendant itself to start before cancelling public
`OpenCodeClient{Backend:"v2"}.Interrupt`. Two Docker/Linux returns took
**3996ms/3995ms** despite `context.Canceled`
(`tmp/interrupt-verification/descendant-started.jsonl`); the stronger host
reproduction took **4003ms/4000ms**
(`tmp/interrupt-verification/reproduction.log`). These observed the previous
behavior and motivated the shared finite grace.
**Added regression coverage** (source-level/mocked; `internal/stage` and
`internal/opencode`, using real `os/exec` fixtures with start-marker barriers,
bounded watchdogs and naturally terminating owned children): cancel after a
descendant starts; deadline error identity; successful parent exit with
descendant-held pipes → `exec.ErrWaitDelay` with no success text; ordinary
help/API/export output, non-zero exit and redaction; and a failed interrupt that
retains cleanup-unconfirmed active ownership and performs no replay.
**Tested vs not deployed**: this describes current source. The running Docker
image predates these changes, so the fix is **not deployed**. Descendant
termination, confirmed remote interruption and any fix for the run13 Docker disk
sleep are explicitly **not claimed**. Docker race remains unavailable (the
runtime has no C compiler), so in-Docker reviewers use ordinary
`go build`/`go test`/`go vet` and host `-race` runs stay host-only.
## 2026-10-11 FINAL INSTALLED verification (friend-ready preview)
This is the dated receipt for the friend-ready preview runtime, recorded by Root
from `tmp/friend-final-verification` (authoritative `summary.json` plus the
installed PNG captures). It supersedes the phase-specific "pending final install"
statements in the earlier dated sections above; those observations stay as history
and are not deleted.
A normal interactive `./install` with both GoDeepseek flags —
```sh
./install --model opencode-go/deepseek-v4.1-flash \
--harness-model opencode-go/deepseek-v4.1-flash
```
— exited **0**. The installer resolved the current OpenCode/Pi releases **live**,
built from the **fresh dirty source**, and produced actual image
**`sha256:1810ab50f3ea3991e7f3548c79250e65a114bb1821eac52efd872b91cf7c3136`**
with **OpenCode 2.0.26 / Pi 1.1.0 / Node 24.18.1**. The install made a **real
tool-free provider validation** and a **real ntfy authenticated publish**, then
confirmed **server + host health**, **home/workspace entry** and the **saved
authoritative endpoint preserved**. Pre-install **database/home backup integrity
was `ok`**.
Post-install preservation checks **all passed**: original definitions 1–4, run
history 1–16, host/container default Pi and both models/profiles, the logical
endpoint, service URLs/timezone/ports/models, the Pi credential hash, the OpenCode
connected accounts and the ntfy token. Neither the original repository commit/push
nor any credential/data cleanup was performed.
Installed host-CLI authoring was actually used with **both** Docker harnesses:
separate retained drafts, each changing **only the worker prompt**, performed a real
shell CLI `ping` → `pong` and `validate` → `validated` through the generated Linux
`/usr/local/bin/pipelines` plus scoped transport aliases that preserved the original
logical `8081` endpoint and draft metadata. Root independently inspected the native
OpenCode completed shell tool outputs and the Pi retained JSONL `toolResults` and
validated both drafts; there was **no submit/run/publication** of the authoring
drafts.
Docker-proxy submit on **verification-only definition 5** → **published v2**; a
second stale v1 draft was **rejected as conflict**, and the original definitions
stayed untouched. **Run17** (definition 5 v2) **succeeded in 7 seconds**: OpenCode
then Pi reported the exact `pipelines-docker-verified` markers, both went
**inactive**, and OpenCode's **exactly one completed read of the marker file** was
verified from the **retained native history, not the latest-assistant preview**.
Unbudgeted reported usage was recorded best-effort and known here: OpenCode
**4011 tokens / $0.00029769599999999996** and Pi **1071 tokens / $0.000142002**;
unknown usage remains allowed by design. `GET /api/session/active` was empty after
the sessions exited.
Installed-UI captures under `tmp/friend-final-verification` (`installed-pi-*`,
`pi-signin-*`, `installed-pi-models-*`): actual run17 at **80x30** and **120x36**
showed neutral Pi evidence and the green both-stage graph; the actual installed Pi
auth handoff/method menu at **80x30** and **100x36** was viewed, canceled and exited
0 with **no sign-in**; the actual installed Pi model wizard at **80x30** viewed the
saved current model, filtered, confirmed the first with Enter and the second with
Esc (exit 1, expected cancel) using **copied preferences only**, while the **actual
production preferences were preserved**.
Root's independent checks: full host `go test -race -count=1 ./...` and
`go vet ./...` **exit 0**; Python suite **80 tests, exit 0, 1 optional PTY**;
Node policy **exit 0**; the isolated developer lifecycle fixture **exit 0 with no
inference/deploy**; author package tests **exit 0**. Earlier independent reviewer
runs performed the ordinary Docker full build/vet/tests and focused subprocess
regressions (ordinary build/vet/test only — **no Docker race, no GCC search, no
global `find`**).
Explicitly **UNVERIFIED** for this install: fresh OAuth/provider login completion,
phone delivery, other real providers, the D-disk-sleep fix and active lease expiry.
Authentication menus and existing-credential inference are **not fresh sign-in
proof**. The shared finite `WaitDelay` stronger synthetic PUBLIC `Interrupt`
child-start barrier (host **252/252 ms**, Docker **250/251 ms**, `context canceled`
true, bounded true vs ~4 s before) is a synthetic diagnostic and is **not proof of
descendant termination, remote cleanup or a Docker VM disk fix**. Archive
extraction, build-identity and compile verification remain **pending** until Root
executes it and are **not claimed** here.
## 2026-10-11 generated release receipt ignore (source-hygiene regression)
Current source adds two root-anchored `.gitignore` rules for the installer's
machine-local generated artifacts: `/.pipelines-releases.json` (the receipt path
from `setup-docker.py` `release_receipt_path()`) and `/.pipelines-releases-*` (the
`tempfile.mkstemp` `prefix=".pipelines-releases-"` in `record_release_receipt()`).
No installer/runtime code changed, and the pre-existing receipt and every other
file are retained.
Controlled isolated Git fixture (offline, credential-free, no network, Docker,
provider or model call): a new `scripts/test_build_metadata.py` case copies the
repository's actual `.gitignore` into a temp dir, `git init`s it, commits one
tracked source file, then writes a representative `.pipelines-releases.json` and a
`.pipelines-releases-abc123` temporary file. `git status --porcelain
--untracked-files=normal` is empty and the existing `build_metadata.docker_args`
helper returns `PIPELINES_DIRTY=false` with a version lacking `-dirty`; after
editing the tracked source the status is non-empty and `docker_args` returns
`PIPELINES_DIRTY=true` with a `-dirty` version. This shows the generated receipt no
longer dirties a clean checkout while dirty source still rebuilds.
This controlled fixture is **not** the actual new-account install/provider login
recorded in the 2026-10-11 FINAL INSTALLED section above, which this change does
not re-run. It is docs-and-ignore only, with no rendered UI and no live install or
provider evidence.
+42 -2
View File
@@ -55,8 +55,9 @@ 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.
copied into the diagnostic. A failed V2 active-session poll (or native V1 `/wait`)
is not evidence that the agent prompt failed to start, and does not trigger replay
of stage work.
Native `StructuredOutputError` is named directly, rather than reduced to a generic
command failure. Native HTTP evidence records the actual HTTP operation/status;
an `exit_code` of -1 there is explicitly marked as not a subprocess exit.
@@ -67,6 +68,45 @@ workaround is read-only CLI `opencode export`. The exported session ID must matc
the requested ID. Nothing is rewritten or removed from the database/history.
Debug receives the original messages plus a note identifying that recovery path.
## Failure diagnostics and confirmed limits
Retained stage failures distinguish two fixed, sanitized categories in the step
diagnostic:
- **FINAL RESULT VALIDATION** for a strictly invalid final result, with the stage
key and the precise parser detail (for example `duplicate JSON field "score"` or
`invalid character 'z' after object key:value pair at byte N`). It states that
completed edits/tool side effects are retained and not undone, and that a full
retry repeats work.
- **HARNESS TRANSPORT** for request, V2 active-session poll and final-readback
failures, including the sanitized `malformed or incomplete` readback message.
A structured-output validation failure is never reported as a harness transport
failure, and vice versa. Neither label includes a provider response body, prompt,
credential or arbitrary model content. Duplicate nested fields are rejected by
strict parsing rather than merged or last-wins, and only a lossless insertion of
missing commas/colons or trailing closers is repaired, so an unknown evidence or
verdict value can never become `success` and admitted tool work is never replayed.
Confirmed ordinary-endpoint failures (2026-10-11): an all-history readback returned
exactly 262144 bytes of incomplete JSON (`invalid agent messages`); a reviewer
result was rejected for a duplicate nested `performance_review` field; and an
onboarding visual-review result failed with `invalid character 'z' after object
key:value pair at byte 3968`, where unsafe lossless repair was correctly rejected.
These are source-level findings covered by mocked `internal/stage` fixtures. An
updated checkout or installed skill is **not** evidence that a user's running
server contains the fix; deploying/restarting is a separate authorized action.
OpenCode V2's published prompt/generate API does not accept a structured-output
field, so a prose `output_contract` does **not** enforce structured output: V2
results are validated locally by strict parsing only, and no unsupported V2 format
field is sent. A review-only fresh execution that could re-derive a failed verdict
without replaying the admitted tool-using stage's edits is a future improvement and
is **not implemented**. Two items remain unresolved and must not be reported
complete: a macOS fixture path-spelling mismatch (`/var/folders` versus
`/private/var/folders` are the same real directory) in
`scripts/test_setup_harness.py`, and onboarding UI visual approval.
## Optional machine-readable restrictions
`tools` enables actions per stage. A stage can narrow edit paths and shell
+11 -5
View File
@@ -20,11 +20,17 @@ session had **no messages and zero usage counters**, even though `/generate`
returned a valid result. Polling that session treated placeholder zeros as known
accounting and did not enforce the intended limit.
Budgeted V2 text calls now use tracked `/prompt` → `/wait` → message readback,
with **all tools denied**. Their messages are retained in the stage audit, usage
is read from the tracked session, and a completed token-budgeted response with
zero reported tokens fails closed. Native V1 handling and unbudgeted text
generation keep their existing paths.
Budgeted V2 text calls now use tracked `/prompt` → bounded active-session polling
→ message readback, with **all tools denied**. Their messages are retained in the
stage audit, usage is read from the tracked session, and a completed
token-budgeted response with zero reported tokens fails closed. Native V1 handling
and unbudgeted text generation keep their existing paths.
A later reliability fix replaced the V2 `.../experimental/session/{id}/wait`
request, which timed out at the CLI's own ~six-minute limit (HTTP 499) on long
stages, with roughly one-second `GET /api/session/active` polls under the stage
context/deadline. That change has fake-CLI regression coverage in `internal/stage`;
it has not yet been exercised by a fresh live run.
The focused live rerun retained **952 reported tokens and $0.00016440**, failed
with `stage budget exceeded`, and stopped its owned session. This is reported