@parcha/agentrun-dsl 0.1.0-beta.3 → 0.1.0-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +165 -21
  2. package/dist/author-references.d.ts +8 -0
  3. package/dist/author-references.js +8 -0
  4. package/dist/author.d.ts +16 -3
  5. package/dist/author.js +40 -16
  6. package/dist/authoring.js +2 -2
  7. package/dist/cli.js +17 -12
  8. package/dist/code-exec.d.ts +6 -0
  9. package/dist/code-exec.js +126 -0
  10. package/dist/decision-provider.d.ts +157 -0
  11. package/dist/decision-provider.js +230 -0
  12. package/dist/decision-receipts.d.ts +143 -0
  13. package/dist/decision-receipts.js +93 -0
  14. package/dist/dry-run.d.ts +14 -1
  15. package/dist/dry-run.js +58 -15
  16. package/dist/graph.d.ts +169 -0
  17. package/dist/graph.js +433 -0
  18. package/dist/index.d.ts +15 -8
  19. package/dist/index.js +8 -4
  20. package/dist/inspection.d.ts +5 -0
  21. package/dist/inspection.js +16 -3
  22. package/dist/job.d.ts +14 -0
  23. package/dist/job.js +5 -0
  24. package/dist/long-timer.d.ts +7 -0
  25. package/dist/long-timer.js +22 -0
  26. package/dist/observer-snapshot.d.ts +3 -0
  27. package/dist/observer-snapshot.js +46 -0
  28. package/dist/predicates.d.ts +10 -0
  29. package/dist/predicates.js +18 -0
  30. package/dist/recovery/binding.d.ts +10 -0
  31. package/dist/recovery/binding.js +43 -0
  32. package/dist/recovery/call-key.d.ts +13 -0
  33. package/dist/recovery/call-key.js +24 -0
  34. package/dist/recovery/canonical-hash.d.ts +7 -0
  35. package/dist/recovery/canonical-hash.js +22 -0
  36. package/dist/recovery/driver.d.ts +238 -0
  37. package/dist/recovery/driver.js +1337 -0
  38. package/dist/recovery/effect-failure.d.ts +34 -0
  39. package/dist/recovery/effect-failure.js +62 -0
  40. package/dist/recovery/errors.d.ts +31 -0
  41. package/dist/recovery/errors.js +51 -0
  42. package/dist/recovery/execution-path.d.ts +53 -0
  43. package/dist/recovery/execution-path.js +167 -0
  44. package/dist/recovery/file-store.d.ts +7 -0
  45. package/dist/recovery/file-store.js +131 -0
  46. package/dist/recovery/frozen-snapshot.d.ts +274 -0
  47. package/dist/recovery/frozen-snapshot.js +187 -0
  48. package/dist/recovery/handoff-block.d.ts +36 -0
  49. package/dist/recovery/handoff-block.js +148 -0
  50. package/dist/recovery/handoff-digest.d.ts +58 -0
  51. package/dist/recovery/handoff-digest.js +195 -0
  52. package/dist/recovery/handoff-files.d.ts +54 -0
  53. package/dist/recovery/handoff-files.js +162 -0
  54. package/dist/recovery/handoff-receipts.d.ts +42 -0
  55. package/dist/recovery/handoff-receipts.js +53 -0
  56. package/dist/recovery/handoff-redact.d.ts +12 -0
  57. package/dist/recovery/handoff-redact.js +44 -0
  58. package/dist/recovery/handoff.d.ts +44 -0
  59. package/dist/recovery/handoff.js +46 -0
  60. package/dist/recovery/index.d.ts +19 -0
  61. package/dist/recovery/index.js +17 -0
  62. package/dist/recovery/item-state.d.ts +48 -0
  63. package/dist/recovery/item-state.js +89 -0
  64. package/dist/recovery/journal.d.ts +28 -0
  65. package/dist/recovery/journal.js +139 -0
  66. package/dist/recovery/memory-store.d.ts +4 -0
  67. package/dist/recovery/memory-store.js +20 -0
  68. package/dist/recovery/store.d.ts +105 -0
  69. package/dist/recovery/store.js +6 -0
  70. package/dist/recovery/testing/conformance.d.ts +4 -0
  71. package/dist/recovery/testing/conformance.js +268 -0
  72. package/dist/recovery/testing/crash-points.d.ts +18 -0
  73. package/dist/recovery/testing/crash-points.js +43 -0
  74. package/dist/recovery/testing/crash-sweep.d.ts +65 -0
  75. package/dist/recovery/testing/crash-sweep.js +146 -0
  76. package/dist/recovery/testing/index.d.ts +3 -0
  77. package/dist/recovery/testing/index.js +4 -0
  78. package/dist/recovery/testing/preload.d.ts +1 -0
  79. package/dist/recovery/testing/preload.js +3 -0
  80. package/dist/recovery/transport-facts.d.ts +23 -0
  81. package/dist/recovery/transport-facts.js +46 -0
  82. package/dist/recovery/with-recovery.d.ts +50 -0
  83. package/dist/recovery/with-recovery.js +142 -0
  84. package/dist/submit-envelope.d.ts +9 -0
  85. package/dist/submit-envelope.js +40 -0
  86. package/dist/system-one.d.ts +40 -1
  87. package/dist/system-one.js +141 -5
  88. package/dist/testing/decision-provider.d.ts +32 -0
  89. package/dist/testing/decision-provider.js +183 -0
  90. package/dist/testing/index.d.ts +1 -0
  91. package/dist/testing/index.js +2 -0
  92. package/dist/vocabulary.d.ts +22 -3
  93. package/dist/vocabulary.js +33 -10
  94. package/dist/workflow-shape.d.ts +7 -0
  95. package/dist/workflow-shape.js +115 -67
  96. package/dist/workflow.d.ts +269 -20
  97. package/dist/workflow.js +1251 -341
  98. package/package.json +25 -2
  99. package/schema/workflow.schema.json +506 -12
  100. package/skills/author/SKILL.md +6 -1
  101. package/skills/author/references/jev-decisions.md +58 -6
  102. package/skills/author/references/language.md +28 -19
  103. package/skills/author/references/sdk-authoring.md +2 -0
