@sunshaobei/dsh-workflow 0.0.0-stage → 2.1.2

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 (386) hide show
  1. package/README.md +43 -2
  2. package/cordis.patch.yml +17 -0
  3. package/lib/client.js +14708 -0
  4. package/lib/core.js +137 -0
  5. package/lib/engine-adapter.js +1387 -0
  6. package/lib/host-driver.js +298 -0
  7. package/lib/index.js +536 -0
  8. package/lib/projection.js +159 -0
  9. package/lib/registry.js +218 -0
  10. package/lib/session-records.js +54 -0
  11. package/lib/submission-commit.js +34 -0
  12. package/lib/world-driver.js +275 -0
  13. package/package.json +67 -4
  14. package/vendor/PROVENANCE.md +9 -0
  15. package/vendor/dynamic-workflow/analysis/actor-graph.d.ts +47 -0
  16. package/vendor/dynamic-workflow/analysis/actor-graph.d.ts.map +1 -0
  17. package/vendor/dynamic-workflow/analysis/actor-graph.js +95 -0
  18. package/vendor/dynamic-workflow/analysis/actor-models.d.ts +60 -0
  19. package/vendor/dynamic-workflow/analysis/actor-models.d.ts.map +1 -0
  20. package/vendor/dynamic-workflow/analysis/actor-models.js +208 -0
  21. package/vendor/dynamic-workflow/analysis/actor-names.d.ts +56 -0
  22. package/vendor/dynamic-workflow/analysis/actor-names.d.ts.map +1 -0
  23. package/vendor/dynamic-workflow/analysis/actor-names.js +155 -0
  24. package/vendor/dynamic-workflow/analysis/analyze.d.ts +63 -0
  25. package/vendor/dynamic-workflow/analysis/analyze.d.ts.map +1 -0
  26. package/vendor/dynamic-workflow/analysis/analyze.js +92 -0
  27. package/vendor/dynamic-workflow/analysis/array-methods.d.ts +21 -0
  28. package/vendor/dynamic-workflow/analysis/array-methods.d.ts.map +1 -0
  29. package/vendor/dynamic-workflow/analysis/array-methods.js +132 -0
  30. package/vendor/dynamic-workflow/analysis/artifact-types.d.ts +39 -0
  31. package/vendor/dynamic-workflow/analysis/artifact-types.d.ts.map +1 -0
  32. package/vendor/dynamic-workflow/analysis/artifact-types.js +114 -0
  33. package/vendor/dynamic-workflow/analysis/artifacts.d.ts +67 -0
  34. package/vendor/dynamic-workflow/analysis/artifacts.d.ts.map +1 -0
  35. package/vendor/dynamic-workflow/analysis/artifacts.js +263 -0
  36. package/vendor/dynamic-workflow/analysis/assign.d.ts +42 -0
  37. package/vendor/dynamic-workflow/analysis/assign.d.ts.map +1 -0
  38. package/vendor/dynamic-workflow/analysis/assign.js +287 -0
  39. package/vendor/dynamic-workflow/analysis/callbacks.d.ts +71 -0
  40. package/vendor/dynamic-workflow/analysis/callbacks.d.ts.map +1 -0
  41. package/vendor/dynamic-workflow/analysis/callbacks.js +133 -0
  42. package/vendor/dynamic-workflow/analysis/calls.d.ts +40 -0
  43. package/vendor/dynamic-workflow/analysis/calls.d.ts.map +1 -0
  44. package/vendor/dynamic-workflow/analysis/calls.js +495 -0
  45. package/vendor/dynamic-workflow/analysis/causality-graph-lanes.d.ts +25 -0
  46. package/vendor/dynamic-workflow/analysis/causality-graph-lanes.d.ts.map +1 -0
  47. package/vendor/dynamic-workflow/analysis/causality-graph-lanes.js +161 -0
  48. package/vendor/dynamic-workflow/analysis/causality-graph-types.d.ts +163 -0
  49. package/vendor/dynamic-workflow/analysis/causality-graph-types.d.ts.map +1 -0
  50. package/vendor/dynamic-workflow/analysis/causality-graph-types.js +8 -0
  51. package/vendor/dynamic-workflow/analysis/causality-graph.d.ts +39 -0
  52. package/vendor/dynamic-workflow/analysis/causality-graph.d.ts.map +1 -0
  53. package/vendor/dynamic-workflow/analysis/causality-graph.js +530 -0
  54. package/vendor/dynamic-workflow/analysis/causality-order-calls.d.ts +29 -0
  55. package/vendor/dynamic-workflow/analysis/causality-order-calls.d.ts.map +1 -0
  56. package/vendor/dynamic-workflow/analysis/causality-order-calls.js +266 -0
  57. package/vendor/dynamic-workflow/analysis/causality-order-functions.d.ts +26 -0
  58. package/vendor/dynamic-workflow/analysis/causality-order-functions.d.ts.map +1 -0
  59. package/vendor/dynamic-workflow/analysis/causality-order-functions.js +116 -0
  60. package/vendor/dynamic-workflow/analysis/causality-order-loops.d.ts +5 -0
  61. package/vendor/dynamic-workflow/analysis/causality-order-loops.d.ts.map +1 -0
  62. package/vendor/dynamic-workflow/analysis/causality-order-loops.js +148 -0
  63. package/vendor/dynamic-workflow/analysis/causality-order-settle.d.ts +39 -0
  64. package/vendor/dynamic-workflow/analysis/causality-order-settle.d.ts.map +1 -0
  65. package/vendor/dynamic-workflow/analysis/causality-order-settle.js +263 -0
  66. package/vendor/dynamic-workflow/analysis/causality-order-state.d.ts +110 -0
  67. package/vendor/dynamic-workflow/analysis/causality-order-state.d.ts.map +1 -0
  68. package/vendor/dynamic-workflow/analysis/causality-order-state.js +162 -0
  69. package/vendor/dynamic-workflow/analysis/causality-order-strands.d.ts +79 -0
  70. package/vendor/dynamic-workflow/analysis/causality-order-strands.d.ts.map +1 -0
  71. package/vendor/dynamic-workflow/analysis/causality-order-strands.js +154 -0
  72. package/vendor/dynamic-workflow/analysis/causality-order-types.d.ts +174 -0
  73. package/vendor/dynamic-workflow/analysis/causality-order-types.d.ts.map +1 -0
  74. package/vendor/dynamic-workflow/analysis/causality-order-types.js +1 -0
  75. package/vendor/dynamic-workflow/analysis/causality-order-walk.d.ts +17 -0
  76. package/vendor/dynamic-workflow/analysis/causality-order-walk.d.ts.map +1 -0
  77. package/vendor/dynamic-workflow/analysis/causality-order-walk.js +282 -0
  78. package/vendor/dynamic-workflow/analysis/causality-order.d.ts +60 -0
  79. package/vendor/dynamic-workflow/analysis/causality-order.d.ts.map +1 -0
  80. package/vendor/dynamic-workflow/analysis/causality-order.js +110 -0
  81. package/vendor/dynamic-workflow/analysis/causality-reduce.d.ts +60 -0
  82. package/vendor/dynamic-workflow/analysis/causality-reduce.d.ts.map +1 -0
  83. package/vendor/dynamic-workflow/analysis/causality-reduce.js +198 -0
  84. package/vendor/dynamic-workflow/analysis/classes.d.ts +47 -0
  85. package/vendor/dynamic-workflow/analysis/classes.d.ts.map +1 -0
  86. package/vendor/dynamic-workflow/analysis/classes.js +264 -0
  87. package/vendor/dynamic-workflow/analysis/constants.d.ts +35 -0
  88. package/vendor/dynamic-workflow/analysis/constants.d.ts.map +1 -0
  89. package/vendor/dynamic-workflow/analysis/constants.js +23 -0
  90. package/vendor/dynamic-workflow/analysis/control-flow.d.ts +26 -0
  91. package/vendor/dynamic-workflow/analysis/control-flow.d.ts.map +1 -0
  92. package/vendor/dynamic-workflow/analysis/control-flow.js +132 -0
  93. package/vendor/dynamic-workflow/analysis/core-json.d.ts +45 -0
  94. package/vendor/dynamic-workflow/analysis/core-json.d.ts.map +1 -0
  95. package/vendor/dynamic-workflow/analysis/core-json.js +49 -0
  96. package/vendor/dynamic-workflow/analysis/core.d.ts +194 -0
  97. package/vendor/dynamic-workflow/analysis/core.d.ts.map +1 -0
  98. package/vendor/dynamic-workflow/analysis/core.js +204 -0
  99. package/vendor/dynamic-workflow/analysis/domain.d.ts +269 -0
  100. package/vendor/dynamic-workflow/analysis/domain.d.ts.map +1 -0
  101. package/vendor/dynamic-workflow/analysis/domain.js +523 -0
  102. package/vendor/dynamic-workflow/analysis/facade-misuse.d.ts +56 -0
  103. package/vendor/dynamic-workflow/analysis/facade-misuse.d.ts.map +1 -0
  104. package/vendor/dynamic-workflow/analysis/facade-misuse.js +350 -0
  105. package/vendor/dynamic-workflow/analysis/fanout-cardinality.d.ts +11 -0
  106. package/vendor/dynamic-workflow/analysis/fanout-cardinality.d.ts.map +1 -0
  107. package/vendor/dynamic-workflow/analysis/fanout-cardinality.js +121 -0
  108. package/vendor/dynamic-workflow/analysis/flow-graph.d.ts +113 -0
  109. package/vendor/dynamic-workflow/analysis/flow-graph.d.ts.map +1 -0
  110. package/vendor/dynamic-workflow/analysis/flow-graph.js +411 -0
  111. package/vendor/dynamic-workflow/analysis/flow-phase.d.ts +28 -0
  112. package/vendor/dynamic-workflow/analysis/flow-phase.d.ts.map +1 -0
  113. package/vendor/dynamic-workflow/analysis/flow-phase.js +104 -0
  114. package/vendor/dynamic-workflow/analysis/flow-strands.d.ts +39 -0
  115. package/vendor/dynamic-workflow/analysis/flow-strands.d.ts.map +1 -0
  116. package/vendor/dynamic-workflow/analysis/flow-strands.js +47 -0
  117. package/vendor/dynamic-workflow/analysis/flow-tree.d.ts +35 -0
  118. package/vendor/dynamic-workflow/analysis/flow-tree.d.ts.map +1 -0
  119. package/vendor/dynamic-workflow/analysis/flow-tree.js +33 -0
  120. package/vendor/dynamic-workflow/analysis/graph.d.ts +5 -0
  121. package/vendor/dynamic-workflow/analysis/graph.d.ts.map +1 -0
  122. package/vendor/dynamic-workflow/analysis/graph.js +199 -0
  123. package/vendor/dynamic-workflow/analysis/handoff-graph.d.ts +48 -0
  124. package/vendor/dynamic-workflow/analysis/handoff-graph.d.ts.map +1 -0
  125. package/vendor/dynamic-workflow/analysis/handoff-graph.js +0 -0
  126. package/vendor/dynamic-workflow/analysis/heap-ops.d.ts +14 -0
  127. package/vendor/dynamic-workflow/analysis/heap-ops.d.ts.map +1 -0
  128. package/vendor/dynamic-workflow/analysis/heap-ops.js +70 -0
  129. package/vendor/dynamic-workflow/analysis/hole-id.d.ts +28 -0
  130. package/vendor/dynamic-workflow/analysis/hole-id.d.ts.map +1 -0
  131. package/vendor/dynamic-workflow/analysis/hole-id.js +41 -0
  132. package/vendor/dynamic-workflow/analysis/hole-sites.d.ts +32 -0
  133. package/vendor/dynamic-workflow/analysis/hole-sites.d.ts.map +1 -0
  134. package/vendor/dynamic-workflow/analysis/hole-sites.js +215 -0
  135. package/vendor/dynamic-workflow/analysis/hole-splice.d.ts +45 -0
  136. package/vendor/dynamic-workflow/analysis/hole-splice.d.ts.map +1 -0
  137. package/vendor/dynamic-workflow/analysis/hole-splice.js +100 -0
  138. package/vendor/dynamic-workflow/analysis/interpret.d.ts +26 -0
  139. package/vendor/dynamic-workflow/analysis/interpret.d.ts.map +1 -0
  140. package/vendor/dynamic-workflow/analysis/interpret.js +200 -0
  141. package/vendor/dynamic-workflow/analysis/literals.d.ts +18 -0
  142. package/vendor/dynamic-workflow/analysis/literals.d.ts.map +1 -0
  143. package/vendor/dynamic-workflow/analysis/literals.js +125 -0
  144. package/vendor/dynamic-workflow/analysis/mermaid.d.ts +60 -0
  145. package/vendor/dynamic-workflow/analysis/mermaid.d.ts.map +1 -0
  146. package/vendor/dynamic-workflow/analysis/mermaid.js +477 -0
  147. package/vendor/dynamic-workflow/analysis/patterns.d.ts +31 -0
  148. package/vendor/dynamic-workflow/analysis/patterns.d.ts.map +1 -0
  149. package/vendor/dynamic-workflow/analysis/patterns.js +94 -0
  150. package/vendor/dynamic-workflow/analysis/phase-graph.d.ts +47 -0
  151. package/vendor/dynamic-workflow/analysis/phase-graph.d.ts.map +1 -0
  152. package/vendor/dynamic-workflow/analysis/phase-graph.js +334 -0
  153. package/vendor/dynamic-workflow/analysis/phases.d.ts +24 -0
  154. package/vendor/dynamic-workflow/analysis/phases.d.ts.map +1 -0
  155. package/vendor/dynamic-workflow/analysis/phases.js +54 -0
  156. package/vendor/dynamic-workflow/analysis/promise-ops.d.ts +52 -0
  157. package/vendor/dynamic-workflow/analysis/promise-ops.d.ts.map +1 -0
  158. package/vendor/dynamic-workflow/analysis/promise-ops.js +123 -0
  159. package/vendor/dynamic-workflow/analysis/relays.d.ts +12 -0
  160. package/vendor/dynamic-workflow/analysis/relays.d.ts.map +1 -0
  161. package/vendor/dynamic-workflow/analysis/relays.js +78 -0
  162. package/vendor/dynamic-workflow/analysis/serialize.d.ts +125 -0
  163. package/vendor/dynamic-workflow/analysis/serialize.d.ts.map +1 -0
  164. package/vendor/dynamic-workflow/analysis/serialize.js +321 -0
  165. package/vendor/dynamic-workflow/analysis/site-phases.d.ts +32 -0
  166. package/vendor/dynamic-workflow/analysis/site-phases.d.ts.map +1 -0
  167. package/vendor/dynamic-workflow/analysis/site-phases.js +69 -0
  168. package/vendor/dynamic-workflow/analysis/sites-labels.d.ts +71 -0
  169. package/vendor/dynamic-workflow/analysis/sites-labels.d.ts.map +1 -0
  170. package/vendor/dynamic-workflow/analysis/sites-labels.js +189 -0
  171. package/vendor/dynamic-workflow/analysis/sites.d.ts +267 -0
  172. package/vendor/dynamic-workflow/analysis/sites.d.ts.map +1 -0
  173. package/vendor/dynamic-workflow/analysis/sites.js +225 -0
  174. package/vendor/dynamic-workflow/analysis/state.d.ts +254 -0
  175. package/vendor/dynamic-workflow/analysis/state.d.ts.map +1 -0
  176. package/vendor/dynamic-workflow/analysis/state.js +569 -0
  177. package/vendor/dynamic-workflow/analysis/taint.d.ts +97 -0
  178. package/vendor/dynamic-workflow/analysis/taint.d.ts.map +1 -0
  179. package/vendor/dynamic-workflow/analysis/taint.js +649 -0
  180. package/vendor/dynamic-workflow/analysis/types.d.ts +100 -0
  181. package/vendor/dynamic-workflow/analysis/types.d.ts.map +1 -0
  182. package/vendor/dynamic-workflow/analysis/types.js +1 -0
  183. package/vendor/dynamic-workflow/analysis/world-run.d.ts +27 -0
  184. package/vendor/dynamic-workflow/analysis/world-run.d.ts.map +1 -0
  185. package/vendor/dynamic-workflow/analysis/world-run.js +44 -0
  186. package/vendor/dynamic-workflow/compiler/compile.d.ts +59 -0
  187. package/vendor/dynamic-workflow/compiler/compile.d.ts.map +1 -0
  188. package/vendor/dynamic-workflow/compiler/compile.js +159 -0
  189. package/vendor/dynamic-workflow/compiler/libs.generated.d.ts +3 -0
  190. package/vendor/dynamic-workflow/compiler/libs.generated.d.ts.map +1 -0
  191. package/vendor/dynamic-workflow/compiler/libs.generated.js +64 -0
  192. package/vendor/dynamic-workflow/engine/artifact-spec.d.ts +26 -0
  193. package/vendor/dynamic-workflow/engine/artifact-spec.d.ts.map +1 -0
  194. package/vendor/dynamic-workflow/engine/artifact-spec.js +173 -0
  195. package/vendor/dynamic-workflow/engine/ask-observation-types.d.ts +54 -0
  196. package/vendor/dynamic-workflow/engine/ask-observation-types.d.ts.map +1 -0
  197. package/vendor/dynamic-workflow/engine/ask-observation-types.js +19 -0
  198. package/vendor/dynamic-workflow/engine/cached-ask-facts.d.ts +28 -0
  199. package/vendor/dynamic-workflow/engine/cached-ask-facts.d.ts.map +1 -0
  200. package/vendor/dynamic-workflow/engine/cached-ask-facts.js +35 -0
  201. package/vendor/dynamic-workflow/engine/concurrency.d.ts +151 -0
  202. package/vendor/dynamic-workflow/engine/concurrency.d.ts.map +1 -0
  203. package/vendor/dynamic-workflow/engine/concurrency.js +282 -0
  204. package/vendor/dynamic-workflow/engine/engine-artifacts-primary.d.ts +17 -0
  205. package/vendor/dynamic-workflow/engine/engine-artifacts-primary.d.ts.map +1 -0
  206. package/vendor/dynamic-workflow/engine/engine-artifacts-primary.js +29 -0
  207. package/vendor/dynamic-workflow/engine/engine-artifacts.d.ts +55 -0
  208. package/vendor/dynamic-workflow/engine/engine-artifacts.d.ts.map +1 -0
  209. package/vendor/dynamic-workflow/engine/engine-artifacts.js +367 -0
  210. package/vendor/dynamic-workflow/engine/engine-config.d.ts +90 -0
  211. package/vendor/dynamic-workflow/engine/engine-config.d.ts.map +1 -0
  212. package/vendor/dynamic-workflow/engine/engine-config.js +6 -0
  213. package/vendor/dynamic-workflow/engine/engine-holes.d.ts +116 -0
  214. package/vendor/dynamic-workflow/engine/engine-holes.d.ts.map +1 -0
  215. package/vendor/dynamic-workflow/engine/engine-holes.js +142 -0
  216. package/vendor/dynamic-workflow/engine/engine-launch.d.ts +34 -0
  217. package/vendor/dynamic-workflow/engine/engine-launch.d.ts.map +1 -0
  218. package/vendor/dynamic-workflow/engine/engine-launch.js +26 -0
  219. package/vendor/dynamic-workflow/engine/engine-phase-stamp.d.ts +35 -0
  220. package/vendor/dynamic-workflow/engine/engine-phase-stamp.d.ts.map +1 -0
  221. package/vendor/dynamic-workflow/engine/engine-phase-stamp.js +74 -0
  222. package/vendor/dynamic-workflow/engine/engine-report.d.ts +27 -0
  223. package/vendor/dynamic-workflow/engine/engine-report.d.ts.map +1 -0
  224. package/vendor/dynamic-workflow/engine/engine-report.js +151 -0
  225. package/vendor/dynamic-workflow/engine/engine-resume.d.ts +18 -0
  226. package/vendor/dynamic-workflow/engine/engine-resume.d.ts.map +1 -0
  227. package/vendor/dynamic-workflow/engine/engine-resume.js +38 -0
  228. package/vendor/dynamic-workflow/engine/engine-settlement.d.ts +30 -0
  229. package/vendor/dynamic-workflow/engine/engine-settlement.d.ts.map +1 -0
  230. package/vendor/dynamic-workflow/engine/engine-settlement.js +79 -0
  231. package/vendor/dynamic-workflow/engine/engine-state.d.ts +99 -0
  232. package/vendor/dynamic-workflow/engine/engine-state.d.ts.map +1 -0
  233. package/vendor/dynamic-workflow/engine/engine-state.js +13 -0
  234. package/vendor/dynamic-workflow/engine/engine-world.d.ts +36 -0
  235. package/vendor/dynamic-workflow/engine/engine-world.d.ts.map +1 -0
  236. package/vendor/dynamic-workflow/engine/engine-world.js +189 -0
  237. package/vendor/dynamic-workflow/engine/engine.d.ts +263 -0
  238. package/vendor/dynamic-workflow/engine/engine.d.ts.map +1 -0
  239. package/vendor/dynamic-workflow/engine/engine.js +602 -0
  240. package/vendor/dynamic-workflow/engine/errors.d.ts +87 -0
  241. package/vendor/dynamic-workflow/engine/errors.d.ts.map +1 -0
  242. package/vendor/dynamic-workflow/engine/errors.js +56 -0
  243. package/vendor/dynamic-workflow/engine/hash-mismatch.d.ts +10 -0
  244. package/vendor/dynamic-workflow/engine/hash-mismatch.d.ts.map +1 -0
  245. package/vendor/dynamic-workflow/engine/hash-mismatch.js +15 -0
  246. package/vendor/dynamic-workflow/engine/hash.d.ts +16 -0
  247. package/vendor/dynamic-workflow/engine/hash.d.ts.map +1 -0
  248. package/vendor/dynamic-workflow/engine/hash.js +48 -0
  249. package/vendor/dynamic-workflow/engine/imported-cache-types.d.ts +96 -0
  250. package/vendor/dynamic-workflow/engine/imported-cache-types.d.ts.map +1 -0
  251. package/vendor/dynamic-workflow/engine/imported-cache-types.js +6 -0
  252. package/vendor/dynamic-workflow/engine/imported-cache.d.ts +127 -0
  253. package/vendor/dynamic-workflow/engine/imported-cache.d.ts.map +1 -0
  254. package/vendor/dynamic-workflow/engine/imported-cache.js +244 -0
  255. package/vendor/dynamic-workflow/engine/index.d.ts +11 -0
  256. package/vendor/dynamic-workflow/engine/index.d.ts.map +1 -0
  257. package/vendor/dynamic-workflow/engine/index.js +10 -0
  258. package/vendor/dynamic-workflow/engine/journal-memory.d.ts +32 -0
  259. package/vendor/dynamic-workflow/engine/journal-memory.d.ts.map +1 -0
  260. package/vendor/dynamic-workflow/engine/journal-memory.js +243 -0
  261. package/vendor/dynamic-workflow/engine/journal-read-types.d.ts +72 -0
  262. package/vendor/dynamic-workflow/engine/journal-read-types.d.ts.map +1 -0
  263. package/vendor/dynamic-workflow/engine/journal-read-types.js +28 -0
  264. package/vendor/dynamic-workflow/engine/persona.d.ts +20 -0
  265. package/vendor/dynamic-workflow/engine/persona.d.ts.map +1 -0
  266. package/vendor/dynamic-workflow/engine/persona.js +43 -0
  267. package/vendor/dynamic-workflow/engine/replay-order.d.ts +96 -0
  268. package/vendor/dynamic-workflow/engine/replay-order.d.ts.map +1 -0
  269. package/vendor/dynamic-workflow/engine/replay-order.js +229 -0
  270. package/vendor/dynamic-workflow/engine/run-terminal.d.ts +35 -0
  271. package/vendor/dynamic-workflow/engine/run-terminal.d.ts.map +1 -0
  272. package/vendor/dynamic-workflow/engine/run-terminal.js +7 -0
  273. package/vendor/dynamic-workflow/engine/scheduler-submit.d.ts +22 -0
  274. package/vendor/dynamic-workflow/engine/scheduler-submit.d.ts.map +1 -0
  275. package/vendor/dynamic-workflow/engine/scheduler-submit.js +84 -0
  276. package/vendor/dynamic-workflow/engine/scheduler-types.d.ts +105 -0
  277. package/vendor/dynamic-workflow/engine/scheduler-types.d.ts.map +1 -0
  278. package/vendor/dynamic-workflow/engine/scheduler-types.js +17 -0
  279. package/vendor/dynamic-workflow/engine/scheduler.d.ts +113 -0
  280. package/vendor/dynamic-workflow/engine/scheduler.d.ts.map +1 -0
  281. package/vendor/dynamic-workflow/engine/scheduler.js +484 -0
  282. package/vendor/dynamic-workflow/engine/types.d.ts +979 -0
  283. package/vendor/dynamic-workflow/engine/types.d.ts.map +1 -0
  284. package/vendor/dynamic-workflow/engine/types.js +26 -0
  285. package/vendor/dynamic-workflow/engine/world-read-input.d.ts +10 -0
  286. package/vendor/dynamic-workflow/engine/world-read-input.d.ts.map +1 -0
  287. package/vendor/dynamic-workflow/engine/world-read-input.js +55 -0
  288. package/vendor/dynamic-workflow/facade/artifact-caps.d.ts +48 -0
  289. package/vendor/dynamic-workflow/facade/artifact-caps.d.ts.map +1 -0
  290. package/vendor/dynamic-workflow/facade/artifact-caps.js +47 -0
  291. package/vendor/dynamic-workflow/facade/dts-hole.d.ts +16 -0
  292. package/vendor/dynamic-workflow/facade/dts-hole.d.ts.map +1 -0
  293. package/vendor/dynamic-workflow/facade/dts-hole.js +26 -0
  294. package/vendor/dynamic-workflow/facade/dts-model.d.ts +11 -0
  295. package/vendor/dynamic-workflow/facade/dts-model.d.ts.map +1 -0
  296. package/vendor/dynamic-workflow/facade/dts-model.js +18 -0
  297. package/vendor/dynamic-workflow/facade/dts-stream.d.ts +15 -0
  298. package/vendor/dynamic-workflow/facade/dts-stream.d.ts.map +1 -0
  299. package/vendor/dynamic-workflow/facade/dts-stream.js +41 -0
  300. package/vendor/dynamic-workflow/facade/dts.d.ts +29 -0
  301. package/vendor/dynamic-workflow/facade/dts.d.ts.map +1 -0
  302. package/vendor/dynamic-workflow/facade/dts.js +324 -0
  303. package/vendor/dynamic-workflow/facade/registry.d.ts +218 -0
  304. package/vendor/dynamic-workflow/facade/registry.d.ts.map +1 -0
  305. package/vendor/dynamic-workflow/facade/registry.js +203 -0
  306. package/vendor/dynamic-workflow/facade/report-caps.d.ts +40 -0
  307. package/vendor/dynamic-workflow/facade/report-caps.d.ts.map +1 -0
  308. package/vendor/dynamic-workflow/facade/report-caps.js +39 -0
  309. package/vendor/dynamic-workflow/facade/world-read-caps.d.ts +37 -0
  310. package/vendor/dynamic-workflow/facade/world-read-caps.d.ts.map +1 -0
  311. package/vendor/dynamic-workflow/facade/world-read-caps.js +36 -0
  312. package/vendor/dynamic-workflow/index.d.ts +41 -0
  313. package/vendor/dynamic-workflow/index.d.ts.map +1 -0
  314. package/vendor/dynamic-workflow/index.js +51 -0
  315. package/vendor/dynamic-workflow/lowering/index.d.ts +2 -0
  316. package/vendor/dynamic-workflow/lowering/index.d.ts.map +1 -0
  317. package/vendor/dynamic-workflow/lowering/index.js +1 -0
  318. package/vendor/dynamic-workflow/lowering/lower-hole.d.ts +16 -0
  319. package/vendor/dynamic-workflow/lowering/lower-hole.d.ts.map +1 -0
  320. package/vendor/dynamic-workflow/lowering/lower-hole.js +63 -0
  321. package/vendor/dynamic-workflow/lowering/lower.d.ts +82 -0
  322. package/vendor/dynamic-workflow/lowering/lower.d.ts.map +1 -0
  323. package/vendor/dynamic-workflow/lowering/lower.js +333 -0
  324. package/vendor/dynamic-workflow/projections.d.ts +26 -0
  325. package/vendor/dynamic-workflow/projections.d.ts.map +1 -0
  326. package/vendor/dynamic-workflow/projections.js +23 -0
  327. package/vendor/dynamic-workflow/schema/actor-submit-profiles.d.ts +49 -0
  328. package/vendor/dynamic-workflow/schema/actor-submit-profiles.d.ts.map +1 -0
  329. package/vendor/dynamic-workflow/schema/actor-submit-profiles.js +69 -0
  330. package/vendor/dynamic-workflow/schema/emit.d.ts +55 -0
  331. package/vendor/dynamic-workflow/schema/emit.d.ts.map +1 -0
  332. package/vendor/dynamic-workflow/schema/emit.js +325 -0
  333. package/vendor/dynamic-workflow/schema/jsdoc.d.ts +10 -0
  334. package/vendor/dynamic-workflow/schema/jsdoc.d.ts.map +1 -0
  335. package/vendor/dynamic-workflow/schema/jsdoc.js +83 -0
  336. package/vendor/dynamic-workflow/schema/serialize.d.ts +8 -0
  337. package/vendor/dynamic-workflow/schema/serialize.d.ts.map +1 -0
  338. package/vendor/dynamic-workflow/schema/serialize.js +20 -0
  339. package/vendor/dynamic-workflow/schema/synthesize.d.ts +48 -0
  340. package/vendor/dynamic-workflow/schema/synthesize.d.ts.map +1 -0
  341. package/vendor/dynamic-workflow/schema/synthesize.js +138 -0
  342. package/vendor/dynamic-workflow/schema/types.d.ts +67 -0
  343. package/vendor/dynamic-workflow/schema/types.d.ts.map +1 -0
  344. package/vendor/dynamic-workflow/schema/types.js +18 -0
  345. package/vendor/dynamic-workflow/schema/validate.d.ts +15 -0
  346. package/vendor/dynamic-workflow/schema/validate.d.ts.map +1 -0
  347. package/vendor/dynamic-workflow/schema/validate.js +213 -0
  348. package/vendor/dynamic-workflow/testing/index.d.ts +6 -0
  349. package/vendor/dynamic-workflow/testing/index.d.ts.map +1 -0
  350. package/vendor/dynamic-workflow/testing/index.js +5 -0
  351. package/vendor/dynamic-workflow/testing/journal-contract-artifacts.d.ts +9 -0
  352. package/vendor/dynamic-workflow/testing/journal-contract-artifacts.d.ts.map +1 -0
  353. package/vendor/dynamic-workflow/testing/journal-contract-artifacts.js +195 -0
  354. package/vendor/dynamic-workflow/testing/journal-contract-events.d.ts +9 -0
  355. package/vendor/dynamic-workflow/testing/journal-contract-events.d.ts.map +1 -0
  356. package/vendor/dynamic-workflow/testing/journal-contract-events.js +163 -0
  357. package/vendor/dynamic-workflow/testing/journal-contract-helpers.d.ts +9 -0
  358. package/vendor/dynamic-workflow/testing/journal-contract-helpers.d.ts.map +1 -0
  359. package/vendor/dynamic-workflow/testing/journal-contract-helpers.js +12 -0
  360. package/vendor/dynamic-workflow/testing/journal-contract-isolation.d.ts +9 -0
  361. package/vendor/dynamic-workflow/testing/journal-contract-isolation.d.ts.map +1 -0
  362. package/vendor/dynamic-workflow/testing/journal-contract-isolation.js +46 -0
  363. package/vendor/dynamic-workflow/testing/journal-contract-nodes.d.ts +9 -0
  364. package/vendor/dynamic-workflow/testing/journal-contract-nodes.d.ts.map +1 -0
  365. package/vendor/dynamic-workflow/testing/journal-contract-nodes.js +234 -0
  366. package/vendor/dynamic-workflow/testing/journal-contract-reads.d.ts +11 -0
  367. package/vendor/dynamic-workflow/testing/journal-contract-reads.d.ts.map +1 -0
  368. package/vendor/dynamic-workflow/testing/journal-contract-reads.js +281 -0
  369. package/vendor/dynamic-workflow/testing/journal-contract-runs.d.ts +9 -0
  370. package/vendor/dynamic-workflow/testing/journal-contract-runs.d.ts.map +1 -0
  371. package/vendor/dynamic-workflow/testing/journal-contract-runs.js +396 -0
  372. package/vendor/dynamic-workflow/testing/journal-contract-script.d.ts +12 -0
  373. package/vendor/dynamic-workflow/testing/journal-contract-script.d.ts.map +1 -0
  374. package/vendor/dynamic-workflow/testing/journal-contract-script.js +82 -0
  375. package/vendor/dynamic-workflow/testing/journal-contract.d.ts +15 -0
  376. package/vendor/dynamic-workflow/testing/journal-contract.d.ts.map +1 -0
  377. package/vendor/dynamic-workflow/testing/journal-contract.js +31 -0
  378. package/vendor/dynamic-workflow-runtime/child-cell-streams.js +128 -0
  379. package/vendor/dynamic-workflow-runtime/child-entry-file.js +43 -0
  380. package/vendor/dynamic-workflow-runtime/child-source.js +299 -0
  381. package/vendor/dynamic-workflow-runtime/harness.js +302 -0
  382. package/vendor/dynamic-workflow-runtime/index.js +4 -0
  383. package/vendor/dynamic-workflow-runtime/protocol.js +2 -0
  384. package/vendor/mcode-host/dynamic-workflow-import.js +269 -0
  385. package/vendor/mcode-host/workflow-git-world-read.js +183 -0
  386. package/vendor/mcode-host/workflow-world-read.js +282 -0
