workflow: condition truthy treats numeric zero (json.Number) as truthy #1616

Closed
opened 2026-10-27 13:41:06 +00:00 by sam · 0 comments
Owner

internal/domain/workflow/control_steps.go:151-167 truthy checks bool, string, float64, and int, then defaults to true. Task inputs and step results are decoded with json.NewDecoder.UseNumber() (task/interface.go:230), yielding json.Number. Conditions like 'when: inputs.count' where count is 0 evaluate json.Number("0") as true instead of false. Done when truthy unpacks json.Number and evaluates zero values as falsy.

Close reason

Fixed on fix/workflow-eda-audit (PR #1627)


Imported from beads archie-core-uv270 · GitHub #1617 · type bug · priority P2 · created 2026-10-11 · closed 2026-10-11

internal/domain/workflow/control_steps.go:151-167 truthy checks bool, string, float64, and int, then defaults to true. Task inputs and step results are decoded with json.NewDecoder.UseNumber() (task/interface.go:230), yielding json.Number. Conditions like 'when: inputs.count' where count is 0 evaluate json.Number("0") as true instead of false. Done when truthy unpacks json.Number and evaluates zero values as falsy. ### Close reason Fixed on fix/workflow-eda-audit (PR #1627) --- _Imported from beads `archie-core-uv270` · GitHub #1617 · type bug · priority P2 · created 2026-10-11 · closed 2026-10-11_
sam added the mediumbug labels 2026-10-27 13:41:06 +00:00
sam self-assigned this 2026-10-27 13:41:06 +00:00
sam closed this issue 2026-10-27 13:41:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1616