fix(decision): give the completion check the step origin and page moves

Merged
HO
12d ago
+36-3

Summary

Fixes #885.

Navigation steps usually end blocked even when the tap was correct. The completion check only saw the goal, the current page, and the step actions. It never saw where the step started, so after Click Back it could not tell came back from never moved. Named links held at 0.33 to 0.40 and Back held at 0.08 to 0.11 in the report.

Change

Forward what the executor already knows to the completion check:

  • packages/decision/src/executor.ts: record the first observed path as the step origin and pass it to completionRequest.
  • packages/decision/src/questions.ts: accept origin in CompletionInput, send origin.path when it differs from the current page, mark actions that changed the page with (page changed), and tell the check that a move from origin to a new page counts even for generic labels such as Back.
  • packages/decision/tests/executor.test.ts: cover origin sent on navigation and origin omitted when the page never changes.
  • .changeset/decision-completion-origin.md: patch changeset for @e2e-dev/decision.

No operation logic changes. Steps that never leave their page send no origin, so existing checks read the same state as before.

Test plan

  • pnpm --filter @e2e-dev/decision run test: 5 files, 90 passed.
  • pnpm --filter @e2e-dev/decision run typecheck: clean.
  • oxlint on changed files: clean.