Files
pipelines/internal/author/skill/references/operations.md
T
alan c42a19f7d3 Improve workflow UI, retain stage diffs, and add portable pipeline transfers
Make OpenCode authoring responsive and expand the managed skill references. Add conflict-aware import/export, real-provider reference workflows, and tracked V2 generation for reliable budget accounting.
2026-10-10 20:55:42 +01:00

95 lines
5.8 KiB
Markdown

# System, storage and run evidence
Pipelines turns a reusable process into sequential stages with explicit handoffs,
outcome routing and retained evidence. A Go CLI/TUI connects to an execution server;
the server owns execution and SQLite history, OpenCode owns model/tool sessions,
and optional ntfy delivery supplies notifications. It is technology-neutral, not a
parallel/distributed task engine or a guarantee that model reports are correct.
## Lifecycle and location
- Drafts are editable Markdown plus JSON metadata. Publishing validates and creates
immutable versions; drafts remain retained. Keep context create-only/base-version
guards. Five optional generic starters are task, summary, review, research and
three-stage; a fresh database starts empty. Templates can be created directly with
an editable prefilled name or customized first.
- A run pins its exact definition version, initial input and resolved directory.
The client invocation directory is the default, but files/tools execute on the
server. Docker needs that directory mounted at the same absolute path. A remote
client does not upload its repository or make host credentials available remotely.
- Host and Docker OpenCode credentials are separate. Preserve setup-selected model
inheritance; do not select a provider just because its ID appears in an example.
- Runtime caps are 30 stage steps and five visits to a stage. There are no parallel
branches or built-in human approval stages. Optional worktrees, full backup/restore,
automatic database sync and independent verifier stage types are future ideas,
not existing capabilities. Do not invent them in definitions.
- 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.
## Where data lives
SQLite retains pipelines/immutable versions, runs, recorded stage visits,
inputs/outputs, status/errors, audit transcripts, session ownership/references,
retry links, schedules/state, notification receipts and file changes. Not everything
is in that database: drafts/settings are client files; complete OpenCode sessions
and credentials use OpenCode storage; repository artifacts are files; ntfy has its
own storage. A pipeline ZIP is not a full backup of these components.
Never merge or sync live SQLite files using generic file synchronization. Do not
delete databases, sessions, volumes or credentials to repair a workflow.
## Inspect results first
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.
- `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.
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.
## Retained stage file changes
Each newly executed visit compares a bounded, read-only workspace snapshot just
before execution with one after execution/cleanup. SQLite retains unified patches
and metadata in `steps[].file_changes`; snapshots themselves are transient memory.
The stage's File changes section highlights added/removed lines and hunk headers.
- The baseline is stage-start content, **not HEAD/index**. Pre-existing edits and
earlier stages' changes are not attributed to this visit. Added/deleted/modified
files, modes and binary-change metadata are recorded; renames are delete/add.
- Git scope is tracked and nonignored untracked files within the run directory;
outside Git, regular workspace files. Symlinks/special files, Git internals,
node_modules and common environment/key/credential/database paths are excluded.
This is path-based protection, **not secret-content scanning**. Patches may still
contain sensitive text; never publish them without approval.
- Limits: 10,000 entries, 1 MiB/file, 32 MiB/snapshot, five-second snapshot context,
5,000 combined text lines, 64 KiB/patch, 128 KiB serialized file evidence/visit.
Missing/skipped/truncated captures must be described as partial/unavailable.
- Failed/canceled stages retain changes when execution returns; unconfirmed agent
cleanup is partial. Crashes may have no after-capture. Historical visits say
not recorded—**never infer no edits from absent evidence**.
- These are observed workspace changes, not exclusive authorship. Concurrent edits,
changes outside scope, ignored new files and changes reverted before capture can
be absent or mixed in. Capture failure does not change the declared run verdict.
Do not add model output fields, new stages or extra model calls merely to obtain
file diffs: current capture is server-owned. Do not promise full files/rollback.
## Debug and retry
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.
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.