@@ -18,6 +18,12 @@
18
18
  "$ref": "#/definitions/WorkflowNode"
19
19
  },
20
20
  "title": "steps"
21
+ },
22
+ "metadata": {
23
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
24
+ "type": "object",
25
+ "additionalProperties": {},
26
+ "title": "metadata"
21
27
  }
22
28
  },
23
29
  "required": [
@@ -44,6 +50,12 @@
44
50
  "as": {
45
51
  "type": "string",
46
52
  "title": "as"
53
+ },
54
+ "metadata": {
55
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
56
+ "type": "object",
57
+ "additionalProperties": {},
58
+ "title": "metadata"
47
59
  }
48
60
  },
49
61
  "required": [
@@ -171,6 +183,33 @@
171
183
  ],
172
184
  "type": "string",
173
185
  "title": "tier"
186
+ },
187
+ "budget_usd": {
188
+ "description": "The most the node asks to spend, in dollars.",
189
+ "exclusiveMinimum": 0,
190
+ "type": "number",
191
+ "title": "budget_usd"
192
+ },
193
+ "max_turns": {
194
+ "description": "The most turns the node asks its host for, per attempt. The host applies it within its own cap; the engine\nenforces nothing.",
195
+ "minimum": 1,
196
+ "type": "integer",
197
+ "title": "max_turns"
198
+ },
199
+ "context": {
200
+ "description": "An `agent` node's context (`AGENT_CONTEXTS`).",
201
+ "enum": [
202
+ "fork",
203
+ "fresh"
204
+ ],
205
+ "type": "string",
206
+ "title": "context"
207
+ },
208
+ "metadata": {
209
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
210
+ "type": "object",
211
+ "additionalProperties": {},
212
+ "title": "metadata"
174
213
  }
175
214
  },
176
215
  "required": [
@@ -299,6 +338,12 @@
299
338
  ],
300
339
  "type": "string",
301
340
  "title": "tier"
341
+ },
342
+ "metadata": {
343
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
344
+ "type": "object",
345
+ "additionalProperties": {},
346
+ "title": "metadata"
302
347
  }
303
348
  },
304
349
  "required": [
@@ -427,6 +472,12 @@
427
472
  ],
428
473
  "type": "string",
429
474
  "title": "tier"
475
+ },
476
+ "metadata": {
477
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
478
+ "type": "object",
479
+ "additionalProperties": {},
480
+ "title": "metadata"
430
481
  }
