Add generic checked starter workflows and isolated lifecycle coverage

This commit is contained in:
2026-10-20 21:31:05 +01:00
parent ae6ba6ae10
commit d58b3f49fc
15 changed files with 475 additions and 109 deletions
+61 -45
View File
@@ -1,65 +1,81 @@
# Simple workflow templates
Five optional, technology-neutral starters. Nothing is installed as a published
pipeline automatically; all templates are manual-only and have at most four stages.
Five small general-purpose starters work with any project. Each has two focused
stages, runs only when requested, and returns plain Markdown.
| Template key | Workflow | Tools |
| --- | --- | --- |
| `task` | Complete a task, then commit it locally | Work: read/edit/shell and conditional web search/fetch; committer: read/shell |
| `review` | Read repository content and report findings | Read/glob/grep and conditional web search/fetch; no edit/shell |
| `research` | Research a question, then write a sourced report | Web search/fetch, then none |
| `three-stage` | Plan → implement → review → commit | Planner read/glob/grep + conditional web; implementer read/glob/grep/edit/shell; reviewer independent shell + conditional web; committer read/shell |
| `debug` | Diagnose → fix → verify → commit | Diagnose read/shell; fix read/edit/shell; verify read/shell; committer read/shell |
| `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 |
Every workflow that changes the repository ends in a **committer** stage that
commits locally and never pushes. The committer inspects `git status` and the full
diff, stages this run's change, and runs the repository's required checks before
committing. `task`, `three-stage` and `debug` follow this; `review` and `research`
change nothing and so do not commit.
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.
Model and agent stages read the turn's `input.md` and `memory.md`, then return the
complete `output.md` markdown. The only required section is `# outcome` followed by
one declared edge word; every other heading is free-form evidence for the next stage
and the operator. See `docs/notes/stage-turns.md`.
Three existing keys remain available for compatibility:
Web search/fetch is conditional: stages use it only when a task genuinely needs
external knowledge such as accepted industry approaches, framework or library
APIs, current security/compatibility guidance, or unfamiliar techniques, and they
state why when no research is needed. Trivial, fully understood local edits do not
force web access. The `three-stage` implementer works from the planner's research;
the reviewer is independent and checks the actual change rather than trusting a
stage summary.
| 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 |
No template assumes a language, framework, repository layout, device, deployment
target or notification setup, and none pushes to a remote. They read the project's
own conventions instead of naming files that only exist in one repository.
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.
In the TUI, use `:templates`, choose a starter, and press **s** or Enter on
**Submit template**. Type a name, press Enter to save a retained draft, then
confirm publication. **e Customize** opens the editor picker instead. Canceling
the name prompt creates nothing; canceling publication keeps the saved draft.
## Use a starter
CLI equivalent:
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:
```sh
pipelines new "My workflow" --template task --no-open
pipelines new "My workflow" --template summarize --no-open
pipelines drafts
pipelines submit /path/printed/by/new.md
```
A draft created through the UI or `new` inherits the server's configured default
model. The checked-in files carry an example provider/model for direct file
submission; replace it with one your execution server actually supports. Provider
availability and search support must be verified on that server.
`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.
Templates do not impose a language, framework, schedule, notification setup or
deployment, and they never push to a remote. Add a schedule, notifications or a
deployment step only when your own workflow requires it.
## Inputs and evidence
Editing these source files does not change any installed or published definition;
each starter becomes an immutable version only after explicit authoring and
publication.
- **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.
Removing a template from this catalog does not delete published versions,
run history, retained drafts, or OpenCode sessions. Nested routing examples used
for renderer regression tests live in `internal/pipeline/testdata`, not this catalog.
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.