[bug] a reference between steps loses its type #1035

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

renderSettings (internal/domain/workflow/step_refs.go) rewrites every string scalar with walkStrings/stringify, so a setting whose value is exactly one reference becomes text. A boolean, number, array or object referenced into a typed setting then fails to decode: 'cannot unmarshal !!str »true« into bool'.

Design

Walk the settings node instead of only its string scalars. A value that is exactly one reference is replaced in place by the referenced value's own YAML node (yaml.Marshal then yaml.Unmarshal), so its type survives; a reference embedded in prose is still interpolated as text; an absent reference still renders empty; mapping keys stay text. Rendering still works on the deep copy, so the definition is never mutated.

Acceptance criteria

A rendered settings object carries a bool, an int, a []string and a map[string]string through intact from a step result; a whole result object crosses as a map; prose interpolates to text; an absent reference renders empty; a string field still receives a coerced number or boolean.

Close reason

Already fixed on main by 502899ce (fix(workflow): preserve a reference's type between steps): renderNode/renderValue/setNodeValue now swap a sole-reference scalar for the referenced value's own YAML node, prose still interpolates, and an absent reference renders empty. TestRenderSettingsPreservesTypes (step_refs_test.go:210) covers bool, int, []string, map, whole-result, prose and absent cases.


Imported from beads archie-core-3elt · GitHub #1552 · type bug · priority P2 · created 2026-10-08 · closed 2026-10-26

renderSettings (internal/domain/workflow/step_refs.go) rewrites every string scalar with walkStrings/stringify, so a setting whose value is exactly one reference becomes text. A boolean, number, array or object referenced into a typed setting then fails to decode: 'cannot unmarshal !!str »true« into bool'. ### Design Walk the settings node instead of only its string scalars. A value that is exactly one reference is replaced in place by the referenced value's own YAML node (yaml.Marshal then yaml.Unmarshal), so its type survives; a reference embedded in prose is still interpolated as text; an absent reference still renders empty; mapping keys stay text. Rendering still works on the deep copy, so the definition is never mutated. ### Acceptance criteria A rendered settings object carries a bool, an int, a []string and a map[string]string through intact from a step result; a whole result object crosses as a map; prose interpolates to text; an absent reference renders empty; a string field still receives a coerced number or boolean. ### Close reason Already fixed on main by 502899ce (fix(workflow): preserve a reference's type between steps): renderNode/renderValue/setNodeValue now swap a sole-reference scalar for the referenced value's own YAML node, prose still interpolates, and an absent reference renders empty. TestRenderSettingsPreservesTypes (step_refs_test.go:210) covers bool, int, []string, map, whole-result, prose and absent cases. --- _Imported from beads `archie-core-3elt` · GitHub #1552 · type bug · priority P2 · created 2026-10-08 · closed 2026-10-26_
sam added the mediumbug labels 2026-10-27 13:38:45 +00:00
sam self-assigned this 2026-10-27 13:38:45 +00:00
sam closed this issue 2026-10-27 13:38:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1035