@@ -0,0 +1,63 @@
1
+ import type { CompileDiagnostic } from "../compiler/compile.js";
2
+ import { type DeclaredArtifact } from "./artifacts.js";
3
+ import { type ModelReference } from "./actor-models.js";
4
+ import { type CausalityGraph } from "./causality-graph.js";
5
+ import { type ControlFlowGraph } from "./flow-graph.js";
6
+ import { type HandoffGraph } from "./handoff-graph.js";
7
+ import type { AnalysisCore } from "./core.js";
8
+ import type { SiteGraph } from "./types.js";
9
+ /**
10
+ * Result of analyzing a workflow script: the same diagnostics `compileWorkflowScript`
11
+ * produces, plus the analysis core and its two projected views.
12
+ *
13
+ * `ok` means "submittable": any diagnostic clears it. The core and the graphs are present
14
+ * whenever the script was analyzable at all, which is *almost* the same thing — the one
15
+ * diagnostic that leaves them in place is {@link FANOUT_ACTOR_NAME_CODE} (a static actor
16
+ * name inside a fan-out). That clause describes a **run-time** failure, not something that
17
+ * stops the analysis: the shape is perfectly analyzable, and withholding the graph would
18
+ * hide the picture exactly when the author needs it to see which fan-out to fix. So:
19
+ * graphs present ⟸ ok, but not the converse.
20
+ */
21
+ export interface AnalyzeResult {
22
+ diagnostics: CompileDiagnostic[];
23
+ ok: boolean;
24
+ /**
25
+ * The all-in-one analysis artifact: taint
26
+ * facts + temporal trace, position-free. `graph` and `causality` are pure projections
27
+ * of it — deriving them again later needs the core only, never the script.
28
+ */
29
+ core?: AnalysisCore;
30
+ graph?: SiteGraph;
31
+ /** The presentation-level happens-before view. */
32
+ causality?: CausalityGraph;
33
+ /** Where execution can go next, per occurrence and per phase. */
34
+ flow?: ControlFlowGraph;
35
+ /** Who takes part in each phase and who hands off to whom. */
36
+ handoff?: HandoffGraph;
37
+ /**
38
+ * 脚本声明的**用户面产物**:`[{id, kind}]`,去重、按 id
39
+ * 排序。与 world.run 的命令集同族的编译产物——运行前就能说出这个工作流会产出什么。
40
+ * 与图不同,它在诊断非空时**照常给出**(它是从站点表直接读的事实,不依赖解释)。
41
+ */
42
+ declaredArtifacts: DeclaredArtifact[];
43
+ /**
44
+ * 脚本能交给子代理的每个模型名,每处出现一条(docs/dynamic-workflow/authoring.md「Choosing a
45
+ * model per subagent」)。launch 工具在确认窗之前把它们对着宿主的模型目录解析
46
+ * (docs/dynamic-workflow/launch.md「Models the script names」)。与 `declaredArtifacts` 同规:
47
+ * 编译不过时是空数组,authoring 诊断在场时照常给出。
48
+ */
49
+ modelReferences: ModelReference[];
50
+ }
51
+ /**
52
+ * Typecheck a workflow script and, when clean, interpret it. The pipeline is
53
+ * createWorkflowProgram -> collectSites (the site-table substrate) -> interpret (the
54
+ * fused taint-fixpoint + temporal walk, minting the {@link AnalysisCore}) ->
55
+ * projectSiteGraph / projectCausalityGraph (pure projections of the core).
56
+ *
57
+ * Between the site table and the interpretation runs the facade-siting check
58
+ * ({@link collectFacadeMisuse}): a facade callable that escapes into value space has
59
+ * no site, so the graph cannot represent it. Its diagnostics are surfaced exactly like
60
+ * typechecker diagnostics — `ok: false`, graphs withheld.
61
+ */
62
+ export declare function analyzeWorkflowScript(scriptText: string): AnalyzeResult;
63
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/analysis/analyze.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,OAAO,EAA+B,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIpF,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kDAAkD;IAClD,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,iEAAiE;IACjE,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;;OAIG;IACH,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC;;;;;OAKG;IACH,eAAe,EAAE,cAAc,EAAE,CAAC;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAqEvE"}
@@ -0,0 +1,92 @@
1
+ import { collectDiagnostics, createWorkflowProgram } from "../compiler/compile.js";
2
+ import { collectSites } from "./sites.js";
3
+ import { collectFacadeMisuse } from "./facade-misuse.js";
4
+ import { collectWorldRunCommands } from "./world-run.js";
5
+ import { collectArtifactDeclarations } from "./artifacts.js";
6
+ import { collectPhaseMarkerDiagnostics } from "./phases.js";
7
+ import { collectHoleDiagnostics } from "./hole-sites.js";
8
+ import { collectDuplicateActorNames, FANOUT_ACTOR_NAME_CODE } from "./actor-names.js";
9
+ import { collectActorModels } from "./actor-models.js";
10
+ import { interpret } from "./interpret.js";
11
+ import { projectSiteGraph } from "./graph.js";
12
+ import { projectCausalityGraph } from "./causality-graph.js";
13
+ import { projectControlFlow } from "./flow-graph.js";
14
+ import { projectHandoffGraph } from "./handoff-graph.js";
15
+ /**
16
+ * Typecheck a workflow script and, when clean, interpret it. The pipeline is
17
+ * createWorkflowProgram -> collectSites (the site-table substrate) -> interpret (the
18
+ * fused taint-fixpoint + temporal walk, minting the {@link AnalysisCore}) ->
19
+ * projectSiteGraph / projectCausalityGraph (pure projections of the core).
20
+ *
21
+ * Between the site table and the interpretation runs the facade-siting check
22
+ * ({@link collectFacadeMisuse}): a facade callable that escapes into value space has
23
+ * no site, so the graph cannot represent it. Its diagnostics are surfaced exactly like
24
+ * typechecker diagnostics — `ok: false`, graphs withheld.
25
+ */
26
+ export function analyzeWorkflowScript(scriptText) {
27
+ const workflow = createWorkflowProgram(scriptText);
28
+ const diagnostics = collectDiagnostics(workflow.program);
29
+ // 编译不过 / facade 逃逸时连站点表都不可信,产物清单只能是空的(缺省而不是缺席:读者
30
+ // 拿到的永远是一个数组,不必在每个消费点分辨"没有产物"与"没能分析")。
31
+ if (diagnostics.length > 0) {
32
+ return { declaredArtifacts: [], diagnostics, modelReferences: [], ok: false };
33
+ }
34
+ const table = collectSites(workflow);
35
+ const misuse = collectFacadeMisuse(workflow, table);
36
+ if (misuse.length > 0) {
37
+ return { declaredArtifacts: [], diagnostics: misuse, modelReferences: [], ok: false };
38
+ }
39
+ // world.run 的字面量 cmd 检查与 misuse 同席:一个运行期才成形的命令没有可展示的授权
40
+ // 对象(确认窗展示的命令集在编译期闭合),所以它和「facade 调用必须有站点」一样是
41
+ // 编译期教改写的那类错误。phase 标记同理:非字面量
42
+ // 名字与非语句位置的标记都没有可指的东西。
43
+ // 字面量 actor 重名同席:规则的正门在运行期(引擎 createActor 的 DuplicateActorName),
44
+ // 这一趟只是把字面量能看穿的那部分提前到便宜的一侧。
45
+ // 三趟一起报——作者一次就能看全要改什么。
46
+ const worldRun = collectWorldRunCommands(workflow, table);
47
+ // 产物的编译期规则同席:id 是编译期字面量、标签指向一个
48
+ // 已声明的预置、同 id 不横跨两种成员——三条都是「运行期才炸不如现在就教改写」的那一类。
49
+ const artifacts = collectArtifactDeclarations(workflow, table);
50
+ // 子代理模型名集合的封闭性(9010)同席:一个运行期才成形的模型名没有可在确认窗之前解析、
51
+ // 展示的对象(docs/dynamic-workflow/authoring.md「Choosing a model per subagent」)。
52
+ const models = collectActorModels(workflow, table);
53
+ const authoring = [
54
+ ...worldRun.diagnostics,
55
+ ...artifacts.diagnostics,
56
+ ...models.diagnostics,
57
+ ...collectPhaseMarkerDiagnostics(workflow, table),
58
+ // 留白的编译期规则(9012)同席(docs/dynamic-workflow/authoring.md「Holes」)。
59
+ ...collectHoleDiagnostics(workflow, table),
60
+ ...collectDuplicateActorNames(workflow, table),
61
+ ];
62
+ // fan-out 里的静态 actor 名(9006)是这批里唯一**不扣下图**的一条:它说的是这个脚本跑起来
63
+ // 会撞 DuplicateActorName,而不是「这段代码没法分析」——形状本身完全可分析,把图扣下来只会
64
+ // 在作者最需要看图定位是哪个 fan-out 的时候把图拿走。它照常清掉 `ok`(提交仍被挡住)。
65
+ // 顺带的好处:分析语料因此还能钉住「fan-out 里的静态名」这个形状的图产物,否则一条挡路的
66
+ // 编译期诊断会让它自己的形状在语料里变得不可表达。
67
+ const withholding = authoring.filter((d) => d.code !== FANOUT_ACTOR_NAME_CODE);
68
+ if (withholding.length > 0) {
69
+ return {
70
+ declaredArtifacts: artifacts.declaredArtifacts,
71
+ diagnostics: authoring,
72
+ modelReferences: models.references,
73
+ ok: false,
74
+ };
75
+ }
76
+ // One interpretation feeds everything: the core carries the taint facts AND the
77
+ // temporal trace, and both graphs project off it without touching the AST again.
78
+ const core = interpret(workflow, table);
79
+ const graph = projectSiteGraph(core);
80
+ const causality = projectCausalityGraph(core, graph);
81
+ return {
82
+ causality,
83
+ core,
84
+ declaredArtifacts: artifacts.declaredArtifacts,
85
+ diagnostics: authoring,
86
+ flow: projectControlFlow(core),
87
+ graph,
88
+ handoff: projectHandoffGraph(core, causality, graph),
89
+ modelReferences: models.references,
90
+ ok: authoring.length === 0,
91
+ };
92
+ }
@@ -0,0 +1,21 @@
1
+ import ts from "typescript";
2
+ import type { IterationCandidate } from "./sites.js";
3
+ import { type AbstractValue } from "./domain.js";
4
+ import type { EvalContext, Evaluator } from "./taint.js";
5
+ /**
6
+ * Per-element callback calls (the callback registry's `each` entries — `map` / `forEach` /
7
+ * `reduce` / … on a receiver, `Array.from(xs, fn)`) promoted to fan-out relays: `iterated`
8
+ * fans out to the callback's element parameter(s), the callback body runs in a
9
+ * `cand@<order>` region, and its return joins back. `evalCall` dispatches here via
10
+ * `candByCall`.
11
+ *
12
+ * Two callback shapes, one contract:
13
+ * - an INLINE literal is evaluated in place with its parameters bound directly (it is not a
14
+ * tracked function — the callback IS the body);
15
+ * - any other expression (`xs.map(review)`, `xs.map(this.f)`) is evaluated to its function
16
+ * values and those tracked functions are applied with registry-shaped positional actuals,
17
+ * recorded as `argument` applications at the call so the ordering walk inlines the same
18
+ * bodies inside the same `fanout` region.
19
+ */
20
+ export declare function handleArrayMethod(ev: Evaluator, node: ts.CallExpression, cand: IterationCandidate, ctx: EvalContext): AbstractValue;
21
+ //# sourceMappingURL=array-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-methods.d.ts","sourceRoot":"","sources":["../../src/analysis/array-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAQL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,EAAE,CAAC,cAAc,EACvB,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,WAAW,GACf,aAAa,CAkGf"}
@@ -0,0 +1,132 @@
1
+ import ts from "typescript";
2
+ import { addOcc, cloneValue, collapse, emptyValue, mergeInto, provisionalFanoutId, unionValues, } from "./domain.js";
3
+ import { applyCallbackFns } from "./calls.js";
4
+ /**
5
+ * Per-element callback calls (the callback registry's `each` entries — `map` / `forEach` /
6
+ * `reduce` / … on a receiver, `Array.from(xs, fn)`) promoted to fan-out relays: `iterated`
7
+ * fans out to the callback's element parameter(s), the callback body runs in a
8
+ * `cand@<order>` region, and its return joins back. `evalCall` dispatches here via
9
+ * `candByCall`.
10
+ *
11
+ * Two callback shapes, one contract:
12
+ * - an INLINE literal is evaluated in place with its parameters bound directly (it is not a
13
+ * tracked function — the callback IS the body);
14
+ * - any other expression (`xs.map(review)`, `xs.map(this.f)`) is evaluated to its function
15
+ * values and those tracked functions are applied with registry-shaped positional actuals,
16
+ * recorded as `argument` applications at the call so the ordering walk inlines the same
17
+ * bodies inside the same `fanout` region.
18
+ */
19
+ export function handleArrayMethod(ev, node, cand, ctx) {
20
+ const semantics = cand.semantics;
21
+ const iterated = collapse(ev.evalExpr(cand.iterated, ctx));
22
+ const fanoutId = provisionalFanoutId(cand.order);
23
+ const promoted = ev.s.promotedOrders.has(cand.order);
24
+ if (promoted)
25
+ ev.s.mergeSink(ev.s.fanoutInVal, fanoutId, iterated);
26
+ const element = cloneValue(iterated);
27
+ if (promoted)
28
+ addOcc(element, { exact: true, site: fanoutId });
29
+ const regionStack = [...ctx.regionStack, `cand@${cand.order}`];
30
+ const isReduce = semantics?.accumulatorParam !== undefined;
31
+ const elementParams = semantics?.elementParams ?? [0];
32
+ const wholeParams = semantics?.wholeParams ?? [2];
33
+ // The accumulator (reduce): initial-value argument ∪ the callback return chained across
34
+ // fixpoint passes. The callback return is a FRESH local each fixpoint pass and is
35
+ // empty when we bind the param, so binding acc from it directly never carries the callback's
36
+ // return taint — sequential ask-chaining through the accumulator would be silently dropped. A
37
+ // persistent per-candidate accumulator (seeded from prior passes' returns) lets the
38
+ // accumulator's taint reach the body and converge like everything else.
39
+ // With NO initial-value argument the accumulator starts as element 0 at runtime, so
40
+ // the seed is the element value (not empty) — otherwise the first element's taint never
41
+ // reaches the body through the accumulator.
42
+ const seedArg = node.arguments[1];
43
+ const accumulator = () => {
44
+ const chain = ev.s.reduceAccOf(cand.order);
45
+ const seedPlace = seedArg === undefined ? undefined : ev.resolvePlace(seedArg);
46
+ if (seedPlace !== undefined) {
47
+ // The initial value is a PLACE: at runtime the accumulator IS that object until the
48
+ // callback returns something else (`acc.items.push(item)` fills the seed), so alias acc
49
+ // to the live seed. JOIN the cross-pass callback-return chain into it — never replace:
50
+ // for a reduce that returns a FRESH object each iteration, losing the chain component
51
+ // would drop the accumulator's carried taint. Spurious later writes into the seed are a
52
+ // sound over-approximation — a cloned seed would instead keep
53
+ // `acc.items.push` from reaching the live seed.
54
+ if (mergeInto(seedPlace, chain))
55
+ ev.s.changed = true;
56
+ return { place: seedPlace, value: seedPlace };
57
+ }
58
+ const initial = seedArg === undefined ? element : ev.evalExpr(seedArg, ctx);
59
+ return { value: unionValues(initial, chain) };
60
+ };
61
+ const callbackReturn = emptyValue();
62
+ const cb = cand.callback;
63
+ if (cb !== undefined) {
64
+ const cbCtx = {
65
+ onReturn: (value) => void mergeInto(callbackReturn, value),
66
+ regionStack,
67
+ };
68
+ if (isReduce)
69
+ bindCallbackParam(ev, cb, semantics?.accumulatorParam ?? 0, accumulator().value, cbCtx);
70
+ // Element parameters bind the fanned-out element; the standard whole-collection parameter
71
+ // (the third of `map`-likes) IS the receiver at runtime, so it binds the same fanned-out
72
+ // value: reads of it inside the promoted callback are downstream of the fan-out, same as
73
+ // element reads. A positional index parameter stays unbound — it carries no element data
74
+ // (same convention as a ternary condition / computed key), so it originates no data edge.
75
+ elementParams.forEach((index, i) => bindCallbackParam(ev, cb, index, i === 0 ? element : cloneValue(element), cbCtx));
76
+ for (const index of wholeParams)
77
+ bindCallbackParam(ev, cb, index, cloneValue(element), cbCtx);
78
+ if (ts.isBlock(cb.body)) {
79
+ for (const stmt of cb.body.statements)
80
+ ev.visit(stmt, cbCtx);
81
+ }
82
+ else {
83
+ mergeInto(callbackReturn, ev.evalExpr(cb.body, cbCtx));
84
+ }
85
+ }
86
+ else if (cand.callbackExpr !== undefined) {
87
+ // Non-literal callback: apply every script function the argument holds, per element, with
88
+ // the registry's positional shape. An untracked value (`xs.map(Boolean)`) applies nothing;
89
+ // the element still flows to the result as it did before.
90
+ const fns = [...ev.evalExpr(cand.callbackExpr, ctx).fns].filter((fn) => ev.s.fnId.has(fn));
91
+ if (fns.length > 0) {
92
+ const slots = Math.max(-1, ...elementParams, ...wholeParams, semantics?.accumulatorParam ?? -1) + 1;
93
+ const actuals = Array.from({ length: slots }, () => emptyValue());
94
+ if (isReduce)
95
+ actuals[semantics?.accumulatorParam ?? 0] = accumulator().value;
96
+ for (const index of elementParams)
97
+ actuals[index] = cloneValue(element);
98
+ for (const index of wholeParams)
99
+ actuals[index] = cloneValue(element);
100
+ mergeInto(callbackReturn, applyCallbackFns(ev, fns, actuals, regionStack, node));
101
+ }
102
+ }
103
+ // Element-mutation write-back: the element parameter may-aliases the collection's elements
104
+ // (they are references at runtime), so a field written through it (`x.note = t`) must reach
105
+ // the collection. Weak-merge the element's FIELD effects (collapsed) into the collection
106
+ // place's occs — a later `xs[k].note` read smears them out. Only element FIELDS propagate:
107
+ // the element's seed occs and fan-out label live in `occs`, so they never flow back (no
108
+ // fan-out self-label).
109
+ const collectionPlace = ev.resolvePlace(cand.iterated);
110
+ if (collectionPlace !== undefined) {
111
+ for (const field of element.fields.values()) {
112
+ if (mergeInto(collectionPlace, collapse(field)))
113
+ ev.s.changed = true;
114
+ }
115
+ }
116
+ // Thread this pass's callback return into the persistent accumulator so the next
117
+ // pass's accumulator param observes it (drives the reduce chain to a fixpoint).
118
+ if (isReduce)
119
+ ev.s.mergeReduceAcc(cand.order, callbackReturn);
120
+ // Result: callback return ∪ element value (the fan-out label already rides on element).
121
+ return unionValues(callbackReturn, element);
122
+ }
123
+ function bindCallbackParam(ev, cb, index, value, ctx) {
124
+ const param = cb.parameters[index];
125
+ if (param === undefined)
126
+ return;
127
+ // Route through the Evaluator's pattern machinery so a binding-pattern parameter
128
+ // (`.map(({ q }) => …)`, `.then(([x, y]) => …)`) binds its extracted names. The
129
+ // old identifier-only guard silently bound nothing for a destructured param, dropping
130
+ // both the element's taint and the fan-out label into every read of the pattern's names.
131
+ ev.bindPattern(param.name, value, ctx);
132
+ }
@@ -0,0 +1,39 @@
1
+ import type { WorkflowProgram } from "../compiler/compile.js";
2
+ import type { SiteTable } from "./sites.js";
3
+ /**
4
+ * Producer-side artifact types for data edges. Every data edge's `from` is a producer
5
+ * site (ask / world-read / join / fan-out) with a statically known artifact type; this
6
+ * module computes that type as a human-readable string, plus per-port types for joins
7
+ * over a static array literal. Semantics is PROVENANCE: an edge means "a value computed
8
+ * from A's output feeds B", so the label is A's artifact type — not a claim about the
9
+ * concrete wire value.
10
+ *
11
+ * The type names come from the live checker's {@link ts.TypeChecker.typeToString} today;
12
+ * schema synthesis will later upgrade these to synthesized-schema names.
13
+ * Uninformative labels (`any`/`unknown`/`never`/`void`) are omitted so a meaningless
14
+ * string is never drawn.
15
+ */
16
+ /** Per-site artifact types and per-port join element types. */
17
+ export interface ArtifactTypes {
18
+ /**
19
+ * Whole-value artifact type per site, keyed by site id. Ask/world-read/join sites use
20
+ * their final ids (`ask#1`); fan-out candidates are keyed by their PROVISIONAL id
21
+ * (`fan-out@order`, see {@link provisionalFanoutId}) — the same key the taint pass
22
+ * stamps into occurrences, so graph assembly looks them up before the `fan-out#N`
23
+ * rename.
24
+ */
25
+ siteType: Map<string, string>;
26
+ /**
27
+ * Per-element awaited types of a join over a static array literal, keyed by join id.
28
+ * Index i is the type of array element i (the join input at port i), or `undefined`
29
+ * when that element's type is unknowable/uninformative. Absent for joins whose
30
+ * argument is not a static array literal (no ports exist).
31
+ */
32
+ joinPortTypes: Map<string, (string | undefined)[]>;
33
+ }
34
+ /**
35
+ * Compute artifact types for every producer site in the table. Pure over the checker and
36
+ * the AST refs the site table already resolved.
37
+ */
38
+ export declare function computeArtifactTypes(workflow: WorkflowProgram, table: SiteTable): ArtifactTypes;
39
+ //# sourceMappingURL=artifact-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-types.d.ts","sourceRoot":"","sources":["../../src/analysis/artifact-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C;;;;;;;;;;;;GAYG;AAEH,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;CACpD;AAeD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,GAAG,aAAa,CAoG/F"}
@@ -0,0 +1,114 @@
1
+ import ts from "typescript";
2
+ import { provisionalFanoutId } from "./domain.js";
3
+ /** typeToString flags: a named interface prints as its name (`Flaky`), no `…` truncation. */
4
+ const FORMAT_FLAGS = ts.TypeFormatFlags.NoTruncation;
5
+ /** Rendered type names that carry no information and must not be drawn as a label. */
6
+ const UNINFORMATIVE = new Set(["any", "unknown", "never", "void"]);
7
+ /**
8
+ * Cap on fan-out array-level unwrapping. Nested maps (`map` of `map`) nest arrays
9
+ * arbitrarily; a fixed bound keeps the peel finite against pathological/cyclic generic
10
+ * types, matching the taint domain's `VALUE_DEPTH_CAP` discipline.
11
+ */
12
+ const FANOUT_UNWRAP_CAP = 8;
13
+ /**
14
+ * Compute artifact types for every producer site in the table. Pure over the checker and
15
+ * the AST refs the site table already resolved.
16
+ */
17
+ export function computeArtifactTypes(workflow, table) {
18
+ const checker = workflow.program.getTypeChecker();
19
+ const siteType = new Map();
20
+ const joinPortTypes = new Map();
21
+ const renderRaw = (type) => checker.typeToString(type, undefined, FORMAT_FLAGS);
22
+ const render = (type) => {
23
+ if (type === undefined)
24
+ return undefined;
25
+ const text = renderRaw(type);
26
+ return UNINFORMATIVE.has(text) ? undefined : text;
27
+ };
28
+ const set = (id, type) => {
29
+ const text = render(type);
30
+ if (text !== undefined)
31
+ siteType.set(id, text);
32
+ };
33
+ // The awaited (resolved) type of a call's own type — `Node<T>`/`Promise<T>` -> `T`.
34
+ const awaitedOf = (node) => checker.getAwaitedType(checker.getTypeAtLocation(node));
35
+ // The element type of a genuine `Array<T>`/`ReadonlyArray<T>`, else undefined. We test
36
+ // the reference target's symbol rather than `getNumberIndexType`, because a `string`
37
+ // (and a string-literal union) is number-indexable too — indexing one would wrongly
38
+ // "peel" `("yes" | "no")[]` into `string[][]`.
39
+ const arrayElement = (type) => {
40
+ const name = type.target?.symbol?.name;
41
+ if (name !== "Array" && name !== "ReadonlyArray")
42
+ return undefined;
43
+ const args = checker.getTypeArguments(type);
44
+ return args.length > 0 ? args[0] : undefined;
45
+ };
46
+ // A fan-out's collected artifact type. The awaited whole call type of a `.map` is the
47
+ // mapped array (`Node<Review>[]`, or `Node<string>[][]` for nested maps); that leaks the
48
+ // facade promise wrapper into a user-facing label, so we peel array levels to a fixed
49
+ // point — awaiting the element at each level (`Node<Review>` -> `Review`) — and rebuild
50
+ // the `[]` suffixes, so `Node<Review>[]` -> `Review[]` and `Node<string>[][]` ->
51
+ // `string[][]`. A top-level union/intersection innermost element is parenthesized
52
+ // (`(A | B)[]`) to stay well-formed. Falls back to the whole-type rendering when the
53
+ // type is not array-like or the peeled element is uninformative. Joins need no such
54
+ // unwrap: `Promise.all`'s `Awaited<>` already resolves recursively.
55
+ const fanoutType = (call) => {
56
+ const whole = awaitedOf(call);
57
+ if (whole === undefined)
58
+ return undefined;
59
+ const wholeText = render(whole);
60
+ let type = whole;
61
+ let depth = 0;
62
+ while (depth < FANOUT_UNWRAP_CAP) {
63
+ const element = arrayElement(type);
64
+ if (element === undefined)
65
+ break;
66
+ type = checker.getAwaitedType(element) ?? element;
67
+ depth += 1;
68
+ }
69
+ if (depth === 0)
70
+ return wholeText; // not array-like: keep the whole rendering
71
+ const elementText = render(type);
72
+ if (elementText === undefined)
73
+ return wholeText; // uninformative element: fall back
74
+ const base = /\s[|&]\s/.test(elementText) ? `(${elementText})` : elementText;
75
+ return `${base}${"[]".repeat(depth)}`;
76
+ };
77
+ // ask: an explicit `ask<Flaky>` type argument is the artifact type directly; otherwise
78
+ // the awaited return type (`Node<T>` -> `T`, default `T = string`).
79
+ for (const site of table.asks) {
80
+ const typeArg = site.call.typeArguments?.[0];
81
+ const type = typeArg !== undefined ? checker.getTypeFromTypeNode(typeArg) : awaitedOf(site.call);
82
+ set(site.id, type);
83
+ }
84
+ // world-read: the awaited call type (`string` for read, `string[]` for glob).
85
+ for (const site of table.worldReads)
86
+ set(site.id, awaitedOf(site.call));
87
+ // open hole: the explicit type argument is the contract (9012 requires it); a filled hole is
88
+ // not a producer site, its body's own sites are.
89
+ for (const site of table.holes) {
90
+ if (site.body === undefined && site.typeArg !== undefined) {
91
+ set(site.id, checker.getTypeFromTypeNode(site.typeArg));
92
+ }
93
+ }
94
+ // join: the awaited whole type (a tuple for a static array literal, an array otherwise),
95
+ // plus per-element awaited types when the argument is a static array literal.
96
+ for (const site of table.joins) {
97
+ set(site.id, awaitedOf(site.call));
98
+ if (site.arg !== undefined && ts.isArrayLiteralExpression(site.arg)) {
99
+ joinPortTypes.set(site.id, site.arg.elements.map((element) => render(awaitedOf(element))));
100
+ }
101
+ }
102
+ // fan-out: array-method candidates take the collected artifact type of the whole call
103
+ // expression (the callback's parent), with the facade promise wrapper unwrapped off the
104
+ // element (see {@link fanoutType}). `for...of` candidates have no call expression, and
105
+ // `void` results (e.g. `forEach`) fall out via the uninformative filter.
106
+ for (const cand of table.iterations) {
107
+ if (cand.form !== "array-method" || cand.call === undefined)
108
+ continue;
109
+ const text = fanoutType(cand.call);
110
+ if (text !== undefined)
111
+ siteType.set(provisionalFanoutId(cand.order), text);
112
+ }
113
+ return { joinPortTypes, siteType };
114
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * 产物(artifact)的编译期收集与诊断。
3
+ *
4
+ * ⚠ 术语:本模块的 artifact 是**用户面产物**——脚本经 `artifact.*` 发布给用户看的文件 /
5
+ * markdown / 预置看板。同目录下的 `artifact-types.ts` 说的是**另一个** artifact:站点的
6
+ * 类型化输出值(给模型看的)。两者不相干。
7
+ *
8
+ * 产物两件:
9
+ *
10
+ * 1. `declaredArtifacts`(编译产物,照 `collectWorldRunCommands` 的 `commands`):脚本声明的
11
+ * 产物清单 `[{id, kind}]`,去重、按 id 排序。中枢与检视器据它在**运行前**就能说出这个
12
+ * 工作流会产出什么。
13
+ * 2. 定位诊断(facade-misuse 同族):id 必须是编译期字面量,标签必须指向一个已声明的预置,
14
+ * 同一个 id 不能横跨两个成员种类,预置声明不该长在循环体 / 回调 / 条件分支里。
15
+ *
16
+ * 为什么 id 必须是编译期字面量(与 `world.run` 的 cmd、`phase` 的 name 同一姿态):一个运行期
17
+ * 才成形的 id 没有可展示的对象——它既进不了「将产出」清单,也让「同 id 两种种类」这类规则
18
+ * 只剩运行期一条路。教改写发生在便宜的那一侧。
19
+ *
20
+ * 与运行期的分工:这一趟只做**字面量能看穿的那一半**。真正的门在引擎——`ArtifactKindMismatch`
21
+ * /`ArtifactRedeclared`/`ArtifactUndeclared`/`ArtifactCapExceeded` 都在运行期兜底,因为
22
+ * 声明的**执行顺序**(哪个先跑到)静态看不出来。所以本模块**只会漏报、不会误报**,
23
+ * 唯一的例外是提升诊断(见 {@link ARTIFACT_HOISTING_CODE})。
24
+ */
25
+ import type { CompileDiagnostic, WorkflowProgram } from "../compiler/compile.js";
26
+ import { type ArtifactOp } from "../facade/registry.js";
27
+ import { type SiteTable } from "./sites.js";
28
+ /**
29
+ * 产物的编译期诊断码(9001 = facade-siting、9002 = schema、9003 = world-run、9004 = phase、
30
+ * 9005/9006 = actor 名,顺延)。覆盖:非字面量 / 空 / 超长 / 非法字符的 id、同 id 跨种类复用、
31
+ * `report` 标签的三种错法。全部是**静态确定**的错误——没有一条会误伤一份合法脚本。
32
+ */
33
+ export declare const ARTIFACT_DECLARATION_CODE = 9007;
34
+ /**
35
+ * 预置声明长在循环体 / 回调 / 条件分支里(「声明提到顶层,一次即可」),单独一个码而不是
36
+ * 复用 9007,理由与 9005/9006 的分家完全相同:**确定性不同**。
37
+ *
38
+ * 循环里以**相同 spec** 重复声明在运行期其实是幂等 no-op,所以这条子句理论上会误报。接受它
39
+ * 的理由是代价不对称——修复是免费的(把声明挪到脚本顶部),而不报的代价是一个看板声明藏在
40
+ * 第三层回调里,读者要跑一遍才知道它到底声明了没有。读端(fixture 语料、未来的宽松档)
41
+ * 因此需要能把它与 9007 区分开,而按错误文本分流是本仓库处处禁止的。
42
+ */
43
+ export declare const ARTIFACT_HOISTING_CODE = 9008;
44
+ /**
45
+ * 两个**不同的** id 都写了字面量 `primary: true`。
46
+ * 与 9008 同一种确定性:互斥分支里各标一个在运行期跑得通,但卡与侧板只会带头一个交付物,
47
+ * 说不清哪个是的脚本没写完。只认字面量 `true`;算出来的旗子留给引擎的 `ArtifactPrimaryConflict`。
48
+ */
49
+ export declare const ARTIFACT_PRIMARY_CONFLICT_CODE = 9009;
50
+ /** 脚本声明的一个产物:id 与它的成员种类。 */
51
+ export interface DeclaredArtifact {
52
+ id: string;
53
+ /** 成员种类(`file` / `markdown` / `chart` / `table` / `metrics` / `board`)。 */
54
+ kind: ArtifactOp;
55
+ }
56
+ export interface ArtifactDeclarations {
57
+ /** 脚本声明的产物清单:去重、按 id 字典序(`declaredCommands` 的同形产物)。 */
58
+ declaredArtifacts: DeclaredArtifact[];
59
+ /** 定位诊断;非空即脚本不可提交。 */
60
+ diagnostics: CompileDiagnostic[];
61
+ }
62
+ /**
63
+ * 收集产物清单与诊断。非空诊断即脚本不可提交(`analyzeWorkflowScript` 与 world.run / phase /
64
+ * actor 名的编译期规则同席)。
65
+ */
66
+ export declare function collectArtifactDeclarations(workflow: WorkflowProgram, table: SiteTable): ArtifactDeclarations;
67
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/analysis/artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAa,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD,4BAA4B;AAC5B,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,sBAAsB;IACtB,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAkCD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,SAAS,GACf,oBAAoB,CAwItB"}