431
482
  },
432
483
  "required": [
@@ -503,6 +554,12 @@
503
554
  ],
504
555
  "type": "string",
505
556
  "title": "thinking"
557
+ },
558
+ "metadata": {
559
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
560
+ "type": "object",
561
+ "additionalProperties": {},
562
+ "title": "metadata"
506
563
  }
507
564
  },
508
565
  "required": [
@@ -590,6 +647,12 @@
590
647
  "type": "string"
591
648
  },
592
649
  "title": "requires"
650
+ },
651
+ "metadata": {
652
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
653
+ "type": "object",
654
+ "additionalProperties": {},
655
+ "title": "metadata"
593
656
  }
594
657
  },
595
658
  "required": [
@@ -629,6 +692,26 @@
629
692
  "maxConcurrency": {
630
693
  "type": "number",
631
694
  "title": "maxConcurrency"
695
+ },
696
+ "onItemFailure": {
697
+ "description": "What an item's failure does: `stop` (the default) stops the map and the run; `collect` ends the item as a row\nof `failedAs` when its failure is an item failure (`isItemFailure`), and the other items finish.",
698
+ "enum": [
699
+ "collect",
700
+ "stop"
701
+ ],
702
+ "type": "string",
703
+ "title": "onItemFailure"
704
+ },
705
+ "failedAs": {
706
+ "description": "With `onItemFailure: \"collect\"`, the state key the map writes its failed items under, one row each in item order:\n`{ item_index, label, code, message }`. `as` stays aligned with the items, `null` in a failed item's slot.",
707
+ "type": "string",
708
+ "title": "failedAs"
709
+ },
710
+ "metadata": {
711
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
712
+ "type": "object",
713
+ "additionalProperties": {},
714
+ "title": "metadata"
632
715
  }
633
716
  },
634
717
  "required": [
@@ -657,6 +740,12 @@
657
740
  "$ref": "#/definitions/WorkflowNode"
658
741
  },
659
742
  "title": "branches"
743
+ },
744
+ "metadata": {
745
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
746
+ "type": "object",
747
+ "additionalProperties": {},
748
+ "title": "metadata"
660
749
  }
661
750
  },
662
751
  "required": [
@@ -688,6 +777,16 @@
688
777
  "maxIters": {
689
778
  "type": "number",
690
779
  "title": "maxIters"
780
+ },
781
+ "expect_iters": {
782
+ "type": "number",
783
+ "title": "expect_iters"
784
+ },
785
+ "metadata": {
786
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
787
+ "type": "object",
788
+ "additionalProperties": {},
789
+ "title": "metadata"
691
790
  }
692
791
  },
693
792
  "required": [
@@ -725,6 +824,12 @@
725
824
  "summary": {
726
825
  "type": "string",
727
826
  "title": "summary"
827
+ },
828
+ "metadata": {
829
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
830
+ "type": "object",
831
+ "additionalProperties": {},
832
+ "title": "metadata"
728
833
  }
729
834
  },
730
835
  "required": [
@@ -767,6 +872,39 @@
767
872
  "type": "string"
768
873
  },
769
874
  "title": "requires"
875
+ },
876
+ "provider": {
877
+ "type": "string",
878
+ "title": "provider"
879
+ },
880
+ "model": {
881
+ "type": "string",
882
+ "title": "model"
883
+ },
884
+ "evidence": {
885
+ "description": "What a decision node asks of its provider's evidence: none, whatever it gives, or some (a provider that gives none is refused before the run).",
886
+ "enum": [
887
+ "if_supported",
888
+ "off",
889
+ "required"
890
+ ],
891
+ "type": "string",
892
+ "title": "evidence"
893
+ },
894
+ "timeoutMs": {
895
+ "type": "number",
896
+ "title": "timeoutMs"
897
+ },
898
+ "images": {
899
+ "description": "The images a decision node sends with its request: each key is a token (such as `\"<page1>\"`) that appears literally in\nthe node's `state` or in a question's text, and each value is a reference to the image, written as a `state` value is\n(`\"{item.pages.0.image}\"`, or a literal path), that resolves to a string the host loads (a run-relative file path).",
900
+ "$ref": "#/definitions/DecisionImages",
901
+ "title": "images"
902
+ },
903
+ "metadata": {
904
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
905
+ "type": "object",
906
+ "additionalProperties": {},
907
+ "title": "metadata"
770
908
  }
