Update templates and authoring skill to the current pipeline contract
Bring the packaged starters and the pipelines skill up to the guidelines the project now works to. Templates: - task and three-stage now end in a committer stage that stages the union of the runner's captured input.server_changed_files and the producer's declared changed_files, runs the repository's checks, commits locally and never pushes; their producers no longer commit. - Every model/agent prompt states the line-oriented result contract (outcome on the first non-empty line, "# output" JSON map, other "# <heading>" sections kept verbatim as evidence) and an "# evidence" section for exact commands and results, with proportionate verification and no fabricated checks. - Stages that can write save their reports, logs and screenshots into the runtime artifacts directory. - Remove the summary starter: a tool-free single-prompt text transform with no repository interaction, artifact or commit is a format demonstration, not a reusable workflow. No starter invents a pretend approval stage; a decision point is a type=human stage. Skill: - references/format.md gains a Result format section (line form, legacy JSON precedence, result_parse, raw-output.md, artifacts) and a Committer stages section with the pre-commit checklist; the role-split and envelope notes mention the line form and the committer. - orchestration.md points at the checklist and records that a genuine gate is a human stage; operations.md and the SKILL.md index drop the removed starter and name the result format and committer. No new reference, so the managed inventory is unchanged. Docs/tests: examples/README, README, docs/cli, docs/first-version-testing, the CLI help example and the smoke script track the four starters; catalog, tool-role, server, tui and pipeline tests are updated, with a new test pinning the committer ending and server-captured change set. Commands run: go build ./...; go vet ./...; go test ./...; python3 -m unittest discover -s scripts -p 'test_*.py'; python3 scripts/smoke-first-install.py. All passed. Templates inspected through an isolated CLI server (pipelines templates; pipelines template KEY --source). No server, service or device was restarted, and nothing was pushed.
This commit is contained in:
@@ -20,18 +20,18 @@ func TestReadmeThreeStageExampleIsValid(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(graph.Stages) != 3 || graph.Settings != nil {
|
||||
t.Fatal("example must be manual-only and three stages")
|
||||
if len(graph.Stages) != 4 || graph.Settings != nil {
|
||||
t.Fatal("example must be manual-only and four stages")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCatalogContainsValidUnpublishedTemplates(t *testing.T) {
|
||||
items := examples.Catalog()
|
||||
if len(items) != 5 {
|
||||
if len(items) != 4 {
|
||||
t.Fatal("unexpected catalog size", len(items))
|
||||
}
|
||||
seen := map[string]bool{}
|
||||
wantStages := map[string]int{"task": 1, "summary": 1, "review": 1, "research": 2, "three-stage": 3}
|
||||
wantStages := map[string]int{"task": 2, "review": 1, "research": 2, "three-stage": 4}
|
||||
for _, item := range items {
|
||||
if seen[item.Key] || item.Description == "" || item.Name == "" {
|
||||
t.Fatal("invalid template metadata", item.Key)
|
||||
@@ -44,8 +44,8 @@ func TestCatalogContainsValidUnpublishedTemplates(t *testing.T) {
|
||||
if (graph.Settings != nil) != item.Scheduled {
|
||||
t.Fatal("missing schedule warning", item.Key)
|
||||
}
|
||||
if graph.Settings != nil || len(graph.Stages) > 3 {
|
||||
t.Fatal("starters must be simple and manual-only", item.Key)
|
||||
if graph.Settings != nil || len(graph.Stages) > 4 {
|
||||
t.Fatal("starters must be small and manual-only", item.Key)
|
||||
}
|
||||
if len(graph.Stages) != wantStages[item.Key] {
|
||||
t.Fatal("unexpected/non-generic catalog entry", item.Key)
|
||||
@@ -89,9 +89,11 @@ func stageTools(t *testing.T, graph pipeline.Graph, key string) ([]string, bool)
|
||||
// Every bundled starter declares a tools block; an empty list is the intentional
|
||||
// deny-all tool-free role.
|
||||
var starterTools = map[string]map[string][]string{
|
||||
"task": {"worker": {"read", "glob", "grep", "edit", "shell", "websearch", "webfetch"}},
|
||||
"summary": {"summarize": {}},
|
||||
"review": {"review": {"read", "glob", "grep", "websearch", "webfetch"}},
|
||||
"task": {
|
||||
"worker": {"read", "glob", "grep", "edit", "shell", "websearch", "webfetch"},
|
||||
"committer": {"read", "glob", "grep", "shell"},
|
||||
},
|
||||
"review": {"review": {"read", "glob", "grep", "websearch", "webfetch"}},
|
||||
"research": {
|
||||
"research": {"websearch", "webfetch"},
|
||||
"report": {},
|
||||
@@ -100,6 +102,7 @@ var starterTools = map[string]map[string][]string{
|
||||
"planner": {"read", "glob", "grep", "websearch", "webfetch"},
|
||||
"implementer": {"read", "glob", "grep", "edit", "shell"},
|
||||
"reviewer": {"read", "glob", "grep", "shell", "websearch", "webfetch"},
|
||||
"committer": {"read", "glob", "grep", "shell"},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -171,3 +174,36 @@ func TestThreeStageReviewerMemoryKeepsPlannerAcceptance(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestWorkProducingStartersEndInACommitter pins the guideline that a workflow
|
||||
// which changes the repository commits locally through its final committer stage,
|
||||
// staging the server-captured change set rather than only a model's declaration.
|
||||
func TestWorkProducingStartersEndInACommitter(t *testing.T) {
|
||||
for _, tc := range []struct{ key, producer string }{
|
||||
{"task", "worker"},
|
||||
{"three-stage", "implementer"},
|
||||
} {
|
||||
graph := parsedCatalog(t)[tc.key]
|
||||
last := graph.Stages[len(graph.Stages)-1]
|
||||
if last.Key != "committer" {
|
||||
t.Fatalf("%s must end in a committer stage, got %q", tc.key, last.Key)
|
||||
}
|
||||
if got := last.Edges["success"]; got != protocol.SuccessEnd {
|
||||
t.Fatalf("%s committer success route = %q, want %q", tc.key, got, protocol.SuccessEnd)
|
||||
}
|
||||
if got := last.Memory["server_changed_files"]; got != "input.server_changed_files" {
|
||||
t.Fatalf("%s committer must select input.server_changed_files, got %q", tc.key, got)
|
||||
}
|
||||
if got := last.Memory["changed_files"]; got != tc.producer+".changed_files" {
|
||||
t.Fatalf("%s committer changed_files = %q, want %q", tc.key, got, tc.producer+".changed_files")
|
||||
}
|
||||
// The producer hands its work on rather than ending the run itself.
|
||||
for _, s := range graph.Stages {
|
||||
if s.Key == tc.producer {
|
||||
if protocol.IsTerminal(s.Edges["success"]) {
|
||||
t.Fatalf("%s/%s must hand success to a later stage, not %q", tc.key, tc.producer, s.Edges["success"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user