Proposal: use sc-compose to author beads formulas (automate complex release/research workflows)
Context
The SC ecosystem runs recurring multi-step agent workflows through bd formulas — TOML workflow templates that pour into bead DAGs (see sc-release.formula.toml: press-release → contessa docs-review → repowise → publish-verify → announce, and the new per-repo atm-core-release-research formula: one serial research bead per audience persona).
These formulas are currently hand-written, and the bd formula engine has a hard limitation that makes that painful:
LoopSpec iterates over integers only (count / until / range), exposing the index as a var. There is no foreach-over-a-list primitive.
VarDef supports only string/int/bool — no list type.
So "generate N persona beads from a persona list" can't be expressed as a loop; we have to hand-expand each persona into its own [[steps]] block (5 near-identical blocks per repo, × 15 repos).
The opportunity
sc-compose is already the SC composition engine: fragments + declared variables + multi-pass rendering, resolved across runtimes. The same mechanism could compose beads formulas — emit .formula.toml from shared fragments, closing the loop primitive gap at a higher level.
Concepts to explore (this is the ask)
-
A formula-composition render target. A --mode formula (or --kind formula) that renders bd formula TOML from fragments + vars, the way --mode profile renders agent profiles. Output lands on the bd formula search path (or a declared path).
-
List-typed variables + foreach expansion. Add a list var type (e.g. personas = ["Agent Orchestrator", ...]) and a foreach/expand construct that emits one step per element — closing the LoopSpec integer-only gap. A persona-research fragment parameterized by (persona story, git-audit template, closure contract) would then expand to N serial steps.
-
Fragment library. Versioned, composable fragments for the recurring shapes: git-audit-research (dual-pass review + grounding + output template), press-release-per-persona, closure-contract. Shared across all 15 repos instead of copy-pasted per repo.
-
Colocate formula source with the persona SSOT. Formula source lives next to hendrix/alpha-prime/<repo>/user-stories.md; sc-compose renders it into the bd search path. Personas and the formula that audits them change together.
Acceptance sketch
Authoring a per-repo research formula should become:
sc-compose render --mode formula --kind release-research \
--repo atm-core --personas "Agent Orchestrator,Agent (agent-first),..." \
--var version --var parent-bead
…instead of hand-writing 5 serial [[steps]] blocks. The emitted formula must pour a valid bd DAG (dry-run passes) and honor the closure contract (report bead with parent, back-reference, close-on-evidence).
Not in scope (for now)
- Changing
bd/beads itself — this is about sc-compose emitting what bd already consumes.
- Full runtime execution of formulas; only authoring/generation.
Filed by alpha-prime (harness engineering PM). Discussion welcome — this is a concept proposal, not a committed design.
Proposal: use sc-compose to author beads formulas (automate complex release/research workflows)
Context
The SC ecosystem runs recurring multi-step agent workflows through
bdformulas — TOML workflow templates that pour into bead DAGs (seesc-release.formula.toml: press-release → contessa docs-review → repowise → publish-verify → announce, and the new per-repoatm-core-release-researchformula: one serial research bead per audience persona).These formulas are currently hand-written, and the
bdformula engine has a hard limitation that makes that painful:LoopSpeciterates over integers only (count/until/range), exposing the index as a var. There is no foreach-over-a-list primitive.VarDefsupports only string/int/bool — no list type.So "generate N persona beads from a persona list" can't be expressed as a loop; we have to hand-expand each persona into its own
[[steps]]block (5 near-identical blocks per repo, × 15 repos).The opportunity
sc-compose is already the SC composition engine: fragments + declared variables + multi-pass rendering, resolved across runtimes. The same mechanism could compose beads formulas — emit
.formula.tomlfrom shared fragments, closing the loop primitive gap at a higher level.Concepts to explore (this is the ask)
A formula-composition render target. A
--mode formula(or--kind formula) that rendersbdformula TOML from fragments + vars, the way--mode profilerenders agent profiles. Output lands on thebdformula search path (or a declared path).List-typed variables + foreach expansion. Add a list var type (e.g.
personas = ["Agent Orchestrator", ...]) and a foreach/expand construct that emits one step per element — closing theLoopSpecinteger-only gap. Apersona-researchfragment parameterized by (persona story, git-audit template, closure contract) would then expand to N serial steps.Fragment library. Versioned, composable fragments for the recurring shapes:
git-audit-research(dual-pass review + grounding + output template),press-release-per-persona,closure-contract. Shared across all 15 repos instead of copy-pasted per repo.Colocate formula source with the persona SSOT. Formula source lives next to
hendrix/alpha-prime/<repo>/user-stories.md; sc-compose renders it into thebdsearch path. Personas and the formula that audits them change together.Acceptance sketch
Authoring a per-repo research formula should become:
…instead of hand-writing 5 serial
[[steps]]blocks. The emitted formula must pour a validbdDAG (dry-run passes) and honor the closure contract (report bead with parent, back-reference, close-on-evidence).Not in scope (for now)
bd/beads itself — this is about sc-compose emitting whatbdalready consumes.Filed by alpha-prime (harness engineering PM). Discussion welcome — this is a concept proposal, not a committed design.