771
909
  },
772
910
  "required": [
@@ -820,6 +958,39 @@
820
958
  "type": "string"
821
959
  },
822
960
  "title": "requires"
961
+ },
962
+ "provider": {
963
+ "type": "string",
964
+ "title": "provider"
965
+ },
966
+ "model": {
967
+ "type": "string",
968
+ "title": "model"
969
+ },
970
+ "evidence": {
971
+ "description": "What a decision node asks of its provider's evidence: none, whatever it gives, or some (a provider that gives none is refused before the run).",
972
+ "enum": [
973
+ "if_supported",
974
+ "off",
975
+ "required"
976
+ ],
977
+ "type": "string",
978
+ "title": "evidence"
979
+ },
980
+ "timeoutMs": {
981
+ "type": "number",
982
+ "title": "timeoutMs"
983
+ },
984
+ "images": {
985
+ "description": "The images a decision node sends with its request: each key is a token (such as `\"<page1>\"`) that appears literally in\nthe node's `state` or in a question's text, and each value is a reference to the image, written as a `state` value is\n(`\"{item.pages.0.image}\"`, or a literal path), that resolves to a string the host loads (a run-relative file path).",
986
+ "$ref": "#/definitions/DecisionImages",
987
+ "title": "images"
988
+ },
989
+ "metadata": {
990
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
991
+ "type": "object",
992
+ "additionalProperties": {},
993
+ "title": "metadata"
823
994
  }
824
995
  },
825
996
  "required": [
@@ -887,6 +1058,39 @@
887
1058
  "type": "string"
888
1059
  },
889
1060
  "title": "requires"
1061
+ },
1062
+ "provider": {
1063
+ "type": "string",
1064
+ "title": "provider"
1065
+ },
1066
+ "model": {
1067
+ "type": "string",
1068
+ "title": "model"
1069
+ },
1070
+ "evidence": {
1071
+ "description": "What a decision node asks of its provider's evidence: none, whatever it gives, or some (a provider that gives none is refused before the run).",
1072
+ "enum": [
1073
+ "if_supported",
1074
+ "off",
1075
+ "required"
1076
+ ],
1077
+ "type": "string",
1078
+ "title": "evidence"
1079
+ },
1080
+ "timeoutMs": {
1081
+ "type": "number",
1082
+ "title": "timeoutMs"
1083
+ },
1084
+ "images": {
1085
+ "description": "The images a decision node sends with its request: each key is a token (such as `\"<page1>\"`) that appears literally in\nthe node's `state` or in a question's text, and each value is a reference to the image, written as a `state` value is\n(`\"{item.pages.0.image}\"`, or a literal path), that resolves to a string the host loads (a run-relative file path).",
1086
+ "$ref": "#/definitions/DecisionImages",
1087
+ "title": "images"
1088
+ },
1089
+ "metadata": {
1090
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
1091
+ "type": "object",
1092
+ "additionalProperties": {},
1093
+ "title": "metadata"
890
1094
  }
891
1095
  },
892
1096
  "required": [
@@ -898,7 +1102,7 @@
898
1102
  ]
899
1103
  },
