Repository navigation
Commit 4093071
authored
📥 Deliver a typed answer to a suspended workflow run (#479)
* 📥 Deliver a typed answer to a suspended workflow run
A suspended run holds a wait: a retained request, a response schema, and no way
to end it. This adds the operation that ends one.
xmd workflow answer <run-id> <suspension-id> <json>
Delivery is not execution. It takes no executor lock, fetches no definition,
attaches no Workspace, records no document execution, appends no journal event
and changes no status — so a run about to be resumed, or being resumed right
now, can still be answered. A value is accepted only when the run is suspended,
its stop reason names a retained suspension_request carrying that id, and the
value satisfies the schema that request retained. Retained state and the answer
event it would become cross the same secret gate durable journal persistence
uses. Every refusal leaves the database unchanged, and neither the rejected
value nor a secret match reaches a diagnostic.
The answer becomes a durable operation of its own, directly behind the request,
so replay tells an answered wait from an unanswered one. Its live path hands the
publication to whoever keeps the run's delivery state: consuming that state and
appending the suspension_answer Yield are one transaction, and the value returns
only once that transaction has committed. A failure on either side leaves the
answer pending and publishes nothing.
Version 1 gains workflow_suspension_answers in place, on the same terms as every
earlier amendment: no version 2, no migration, and strict recognition refusing
the previous shape as an incomplete pre-release.
Scheduling stays blocked on #301.
* 🧪 Keep the answer-delivery suite out of Node and Bun
The suite opens a real node:sqlite run database and takes the Deno lifecycle
adapter's advisory lock, like every other Deno-adapter workflow suite. It was
not listed in the exclusion manifest, so test-node ran it and failed eleven
ways on the executor lock, and test-bun failed to resolve node:sqlite at all.
Its tier is renamed WAD, because Tier WA already names the ACP server lifecycle
suite in packages/test-agent.
* 🧹 Drop two redundant template wrappers in answer delivery
Each wrapped an already-string expression in a template of its own.
* 📖 Register delivery in the Terminology table
Delivery retains one externally supplied value for an exact durable suspension
request without executing the run or advancing its lifecycle. It is not resume,
not the answer publication that execution appends, and not the answer
consumption that spends the retained value; each of those is registered beside
it so the distinction has one place to live.
---------
Co-authored-by: Taras Mankovski <[email protected]>1 parent 4f2baa8 commit 4093071
28 files changed
Lines changed: 2671 additions & 94 deletions
File tree
- packages
- cli
- src
- tests
- core
- workflow
- src
- deno
- suspension
- tests
- scripts
- specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
753 | 775 | | |
754 | 776 | | |
755 | 777 | | |
| |||
758 | 780 | | |
759 | 781 | | |
760 | 782 | | |
761 | | - | |
762 | | - | |
763 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
764 | 787 | | |
765 | 788 | | |
766 | 789 | | |
| |||
2116 | 2139 | | |
2117 | 2140 | | |
2118 | 2141 | | |
2119 | | - | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
2120 | 2146 | | |
2121 | 2147 | | |
2122 | 2148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1006 | 1006 | | |
1007 | 1007 | | |
1008 | 1008 | | |
1009 | | - | |
| 1009 | + | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| |||
1168 | 1168 | | |
1169 | 1169 | | |
1170 | 1170 | | |
1171 | | - | |
| 1171 | + | |
1172 | 1172 | | |
1173 | 1173 | | |
1174 | | - | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1175 | 1180 | | |
1176 | 1181 | | |
1177 | 1182 | | |
| |||
1184 | 1189 | | |
1185 | 1190 | | |
1186 | 1191 | | |
1187 | | - | |
| 1192 | + | |
1188 | 1193 | | |
1189 | 1194 | | |
1190 | 1195 | | |
1191 | 1196 | | |
1192 | 1197 | | |
1193 | 1198 | | |
1194 | | - | |
1195 | | - | |
| 1199 | + | |
| 1200 | + | |
1196 | 1201 | | |
1197 | 1202 | | |
1198 | 1203 | | |
| |||
1268 | 1273 | | |
1269 | 1274 | | |
1270 | 1275 | | |
1271 | | - | |
| 1276 | + | |
1272 | 1277 | | |
1273 | 1278 | | |
1274 | 1279 | | |
1275 | 1280 | | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1276 | 1285 | | |
1277 | 1286 | | |
1278 | 1287 | | |
| |||
1294 | 1303 | | |
1295 | 1304 | | |
1296 | 1305 | | |
1297 | | - | |
| 1306 | + | |
1298 | 1307 | | |
1299 | 1308 | | |
1300 | 1309 | | |
| |||
1331 | 1340 | | |
1332 | 1341 | | |
1333 | 1342 | | |
1334 | | - | |
| 1343 | + | |
1335 | 1344 | | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1340 | 1351 | | |
1341 | 1352 | | |
1342 | 1353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
28 | | - | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
48 | 72 | | |
49 | 73 | | |
50 | 74 | | |
| |||
0 commit comments