Replace starters with four graded examples seeded into new databases

The template catalog is now Example 1-4: one stage, two stages (handoff),
feedback loop (runner-owned limits, retries, timeout) and human decision
(type=human approve/revise/abort with notify hooks). All read-only or leave
changes uncommitted; none commits, pushes or deploys.

A brand-new database (schema created by this Open) gets the examples once at
server start, bound to the configured default model and harness. A
server_settings marker records the decision, so removed examples never come
back and existing installs are marked without any pipeline being added or
rewritten.
This commit is contained in:
2026-11-03 19:35:47 +00:00
parent fa6c0864db
commit a48e4a5b6a
38 changed files with 711 additions and 929 deletions
+47 -66
View File
@@ -1,81 +1,62 @@
# Simple workflow templates
# Example pipelines
Five small general-purpose starters work with any project. Each has two focused
stages, runs only when requested, and returns plain Markdown.
Four small examples, read in order. Each adds one feature to the one before. They
work with any project and use the server's default model and harness.
| Template key | Workflow | Tools |
| --- | --- | --- |
| `task` | Small code change → independent read-only review | Worker: read/glob/grep/edit/shell; reviewer: read/glob/grep |
| `research` | Research → fact-check and cited report | Research: websearch/webfetch; report: webfetch |
| `summarize` | Summarize supplied documents → check against originals | Read/glob/grep only |
| `compare` | Compare options → check decision brief | Read/glob/grep only |
| `plan` | Draft plan/checklist → check dependencies and risks | Read/glob/grep only |
| Key | Pipeline | Stages | Teaches |
| --- | --- | --- | --- |
| `one-stage` | Example 1: one stage | review | A single read-only stage |
| `two-stages` | Example 2: two stages | draft → check | Handing one stage's output to the next |
| `feedback-loop` | Example 3: feedback loop | implement ⇄ review | A bounded loop (`limits`), `retries` and `timeout` |
| `human-decision` | Example 4: human decision | plan → decide → act | A `type=human` approve/revise/abort stage and `notify` hooks |
The code starter leaves changes **uncommitted**. It does not install dependencies,
push, merge, release or deploy. The other four starters do not change files.
Missing essential input or evidence routes to `blocked`, with an explanation,
rather than guessing or waiting at an unnecessary human stage.
- **one-stage** reviews the files or folder named in the run prompt. Read-only.
- **two-stages** drafts a short document from local files, then a second stage
checks it against the sources and the request. Read-only.
- **feedback-loop** makes a small change, then an independent review approves it
or rejects it back to `implement` with must-fix findings. The runner, not the
model, caps the loop with `{"max_visits":3,"on":["rejected"]}`: a third
rejection fails the run. Each stage sets its own `retries` and `timeout`.
Changes stay uncommitted.
- **human-decision** plans a change read-only, then waits for a person to choose
`approve` (carry it out), `revise` (send feedback back to the planner) or
`abort`. Decide in the app, the TUI or with `pipelines decide`. Its `notify`
blocks follow the terminal-path recipe: `plan` on failure, `decide` on
`waiting`, `act` on success and failure. Notifications need the phone
connection set up. Changes stay uncommitted.
Three existing keys remain available for compatibility:
No example installs dependencies, commits, pushes or deploys. Missing input
routes to `blocked` (or `rejected`) and fails the run with an explanation. Each
stage returns Markdown; only its `# outcome` section is interpreted (see
`docs/notes/stage-turns.md`).
| Template key | Workflow | Behavior |
| --- | --- | --- |
| `review` | One-stage content review | Read-only; conditional websearch/webfetch |
| `three-stage` | Plan → implement → review → commit | Makes a local commit; never pushes |
| `debug` | Diagnose → fix → verify → commit | Makes a local commit; never pushes |
## On a new install
The extended coding starters inspect the actual diff and preserve unrelated work.
None assumes a language, framework, repository layout, device, service or model.
They use the project's own conventions and checks.
A brand-new database starts with these four as ordinary pipelines, bound to the
server's default model and harness when the server first creates it. Open, run or
edit them like any other pipeline. This happens once: the server records that it
seeded the database, so removing them does not bring them back, and upgrading an
existing install never adds or rewrites a pipeline. If no default model was set
up before that first start, the examples keep the `provider=default` /
`model=default` markers; pick a model when you run them (`--model`) or edit them.
## Use a starter
## As templates
These files are embedded in the server's template catalog, not merely examples to
copy manually. They appear in the web create/template picker, TUI `:templates`,
and `pipelines templates`. Choosing a template uses the existing creation flow;
there is no separate catalog registration, installation or publication step.
Nothing is seeded into the database or rewritten on upgrade. Creating a named
pipeline remains an explicit authoring action and cannot replace an existing
definition through the create-only template flow.
CLI draft equivalent:
The same files are the server's template catalog: the web/app create flow, TUI
`:templates` and `pipelines templates`. Choosing one creates a new pipeline
through the normal create-only flow; it never replaces an existing one.
```sh
pipelines new "My workflow" --template summarize --no-open
pipelines new "My loop" --template feedback-loop --no-open
pipelines drafts
pipelines submit /path/printed/by/new.md
```
`provider=default` and `model=default` in the checked-in files are neutral template
markers, **not real provider/model IDs**. Web, TUI and CLI template creation bind
them to the server's configured default model and harness. Configure a working
default through the normal setup flow before execution. For direct file submission,
replace the markers with the configured provider/model IDs yourself. Browsing the
catalog does not probe providers or invoke agents.
`provider=default` and `model=default` in the checked-in files are neutral markers,
**not real provider/model IDs**. Web, TUI and CLI template creation, and seeding,
bind them to the configured default model and harness. For direct file
submission, replace them with real provider/model IDs yourself.
## Inputs and evidence
- **Code:** request one focused change in the selected project, including desired
behavior and relevant checks. The reviewer checks the actual change but has no
shell tool; unverified behavior is reported, not claimed tested.
- **Research:** provide a precise question, time/version scope and source needs.
Requires working `websearch` and `webfetch` in the configured harness; tool
support is not guaranteed by the template. Both stages report inaccessible
sources and missing evidence honestly. The report stage reopens citations;
it does not treat a previous stage's summary as verification.
- **Summary:** identify readable local documents (or include their text), audience
and desired length. Unsupported formats or missing files are reported as blocked.
- **Comparison:** supply options, decision criteria, constraints and evidence in
the prompt or local documents. This is not a live market/pricing research tool.
- **Plan:** supply a goal, constraints and available context. The output is a plan
and checklist, not execution, assigned owners or invented deadlines.
Model stages consume the runtime's turn context and return Markdown. The only
required output section is `# outcome` with a declared edge word. Other headings
carry the result and evidence for later stages and the operator. Native session
exports and artifact delivery are runtime-owned, not prompt tasks. See
`docs/notes/stage-turns.md`.
Editing these files never changes installed custom definitions, immutable
published versions, run history, retained drafts or sessions. Renderer regression
fixtures live in `internal/pipeline/testdata`, not the catalog.
Editing these files never changes pipelines already in a database, published
versions, run history, drafts or sessions. Renderer regression fixtures live in
`internal/pipeline/testdata`, not here.