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
+16 -12
View File
@@ -87,15 +87,17 @@ def main():
try:
pong = rpc("ping")
assert pong["build"] == version, "Client/server build mismatch"
assert not rpc("list").get("pipelines"), "Fresh database must be empty"
examples = {"Example 1: one stage", "Example 2: two stages", "Example 3: feedback loop", "Example 4: human decision"}
seeded = {item["name"] for item in rpc("list")["pipelines"]}
assert seeded == examples, f"Fresh database must hold only the examples: {seeded}"
assert not rpc("runs").get("runs"), "Fresh database must have no runs"
templates = rpc("templates")["templates"]
keys = {template["key"] for template in templates}
assert keys == {"task", "research", "summarize", "compare", "plan", "review", "three-stage", "debug"}, keys
# Exercise the five primary starters using only draft and
# validation commands: never run a model or launch an editor.
assert keys == {"one-stage", "two-stages", "feedback-loop", "human-decision"}, keys
# Exercise every example using only draft and validation
# commands: never run a model or launch an editor.
drafts = {}
for key in ("task", "research", "summarize", "compare", "plan"):
for key in sorted(keys):
drafts[key] = rpc("new", f"Starter {key}", "Use only supplied test context",
"--template", key, "--no-open", "--yes")
rpc("validate", drafts[key]["path"])
@@ -103,27 +105,29 @@ def main():
assert "provider=smoke-provider" in source, key
assert "model=smoke-model" in source, key
assert "harness=opencode" in source, key
draft = drafts["plan"]
assert not rpc("list").get("pipelines"), "Draft creation must not publish"
draft = drafts["one-stage"]
assert len(rpc("list")["pipelines"]) == len(examples), "Draft creation must not publish"
rpc("submit", draft["path"], "--yes")
published = rpc("show", "Starter plan")
published = rpc("show", "Starter one-stage")
assert published["version"] == 1
archive = root / "definitions.zip"
rpc("export", "Starter plan", "--output", str(archive))
rpc("export", "Starter one-stage", "--output", str(archive))
result = rpc("import", str(archive), "--all", "--yes")
assert not result["imported"], "Identical import must not republish"
assert rpc("show", "Starter plan")["version"] == 1
assert rpc("show", "Starter one-stage")["version"] == 1
assert Path(draft["path"]).is_file(), "Published draft must remain"
finally:
stop(process)
process = start(log)
try:
assert rpc("show", "Starter plan")["source"] == published["source"], "Definition lost on restart"
assert rpc("show", "Starter one-stage")["source"] == published["source"], "Definition lost on restart"
after = rpc("list")["pipelines"]
assert len(after) == len(examples) + 1 and all(item["version"] == 1 for item in after), "Restart re-seeded examples"
assert rpc("ping")["build"] == version
assert not rpc("runs").get("runs"), "Smoke check must not execute a workflow"
finally:
stop(process)
print("PASS developer lifecycle fixture: isolated source binaries/skill, offline version, empty DB, eight catalog templates, five generic drafts validated with configured defaults, explicit scratch publication, ZIP identical import, restart persistence. Not an installation option; no inference or notifications.")
print("PASS developer lifecycle fixture: isolated source binaries/skill, offline version, DB seeded with only the four examples, four catalog templates drafted and validated with configured defaults, explicit scratch publication, ZIP identical import, restart persistence. Not an installation option; no inference or notifications.")
if __name__ == "__main__":
+1 -1
View File
@@ -12,7 +12,7 @@ class PackageTests(unittest.TestCase):
with tarfile.open(archive) as tar:
names = tar.getnames()
self.assertTrue(any(name.endswith("install.sh") for name in names))
self.assertTrue(any(name.endswith("examples/task.md") for name in names))
self.assertTrue(any(name.endswith("examples/one-stage.md") for name in names))
self.assertFalse(any("/secrets/" in name or name.endswith(".db") or "/.env" in name or "/__pycache__/" in name for name in names))
self.assertTrue(archive.with_suffix(archive.suffix + ".sha256").exists())