900
1104
  {
901
- "description": "A choice among subgraphs. The options are the branch names, their criteria the branch\ndescriptions; the chosen branch runs on the state. `as` (optional) records the choice and its\ndistribution; `unsure` names the branch taken when confidence is below `gte`.",
1105
+ "description": "A choice among subgraphs that Jev makes. The options are the branch names, their criteria the branch\ndescriptions; the chosen branch runs on the state. `as` (optional) records the choice and its\ndistribution; `unsure` names the branch taken when confidence is below `gte`.",
902
1106
  "type": "object",
903
1107
  "properties": {
904
1108
  "node": {
@@ -966,6 +1170,39 @@
966
1170
  "type": "string"
967
1171
  },
968
1172
  "title": "requires"
1173
+ },
1174
+ "provider": {
1175
+ "type": "string",
1176
+ "title": "provider"
1177
+ },
1178
+ "model": {
1179
+ "type": "string",
1180
+ "title": "model"
1181
+ },
1182
+ "evidence": {
1183
+ "description": "What a decision node asks of its provider's evidence: none, whatever it gives, or some (a provider that gives none is refused before the run).",
1184
+ "enum": [
1185
+ "if_supported",
1186
+ "off",
1187
+ "required"
1188
+ ],
1189
+ "type": "string",
1190
+ "title": "evidence"
1191
+ },
1192
+ "timeoutMs": {
1193
+ "type": "number",
1194
+ "title": "timeoutMs"
1195
+ },
1196
+ "images": {
1197
+ "description": "The images a decision node sends with its request: each key is a token (such as `\"<page1>\"`) that appears literally in\nthe node's `state` or in a question's text, and each value is a reference to the image, written as a `state` value is\n(`\"{item.pages.0.image}\"`, or a literal path), that resolves to a string the host loads (a run-relative file path).",
1198
+ "$ref": "#/definitions/DecisionImages",
1199
+ "title": "images"
1200
+ },
1201
+ "metadata": {
1202
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
1203
+ "type": "object",
1204
+ "additionalProperties": {},
1205
+ "title": "metadata"
969
1206
  }
970
1207
  },
971
1208
  "required": [
@@ -974,7 +1211,102 @@
974
1211
  "label",
975
1212
  "node",
976
1213
  "state"
977
- ]
1214
+ ],
1215
+ "not": {
1216
+ "anyOf": [
1217
+ {
1218
+ "required": [
1219
+ "valuePath"
1220
+ ]
1221
+ },
1222
+ {
1223
+ "required": [
1224
+ "otherwise"
1225
+ ]
1226
+ }
1227
+ ]
1228
+ }
1229
+ },
1230
+ {
1231
+ "description": "A route by a value already in state: the string at `valuePath` names the branch. A missing value or\nan unknown name takes `otherwise` when declared and fails before any branch otherwise; a value that is\nnot a string always fails. `as` records `{value, taken, fallback}`.",
1232
+ "type": "object",
1233
+ "properties": {
1234
+ "node": {
1235
+ "type": "string",
1236
+ "const": "route",
1237
+ "title": "node"
1238
+ },
1239
+ "label": {
1240
+ "type": "string",
1241
+ "title": "label"
1242
+ },
1243
+ "valuePath": {
1244
+ "type": "string",
1245
+ "title": "valuePath"
1246
+ },
1247
+ "branches": {
1248
+ "type": "object",
1249
+ "additionalProperties": {
1250
+ "type": "object",
1251
+ "properties": {
1252
+ "body": {
1253
+ "$ref": "#/definitions/WorkflowNode",
1254
+ "title": "body"
1255
+ }
1256
+ },
1257
+ "required": [
1258
+ "body"
1259
+ ]
1260
+ },
1261
+ "title": "branches"
1262
+ },
1263
+ "otherwise": {
1264
+ "type": "string",
1265
+ "title": "otherwise"
1266
+ },
1267
+ "as": {
1268
+ "type": "string",
1269
+ "title": "as"
1270
+ },
1271
+ "requires": {
1272
+ "type": "array",
1273
+ "items": {
1274
+ "type": "string"
1275
+ },
1276
+ "title": "requires"
1277
+ },
1278
+ "metadata": {
1279
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
1280
+ "type": "object",
1281
+ "additionalProperties": {},
1282
+ "title": "metadata"
1283
+ }
1284
+ },
1285
+ "required": [
1286
+ "branches",
1287
+ "label",
1288
+ "node",
1289
+ "valuePath"
1290
+ ],
1291
+ "not": {
1292
+ "anyOf": [
1293
+ {
1294
+ "required": [
1295
+ "state"
1296
+ ]
1297
+ },
1298
+ {
1299
+ "required": [
1300
+ "instructions"
1301
+ ]
1302
+ },
1303
+ {
1304
+ "required": [
1305
+ "unsure"
1306
+ ]
1307
+ }
1308
+ ]
1309
+ }
978
1310
  },
979
1311
  {
980
1312
  "type": "object",
@@ -1060,6 +1392,7 @@
1060
1392
  "title": "deadline_s"
1061
1393
  },
1062
1394
  "retry": {
1395
+ "description": "`on` names retry classes or effect failure codes; absent, the transient retry classes.",
1063
1396
  "type": "object",
1064
1397
  "properties": {
1065
1398
  "attempts": {
@@ -1073,7 +1406,24 @@
1073
1406
  "on": {
1074
1407
  "type": "array",
1075
1408
  "items": {
1076
- "$ref": "#/definitions/CallRetryClass"
1409
+ "enum": [
1410
+ "connection",
1411
+ "effect_code_unsafe",
1412
+ "effect_exit",
1413
+ "effect_not_granted",
1414
+ "effect_path_escape",
1415
+ "effect_produces_missing",
1416
+ "effect_timeout",
1417
+ "effect_transport",
1418
+ "effect_unknown_transport",
1419
+ "exit",
1420
+ "http_429",
1421
+ "http_5xx",
1422
+ "output_invalid",
1423
+ "state_invalid",
1424
+ "timeout"
1425
+ ],
1426
+ "type": "string"
1077
1427
  },
1078
1428
  "title": "on"
1079
1429
  }
@@ -1273,6 +1623,33 @@
1273
1623
  "predicate",
1274
1624
  "values"
1275
1625
  ]
1626
+ },
1627
+ {
1628
+ "type": "object",
1629
+ "properties": {
1630
+ "predicate": {
1631
+ "type": "string",
1632
+ "const": "field_type",
1633
+ "title": "predicate"
1634
+ },
1635
+ "path": {
1636
+ "type": "string",
1637
+ "title": "path"
1638
+ },
1639
+ "type": {
1640
+ "$ref": "#/definitions/FieldType",
1641
+ "title": "type"
1642
+ }
1643
+ },
1644
+ "required": [
1645
+ "path",
1646
+ "predicate",
1647
+ "type"
1648
+ ]
1649
+ },
1650
+ {
1651
+ "$ref": "#/definitions/NotPredicate",
1652
+ "description": "Holds when `of` does not. `of` is mechanical: a judged question never sits inside a negation."
1276
1653
  }
1277
1654
  ],
1278
1655
  "title": "fail_when"
@@ -1299,6 +1676,12 @@
1299
1676
  "type": "string"
1300
1677
  },
1301
1678
  "title": "requires"
1679
+ },
1680
+ "metadata": {
1681
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
1682
+ "type": "object",
1683
+ "additionalProperties": {},
1684
+ "title": "metadata"
1302
1685
  }
1303
1686
  },
1304
1687
  "required": [
@@ -1337,6 +1720,12 @@
1337
1720
  "as": {
1338
1721
  "type": "string",
1339
1722
  "title": "as"
1723
+ },
1724
+ "metadata": {
1725
+ "description": "Host-owned markers on a node: any JSON object. The engine admits, carries and hashes it with the\ndocument and never reads it; it never reaches state, events, prompts or effect identities.",
1726
+ "type": "object",
1727
+ "additionalProperties": {},
1728
+ "title": "metadata"
1340
1729
  }
1341
1730
  },
1342
1731
  "required": [
@@ -1537,6 +1926,33 @@
1537
1926
  "values"
1538
1927
  ]
1539
1928
  },
1929
+ {
1930
+ "type": "object",
1931
+ "properties": {
1932
+ "predicate": {
1933
+ "type": "string",
1934
+ "const": "field_type",
1935
+ "title": "predicate"
1936
+ },
1937
+ "path": {
1938
+ "type": "string",
1939
+ "title": "path"
1940
+ },
1941
+ "type": {
1942
+ "$ref": "#/definitions/FieldType",
1943
+ "title": "type"
1944
+ }
1945
+ },
1946
+ "required": [
1947
+ "path",
1948
+ "predicate",
1949
+ "type"
1950
+ ]
1951
+ },
1952
+ {
1953
+ "$ref": "#/definitions/NotPredicate",
1954
+ "description": "Holds when `of` does not. `of` is mechanical: a judged question never sits inside a negation."
1955
+ },
1540
1956
  {
1541
1957
  "type": "object",
1542
1958
  "properties": {
@@ -1570,6 +1986,33 @@
1570
1986
  "gte": {
1571
1987
  "type": "number",
1572
1988
  "title": "gte"
1989
+ },
1990
+ "provider": {
1991
+ "type": "string",
1992
+ "title": "provider"
1993
+ },
1994
+ "model": {
1995
+ "type": "string",
1996
+ "title": "model"
1997
+ },
1998
+ "evidence": {
1999
+ "description": "What a decision node asks of its provider's evidence: none, whatever it gives, or some (a provider that gives none is refused before the run).",
2000
+ "enum": [
2001
+ "if_supported",
2002
+ "off",
2003
+ "required"
2004
+ ],
2005
+ "type": "string",
2006
+ "title": "evidence"
2007
+ },
2008
+ "timeoutMs": {
2009
+ "type": "number",
2010
+ "title": "timeoutMs"
2011
+ },
2012
+ "images": {
2013
+ "description": "The images a decision node sends with its request: each key is a token (such as `\"<page1>\"`) that appears literally in\nthe node's `state` or in a question's text, and each value is a reference to the image, written as a `state` value is\n(`\"{item.pages.0.image}\"`, or a literal path), that resolves to a string the host loads (a run-relative file path).",
2014
+ "$ref": "#/definitions/DecisionImages",
2015
+ "title": "images"
1573
2016
  }
1574
2017
  },
1575
2018
  "required": [
@@ -1579,20 +2022,19 @@
1579
2022
  }
1580
2023
  ]
