Merge commit 'cb897b74d9cf2ce237319e7599bf6851abc30d05' into pipelines/run-20261112-0157-log-notification-subscriptions-and-rejec-fb10

This commit is contained in:
2026-11-12 02:51:13 +00:00
108 changed files with 4334 additions and 757 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ explain the gap; ask before authoring. Do not add a task-specific pipeline as a
## Authoring
Start from `pipelines templates` and `pipelines new NAME --template KEY`
(`one-stage`, `two-stages`, `feedback-loop`, `human-decision`); these fill in
(`research`, `task`); these fill in
the server's provider/model. Read `references/format.md` and
`references/practices.md` before writing prompts. Stage names: `plan` ·
`implement` · `review` · `ui-review` · `decide` (human) · `land`.
+2 -3
View File
@@ -147,8 +147,8 @@ failing else, and `set +e`. Cover every language the run can change.
## Human stages
`type=human` pauses the run until a person picks one of its non-`error` edges
(e.g. `approve -> act`, `revise -> plan`, `abort -> #failure`; see the
`human-decision` template). It needs only `prompt` (operator instructions),
(e.g. `approve -> act`, `revise -> plan`, `abort -> #failure`). It needs only
`prompt` (operator instructions),
`configs` with `type=human` and `edges`; no model or tools. Decide with
`pipelines decide RUN_ID [STAGE] --option KEY [--feedback TEXT]` or the apps. The
wait survives restarts and is never killed by a stage timeout or `max_visits`.
@@ -185,4 +185,3 @@ once. A run started inside a linked worktree (an item's tree) and every retry
use their directory as is. After a successful run whose tree is clean and
whose branch is on `main`, the server removes the tree and branch; anything
else (a failed run, unlanded commits, stray files) is kept for recovery.
@@ -10,8 +10,8 @@ parallel/distributed task engine or a guarantee that model reports are correct.
- Drafts are editable Markdown plus JSON metadata. Publishing validates and creates
immutable versions; drafts remain retained. Keep context create-only/base-version
guards. The four generic examples (one-stage, two-stages, feedback-loop,
human-decision) are the template set; a brand-new database is seeded with them
guards. The two generic starters (research and task) are the template set; a
brand-new database is seeded with them
once, and an existing or already-seeded database never is. Templates can be created directly with
an editable prefilled name or customized first. Editing a bundled repository
template changes no installed or published definition; only explicit authoring
+1 -1
View File
@@ -122,7 +122,7 @@ func (a App) flags(command string) (*flag.FlagSet, *options) {
f.BoolVar(&o.noOpen, "no-open", false, "Create the draft without opening the configured harness")
f.StringVar(&o.opencode, "opencode", envOr("PIPELINES_OPENCODE", "opencode"), "Host OpenCode executable")
if command == "new" {
f.StringVar(&o.template, "template", "", "Optional template key; omitted starts a one-stage draft")
f.StringVar(&o.template, "template", "", "Optional template key; omitted starts a single-stage draft")
}
if command == "edit" {
f.IntVar(&o.version, "version", 0, "Source version (0 = latest)")
+2 -2
View File
@@ -96,7 +96,7 @@ func TestCLIStatusAndStatistics(t *testing.T) {
func TestCLIDraftValidateSubmitAndImmutableHistory(t *testing.T) {
run, store, _ := setup(t)
output, err := run("new", "example", "--template", "one-stage", "--json")
output, err := run("new", "example", "--template", "research", "--json")
if err != nil {
t.Fatal(err)
}
@@ -171,7 +171,7 @@ func TestCLIDraftValidateSubmitAndImmutableHistory(t *testing.T) {
if items[0].Version != 3 {
t.Fatal("invalid submission changed live version", items)
}
for _, command := range [][]string{{"list", "--json"}, {"show", "example", "--json"}, {"templates", "--json"}, {"template", "one-stage", "--source"}, {"drafts", "--json"}, {"runs", "--json"}, {"connection", "--json"}, {"ping"}} {
for _, command := range [][]string{{"list", "--json"}, {"show", "example", "--json"}, {"templates", "--json"}, {"template", "research", "--source"}, {"drafts", "--json"}, {"runs", "--json"}, {"connection", "--json"}, {"ping"}} {
if _, err = run(command...); err != nil {
t.Fatal(command, err)
}
+1 -1
View File
@@ -48,7 +48,7 @@ var notes = map[string]string{
"status": "Reports server, host and ntfy publishing health. The client compares its build/protocol against the server and warns once (or fails on a newer protocol) rather than proceeding silently.",
"export": "Without a name, select pipelines with Space and save a ZIP in the current directory. --output writes a portable definition bundle; --all skips selection. One name without --output prints Markdown as before. No runs, credentials or old versions are exported.",
"import": "Select definitions from a ZIP. Identical existing definitions are skipped. For differing names, choose keep existing, keep both under a new name, or use imported as a new version (history retained). --on-conflict supplies an explicit automation policy; --yes only approves final publication. Schedules may activate; no run history is imported.",
"new": "Create an optional template copy or a one-stage starter. Opens the configured default harness; --harness opencode|pi|nvim overrides it. No submission is performed.",
"new": "Create an optional template copy or a single-stage starter. Opens the configured default harness; --harness opencode|pi|nvim overrides it. No submission is performed.",
"edit": "Omit the name to open fuzzy selection. Original immutable source is copied to a private draft. The configured harness edits that draft, never the live definition.",
"validate": "Uses the same server parser as submission. Does not persist or activate schedules. Structural validity does not prove runtime/tool availability.",
"submit": "Confirm publication at the prompt, or use --yes for explicit automation; schedules activate on acceptance. Managed drafts provide the name and base-version guard. --force never bypasses validation.",
+1 -1
View File
@@ -80,7 +80,7 @@ Examples:
Authoring examples — use only when the operator explicitly requested a definition change:
pipelines edit "bug fix" "Add a review step"
pipelines new "release notes" "Summarize changes and notify my phone"
pipelines new "Add a feature" --template feedback-loop --no-open --json --yes
pipelines new "Add a feature" --template task --no-open --json --yes
pipelines validate /path/to/draft.md --json
pipelines submit /path/to/draft.md
+1 -1
View File
@@ -10,7 +10,7 @@ import (
)
func TestShowcaseDefinitions(t *testing.T) {
for _, name := range []string{"one-stage", "two-stages", "feedback-loop", "human-decision"} {
for _, name := range []string{"research", "task"} {
t.Run(name, func(t *testing.T) {
source, err := os.ReadFile(filepath.Join("..", "..", "examples", name+".md"))
if err != nil {
+11 -12
View File
@@ -105,8 +105,8 @@ func TestStageNotificationEventsAndArtifactAudit(t *testing.T) {
}
}
// Regress the terminal-path recipe from the authoring guide (research -> report
// there) on the bundled two-stage example's draft -> check.
// Regress the terminal-path recipe from the authoring guide on the bundled
// research -> report starter.
// A completion-alert request must not require native delivery or change run routing.
func TestTerminalNotificationRecipe(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
@@ -118,15 +118,14 @@ func TestTerminalNotificationRecipe(t *testing.T) {
defer store.Close()
var source string
for _, template := range examples.Catalog() {
if template.Key == "two-stages" {
if template.Key == "research" {
source = template.Source
}
}
if source == "" {
t.Fatal("two-stages template missing")
t.Fatal("research template missing")
}
source = strings.Replace(source, "# stage draft", "# stage draft\n```notify\non=failure\n```", 1)
source = strings.Replace(source, "# stage check", "# stage check\n```notify\non=success,failure\n```", 1)
source = strings.Replace(source, "# stage report", "# stage report\n```notify\non=success,failure\n```", 1)
if _, err = store.Submit(ctx, "research notification recipe", source); err != nil {
t.Fatal(err)
}
@@ -160,12 +159,12 @@ func TestTerminalNotificationRecipe(t *testing.T) {
name, stage, outcome, status string
executionError, deliveryError bool
}{
{"success", "check", "success", "succeeded", false, false},
{"draft blocked", "draft", "blocked", "failed", false, false},
{"draft execution error", "draft", "error", "failed", true, false},
{"check blocked", "check", "blocked", "failed", false, false},
{"check execution error", "check", "error", "failed", true, false},
{"delivery error preserves success", "check", "success", "succeeded", false, true},
{"success", "report", "success", "succeeded", false, false},
{"research blocked", "research", "blocked", "failed", false, false},
{"research execution error", "research", "error", "failed", true, false},
{"report blocked", "report", "blocked", "failed", false, false},
{"report execution error", "report", "error", "failed", true, false},
{"delivery error preserves success", "report", "success", "succeeded", false, true},
} {
t.Run(test.name, func(t *testing.T) {
deliveryFailure.Store(test.deliveryError)
+1 -1
View File
@@ -11,7 +11,7 @@ import (
)
func TestShowcaseGraphsRender(t *testing.T) {
for _, name := range []string{"one-stage", "two-stages", "feedback-loop", "human-decision"} {
for _, name := range []string{"research", "task"} {
t.Run(name, func(t *testing.T) {
source, err := os.ReadFile(filepath.Join("..", "..", "examples", name+".md"))
if err != nil {
+1 -1
View File
@@ -38,7 +38,7 @@ func TestTemplateSubmitNamesRetainsAndExplicitlyPublishesSelectedTemplate(t *tes
m.templateOpen, m.keys.templates = true, true
m.defaultModel = "fixture/model"
for i, item := range m.templates {
if item.Key == "one-stage" {
if item.Key == "research" {
m.templateIndex = i
}
}
+1 -1
View File
@@ -92,7 +92,7 @@ func TestTemplateGraphPreviewFocusNavigationAndSizes(t *testing.T) {
t.Fatal(err)
}
view := ansi.Strip(m.View())
if !strings.Contains(view, parsed.Stages[0].Key) {
if size.w >= 80 && !strings.Contains(strings.ToLower(view), strings.ToLower(parsed.Stages[0].Key)) {
t.Fatal("focused graph does not match selected template", size, item.Key, view)
}
oldIndex, oldTop := m.templateIndex, m.templateTop
+3 -3
View File
@@ -21,7 +21,7 @@ func TestUIUXReviewSnapshots(t *testing.T) {
if err := os.MkdirAll(directory, 0700); err != nil {
t.Fatal(err)
}
source, err := os.ReadFile("../../examples/human-decision.md")
source, err := os.ReadFile("../../examples/task.md")
if err != nil {
t.Fatal(err)
}
@@ -36,7 +36,7 @@ func TestUIUXReviewSnapshots(t *testing.T) {
m.loaded = true
m.status = "127.0.0.1:8080"
m.notificationEndpoints = []protocol.NotificationEndpoint{{Destination: "system", ServerURL: "http://100.85.25.33:8090", Topic: "pipelines"}}
m.pipelines = []protocol.PipelineSummary{{ID: 8, Name: "Example 4: human decision", Version: 1, Stages: 3, CreatedAt: "2026-10-08T20:00:00Z", UpdatedAt: "2026-10-08T20:00:00Z"}}
m.pipelines = []protocol.PipelineSummary{{ID: 8, Name: "Implement, review and land", Version: 1, Stages: 4, CreatedAt: "2026-10-08T20:00:00Z", UpdatedAt: "2026-10-08T20:00:00Z"}}
save := func(name string) {
t.Helper()
view := ansi.Strip(m.View())
@@ -66,7 +66,7 @@ func TestUIUXReviewSnapshots(t *testing.T) {
save("review-stage")
m.runOpen = true
m.keys.runs = true
m.runDetail = &protocol.RunDetail{RunSummary: protocol.RunSummary{ID: 1, Name: "Example 4: human decision", PipelineID: 8, Version: 1, Status: "succeeded", CreatedAt: "2026-10-08T20:00:00Z", FinishedAt: "2026-10-08T20:01:00Z"}, Graph: graph, Steps: []protocol.RunStep{{Sequence: 1, Stage: "plan", Status: "completed", Outcome: "success", Target: "decide"}, {Sequence: 2, Stage: "decide", Status: "completed", Outcome: "approve", Target: "act"}, {Sequence: 3, Stage: "act", Status: "completed", Outcome: "success", Target: protocol.SuccessEnd, Output: map[string]any{"summary": "Fixture review report", "findings": "Fixture findings"}}}}
m.runDetail = &protocol.RunDetail{RunSummary: protocol.RunSummary{ID: 1, Name: "Implement, review and land", PipelineID: 8, Version: 1, Status: "succeeded", CreatedAt: "2026-10-08T20:00:00Z", FinishedAt: "2026-10-08T20:01:00Z"}, Graph: graph, Steps: []protocol.RunStep{{Sequence: 1, Stage: "Code", Status: "completed", Outcome: "success", Target: "Review"}, {Sequence: 2, Stage: "Review", Status: "completed", Outcome: "success", Target: "UIReview"}, {Sequence: 3, Stage: "UIReview", Status: "completed", Outcome: "approved", Target: "Land"}, {Sequence: 4, Stage: "Land", Status: "completed", Outcome: "success", Target: protocol.SuccessEnd, Output: map[string]any{"summary": "Fixture review report", "findings": "Fixture findings"}}}}
m.runStepIndex = 3
save("run")
}