local F = require("flow_dsl")
local B = require("bp_dsl")
local flow = B.pipeline({
B.stage "analyze" { agent = "analyzer" },
B.stage "review" {
agent = "reviewer",
retry = {
max = 2,
fix = B.stage "fix" { agent = "fixer", input = B.from "review" },
},
},
B.stage "publish" { agent = "publisher" },
halt_on = { "BLOCKED" },
halted_at = "$.halted_at",
done = "$.pipeline_complete",
})
return {
id = "sample-dsl-pipeline",
flow = flow,
agents = {
{
name = "analyzer",
kind = "operator",
spec = { operator_ref = "main-ai" },
profile = { system_prompt = "Always reply `ANALYZED`", tools = {} },
},
{
name = "reviewer",
kind = "operator",
spec = { operator_ref = "main-ai" },
profile = {
system_prompt = "Stage a named `verdict` part (`PASS` or `BLOCKED`), then finish with a report body",
tools = {},
},
verdict = { channel = "part", values = { "PASS", "BLOCKED" } },
},
{
name = "fixer",
kind = "operator",
spec = { operator_ref = "main-ai" },
profile = { system_prompt = "Always reply `FIXED`", tools = {} },
},
{
name = "publisher",
kind = "operator",
spec = { operator_ref = "main-ai" },
profile = { system_prompt = "Always reply `PUBLISHED`", tools = {} },
},
},
operators = {
{ name = "main-ai" },
},
strategy = { strict_refs = true, strict_kind = true },
metadata = {
description = "Verdict-gated three-stage pipeline built with bp_dsl's B.pipeline{} sugar: analyze -> review (retries a bounded fix-and-regate loop while its staged verdict part reads BLOCKED) -> publish. Seed with init_ctx={\"d\":{\"analyze\":\"issue\"}}. All operator agents point at the \"main-ai\" logical role; join with mse_operator_join(roles=[\"main-ai\"]) before dispatch.",
},
}