Install shared authoring skill and add retained drafts browser

This commit is contained in:
2026-10-09 01:33:59 +01:00
parent 94a76f9c5c
commit 998b0941d3
28 changed files with 787 additions and 520 deletions
+24 -11
View File
@@ -2,16 +2,16 @@
`pipelines help` lists commands; `pipelines help edit` (or `edit --help`) shows
command-specific flags and examples. Installed commands work from any directory.
The installed command is a compiled Go binary; only service lifecycle management
delegates to the private Python helper. The binary discovers its manifest through
the system command symlink. A separately `go install ./cmd/pipelines`-installed
binary can select a managed installation using `PIPELINES_PREFIX`.
The installed command is a compiled Go binary. Optional autostart uses the OS user
service manager directly. Legacy Python-managed installations require an explicit
`PIPELINES_PREFIX`; no configuration is inferred from the executable's location.
For source development, use `go run ./cmd/pipelines help`; start the native server
separately. Set `PIPELINES_URL` or pass `--url` to select another server.
## Draft-first OpenCode workflow
```sh
pipelines new # OpenCode 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" "Add a review step"
@@ -19,19 +19,32 @@ pipelines new "release notes" "Summarize changes and notify my phone"
pipelines new "weekly digest" --template scheduled-summary
```
`new` asks for a name when omitted. `edit` accepts an exact name or ID, with names
taking precedence over numeric IDs. Both copy a definition into a private draft
and launch the host OpenCode interface. An isolated authoring workspace contains
the bundled `pipelines` skill and format reference. The CLI creates an OpenCode
session and **explicitly activates the skill with `resume=false` before opening
the interface**. It does not modify shared OpenCode configuration or copy login
credentials. Your OpenCode permissions remain in effect; auto-approval is not used.
`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
`go install` users run `pipelines skill install` separately. Shared login/config
and user-modified skills are preserved; OpenCode 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
security sandbox: an agent with CLI/shell access can submit when explicitly asked.
Every submission, including agent-issued `submit`/`rpc`, still uses server validation.
## Drafts in the TUI
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
the existing draft, `v` for server validation, and `s` for submission confirmation.
`r` refreshes the list. Submission preserves create-only/version guards and rejects
drafts belonging to another server. An unnamed draft must be named through OpenCode
or CLI `submit --name`. Draft selection/editor completion never publishes it.
New unnamed drafts open OpenCode so the skill can name them. For named drafts,
the default editor is OpenCode; explicit `VISUAL`/`EDITOR` overrides remain.
For agents or scripts that should not open a terminal:
```sh
+5 -4
View File
@@ -22,10 +22,11 @@ incompatibility rather than fix it.
service. The existing V2 adapter is retained rather than pretending APIs match.
- Crash ownership must include the backend and native service. Additive metadata
records those references without rewriting immutable definitions or histories.
- The skill name did not match its directory. It is now `pipelines`. Native
authoring preloads the skill/reference text without inference; V2 activates it.
- Ownership persistence failure and authoring `SESSION` write failure could leak
created sessions. Those failure paths now clean up only their owned sessions.
- The skill name did not match its directory. It is now `pipelines`. Installation
installs/updates the global skill; authoring references it directly instead of
preloading instructions or making preliminary session/API calls.
- Ownership persistence failure could leak created agent sessions. That failure
path cleans up its owned session. Authoring no longer pre-creates sessions.
## Deliberately removed from default installation
+14 -5
View File
@@ -6,20 +6,22 @@ model stages. Docker/ntfy is optional and is configured separately.
```sh
git clone https://git.a-wan.net/alan/pipelines.git
cd pipelines
go install ./cmd/...
# ./install.sh is a thin wrapper around the same command.
./install.sh
# Equivalent: go install ./cmd/... && pipelines skill install
```
This 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 without changing data or configuration.
Re-running installation updates the binaries and bundled OpenCode skill without
changing databases, login, or OpenCode configuration files.
For a private repository, use your normal Git credentials and `GOPRIVATE`:
```sh
GOPRIVATE=git.a-wan.net go install git.a-wan.net/alan/pipelines/cmd/...@latest
pipelines skill install
```
For a system-wide command, build as your normal user and install the three binaries
@@ -94,8 +96,15 @@ executable. No OpenCode version is required just to install binaries. At runtime
stage tool permissions. Native `shell` permissions map to OpenCode's `bash`.
- Audited native sessions record their backend and a private service reference
so recovery addresses the same service, rather than a new unrelated instance.
- `new`/`edit` preload authoring instructions before opening the normal interface.
Native preloading uses `noReply=true`; V2 uses explicit skill activation.
- `new`/`edit` open the normal interface directly with `@pipelines` and a draft
context-file reference. The skill handles questions and draft validation inside
OpenCode; no preliminary session/API calls or instruction preload are performed.
The global skill is installed in `$XDG_CONFIG_HOME/opencode/skills/pipelines`,
or the normal `~/.config/opencode/skills/pipelines` default. Only unchanged files
previously installed by Pipelines are updated. A user-managed/modified skill is
never overwritten; preserve or rename it before running `pipelines skill install`.
Installation does not require OpenCode itself. Uninstall retains the skill and drafts.
The bundled examples retain `opencode-go/deepseek-v4.1-flash`. Availability and
authentication for that model are runtime requirements, not installation checks.
+14 -1
View File
@@ -18,7 +18,8 @@ PIPELINES_TEST_OPENCODE_V1=/path/to/opencode \
The stable checks use isolated home/config/data/cache directories; they never
copy login credentials or invoke a model. They exercise session creation, explicit
model selection, stored scoped permissions, abort on the same owned service,
session deletion, and authoring instruction preload with `noReply=true`.
session deletion, and discovery of the installed global authoring skill. Authoring
now references that skill directly instead of preloading instructions.
Native generation/assistant completion parsing is regression-tested against a
controlled HTTP server. Full live inference, permission enforcement by real model
@@ -43,3 +44,15 @@ systemd installed. The native `systemd-analyze verify` regression passed for the
generated unit, including a directory containing spaces, quotes, and `%`/`$`.
This reproduced and fixed the invalid quoted `WorkingDirectory` setting. A
container syntax check does not prove live user-service startup or login restart.
Authoring regression tests exercise idempotent skill installation, preservation of
user modifications, one direct OpenCode launch with a short skill/context reference,
and an unnamed new draft without CLI questions. TUI integration checks browse a
CLI-style retained draft, validate through the server, require explicit submission
confirmation, preserve create-only guards, and reject a different server.
An isolated installed-binary PTY check also opened a CLI-created draft in the TUI,
reopened the same file through a mock OpenCode executable, and explicitly submitted
it while retaining the draft. Plain unnamed CLI creation invoked the mock exactly
once. Real model-driven authoring/questions and native skill loading during a
model turn remain **not tested**; global skill discovery was tested without inference.