Skip to content

Proposal: use sc-compose to author beads formulas (automate complex release/research workflows) #551

Description

@randlee

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)

  1. 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).

  2. 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.

  3. 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.

  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions