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
+27
View File
@@ -10,6 +10,7 @@ import (
"strings"
"git.a-wan.net/alan/pipelines/internal/draft"
"git.a-wan.net/alan/pipelines/internal/harness"
)
//go:embed skill/SKILL.md skill/references/*.md
@@ -48,3 +49,29 @@ func Prompt(d draft.Draft, request, command string) string {
}
return prompt
}
func HarnessCommand(ctx context.Context, name string, d draft.Draft, request, cli string) (*exec.Cmd, error) {
skill, err := SkillDirectory()
if err != nil {
return nil, err
}
if _, err := os.Stat(filepath.Join(skill, "SKILL.md")); err != nil {
return nil, fmt.Errorf("pipelines skill is not installed; run pipelines skill install: %w", err)
}
cwd, err := os.Getwd()
if err != nil {
return nil, err
}
prompt := Prompt(d, request, cli)
config, err := harness.Load()
if err != nil {
return nil, err
}
if name == "" {
name = config.Default
}
if name == "pi" {
prompt = strings.Replace(prompt, "@pipelines", "/skill:pipelines", 1)
}
return harness.Command(ctx, name, cwd, prompt, skill)
}
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"path/filepath"
)
var skillFiles = []string{"SKILL.md", "references/format.md", "references/notifications.md", "references/operations.md", "references/transfer.md", "references/verification.md"}
var skillFiles = []string{"SKILL.md", "references/format.md", "references/notifications.md", "references/operations.md", "references/transfer.md", "references/verification.md", "references/control.md", "references/harnesses.md"}
func SkillDirectory() (string, error) {
dir := os.Getenv("XDG_CONFIG_HOME")
+5
View File
@@ -43,6 +43,8 @@ repository does not need to contain Pipelines source or documentation.
| Task | Packaged reference |
| --- | --- |
| Definition changes, tools, permissions, routing, schedules, budgets | `references/format.md` |
| Bounded loops, independent review, selected shared context | `references/control.md` |
| OpenCode/Pi configuration, model defaults, harness limits | `references/harnesses.md` |
| Phone alerts and report/file attachments | `references/notifications.md` |
| System overview, storage, execution location, results/diffs, Debug/retry | `references/operations.md` |
| Select/export/import definitions and resolve existing-name conflicts | `references/transfer.md` |
@@ -79,6 +81,9 @@ a workflow, publishing a notification, reinstalling, or restarting services.
the live database or immutable source.
Keep unrelated stages and user constraints. Preserve handoff context, explicit
tools, exclusive routing, and bounded feedback loops.
Put visit limits in runtime `limits`, never model counters/instructions.
Use selected `memory` fields for independent review; do not inject earlier
verdicts, visit counts, or implementation conversations into the reviewer.
4. Run `CLI_PREFIX validate DRAFT_PATH --json`. Fix every validation error and rerun.
Validation proves structural validity, not model/tool availability or runtime success.
5. Summarize the change, validation outcome, edit/tool permissions, and any schedule
@@ -0,0 +1,49 @@
# Runner-owned limits and shared memory
Use these blocks for bounded feedback loops. Never ask a model to count visits,
increment revision counters, or enforce retry caps. Model verdicts concern current
work only. Counters are runner audit data, not model input. A fresh session alone
does not guarantee independent review: explicitly select its input fields.
````markdown
```limits
{"max_visits":3,"on":["rejected"]}
```
```memory
{"task":"input.prompt","checks":"planner.checks"}
```
```edges
approved -> #success
rejected -> implement
error -> #failure
```
````
These blocks accompany a normal review stage's prompt/output/tools/configs.
Pipelines counts actual visits, ignoring model-generated counters. On visit three,
`approved` can succeed; `rejected` retains its verdict but routes to `#failure`.
Visit count, limit decision and original target are retained in `inspect --json`
and run metadata. `max_visits` accepts 1–5. Every `on` outcome must declare a
nonterminal edge. Without `on`, entering beyond the cap fails before execution.
Global 30-step/five-visits-per-stage safety limits still apply.
`memory` maps input aliases to `input.FIELD` (original input) or `STAGE.FIELD`
(latest completed output of that stage **in this run**). A memory block replaces
previous-stage input with only those fields. Without it, previous output remains
input. Reads retain source and visit sequence. Missing required fields fail before
execution. Append `?` to omit an unavailable field, e.g.
`"feedback":"review.findings?"` for implement's first visit. Self-memory is
rejected. Limits: 50 bindings; 1 MiB per retained in-memory value map.
Implementers can receive task, plan and optional findings. Independent reviewers
should receive task/acceptance criteria and inspect actual artifacts—not previous
verdicts, counters, or implementation conversations. Selected content remains
untrusted data; this cannot prove semantic independence or prevent all injection.
Memory is run-local; persisted completed outputs/read provenance are its audit.
There is no cross-run memory, restart/resume, or hidden replay. New runs/retries
start fresh. Arbitrary prose is not executable policy. Future AI-assisted
guidelines validation is **not implemented**; structural validation does not
recognize every unreliable counting instruction.
+7 -3
View File
@@ -4,8 +4,9 @@ Definitions are Markdown made only of `# stage KEY` headings and fenced blocks.
An optional `# settings` section precedes all stages. No unrelated prose outside
blocks. The first stage receives `input.prompt` from the runtime user's task
and `input.pwd`, the resolved run directory recorded by the server;
later stages receive exactly the previous executed stage's output map. There are
no stage `input` blocks. Preserve needed context explicitly in `output` handoffs.
later stages receive previous output unless `memory` explicitly selects fields
from run-local context. There are no stage `input` blocks. Read
`references/control.md` for selected memory and runner-enforced limits.
Each model stage requires nonempty `output`, `prompt`, `configs`, and `edges` blocks:
@@ -43,8 +44,11 @@ Each outcome has exactly one target: another stage, `#success`, or `#failure`.
An omitted error edge defaults to failure. Execution is sequential; forks choose
one outcome, never execute parallel branches. Cycles are allowed; every stage
must be reachable from entry and have a possible path to a terminal. Use bounded
revision counters in prompts/outputs for feedback loops (runtime also has limits).
runner-owned `limits` for feedback loops, never revision counters in model
prompts/outputs. Read `references/control.md` for the exact format.
Model configs may set `harness=opencode` or `harness=pi`; omission preserves
historical OpenCode execution. Read `references/harnesses.md` for setup/limits.
Use the exact provider/model IDs validated during server setup. New drafts/templates
inherit that selection; do not assume the host's login matches the container's.
Other OpenCode provider/model IDs are accepted syntactically; actual availability,
@@ -0,0 +1,165 @@
# Configured harnesses
Current source supports OpenCode and Pi interactive authoring, debugging and
model stages. nvim remains a file editor/read-only debug packet viewer, not a
stage backend. Only configured harnesses appear in TUI pickers, default first.
CLI `new/edit/debug --harness opencode|pi|nvim` overrides the default.
`pipelines harness` launches the configured default in the invocation directory.
CLI `new/edit/debug` and TUI author/debug build one shared, Docker-aware CLI
prefix. A Docker-linked profile embeds the in-container `/usr/local/bin/pipelines`
(never the host binary: Linux can see but cannot execute a mounted macOS host
executable). Loopback is recognized only via `net.ParseIP(...).IsLoopback()` plus
an exact case-insensitive `localhost`, so a remote DNS name such as
`127.remote.example` stays remote and runs no probe. For a loopback logical
`--url`, a single bounded `docker compose port` probe parses each returned line
as a complete `host:port` binding (IPv4/IPv6/wildcard) and the prefix maps only
when a binding covers the requested loopback address and port; malformed or
non-matching bindings fail closed. A loopback `wss` endpoint is rejected as
having no supported local TLS mapping rather than downgraded to plaintext. On a
match it embeds scoped `PIPELINES_TRANSPORT_SOURCE`/`PIPELINES_TRANSPORT_TARGET`
aliases in the prefix string (not `cmd.Env`, so the pre-existing harness
server's tools inherit them). The client rewrites an endpoint only on an exact
source match; remote endpoints stay remote. Draft metadata (server, base
version, create-only guard) is preserved unchanged.
`provider-check` with a Docker-linked profile runs inside that profile's existing
Compose service with `-T`, the original cwd/model/timeout and exact stdout/exit
propagation; container profiles have no `DockerDirectory` and cannot recurse, and
explicit native profiles keep the host path. The picker uses a true `x/term` TTY
check, so `/dev/null` and pipes fail fast instead of hanging.
`pipelines harness setup opencode|pi --login --default` runs a styled onboarding
wizard (bold title, verified Docker harness versions) and selects separate
harness and new-pipeline models using type-to-filter fuzzy pickers, not numbered
prompts. Each picker itself shows its numbered step with the title and purpose
(no duplicate numbered prose is printed outside it); the interactive harness
model is `Step 1 of 2` and the new-pipeline model is `Step 2 of 2`, matching
fresh Docker setup. Typing filters, arrow keys or Tab navigate, Enter confirms,
and Esc cancels. The saved value is preselected and marked `(current)`; the window
follows the active row on narrow terminals and the heading, selected row and
no-match state stay within the real terminal height.
Automation: `--model PROVIDER/MODEL --pipeline-model PROVIDER/MODEL`.
`harness default [opencode|pi]` switches defaults; `harness list` prints settings.
Setup reads catalogs/login state without inference. Changing defaults never
rewrites published definitions or retained drafts. Canceling or failing either
picker leaves saved preferences byte-identical. Non-terminal automation with a
missing model fails clearly instead of starting a picker.
`./install --opencode` / `./install --pi` reopen login and selection. With an
existing Docker setup, they configure inside its container and link the host
launcher without restarting/deploying services. They resolve and verify the current
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, resolve the selected tag's immutable
GHCR `sha256` digest, and require a rebuild only when the verified release image
identity no longer matches. A full install always invokes the Docker build for a
dirty source (relying on layer caching); a model/login-only reconfiguration does
not rebuild. Setup writes its generated release receipt to the machine-local root
file `.pipelines-releases.json` (with atomic `.pipelines-releases-*` temporary
files); both are git-ignored, so a fresh clean checkout stays clean and reinstall
still reuses the verified release/image identity. The actual built image's labels
stay authoritative and a dirty source still rebuilds. If discovery, digest
resolution or completeness cannot be established they stop with an error (keeping
the last verified Dockerfile fallback pins); they never guess, fall back to a host
runtime or install a stale pin.
Without Docker setup, these commands stop and require `./install`. Container/host
credentials and accounts remain independent and are reused on reinstall/reconfigure.
Docker is the only supported runtime installation: run `./install`, with no mode flag.
Fresh setup accepts `./install --harness pi` to skip OpenCode
login. Existing setup can configure either harness independently. Pi setup does
not run a generation check; `provider-check --harness pi --model PROVIDER/MODEL`
is a separate confirmed, potentially chargeable check.
Profiles live in XDG config home's `pipelines/harnesses.json`, store preferences
only, and preserve unrelated configuration. Harness CLI setup/default commands
always configure the local execution user, not a remote `--url` server.
OpenCode interactive launch uses
`mini --model`: verified V2 full CLI lacks a model flag. Pi uses its CLI with the
packaged skill explicitly loaded. Pi has no standalone `auth login` command
(verified `pi auth --help`: only credential check/print): setup prints a
title-plus-three-lines Pi sign-in handoff and opens a fresh, no-context,
extension-free, no-prompt-templates, no-tools session with Pi's documented
`--tui-mode regular` flag, so the header and handoff stay visible above Pi's
interface at 80x30 instead of the default fullscreen clear. The user types
`/login`, chooses an authentication method ("Sign in with an API key" for
provider API credentials; account and Radius remain the user's choice), finishes
provider sign-in, then exits with `ctrl+c`/`ctrl+d` to return to Pipelines model
configuration. Existing sign-ins are reused by exiting when no new sign-in is
needed; completing a sign-in can update the credentials stored in the Docker
volume. No coding/task prompt or scripted keystrokes are injected.
OpenCode V2 model stages settle long sessions by polling `GET /api/session/active`
about once per second under the stage context, instead of the `.../wait` request
whose CLI-side request timeout failed long stages after roughly six minutes
(HTTP 499, dated 2026-10-10). V1 native settlement is unchanged. Final results
and debug session evidence use the same single bounded latest-assistant readback
(`order=desc&limit=1&type=assistant`), so a small final result is visible behind
large prior tool content; retained transcripts over 32 KiB are stored as valid
bounded preview envelopes that preserve stage limits and diagnostics, and exact
outputs remain authoritative. Pi evidence is JSONL and is not parsed as one JSON
object. Short-lived context-controlled CLI calls (`--help` detection, API calls
and the native export fallback) share one finite inherited-pipe drain grace
(`os/exec.Cmd.WaitDelay` ~250ms) so a canceled context or a descendant that still
holds stdout/stderr cannot block for the child's natural lifetime; the
`context.Canceled`/`DeadlineExceeded` and `exec.ErrWaitDelay` identities are
preserved and partial stdout after the grace is never accepted as success.
Stages set `harness=pi` or `harness=opencode` in configs; omission preserves
historical OpenCode behavior. Pi must be configured on the execution server.
The RPC adapter starts new retained sessions per visit with explicit tools and
a Pipelines permission extension. Ambient extensions, skills, context files,
prompt templates, automatic retries/compaction are disabled. Tool gates are not
an OS sandbox: approved shell can have broad side effects. Usage accumulates
across attempts/visits; missing required accounting fails closed. Strict envelope
validation and bounded syntax-only repair never replay tools. A model-driven
repair, when needed, uses a separate deny-all session with retained ownership
and the same cumulative budget. Its output is checked locally for value changes.
Session/RPC audit lives in the execution user's cache under `pipelines/pi-sessions`.
Ownership persists before prompts. Cleanup waits for settlement; expired leases
request abort through the extension. Unconfirmed cleanup blocks continuation/retry.
2026-10-10 verification: `scripts/check-pi-rpc.py` checked installed Pi 0.87.1
readiness, metadata/config RPC and **idle** lease cleanup without inference.
Go RPC fixtures cover result/budget/missing-accounting/timeout/format-repair paths;
Node tests cover permission checks. `PIPELINES_PI_LOCAL=1 go test ./internal/stage
-run TestPiInstalledLocalIntegration` also exercised the **installed Pi** against
scripted loopback responses: actual allowed/denied writes, budget exhaustion,
and active-shell cancellation (including no delayed write after cleanup).
The installed-Pi loopback suite also covers isolated deny-all syntax repair with
retained ownership and cumulative usage. The compiled fuzzy picker passed PTY
selection/cancellation; installed Pi catalog discovery/configuration passed with
an unreachable local endpoint and no prompt.
This is integration evidence, not real-provider/model evidence. Active lease-expiry
recovery, web search delivery and fresh interactive Docker Pi setup remain
**not tested**. Pi catalogs exclude ambient provider extensions for parity with
audited stages; compatible custom endpoints can use Pi's private `models.json`.
An isolated built Docker image also passed non-root, network-disabled policy/RPC
readiness and idle lease cleanup, without credentials/mounts or inference.
Codex/Claude
adapters and AI-assisted server guidelines validation remain future work.
2026-10-11 source-level coverage (source-level regressions; the separate dated
2026-10-11 final install is live evidence): the
shared Docker-aware CLI prefix, exact-match client transport rewriting,
Docker-linked `provider-check` dispatch and the `x/term` TTY check have
source-level regression tests (`internal/harness`, `internal/client`,
`internal/cli`). The prefix tests cover the remote-DNS negative
(`127.remote.example` stays unmapped with no probe), IPv4/IPv6/`localhost`
positives, complete `host:port` binding matching (a different service on the same
port, or a family mismatch, does not match), malformed/empty output failing
clearly, multiple bindings under a single probe, and loopback `wss` rejection.
Terminal Pick regression tests use a short deadline so a TTY regression fails
fast rather than hanging. Docker dispatch tests assert `--json` is passed only in
JSON mode while plain text stays readable. Python fixtures cover arbitrary-digit
OpenCode patches (a parsed `2.0.260` is still rejected against an expected
`2.0.26` by exact equality; 260/100 are illustrative valid/future examples, not
verified releases) and reject both raw and canonical reserved homes. Real
in-container `provider-check`/ping confirmation, a compiled PTY run and a real
Docker reconfigure remain **not tested** in this change. These source-level
regressions are not a claim about the deployed image; the separate dated 2026-10-11
FINAL INSTALLED verification recorded that the runtime was actually installed and
used (OpenCode 2.0.26 / Pi 1.1.0 / Node 24.18.1, image
`sha256:1810ab50f3ea3991e7f3548c79250e65a114bb1821eac52efd872b91cf7c3136`, with
both real stages executed in run17 and passed in Root's full host race/vet runs).
Active lease-expiry recovery, web search delivery and fresh interactive Docker Pi
sign-in remain **not tested**.
+70 -3
View File
@@ -26,6 +26,23 @@ parallel/distributed task engine or a guarantee that model reports are correct.
- Services are native or Docker-based. With an existing Docker installation do not
start a competing native server. Server APIs are unauthenticated: trusted networks
only; never recommend public exposure. Tool scope is not a universal OS sandbox.
- Docker setup resolves the current 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, resolves the
selected tag's immutable GHCR `sha256` digest, builds `FROM` that digest, and
verifies the built image reports exactly those executable versions plus a
Node-compatible Pi engine.
It fails closed, keeping the last verified Dockerfile fallback pins, when discovery,
digest resolution, completeness, build or compatibility cannot be established: never
a hardcoded fallback, never a silent stale-pin substitution. 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.
`./install --opencode|--pi` reconfigures inside the existing container and
refuses an image that does not match; it does not rebuild or restart services (an
explicit ordinary `./install` does when the user asks).
## Where data lives
@@ -44,16 +61,52 @@ Use the authoritative `CLI_PREFIX` from the prompt:
- `CLI_PREFIX runs --json`: run history (optional `--pipeline NAME` scope).
- `CLI_PREFIX inspect RUN_ID --json`: selected run, visits and retained evidence.
Exact stage outputs are authoritative; a transcript over the 32 KiB retained
bound is a valid, credential-redacted preview envelope (with preserved stage
limits, failure/format diagnostics and the retained session pointer), not the
complete tool history.
- `CLI_PREFIX run ... --json --wait --wait-timeout DURATION`: `--wait` polls until
terminal and `--wait-timeout` bounds only the client wait after admission,
independent of per-request `--timeout`. A reached wait limit leaves the admitted run
active; inspect it read-only with `inspect RUN_ID --json`, or keep waiting by
rerunning `--wait` and reusing the original `--request-key`. Never start a duplicate
run, and never expect an automatic replay or cancel of admitted work.
- `CLI_PREFIX show NAME --version N --json`: exact pinned definition, not whichever
version happens to be latest now.
- `CLI_PREFIX status --json`: connection details; candidate addresses are not proof
they are reachable from another device.
- `CLI_PREFIX ping --json`: `pong.build.version`, `build.commit` (full Git revision)
and `build.dirty` identify the compiled **server**, not the client or its runtime
checkout. A dirty build includes `-dirty`; `commit: "unknown"` or `dirty: null`
means metadata was unavailable. Older servers omit `build`. Never infer a deployed
fix from source/skill contents. Native Go builds use embedded VCS metadata;
Docker setup stamps build arguments. For an explicitly requested Docker rebuild,
`python3 scripts/build_metadata.py` resolves the current releases and stamps
`docker compose build` from the checkout with the immutable digest; it does not
restart/deploy. A plain `docker compose build` without that resolved digest cannot
build the image.
Plain `ping` also displays server identity; `CLI_PREFIX version --json` (alias
`--version`) identifies the client offline. Include both in sanitized bug reports.
Two dirty builds at the same commit can differ. Docker setup verifies its started
server identity against the build arguments before declaring setup complete.
Pipelines is a single-user first-version preview for supervised work, not a
multi-user service. Recommend a disposable repository for initial trials. Tool
permissions and same-path home mounts do not isolate valuable files. Never collect
raw credential/session databases or publish private inspect output as diagnostics.
In a source checkout, `python3 scripts/smoke-first-install.py` checks a disposable
source-built test binaries, draft/publication/transfer and restart persistence without
inference, notifications or deployment. It is not a live-provider or phone test.
That is a developer test fixture, not a native installation option. End-user
installation is Docker-only through `./install`; no `--docker` flag is needed.
In the TUI, Home advertises `/` search and `:` commands. Run Tab switches only
Details ↔ Graph. `n/p` select recorded visits, including repeated stages; `d`
focuses/toggles file changes, `D`/`:debug` opens fresh investigation, and `P` opens
the pinned pipeline version. `:quit` exits; `q` does not. Results are retained reports,
not independently confirmed achievements. Distinguish partial output from full success.
focuses/toggles file changes, `a` selects the active/latest retained
configured-harness agent session's bounded, redacted tool evidence, `D`/`:debug`
opens fresh investigation, and `P` opens the pinned pipeline version. `:quit`
exits; `q` does not. Results are retained reports, not independently confirmed
achievements. Distinguish partial output from full success.
## Retained stage file changes
@@ -88,7 +141,21 @@ file diffs: current capture is server-owned. Do not promise full files/rollback.
Debug opens a new conversation with retained failure context, exact definition and
session evidence; it does not resume implementation or grant permission to edit.
Inspect first, identify evidence-supported causes, and say what remains unknown.
Server-side session evidence is the latest bounded, credential-redacted evidence
for up to the 3 most recent session-bearing steps; OpenCode V2 selects the latest
assistant message with the same bounded readback as the final result, so a small
final result is visible behind large prior tool content. Inspect the retained
session itself when a preview is bounded or omitted; never assume a complete tool
history from a preview.
Retry is allowed for a failed run after cleanup stops: a fresh run/session starts
at entry with the original input/directory/pinned version/edit scope. Previous
side effects remain and can happen again. Never describe retry or cancellation as
rollback, or resume/replay admitted tool work just to recover formatting.
Retained model-stage failures carry a fixed sanitized category. `FINAL RESULT
VALIDATION` names the exact duplicate-field/syntax detail and byte offset for a
strictly invalid final result; `HARNESS TRANSPORT` covers request, active-session
poll and final-readback failures. A validation failure never re-prompts the
admitted tool-using stage: completed edits and tool side effects are retained and
not undone, so a full retry repeats work. Neither category exposes provider/model
bodies or credentials.
@@ -32,16 +32,319 @@ these are **not provider-side hard caps or a guaranteed bill ceiling**. Reported
USD may validly be zero; do not fabricate prices/accounting from output length.
A live V2 trial found `/generate` returned text while its retained session had no
messages and zero counters. Current source uses tracked `/prompt` → `/wait` →
message readback for **budgeted V2 text-only calls, with all tools denied**.
Completed token-budgeted responses reporting zero tokens fail closed. No new
definition flags or agent tools are required for this fix. Unbudgeted tool-free
V2 generation can still have empty backend message history; pipeline inputs,
results and command audit remain retained. Native V1 uses its existing path.
messages and zero counters. Current source uses tracked `/prompt` → bounded
active-session polling → message readback for **budgeted V2 text-only calls, with
all tools denied**. Completed token-budgeted responses reporting zero tokens fail
closed. No new definition flags or agent tools are required for this fix.
Unbudgeted tool-free V2 generation can still have empty backend message history;
pipeline inputs, results and command audit remain retained. An unbudgeted V2
audited agent stage makes exactly one extra bounded final session-aggregate read
to record any reported USD/token usage best-effort: missing or invalid usage stays
unknown and never turns a valid run into a failure, cumulative sessions/retries
are keyed per session so they cannot double count, and totals are never inferred
from final-assistant-only or native-partial data. Budgeted settlement and native
V1 enforcement are unchanged. Native V1 uses its existing path.
This describes current source behavior, not a guarantee that a user's installed
server includes the fix. An updated skill/client is not deployment evidence; never
rebuild/restart services or log into providers without specific authorization.
The V2 `.../experimental/session/{id}/wait` request is **no longer used**: a dated
Docker log shows it timing out at the CLI's own request timeout after about six
minutes (run started 2026-10-10T23:07:16.547Z, `TimeoutError` logged at
2026-10-10T23:13:17.262Z, server `http.status=499`), which aborted a long
implementation stage. Instead current source polls `GET /api/session/active`
about once per second with a context-aware delay and no busy loop, until the
admitted session is absent (inactive). Missing/null/non-object `data`, or a state
other than the documented `running` type, fails closed and is never treated as
inactive. This is **mocked regression coverage** in `internal/stage` (fake CLI),
not live-provider evidence; V1 native settlement is unchanged.
Current source reads the V2 final result with a single bounded descending
final-assistant readback (`order=desc&limit=1&type=assistant`) after the settled
poll, for both audited agent stages and budgeted V2 text-only calls, so large
retained history (including prior tool-read contents) is no longer fetched just
to select the completed result. A truncated/incomplete readback, an empty data
list, or a latest message that is neither completed `stop` nor a completed
structured tool-call fails closed with a sanitized diagnostic that omits
provider content; retained audit previews are **not** executable final results.
Session/debug evidence now reuses the same single latest-assistant readback
instead of a recent-20 all-message fetch, and returns each payload as a labelled
bounded, credential-redacted envelope with explicit preview/truncation/missing
diagnostics; a small final assistant result is therefore selected even when large
prior tool content exists. Pi evidence remains documented JSONL and is never
parsed as one JSON object. This describes current source behavior, not a guarantee
that a user's installed server includes the fix. An updated skill/client is not
deployment evidence; never rebuild/restart services or log into providers without
specific authorization.
Retained model-stage failures now carry a fixed sanitized category. A strictly
invalid final result (a duplicate nested field, or malformed/ambiguous JSON with a
byte offset) is labeled `FINAL RESULT VALIDATION`; request, V2 active-session poll
and final-readback failures are labeled `HARNESS TRANSPORT`. A validation failure
preserves the admitted session, transcript and evidence and performs no second tool
execution. Confirmed ordinary-endpoint failures on 2026-10-11: an all-history
readback of exactly 262144 bytes of incomplete JSON (`invalid agent messages`), a
reviewer result with a duplicate nested `performance_review` field, and an
onboarding visual-review result with `invalid character 'z' after object key:value
pair at byte 3968` where unsafe lossless repair was rejected. These are **mocked
`internal/stage` fixtures**: executable source-level evidence, not live-provider
evidence and not a deployment. OpenCode V2 prose `output_contract` does not enforce
structured output; V2 results are validated locally and no unsupported V2 format
field is sent. A review-only fresh execution is a future recovery idea, **not
implemented**. Onboarding UI visual approval remains unresolved and must not be
reported complete.
## Dated source-level coverage: 2026-10-11
Source-level/mocked regression coverage (not live-provider evidence):
`resolve-releases` now uses a single bounded
`GET .../git/matching-refs/tags/v2` response that the GitHub REST docs describe as
complete with no pagination; offline fixtures cover a 100+ ref array,
`MAX_REFS`/`MAX_BODY` caps, ignored prerelease/build tags, malformed refs and a
missing newest-tag digest failing closed with no older fallback, with no
`tags/list` cross-check. Picker tests cover blink/index preservation,
ANSI-readable selection without a colliding background, and
40x16/80x24/120x36 height budgets. The compiled picker PTY check (opt-in via
`PIPELINES_HARNESS_PTY_DIR`) waits through blink intervals and asserts exact
saved/arrow-scrolled models. `setup-docker.py` accepts the actual
`opencode v2.0.26` probe token and compares source identity only on a full
install; model/login-only reconfiguration compares the verified release image
identity. Python fixtures bind temporary HOME directories so the suite passes
under the container default `/home/pipelines` without weakening mount guards.
The Docker authoring transport is also covered at source level: the shared
prefix picks `/usr/local/bin/pipelines` for a Docker-linked profile. Loopback is
recognized only via `net.ParseIP(...).IsLoopback()` and an exact case-insensitive
`localhost`, so a remote DNS name such as `127.remote.example` stays remote with
no probe. A single bounded `docker compose port` probe parses complete
`host:port` bindings, and scoped source/target aliases are embedded only when a
binding covers the requested loopback address and port; malformed or non-matching
bindings and a loopback `wss` endpoint fail closed, and `client.Dial` rewrites
only an exact source match. `provider-check` dispatches through a Docker-linked
profile's existing service with `-T`, the original cwd/model/timeout, exact
stdout/exit propagation and `--json` passed only in JSON mode (fixture tests, no
real provider), while explicit native profiles keep the host generator. The
picker uses a true `x/term` TTY check so `/dev/null` and pipes fail fast, with a
short context deadline so a regression fails rather than hangs. Real Docker
rebuild/reconfigure against live registries, a real
40x16/80x24/120x36 terminal capture, and real model inference remain **not tested**
in this change.
### 2026-10-11 Pi sign-in handoff (source + Root PTY observation)
Root separately exercised current-source `pipelines harness setup pi --login`
under a real Docker PTY with copied harness preferences. Root observed that
Pi 1.1.0 defaults to fullscreen and clears the Pipelines login instructions, so
the user sees a coding interface without the `/login` guidance, and that
`/login` first shows "Select authentication method" (account / API key / Radius)
rather than a provider picker. The same handler run with a temporary executable
wrapper passing `pi --tui-mode regular` retained the Pipelines header and
instructions above Pi's interface. Installed `pi --help` documents the supported
`--tui-mode regular` flag and the fullscreen default; `pi auth --help` confirms
there is no standalone login (only print/check, never run). These are source/root
observations with copied preferences: **no provider was selected, no key was
entered and no inference occurred**, and this source is **not deployed** and is
not live-provider evidence. A first reviewer capture at 80x30 found the longer
handoff plus Pi's own banner scrolled the Pipelines header off the top, so the
copy was shortened to a title plus three short lines (existing-credential reuse
folded into the `/login` line, with the account/API key/Radius method choice and
`ctrl+c`/`ctrl+d` exit keys kept) and the redundant trailing blank removed.
Independent PTY re-capture at 80x30/100x36 after this shortening is **not
tested** in this change. The matching exact login-argv and copy assertions are
covered by fixture tests in `internal/cli`/`internal/harness`.
### 2026-10-11 server CLI fixture isolation (source-level + Root-reported run)
Root-reported runtime evidence supplied for this change (not re-executed by the
authoring stages): the deterministic seeded-profile regression
`go test ./tmp/preview-verification -run TestServerCLIFixtureDoesNotInheritUserDockerProfile -count=1`
seeds a synthetic Docker-linked harness profile in a child
`go test ./internal/server -run '^TestCLIHeadlessRunInspectionCancellationAndRPC$'`.
It previously failed because the child inherited the caller's real
`PIPELINES_HARNESS_CONFIG`, so the CLI `debug` prefix failed closed
("refusing to redirect") against the test's ephemeral httptest endpoint. Root's
four independent preview tests for the bounded transcript helpers pass; Root's
full host race run produced no race warning and only this fixture failure, and
`go vet ./...` passed. Current source therefore isolates the server CLI fixture
with the same missing-temp-file
`t.Setenv("PIPELINES_HARNESS_CONFIG", filepath.Join(t.TempDir(), "harnesses.json"))`
pattern already used by `internal/cli`'s setup, so the host executable stays
authoritative and no Docker probe runs for an ephemeral test endpoint. The
production fail-closed redirect guard in `internal/harness/prefix.go` and its
`refusing to redirect` / loopback-wss regressions are unchanged; the failing
verification was fixed rather than removed.
This is a current-source and Root-reported observation. At the time of that
observation, independent re-execution of the full `go build`/`go vet`/`go test`
matrix (including Docker-only race results) and the final installed-host Docker
verification were **pending**; they are now recorded in the 2026-10-11 FINAL
INSTALLED section below, so this phase-specific wording is superseded by that dated
install. The packaged reference describes source behavior; a source fix or updated
skill is not deployment evidence.
### 2026-10-11 retained run11 reviewer re-capture (source-level, not a final install)
Independently reading the retained run11 verification at
`tmp/maintenance-run11-verification.json` records the source-level review
sequence: an earlier reviewer PTY capture rejected the longer handoff because at
80x30 it scrolled the Pipelines header off the top; the implementer then
shortened `AuthHandoff` to a title plus three short lines; and the re-run
`reviewer` and `ui_reviewer` stages approved from real current-source Pipelines
PTY captures at 80x30 and 100x36 that showed the header and handoff visible above
installed Pi 1.1.0's regular interface. A labelled controlled fixture that
stripped `--tui-mode regular` reproduced the pre-fix fullscreen clear, and the
review stages report no provider selected, no key entered and no inference. This
is source-level reviewer evidence, read from retained output; it was not a
deployed/installed state at that time, and the final full Docker install
verification was then **pending** — it is now recorded in the 2026-10-11 FINAL
INSTALLED section below, so this phase-specific wording is superseded by that dated
install.
Root-reported actual runs (source-level observations supplied by Root for this
change and not re-verified here): run7 showed both configured providers' exact
handoff markers; runs6/9/10 exercised live maintenance with final-assistant
polling/readback succeeding. These are Root observations, not mocked-regression
coverage and not a completed installation; no final deployed/installed state is
claimed.
### 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): bounded 32 KiB
(`transcriptBound = 32<<10`) redacted transcript previews produce a valid JSON
envelope with redaction applied before truncation and a rune-safe 8 KiB preview;
session/debug evidence is scoped `latest_bounded_evidence` with the single
bounded latest-assistant readback and at most the 3 most recent session-bearing
steps; an unbudgeted V2 audited agent stage records reported usage best-effort
through exactly one 2s-bounded final session-aggregate read, leaving
missing/invalid usage unknown; and the isolated server CLI fixture uses the
missing-temp-file `PIPELINES_HARNESS_CONFIG` pattern while the production
fail-closed redirect guard in `internal/harness/prefix.go` is unchanged. Pi JSONL
is never parsed as one JSON object; 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 ./...` and `go vet ./...`; after
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, not
re-executed by the authoring stages.
3. **Deployed old image**: the running Docker image predates these source changes
and does not include them.
4. **Final install (completed 2026-10-11)**: the final install and installed
authoring/provider verification were **pending** when this separation was
written and are now recorded in the 2026-10-11 FINAL INSTALLED section below; an
updated skill/client or source checkout is still not deployment evidence on its
own.
Docker race limitation (confirmed): the Docker runtime is built with
`CGO_ENABLED=0` 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` and rely on independently executed host
`-race` runs. 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**.
This is an environment/interruption observation only: no general cancellation fix
is inferred and process termination is unchanged. Docker startup recovery already
sets running steps to `interrupted` with `agent_active=0`.
### 2026-10-11 short-lived CLI inherited-pipe cancellation (current source)
Current source (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 the `internal/stage`
`OpenCodeClient.call()` API/agent path (including `Interrupt`), `opencode.Detect()`
`--help` 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 holding the inherited stdout/stderr pipes, then
closes them and reports `exec.ErrWaitDelay`; it does not terminate or confirm
cleanup of descendants.
`context.Canceled`/`context.DeadlineExceeded` identities, `exec.ErrWaitDelay` on
the sanitized errors, the ≤64 KiB request / ≤1 MiB response / 8 KiB stderr bounds,
`boundedBuffer`/`boundedOutput` drain-with-overflow behavior, redaction, strict
result validation and cleanup-unconfirmed active ownership (`ErrStageCleanup`, no
replay) are unchanged; no new module dependency is added and a parent that exits
successfully while a descendant still holds partial stdout is never treated as
success.
Dated synthetic reproduction (`tmp/interrupt-verification`, synthetic
real-subprocess diagnostics, **not provider evidence**): with Root waiting for the
descendant itself to start before cancelling public
`OpenCodeClient{Backend:"v2"}.Interrupt`, two Docker/Linux returns took
3996/3995ms despite `context.Canceled` (`descendant-started.jsonl`); the stronger
host reproduction took 4003/4000ms (`reproduction.log`). Added source-level
regressions use real `os/exec` fixtures with start-marker barriers, bounded
watchdogs and naturally terminating children for cancel-after-descendant,
deadline identity, descendant-held pipes → `ErrWaitDelay`, ordinary
output/exit/redaction, failed-interrupt ownership/no replay, plus `Detect`/export
wait-delay and cancellation cases. This is **current source, not deployed**:
descendant termination, confirmed remote interruption and any run13 Docker disk
sleep fix are **not claimed**, and Docker race remains unavailable (no C
compiler).
### 2026-10-11 FINAL INSTALLED verification (friend-ready preview)
This is the dated receipt for the installed runtime, recorded by Root from
`tmp/friend-final-verification/summary.json`; it supersedes the earlier
"pending final install" statements above, which stay as phase-specific history.
A normal interactive `./install --model opencode-go/deepseek-v4.1-flash
--harness-model opencode-go/deepseek-v4.1-flash` exited **0**, resolving the current
releases live and building fresh dirty source into actual image
`sha256:1810ab50f3ea3991e7f3548c79250e65a114bb1821eac52efd872b91cf7c3136`
(OpenCode 2.0.26 / Pi 1.1.0 / Node 24.18.1) with real tool-free provider
validation, ntfy authenticated publish, server + host health, home/workspace entry,
preserved authoritative endpoint and `ok` pre-install database/home backup
integrity. Post-install preservation all passed (original definitions 1–4, history
1–16, host/container default Pi and both models/profiles, logical endpoint,
service URLs/timezone/ports/models, Pi credential hash, OpenCode connected accounts,
ntfy token); neither original-repo commit/push nor credential/data cleanup ran.
Installed host-CLI authoring with **both** Docker harnesses (separate retained
drafts, each changing only the worker prompt) performed real `ping` → `pong` and
`validate` → `validated` through the generated Linux `/usr/local/bin/pipelines` and
scoped transport aliases preserving the logical `8081` endpoint and draft metadata,
independently inspected from native OpenCode tool outputs and retained Pi JSONL
`toolResults`, with no draft submit/run/publication. Docker-proxy submit on
verification-only definition 5 published v2, a second stale v1 draft was rejected as
conflict, and **Run17** succeeded in 7 seconds with the exact
`pipelines-docker-verified` markers in OpenCode then Pi, both inactive and exactly
one completed marker read verified from retained native history (not the
latest-assistant preview); best-effort unbudgeted usage was OpenCode 4011
tokens/$0.00029769599999999996 and Pi 1071 tokens/$0.000142002, and
`/api/session/active` was empty after exit. Installed-UI captures
(`installed-pi-*`, `pi-signin-*`, `installed-pi-models-*`) cover the actual run17
80x30/120x36 neutral-Pi/green-both-stage renders, the Pi auth handoff/method menu
viewed/canceled/exit0 with no sign-in, and the model wizard using copied
preferences only while production preferences stayed preserved. Root's independent
checks passed: full host `go test -race -count=1 ./...` and `go vet ./...`,
Python 80 tests (1 optional PTY skipped), Node policy, isolated developer lifecycle
fixture (no inference/deploy) and author package tests; earlier independent
reviewers ran ordinary Docker build/vet/tests and focused subprocess regressions
(no Docker race, no GCC search, no global `find`). **UNVERIFIED** here: 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 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 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 them.
### 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 other files are
retained. A new `scripts/test_build_metadata.py` case is a controlled, isolated Git
fixture using the repository's actual `.gitignore`: a clean tracked source plus a
representative generated receipt/`.pipelines-releases-*` temporary file leave `git
status --porcelain` empty and `build_metadata.docker_args` at
`PIPELINES_DIRTY=false` with no `-dirty` version; editing the tracked source then
makes the status non-empty and `docker_args` report `PIPELINES_DIRTY=true` with a
`-dirty` version. This is **offline source-level regression coverage**, not the
recorded actual new-account install/provider login above and not live-provider or
deployment evidence; this docs-and-ignore change has no rendered UI.
## Dated live reference validation: 2026-10-10
@@ -69,6 +372,24 @@ Real ntfy authentication/storage, phone reception, provider outages/timeouts,
long-stream interruption and promptness of cleanup were **not tested** by this trial.
The trial ran rebuilt test binaries; it did not deploy the fix to the ordinary server.
## Dated live reference validation: 2026-10-11 (run7)
One existing real run7 (2026-10-11) is the retained live evidence dated for this
change: it executed both configured harnesses, OpenCode 2.0.26 and Pi 1.1.0, with
`opencode-go/deepseek-v4.1-flash` stages on the Docker server, and both steps
succeeded (6s; the retained Pi evidence panel reports 1054/10000 tokens). The
captures are retained at `tmp/friend-ui-verification/source-pi-80-*` and
`source-pi-120-*`, and a current-source TUI inspection of that run recorded actual
80x30 and 120x36 renderings, including the run graph and the bounded evidence
panel.
This is a single real run, **not** a fresh full reference suite. Other providers,
real outages/long-stream interruption, fresh OAuth and phone delivery remain
**not tested**; the new-source installer and installed-authoring verification were
separately completed by the dated 2026-10-11 FINAL INSTALLED section above. The
[2026-10-10 OpenCode v2.0.20 trial](#dated-live-reference-validation-2026-10-10)
above remains dated history.
## Reference suite when explicitly requested
The source checkout's `TestReferenceWorkflowsLive` uses six model stage attempts