feat: add negation support for step conditions (!{{var}})

Adds "!{{var}}" syntax for negated truthy checks in Step.Condition.
Useful for "skip this step if feature is enabled" patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/emma
2025-12-31 00:37:59 -08:00
committed by Steve Yegge
parent ee34a74e90
commit 6893eb6080
3 changed files with 42 additions and 1 deletions

View File

@@ -84,6 +84,35 @@ func TestEvaluateStepCondition(t *testing.T) {
want: true,
wantErr: false,
},
// Negated truthy checks: !{{var}}
{
name: "negated - truthy value becomes false",
condition: "!{{enabled}}",
vars: map[string]string{"enabled": "true"},
want: false,
wantErr: false,
},
{
name: "negated - falsy value becomes true",
condition: "!{{enabled}}",
vars: map[string]string{"enabled": "false"},
want: true,
wantErr: false,
},
{
name: "negated - empty value becomes true",
condition: "!{{enabled}}",
vars: map[string]string{"enabled": ""},
want: true,
wantErr: false,
},
{
name: "negated - missing variable becomes true",
condition: "!{{enabled}}",
vars: map[string]string{},
want: true,
wantErr: false,
},
// Equality checks: {{var}} == value
{
name: "equality - match",