diff --git a/docs/FIX_CONTEXTUAL_REENTRY_BEFORE_TERMINAL_WORKFLOW_RESUME_20260922.md b/docs/FIX_CONTEXTUAL_REENTRY_BEFORE_TERMINAL_WORKFLOW_RESUME_20260922.md new file mode 100644 index 00000000..0cdbfe93 --- /dev/null +++ b/docs/FIX_CONTEXTUAL_REENTRY_BEFORE_TERMINAL_WORKFLOW_RESUME_20260922.md @@ -0,0 +1,65 @@ +# Fix: contextual reentry before terminal workflow resume + +## Problem + +A paused workflow with a declarative `expected_input.semantic_classifier` could receive a +compound reply such as: + +```text +ainda nao. Eu nao contratei esse neymar jr +``` + +If the classifier returned only `NAO`, the framework immediately resumed the paused workflow. +A backend workflow was then free to enter a terminal branch (for example human handoff) before +the substantive remainder of the same user turn was reinterpreted by normal routing. + +This is an orchestration problem in the framework, not a domain rule for billing and not a +frontend problem. + +## Corrected precedence + +Literal `expected_input` matches keep absolute precedence and are unchanged. For non-literal +semantic matches, when the workflow itself declares an option with +`option_actions.