1581
2024
  },
1582
- "CallRetryClass": {
1583
- "description": "`exit` is a shell command that ended with a non-zero status: retried only when the author\ndeclared retry, since re-running a command is the author's call.",
1584
- "title": "CallRetryClass",
2025
+ "FieldType": {
2026
+ "title": "FieldType",
1585
2027
  "enum": [
1586
- "connection",
1587
- "exit",
1588
- "http_429",
1589
- "http_5xx",
1590
- "timeout"
2028
+ "array",
2029
+ "boolean",
2030
+ "null",
2031
+ "number",
2032
+ "object",
2033
+ "string"
1591
2034
  ],
1592
2035
  "type": "string"
1593
2036
  },
1594
2037
  "AcceptPredicate": {
1595
- "description": "A predicate a `call` evaluates against ITS OWN RESULT: paths are result-relative.",
1596
2038
  "title": "AcceptPredicate",
1597
2039
  "anyOf": [
1598
2040
  {
@@ -1774,9 +2216,61 @@
1774
2216
  "predicate",
1775
2217
  "values"
1776
2218
  ]
2219
+ },
2220
+ {
2221
+ "type": "object",
2222
+ "properties": {
2223
+ "predicate": {
2224
+ "type": "string",
2225
+ "const": "field_type",
2226
+ "title": "predicate"
2227
+ },
2228
+ "path": {
2229
+ "type": "string",
2230
+ "title": "path"
2231
+ },
2232
+ "type": {
2233
+ "$ref": "#/definitions/FieldType",
2234
+ "title": "type"
2235
+ }
2236
+ },
2237
+ "required": [
2238
+ "path",
2239
+ "predicate",
2240
+ "type"
2241
+ ]
2242
+ },
2243
+ {
2244
+ "$ref": "#/definitions/NotPredicate",
2245
+ "description": "Holds when `of` does not. `of` is mechanical: a judged question never sits inside a negation."
1777
2246
  }
1778
2247
  ]
1779
2248
  },
2249
+ "NotPredicate": {
2250
+ "description": "Holds when `of` does not. `of` is mechanical: a judged question never sits inside a negation.",
2251
+ "title": "NotPredicate",
2252
+ "type": "object",
2253
+ "properties": {
2254
+ "predicate": {
2255
+ "type": "string",
2256
+ "const": "not",
2257
+ "title": "predicate"
2258
+ },
2259
+ "of": {
2260
+ "$ref": "#/definitions/AcceptPredicate",
2261
+ "title": "of"
2262
+ }
2263
+ },
2264
+ "required": [
2265
+ "of",
2266
+ "predicate"
2267
+ ]
2268
+ },
2269
+ "DecisionImages": {
2270
+ "description": "The images a decision node sends with its request: each key is a token (such as `\"<page1>\"`) that appears literally in\nthe node's `state` or in a question's text, and each value is a reference to the image, written as a `state` value is\n(`\"{item.pages.0.image}\"`, or a literal path), that resolves to a string the host loads (a run-relative file path).",
2271
+ "title": "DecisionImages",
2272
+ "type": "object"
2273
+ },
1780
2274
  "Workflow": {
1781
2275
  "title": "Workflow",
1782
2276
  "type": "object",