From f818834ec1565ecff1cd3971eb5d84318d4c0bbf Mon Sep 17 00:00:00 2001 From: cflmy Date: Wed, 18 Nov 2026 09:52:35 +0800 Subject: [PATCH] test(ai): exercise ABI-only durable workflow in actual Marqdo interpreter --- tests/ext/ai-native-workflow.mq.md | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/ext/ai-native-workflow.mq.md diff --git a/tests/ext/ai-native-workflow.mq.md b/tests/ext/ai-native-workflow.mq.md new file mode 100644 index 0000000..b643ce8 --- /dev/null +++ b/tests/ext/ai-native-workflow.mq.md @@ -0,0 +1,59 @@ +--- +markup: occlusion +title: ABI-native durable agent workflow test +import: + workflow: ext/ai/workflow.mq.md + json: lib/json.mq.md + sys: lib/sys.mq.md +--- + +# main + +Offline test: the same Marqdo program advances through model choice, user +input and terminal state with plugin-owned durable checkpoints. + +**steps = > json.parse text=[{"id":"intent","kind":"model","options":["chat","office"]},{"id":"confirm","kind":"input","question":"Continue?","options":["yes","no"]},{"id":"end","kind":"return"}]** +**opened = > workflow.open id="abi_flow_ci_20261118" steps=`steps` source_revision="flow-v1"** +**o = > json.get value=`opened` key="ok"** +1. `o` + **_ = 1** +2. * + > sys.exit code=21 + +**first = > workflow.next id="abi_flow_ci_20261118" source_revision="flow-v1"** +**first_state = > json.get value=`first` key="status"** +1. `first_state` == "waiting_model" + **_ = 1** +2. * + > sys.exit code=22 + +**c1 = > workflow.commit id="abi_flow_ci_20261118" step_id="intent" response="chat" source_revision="flow-v1"** +**done1 = > json.get value=`c1` key="ok"** +1. `done1` + **_ = 1** +2. * + > sys.exit code=23 + +**second = > workflow.next id="abi_flow_ci_20261118" source_revision="flow-v1"** +**second_state = > json.get value=`second` key="status"** +1. `second_state` == "waiting_input" + **_ = 1** +2. * + > sys.exit code=24 + +**c2 = > workflow.commit id="abi_flow_ci_20261118" step_id="confirm" response="yes" source_revision="flow-v1"** +**done2 = > json.get value=`c2` key="ok"** +1. `done2` + **_ = 1** +2. * + > sys.exit code=25 + +**c3 = > workflow.commit id="abi_flow_ci_20261118" step_id="end" response="finished" source_revision="flow-v1"** +**complete = > workflow.next id="abi_flow_ci_20261118" source_revision="flow-v1"** +**status = > json.get value=`complete` key="status"** +1. `status` == "succeeded" + **_ = 1** +2. * + > sys.exit code=26 + +Return *"durable-agent-flow-ok"*.