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
+97 -38
View File
@@ -1,5 +1,15 @@
# Pipelines
Configured OpenCode/Pi harnesses, separate model defaults, runner-enforced review
limits and selected run-local context: [guide](docs/harnesses-and-control.md).
Reusable, sequential workflows for your repositories, with a Go CLI/TUI,
OpenCode model stages, retained run history, and optional phone notifications.
**First-version preview:** a single-user tool for supervised work. Start with a
disposable repository, review edits and command evidence, and expect rough edges.
See the [tester walkthrough and known limits](docs/first-version-testing.md).
Stage results include [retained, highlighted workspace diffs](docs/stage-file-diffs.md)
for newly executed visits, alongside their reports and audit evidence.
@@ -10,61 +20,102 @@ between servers as portable ZIP bundles.
handoffs, file edits/verification, failure routing and reported-usage budgets with
independent acceptance checks and retained evidence. Live inference is opt-in.
Reusable, sequential workflows for your repositories, with a Go CLI/TUI,
OpenCode model stages, retained run history, and optional phone notifications.
## Install
`./install.sh` defaults to full **Docker server + ntfy** setup; use `--native` for
native binaries only. Docker mode needs Docker Compose and Python 3; native
mode needs Go 1.27+ and uses your existing OpenCode for model stages.
`./install` installs **Docker server + ntfy**. Docker is the only supported runtime
installation. Setup needs Docker Compose and Python 3.
For the host CLI/TUI walkthrough below, also install Go 1.27+; the Docker
installer installs/updates those clients when host Go is available.
```sh
git clone https://git.a-wan.net/alan/pipelines.git
cd pipelines
./install.sh # configure/start Docker services and connect a provider
# Optional host CLI/TUI binaries: ./install.sh --native
./install # configure/start Docker services and connect a provider
```
The installer requires this Git checkout (including `.git`); a standalone source
archive cannot self-install. Without host Go you can still use the
Docker-contained TUI/CLI. Run Compose from the checkout with `--project-directory`
so it finds `compose.yaml`, and pass `--workdir "$PWD"` so the container keeps the
actual (disposable) workspace rather than its own image directory:
```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>
```
Point a host client at 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 container listens on port **8080**; only the default host mapping is 8081.
Prefer the installer-saved configured endpoint when present; never replace it with
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;
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.
Native mode installs the Go binaries and shared OpenCode `pipelines` skill without
login checks or automatic services. Docker mode configures ntfy accounts/token,
The installer builds only CLI/TUI clients on the host when Go is available;
the server and stage harnesses run in Docker. It configures ntfy accounts/token,
checks publishing/health, and opens container OpenCode provider login on first setup;
existing settings, credentials and volumes are retained on reinstall.
Docker provider credentials live in its persistent container volume, separately
from your host OpenCode login. Setup asks for ntfy account passwords, then your
model-provider login and a model; it validates that model with a small real
generation (provider charges may apply).
With plain `go install ./cmd/...`, also run `pipelines skill install`.
For system-wide use, install the binaries into your chosen system bin directory
with the appropriate permissions. Configuration and data remain per-user.
from your host OpenCode login; reinstalling or reconfiguring reuses the existing
container accounts and volumes rather than replacing them. Setup asks for ntfy
account passwords, then your model-provider login and models. It selects separate
saved defaults in order: first the interactive harness model, then the
new-pipeline model, in two fuzzy-searchable pickers (the saved value is
preselected and marked `(current)`; typing filters, arrow keys or Tab navigate,
Enter confirms, and Esc cancels without changing anything). Model selection
performs no inference; only the OpenCode path validates the new-pipeline model
with a small real generation (provider charges may apply). Fresh
`./install --harness pi` skips OpenCode login and that generation check. Pi has no
standalone `auth login`: setup opens a fresh `/login` session (regular TUI mode)
where you choose an authentication method, reuse existing volume credentials by
exiting, or sign in with an API key. Each
setup resolves the current supported OpenCode V2 release from the single
documented complete `git/matching-refs/tags/v2` response (no pagination; never the
moving `latest` tag) and the current Pi release from npm, builds `FROM` the
OpenCode image's immutable `sha256` digest, and verifies the built image reports
exactly those executable versions (and a Node-compatible Pi engine). It stops with
a clear error instead of silently substituting a stale pin when discovery, build
or compatibility fails. Use `./install --opencode` or `./install --pi` to
reconfigure login and models inside the existing container without restarting
services: an image matching the release identity needs no rebuild, while a dirty
source always invokes the Docker build and relies on layer caching. The built
image includes python3 so the installer/verification tests can also run inside
the container.
Configuration and data remain per-user. No native server installer is offered.
Docker setup starts the server and saves its client endpoint (default host port
**8081**). Do **not** also start `pipelines serve` for this setup. Explicit `--url`
and `PIPELINES_URL` override the saved endpoint; restart existing TUIs after setup.
Docker mounts your home and installation checkout at their original paths and
uses your UID/GID. Other host repositories need a bind mount at the same absolute
path; repositories on another client computer are not automatically transferred.
Docker setup starts the server and saves its client endpoint (the container port
is **8080**; only the default host mapping is **8081**). That saved endpoint is
authoritative: prefer it and never replace it with a guessed default. Do **not**
also start `pipelines serve` for this setup. Explicit `--url` and `PIPELINES_URL`
override the saved endpoint; restart existing TUIs after setup.
Docker mounts your home and installation checkout at their original absolute paths
and uses your UID/GID, so the checkout supplies `compose.yaml` while
`--workdir "$PWD"` preserves the actual disposable workspace. Other host
repositories need a bind mount at the same absolute path; repositories on another
client computer are not automatically transferred.
These unauthenticated server ports are for trusted networks only—do not expose
them to the public Internet.
### Native server instead (optional)
### Developer/legacy local server (unsupported)
Start a native server explicitly; fresh databases contain no pipelines:
For developing Pipelines itself or running a previous native setup, an explicit
foreground server remains available. This is **not** a supported end-user
installation and is not part of Docker setup; fresh databases contain no pipelines:
```sh
pipelines serve # foreground server
pipelines serve # foreground developer/legacy server
# In another terminal:
pipelines
```
Optional autostart at login (starts the server now):
Optional developer/legacy autostart at login (starts the server now):
```sh
pipelines service enable
@@ -85,11 +136,12 @@ cd /path/to/your/repository
pipelines
```
1. **Create:** press **n** or use **:new**. Choose **OpenCode** to author a
workflow together, or **nvim** to edit the Markdown yourself. The selected
editor must be installed on your client computer. Describe the stages, their
inputs/outputs, and the tools they need. Templates (**b** on Home) are optional;
a fresh installation has no published pipelines.
1. **Create:** press **n** or use **:new**. Choose the configured **OpenCode** or
**Pi** harness to author a workflow together, or **nvim** to edit the Markdown
yourself. Harness authoring runs in the Docker server; only the **nvim** editor
is required on your client computer. Describe the stages, their inputs/outputs,
and the tools they need. Templates (**b** on Home) are optional; a fresh
installation has no published pipelines.
To skip authoring, use **:templates**, choose one of the five generic starters,
and press **s** or Enter on **Create pipeline**. Review the prefilled name
(edit it if needed), then press Enter to create—no separate naming or editor
@@ -184,9 +236,12 @@ pipelines run "three stage"
```
Every submission is validated and creates an immutable version. Examples are
optional; nothing is imported automatically. Run from your repository directory;
stage tools are enabled automatically. Edits support any language/file type and
new files. No file list or typed RUN confirmation is required.
optional; nothing is imported automatically. The three stages give a visible
plan → implement → review path using your own accounts and repository; no
maintainer accounts or published definitions are assumed. Run from your
repository directory; stage tools are enabled automatically. Edits support any
language/file type and new files. No file list or typed RUN confirmation is
required.
## Useful commands
@@ -204,10 +259,13 @@ pipelines runs
pipelines inspect 1
pipelines serve # foreground server; Ctrl+C stops it
pipelines ping
pipelines version --json # local client identity (offline)
pipelines ping --json # running server identity
pipelines help edit
```
CLI `new`/`edit` open OpenCode directly with `@pipelines`. The installed skill asks
CLI `new`/`edit` open the configured harness (**OpenCode** or **Pi**) directly with
the Pipelines skill. The installed skill asks
missing questions; `pipelines new` needs no preliminary questionnaire. Changes stay
as drafts by default; CLI and TUI share validation and draft storage. Most
commands support `--json` for agents and scripts.
@@ -233,8 +291,8 @@ Quit the TUI with **:quit**; **q** does not exit. **Ctrl+C** remains an interrup
Starting/retrying/canceling runs and deleting drafts require confirmation. CLI
publication also prompts; use `--yes` only for explicitly approved automation.
**n / :new** and creating from a template offer a Tab-navigable, fuzzy-searchable
picker: **nvim** opens the draft Markdown file; **OpenCode** authors it with you.
Canceling the picker creates no draft and publishes nothing.
picker: **nvim** opens the draft Markdown file; **OpenCode**/**Pi** author it with
you. Canceling the picker creates no draft and publishes nothing.
Wide terminals show runs and pipelines side by side; narrow terminals stack them.
The TUI uses soft light/dark-adaptive cards, muted metadata, subtle selections,
and local loading animations instead of heavy character borders and inverted bars.
@@ -260,7 +318,8 @@ In the draft browser, **x** then **y** deletes the selected retained draft and
metadata. CLI: `pipelines draft-delete <draft.md>`. Published history is untouched.
Model results use native JSON-schema output where supported, precise parsing
errors, and bounded format-only repair without replaying tools. Optional stage
errors, and bounded format-only repair without replaying tools. Retained failures
distinguish final-result validation from harness transport. Optional stage
permissions narrow file/command access without imposing a language-specific
default. See [model result recovery and permissions](docs/model-results.md).
The run graph header shows start time and elapsed/final duration, plus finish