feat: implement Step.Condition evaluation in bd cook (bd-7zka.1)
Add compile-time step filtering based on formula variables:
- New EvaluateStepCondition function for {{var}} truthy and equality checks
- FilterStepsByCondition to exclude steps based on conditions
- Integration into pour, wisp, and mol bond commands
- Supports: {{var}}, {{var}} == value, {{var}} != value
Steps with conditions that evaluate to false are excluded from the
cooked formula, along with their children.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
82611834df
commit
ee34a74e90
@@ -167,7 +167,8 @@ func runWispCreate(cmd *cobra.Command, args []string) {
|
||||
|
||||
// Try to cook formula inline (ephemeral protos)
|
||||
// This works for any valid formula name, not just "mol-" prefixed ones
|
||||
sg, err := resolveAndCookFormula(args[0], nil)
|
||||
// Pass vars for step condition filtering (bd-7zka.1)
|
||||
sg, err := resolveAndCookFormulaWithVars(args[0], nil, vars)
|
||||
if err == nil {
|
||||
subgraph = sg
|
||||
protoID = sg.Root.ID
|
||||
|
||||
Reference in New Issue
Block a user