fix(decision): forward an element's selected state to the model
Merged
AS
10d ago+32+32+01234567890123456789-0-0-0123456789
Summary
Fixes #884.
checked and expanded already reach the decision model through the element table (actionSpace) and target criteria (targetCriterion), but selected did not, even though the engine already reports it in SemanticNode.states. On a tab bar every tab therefore looked identical to the model, so:
- the completion check for a tab switch landed around 50/50 (
holds/inconclusive), sometimes blocking a step that actually worked - a step could be marked
donebefore anything was tapped, because the model couldn't tell the already-active tab from the one it needed to reach
Change
Forward selected the same way checked already is:
packages/decision/src/elements.ts: addselected?: booleantoElement, copyrow.node.states?.selectedinto the element tablepackages/decision/src/questions.ts: includeselectedin bothelementRecordsandtargetCriterion
No operation logic changes — tab was already tappable; this only forwards state that was already being read by the engine but dropped before it reached the model.
Test plan
elements.test.ts: new test asserting a tab'sselectedstate appears in the element tableexecutor.test.ts: new test assertingselectedappears intap_targetcriteria, covering the same pathcheckedalready has a test for incheck_targetcriteriapnpm --filter @e2e-dev/decision test: 75 passed (the 4 pre-existingcli.test.tsskips are unrelated — that suite needs Node ≥22.22.3, and this sandbox has 22.22.0)pnpm --filter @e2e-dev/decision typecheck: cleanoxlinton the changed files: clean
Added a patch changeset.