a48e4a5b6a
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.
34 lines
1.5 KiB
Go
34 lines
1.5 KiB
Go
package examples
|
|
|
|
import (
|
|
"embed"
|
|
"git.a-wan.net/alan/pipelines/internal/protocol"
|
|
)
|
|
|
|
// Only checked-in Markdown examples are shipped. No runtime databases or user drafts.
|
|
//
|
|
//go:embed *.md
|
|
var sources embed.FS
|
|
|
|
// The examples are a graded set, read in order: each one adds a feature to the
|
|
// previous. They are offered by the template picker and seeded once into a brand
|
|
// new database (see pipeline.Store.SeedExamples).
|
|
var starters = []protocol.Template{
|
|
{Key: "one-stage", Name: "Example 1: one stage", Description: "One read-only stage reviews the files you name. Changes nothing."},
|
|
{Key: "two-stages", Name: "Example 2: two stages", Description: "A draft stage hands its output to a check stage that corrects it. Changes nothing."},
|
|
{Key: "feedback-loop", Name: "Example 3: feedback loop", Description: "Implement, then review; a rejected review sends findings back, at most three reviews. Shows retries and timeouts. Leaves changes uncommitted."},
|
|
{Key: "human-decision", Name: "Example 4: human decision", Description: "Plan, then wait for a person to approve, revise or abort before acting, with notifications. Leaves changes uncommitted."},
|
|
}
|
|
|
|
func Catalog() []protocol.Template {
|
|
result := make([]protocol.Template, 0, len(starters))
|
|
for _, item := range starters {
|
|
data, _ := sources.ReadFile(item.Key + ".md")
|
|
item.Source = string(data)
|
|
// Schedules are saved run configurations, never starter definitions.
|
|
item.Scheduled = false
|
|
result = append(result, item)
|
|
}
|
|
return result
|
|
}
|