cloving 1.1.0 → 1.2.0

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 (213) hide show
  1. package/README.md +121 -21
  2. package/assets/watch-fonts/fira-code-OFL.md +93 -0
  3. package/assets/watch-fonts/fira-code-latin-400-normal.woff2 +0 -0
  4. package/assets/watch-fonts/fira-code-latin-500-normal.woff2 +0 -0
  5. package/assets/watch-fonts/heebo-OFL.md +93 -0
  6. package/assets/watch-fonts/heebo-latin-500-normal.woff2 +0 -0
  7. package/assets/watch-fonts/heebo-latin-700-normal.woff2 +0 -0
  8. package/assets/watch-fonts/heebo-latin-800-normal.woff2 +0 -0
  9. package/assets/watch-fonts/manifest.json +112 -0
  10. package/assets/watch-fonts/space-grotesk-OFL.md +93 -0
  11. package/assets/watch-fonts/space-grotesk-latin-400-normal.woff2 +0 -0
  12. package/assets/watch-fonts/space-grotesk-latin-500-normal.woff2 +0 -0
  13. package/assets/watch-fonts/space-grotesk-latin-600-normal.woff2 +0 -0
  14. package/assets/watch-fonts/space-grotesk-latin-700-normal.woff2 +0 -0
  15. package/dist/src/authority/commands.d.ts +1 -0
  16. package/dist/src/authority/commands.js +25 -4
  17. package/dist/src/authority/dispatch-decision.d.ts +1 -0
  18. package/dist/src/authority/dispatch-decision.js +7 -4
  19. package/dist/src/authority/events.js +2 -2
  20. package/dist/src/authority/handoff-chain.d.ts +24 -0
  21. package/dist/src/authority/handoff-chain.js +46 -0
  22. package/dist/src/authority/reconciliation.d.ts +1 -0
  23. package/dist/src/authority/reconciliation.js +18 -11
  24. package/dist/src/authority/transitions.d.ts +1 -1
  25. package/dist/src/authority/transitions.js +3 -0
  26. package/dist/src/broker/actor/authority-queries.d.ts +4 -0
  27. package/dist/src/broker/actor/authority-queries.js +51 -2
  28. package/dist/src/broker/actor/delivery-intents.d.ts +1 -0
  29. package/dist/src/broker/actor/effect-delivery.js +9 -0
  30. package/dist/src/broker/authority-admission.js +13 -5
  31. package/dist/src/chats/analysis-batches.d.ts +18 -0
  32. package/dist/src/chats/analysis-batches.js +15 -1
  33. package/dist/src/chats/analysis-checkpoint.d.ts +29 -0
  34. package/dist/src/chats/analysis-checkpoint.js +31 -0
  35. package/dist/src/chats/analysis-input.d.ts +7 -1
  36. package/dist/src/chats/analysis-input.js +20 -6
  37. package/dist/src/chats/analysis-merge.d.ts +16 -0
  38. package/dist/src/chats/analysis-merge.js +134 -0
  39. package/dist/src/chats/analysis-prompt.d.ts +8 -0
  40. package/dist/src/chats/analysis-prompt.js +27 -1
  41. package/dist/src/chats/analysis-proposal.d.ts +2 -0
  42. package/dist/src/chats/analysis-proposal.js +9 -0
  43. package/dist/src/chats/analysis-shape.d.ts +1 -0
  44. package/dist/src/chats/analysis-shape.js +11 -4
  45. package/dist/src/chats/reference-mapping.d.ts +16 -0
  46. package/dist/src/chats/reference-mapping.js +153 -0
  47. package/dist/src/chats/workflow-generation-projection.d.ts +8 -0
  48. package/dist/src/chats/workflow-generation-projection.js +75 -0
  49. package/dist/src/chats/workflow-generation-source.d.ts +25 -0
  50. package/dist/src/chats/workflow-generation-source.js +124 -0
  51. package/dist/src/chats/workflow-generation-text.d.ts +23 -0
  52. package/dist/src/chats/workflow-generation-text.js +74 -0
  53. package/dist/src/chats/workflow-generation.d.ts +69 -0
  54. package/dist/src/chats/workflow-generation.js +142 -0
  55. package/dist/src/cli/render.d.ts +1 -0
  56. package/dist/src/cli/render.js +60 -13
  57. package/dist/src/cli/usage.js +5 -2
  58. package/dist/src/cli/watch-board-view.d.ts +12 -1
  59. package/dist/src/cli/watch-board-view.js +57 -11
  60. package/dist/src/cli/watch-board.d.ts +7 -1
  61. package/dist/src/cli/watch-board.js +42 -10
  62. package/dist/src/cli/watch-client.d.ts +1 -1
  63. package/dist/src/cli/watch-client.js +7 -3
  64. package/dist/src/cli/watch-model.d.ts +10 -4
  65. package/dist/src/cli/watch-model.js +35 -58
  66. package/dist/src/cli/watch-page.js +21 -4
  67. package/dist/src/cli/watch-phases.js +3 -3
  68. package/dist/src/cli/watch-pr-command.d.ts +5 -2
  69. package/dist/src/cli/watch-pr-command.js +41 -4
  70. package/dist/src/cli/watch-pr-identity.d.ts +14 -2
  71. package/dist/src/cli/watch-pr-identity.js +25 -0
  72. package/dist/src/cli/watch-pr-observer.d.ts +1 -0
  73. package/dist/src/cli/watch-pr-observer.js +48 -6
  74. package/dist/src/cli/watch-pull-request.d.ts +10 -0
  75. package/dist/src/cli/watch-pull-request.js +130 -0
  76. package/dist/src/cli/watch-reads.d.ts +7 -1
  77. package/dist/src/cli/watch-reads.js +42 -20
  78. package/dist/src/cli/watch-render.d.ts +14 -1
  79. package/dist/src/cli/watch-render.js +2 -1
  80. package/dist/src/cli/watch-server.js +33 -2
  81. package/dist/src/cli/watch-turn.js +1 -1
  82. package/dist/src/cli/watch-view.d.ts +7 -0
  83. package/dist/src/cli/watch-view.js +51 -3
  84. package/dist/src/daemon/analysis-worker.d.ts +0 -2
  85. package/dist/src/daemon/analysis-worker.js +71 -19
  86. package/dist/src/daemon/chats-batch-binding.d.ts +23 -0
  87. package/dist/src/daemon/chats-batch-binding.js +99 -0
  88. package/dist/src/daemon/chats-capture.d.ts +18 -0
  89. package/dist/src/daemon/chats-capture.js +194 -0
  90. package/dist/src/daemon/chats-checkpoints.d.ts +41 -0
  91. package/dist/src/daemon/chats-checkpoints.js +186 -0
  92. package/dist/src/daemon/chats-files.d.ts +29 -2
  93. package/dist/src/daemon/chats-files.js +142 -3
  94. package/dist/src/daemon/chats-follow-up.d.ts +38 -0
  95. package/dist/src/daemon/chats-follow-up.js +180 -0
  96. package/dist/src/daemon/chats-question.d.ts +15 -0
  97. package/dist/src/daemon/chats-question.js +93 -0
  98. package/dist/src/daemon/chats-worker.d.ts +1 -0
  99. package/dist/src/daemon/chats-worker.js +52 -51
  100. package/dist/src/daemon/claude-turn.d.ts +2 -1
  101. package/dist/src/daemon/claude-turn.js +1 -1
  102. package/dist/src/daemon/claude-worker.d.ts +0 -2
  103. package/dist/src/daemon/claude-worker.js +6 -11
  104. package/dist/src/daemon/daemon.d.ts +5 -1
  105. package/dist/src/daemon/daemon.js +38 -10
  106. package/dist/src/daemon/delivery-router.js +6 -0
  107. package/dist/src/daemon/github-calls.d.ts +4 -0
  108. package/dist/src/daemon/github-calls.js +16 -7
  109. package/dist/src/daemon/github-ci.d.ts +6 -0
  110. package/dist/src/daemon/github-ci.js +170 -0
  111. package/dist/src/daemon/github-merge-call.d.ts +14 -0
  112. package/dist/src/daemon/github-merge-call.js +73 -0
  113. package/dist/src/daemon/github-merge.d.ts +3 -5
  114. package/dist/src/daemon/github-merge.js +52 -95
  115. package/dist/src/daemon/github-methods.d.ts +28 -0
  116. package/dist/src/daemon/github-methods.js +80 -16
  117. package/dist/src/daemon/github-operation.d.ts +2 -0
  118. package/dist/src/daemon/github-retry.d.ts +6 -0
  119. package/dist/src/daemon/github-retry.js +49 -0
  120. package/dist/src/daemon/github-ticket-status.js +27 -1
  121. package/dist/src/daemon/github-worker.js +2 -1
  122. package/dist/src/daemon/handoff-worker.d.ts +10 -0
  123. package/dist/src/daemon/handoff-worker.js +232 -0
  124. package/dist/src/daemon/issue-queue.d.ts +1 -0
  125. package/dist/src/daemon/issue-queue.js +94 -42
  126. package/dist/src/daemon/notify-journal.d.ts +18 -0
  127. package/dist/src/daemon/notify-journal.js +108 -0
  128. package/dist/src/daemon/notify-message.js +2 -1
  129. package/dist/src/daemon/notify.js +176 -37
  130. package/dist/src/daemon/retrying-turn.d.ts +3 -0
  131. package/dist/src/daemon/retrying-turn.js +55 -9
  132. package/dist/src/daemon/ticket-dependency-waits.d.ts +18 -0
  133. package/dist/src/daemon/ticket-dependency-waits.js +60 -0
  134. package/dist/src/daemon/ticket-registration.d.ts +8 -4
  135. package/dist/src/daemon/ticket-registration.js +76 -22
  136. package/dist/src/daemon/ticket-source.d.ts +4 -1
  137. package/dist/src/daemon/ticket-source.js +8 -2
  138. package/dist/src/decision-visibility.d.ts +2 -0
  139. package/dist/src/decision-visibility.js +10 -0
  140. package/dist/src/execution-pin.d.ts +4 -0
  141. package/dist/src/execution-pin.js +23 -2
  142. package/dist/src/host/start-delivery.d.ts +2 -1
  143. package/dist/src/host/start-delivery.js +1 -1
  144. package/dist/src/host/step-bridge-host.d.ts +1 -0
  145. package/dist/src/host/step-bridge-host.js +16 -0
  146. package/dist/src/host/world-reconciliation.d.ts +1 -0
  147. package/dist/src/host/world-reconciliation.js +3 -0
  148. package/dist/src/host/world-runs.js +5 -0
  149. package/dist/src/issue-identity.d.ts +6 -0
  150. package/dist/src/issue-identity.js +23 -0
  151. package/dist/src/service/queue-runs.d.ts +3 -0
  152. package/dist/src/service/queue-runs.js +39 -0
  153. package/dist/src/service/registry.d.ts +8 -2
  154. package/dist/src/service/registry.js +20 -8
  155. package/dist/src/service/replies.d.ts +2 -0
  156. package/dist/src/service/run-handlers.js +44 -12
  157. package/dist/src/service/service.d.ts +3 -0
  158. package/dist/src/service/service.js +3 -1
  159. package/dist/src/service/submission-handler.d.ts +1 -0
  160. package/dist/src/service/submission-handler.js +92 -13
  161. package/dist/src/service/worker-totals.js +25 -1
  162. package/dist/src/step-bridge.d.ts +9 -0
  163. package/dist/src/steps/handoff.d.ts +2 -0
  164. package/dist/src/steps/handoff.js +13 -0
  165. package/dist/src/ticket-dependencies.d.ts +1 -0
  166. package/dist/src/ticket-dependencies.js +15 -0
  167. package/dist/src/ticket-status.js +7 -4
  168. package/dist/src/token-prices.d.ts +2 -0
  169. package/dist/src/token-prices.js +41 -9
  170. package/dist/src/worker-usage.d.ts +9 -0
  171. package/dist/src/worker-usage.js +1 -1
  172. package/dist/src/workflow-admission.d.ts +1 -0
  173. package/dist/src/workflow-candidate.js +1 -0
  174. package/dist/src/workflow-contracts.d.ts +2 -0
  175. package/dist/src/workflow-contracts.js +8 -3
  176. package/dist/src/workflow-declaration.d.ts +11 -0
  177. package/dist/src/workflow-declaration.js +71 -15
  178. package/dist/src/workflow-discovery.d.ts +18 -0
  179. package/dist/src/workflow-discovery.js +33 -0
  180. package/dist/src/workflow-refusals.d.ts +6 -0
  181. package/dist/src/workflow-refusals.js +39 -0
  182. package/dist/src/workflows.d.ts +2 -1
  183. package/dist/src/workflows.js +1 -0
  184. package/dist/tools/admit-workflow.d.ts +13 -0
  185. package/dist/tools/admit-workflow.js +94 -0
  186. package/dist/tools/self-host-project.d.ts +17 -0
  187. package/dist/tools/self-host-project.js +177 -0
  188. package/dist/tools/self-host.js +27 -81
  189. package/dist/tools/workflow-bundle-dependencies.d.ts +5 -0
  190. package/dist/tools/workflow-bundle-dependencies.js +93 -0
  191. package/dist/tools/workflow-bundles.d.ts +20 -0
  192. package/dist/tools/workflow-bundles.js +173 -0
  193. package/dist/tools/workflow-candidate-counts.d.ts +8 -0
  194. package/dist/tools/workflow-candidate-counts.js +251 -0
  195. package/dist/tools/workflow-candidate-program.d.ts +11 -0
  196. package/dist/tools/workflow-candidate-program.js +78 -0
  197. package/dist/tools/workflow-candidate-source.d.ts +6 -0
  198. package/dist/tools/workflow-candidate-source.js +107 -0
  199. package/dist/tools/workflow-candidate-syntax.d.ts +15 -0
  200. package/dist/tools/workflow-candidate-syntax.js +219 -0
  201. package/dist/tools/workflow-folder-capture.d.ts +17 -0
  202. package/dist/tools/workflow-folder-capture.js +216 -0
  203. package/dist/tools/workflow-folders.d.ts +33 -0
  204. package/dist/tools/workflow-folders.js +150 -0
  205. package/dist/tools/workflow-source-effects.d.ts +10 -0
  206. package/dist/tools/workflow-source-effects.js +213 -0
  207. package/dist/workflows/analyze-chats.d.ts +6 -1
  208. package/dist/workflows/analyze-chats.declaration.json +14 -1
  209. package/dist/workflows/analyze-chats.js +188 -11
  210. package/dist/workflows/develop-prd.js +71 -3
  211. package/dist/workflows/develop-ticket.js +5 -0
  212. package/dist/workflows/ticket-prompts.js +12 -2
  213. package/package.json +21 -3
@@ -0,0 +1,112 @@
1
+ {
2
+ "files": [
3
+ {
4
+ "path": "fira-code-latin-400-normal.woff2",
5
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/fira-code/-/fira-code-5.3.0.tgz",
6
+ "sourceMember": "package/files/fira-code-latin-400-normal.woff2",
7
+ "package": "@fontsource/fira-code",
8
+ "version": "5.3.0",
9
+ "bytes": 23312,
10
+ "sha256": "6dc9da171ccea71d525379ee1cbf51d143e31acac330a251bb71b3d6060e687c"
11
+ },
12
+ {
13
+ "path": "fira-code-latin-500-normal.woff2",
14
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/fira-code/-/fira-code-5.3.0.tgz",
15
+ "sourceMember": "package/files/fira-code-latin-500-normal.woff2",
16
+ "package": "@fontsource/fira-code",
17
+ "version": "5.3.0",
18
+ "bytes": 23316,
19
+ "sha256": "9e4da5ad2c147be02544df5a732d22830a82b1e9800dc06267ba656f5c40f7e9"
20
+ },
21
+ {
22
+ "path": "fira-code-OFL.md",
23
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/fira-code/-/fira-code-5.3.0.tgz",
24
+ "sourceMember": "package/LICENSE",
25
+ "package": "@fontsource/fira-code",
26
+ "version": "5.3.0",
27
+ "bytes": 4389,
28
+ "sha256": "126cd7bf732b86f42885f1fbf682e6aeea456672c7fdb99f2d557ec44e468a28"
29
+ },
30
+ {
31
+ "path": "heebo-latin-500-normal.woff2",
32
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/heebo/-/heebo-5.3.0.tgz",
33
+ "sourceMember": "package/files/heebo-latin-500-normal.woff2",
34
+ "package": "@fontsource/heebo",
35
+ "version": "5.3.0",
36
+ "bytes": 12312,
37
+ "sha256": "aa1ea48851b81ac859cf5bcb0e121b596d6b9386dbb9a3f7cd01af3e997201ae"
38
+ },
39
+ {
40
+ "path": "heebo-latin-700-normal.woff2",
41
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/heebo/-/heebo-5.3.0.tgz",
42
+ "sourceMember": "package/files/heebo-latin-700-normal.woff2",
43
+ "package": "@fontsource/heebo",
44
+ "version": "5.3.0",
45
+ "bytes": 12216,
46
+ "sha256": "2dd5f140b9902257dc0f38e89f47f79d40b31438abef118637d916861fd370bb"
47
+ },
48
+ {
49
+ "path": "heebo-latin-800-normal.woff2",
50
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/heebo/-/heebo-5.3.0.tgz",
51
+ "sourceMember": "package/files/heebo-latin-800-normal.woff2",
52
+ "package": "@fontsource/heebo",
53
+ "version": "5.3.0",
54
+ "bytes": 12132,
55
+ "sha256": "4890f322303544cf75def54d1065880f017dfe173f15d1b89a1a216e9855fe58"
56
+ },
57
+ {
58
+ "path": "heebo-OFL.md",
59
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/heebo/-/heebo-5.3.0.tgz",
60
+ "sourceMember": "package/LICENSE",
61
+ "package": "@fontsource/heebo",
62
+ "version": "5.3.0",
63
+ "bytes": 4379,
64
+ "sha256": "50ac3e340fcd4822b2904413d14b457e02392f0bef38cd790e88da82014be44f"
65
+ },
66
+ {
67
+ "path": "space-grotesk-latin-400-normal.woff2",
68
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.3.0.tgz",
69
+ "sourceMember": "package/files/space-grotesk-latin-400-normal.woff2",
70
+ "package": "@fontsource/space-grotesk",
71
+ "version": "5.3.0",
72
+ "bytes": 13388,
73
+ "sha256": "65fd17fcbd2e2f522940b5f67ead3d23329e02891aa5495e74d11a499c0b0673"
74
+ },
75
+ {
76
+ "path": "space-grotesk-latin-500-normal.woff2",
77
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.3.0.tgz",
78
+ "sourceMember": "package/files/space-grotesk-latin-500-normal.woff2",
79
+ "package": "@fontsource/space-grotesk",
80
+ "version": "5.3.0",
81
+ "bytes": 13312,
82
+ "sha256": "1b1a8131d9edf975d9decee81e2f2bf504812f7a4f498e5500f28a613e22e64c"
83
+ },
84
+ {
85
+ "path": "space-grotesk-latin-600-normal.woff2",
86
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.3.0.tgz",
87
+ "sourceMember": "package/files/space-grotesk-latin-600-normal.woff2",
88
+ "package": "@fontsource/space-grotesk",
89
+ "version": "5.3.0",
90
+ "bytes": 13284,
91
+ "sha256": "685bbbf69fa616df1ef81847c85fc76be097ddfb3468ff2257be54511ab3130f"
92
+ },
93
+ {
94
+ "path": "space-grotesk-latin-700-normal.woff2",
95
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.3.0.tgz",
96
+ "sourceMember": "package/files/space-grotesk-latin-700-normal.woff2",
97
+ "package": "@fontsource/space-grotesk",
98
+ "version": "5.3.0",
99
+ "bytes": 12840,
100
+ "sha256": "35f8aec56cfd5cbfdb03cc68733a54a0b05bb3617ffcd5fd332badc0b045ca55"
101
+ },
102
+ {
103
+ "path": "space-grotesk-OFL.md",
104
+ "sourceArchive": "https://registry.npmjs.org/@fontsource/space-grotesk/-/space-grotesk-5.3.0.tgz",
105
+ "sourceMember": "package/LICENSE",
106
+ "package": "@fontsource/space-grotesk",
107
+ "version": "5.3.0",
108
+ "bytes": 4401,
109
+ "sha256": "18a4de52385f6b988782639d5d0cc1326e5a8c2de9a7f01d7b20d9aedcc60943"
110
+ }
111
+ ]
112
+ }
@@ -0,0 +1,93 @@
1
+ Copyright 2020 The Space Grotesk Project Authors (https://github.com/floriankarsten/space-grotesk)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -5,3 +5,4 @@ export declare const recoveryBound = 10;
5
5
  export declare function isCapabilityList(value: unknown): value is string;
6
6
  export declare function isIdentifier(value: unknown): value is string;
7
7
  export declare function isRecordKey(value: unknown): value is string;
8
+ export declare function isCommandId(value: unknown): value is string;
@@ -1,6 +1,7 @@
1
1
  import { isTicketStatus } from "../ticket-status.js";
2
+ import { operationScope } from "../operation-identity.js";
2
3
  import { isInstant } from "./instants.js";
3
- import { isBlockedReason } from "../workflow-contracts.js";
4
+ import { isBlockedReason, isPromotionId } from "../workflow-contracts.js";
4
5
  import { numberFields, textFields, } from "./transitions.js";
5
6
  const identifier = /^[A-Za-z0-9._:/-]{1,128}$/;
6
7
  const digest = /^sha256:[0-9a-f]{64}$/;
@@ -30,6 +31,8 @@ const shapes = {
30
31
  "admit-run": {
31
32
  required: ["workflow"],
32
33
  optional: [
34
+ "parentRunId",
35
+ "chainId",
33
36
  "submission",
34
37
  "input",
35
38
  "resolver",
@@ -37,6 +40,7 @@ const shapes = {
37
40
  "capabilities",
38
41
  ],
39
42
  groups: [
43
+ ["parentRunId", "chainId"],
40
44
  ["submission", "input", "resolver"],
41
45
  ["effectLimit", "capabilities"],
42
46
  ],
@@ -66,15 +70,24 @@ const shapes = {
66
70
  "resume-run": revised,
67
71
  "complete-run": {
68
72
  required: ["expectedRevision"],
69
- optional: ["outcome", "outcomeReason", "ticketStatus", "issueUpdate"],
73
+ optional: [
74
+ "outcome",
75
+ "outcomeReason",
76
+ "promotionId",
77
+ "ticketStatus",
78
+ "issueUpdate",
79
+ ],
70
80
  validators: {
71
81
  outcome: (value) => value === "handoff_requested" || value === "blocked",
72
82
  outcomeReason: isBlockedReason,
83
+ promotionId: isPromotionId,
73
84
  ticketStatus: isTicketStatus,
74
85
  issueUpdate: (value) => value === "failed",
75
86
  },
76
87
  consistent: (fields) => (fields["outcomeReason"] === undefined ||
77
- fields["outcome"] === "blocked") &&
88
+ fields["outcome"] !== undefined) &&
89
+ (fields["promotionId"] === undefined ||
90
+ fields["outcome"] === "handoff_requested") &&
78
91
  (fields["ticketStatus"] === undefined ||
79
92
  fields["outcome"] === "handoff_requested") &&
80
93
  (fields["issueUpdate"] === undefined ||
@@ -147,7 +160,7 @@ export function parseCommand(value) {
147
160
  return null;
148
161
  const fields = Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined));
149
162
  const { kind, commandId, runId } = fields;
150
- if (!knownKind(kind) || !isRecordKey(commandId) || !isRecordKey(runId))
163
+ if (!knownKind(kind) || !isCommandId(commandId) || !isRecordKey(runId))
151
164
  return null;
152
165
  if (!completeFields(kind, fields))
153
166
  return null;
@@ -269,3 +282,11 @@ const plainRecord = {};
269
282
  export function isRecordKey(value) {
270
283
  return isIdentifier(value) && !(value in plainRecord);
271
284
  }
285
+ export function isCommandId(value) {
286
+ if (isRecordKey(value))
287
+ return true;
288
+ return (typeof value === "string" &&
289
+ value.startsWith("handoff:") &&
290
+ printable(value.slice(8)) &&
291
+ operationScope(value.slice(8)) !== null);
292
+ }
@@ -35,6 +35,7 @@ export interface DispatchCheck {
35
35
  readonly leaseGeneration?: number;
36
36
  };
37
37
  readonly now: string;
38
+ readonly mode?: "retry";
38
39
  }
39
40
  export type DispatchDecision = "stale" | "withheld" | "refused" | "blocked" | "send";
40
41
  export declare function dispatchDecision(read: DispatchRead, check: DispatchCheck): DispatchDecision;
@@ -15,13 +15,16 @@ function bound(read, intent) {
15
15
  lease.state !== "released",
16
16
  ].every(Boolean);
17
17
  }
18
- function sendable(read, now) {
18
+ function sendable(read, check) {
19
+ const statuses = check.mode === "retry"
20
+ ? ["dispatch-pending", "recovering", "blocked"]
21
+ : ["dispatch-pending"];
19
22
  return [
20
23
  !read.released,
21
24
  read.runStatus === "running",
22
- read.operation?.status === "dispatch-pending",
25
+ statuses.includes(read.operation?.status ?? ""),
23
26
  read.lease?.state === "held",
24
- isAfter(read.lease?.expiresAt ?? "", now),
27
+ isAfter(read.lease?.expiresAt ?? "", check.now),
25
28
  ].every(Boolean);
26
29
  }
27
30
  function authorized(read) {
@@ -39,7 +42,7 @@ function authorized(read) {
39
42
  export function dispatchDecision(read, check) {
40
43
  if (!bound(read, check.intent))
41
44
  return "stale";
42
- if (!sendable(read, check.now))
45
+ if (!sendable(read, check))
43
46
  return "withheld";
44
47
  if (!authorized(read))
45
48
  return "refused";
@@ -1,4 +1,4 @@
1
- import { isRecordKey } from "./commands.js";
1
+ import { isCommandId, isRecordKey } from "./commands.js";
2
2
  import { eventTypes } from "./transitions.js";
3
3
  export function parseEvent(value) {
4
4
  const fields = record(value);
@@ -11,7 +11,7 @@ export function parseEvent(value) {
11
11
  !Number.isSafeInteger(sequence) ||
12
12
  eventType === undefined ||
13
13
  !isRecordKey(runId) ||
14
- !isRecordKey(commandId) ||
14
+ !isCommandId(commandId) ||
15
15
  typeof recordedAt !== "string" ||
16
16
  typeof request !== "string" ||
17
17
  !payload)
@@ -0,0 +1,24 @@
1
+ export interface RunOrigin {
2
+ readonly parentRunId: string | null;
3
+ readonly chainId: string;
4
+ }
5
+ export type RunOrigins = Readonly<Record<string, RunOrigin>>;
6
+ export interface RunLinks extends RunOrigin {
7
+ readonly childRunIds: readonly string[];
8
+ }
9
+ export declare function linksOf(run: {
10
+ readonly runId: string;
11
+ } & Partial<RunLinks>): RunLinks;
12
+ export declare function runLinks(origins: RunOrigins): Readonly<Record<string, RunLinks>>;
13
+ export declare function childRuns(origins: RunOrigins): Readonly<Record<string, readonly string[]>>;
14
+ export type HandoffChain = {
15
+ readonly kind: "root";
16
+ } | {
17
+ readonly kind: "handoff";
18
+ readonly parentRunId: string;
19
+ readonly chainId: string;
20
+ } | {
21
+ readonly kind: "refused";
22
+ readonly reason: string;
23
+ };
24
+ export declare function handoffChain(commandId: string, origins: RunOrigins): HandoffChain;
@@ -0,0 +1,46 @@
1
+ import { operationScope } from "../operation-identity.js";
2
+ export function linksOf(run) {
3
+ return {
4
+ parentRunId: run.parentRunId ?? null,
5
+ chainId: run.chainId ?? run.runId,
6
+ childRunIds: run.childRunIds ?? [],
7
+ };
8
+ }
9
+ export function runLinks(origins) {
10
+ const children = childRuns(origins);
11
+ return Object.fromEntries(Object.entries(origins).map(([runId, origin]) => [
12
+ runId,
13
+ {
14
+ ...origin,
15
+ childRunIds: children[runId] ?? [],
16
+ },
17
+ ]));
18
+ }
19
+ export function childRuns(origins) {
20
+ const children = {};
21
+ for (const [runId, origin] of Object.entries(origins)) {
22
+ if (origin.parentRunId === null)
23
+ continue;
24
+ const siblings = children[origin.parentRunId] ?? [];
25
+ siblings.push(runId);
26
+ children[origin.parentRunId] = siblings;
27
+ }
28
+ return children;
29
+ }
30
+ export function handoffChain(commandId, origins) {
31
+ if (!commandId.startsWith("handoff:"))
32
+ return { kind: "root" };
33
+ const parentRunId = operationScope(commandId.slice(8))?.run;
34
+ const parent = parentRunId === undefined ? undefined : origins[parentRunId];
35
+ if (parent === undefined || parentRunId === undefined)
36
+ return { kind: "refused", reason: "unknown-handoff-parent" };
37
+ let current = parent;
38
+ for (let length = 1; current !== undefined; length += 1) {
39
+ if (length >= 5)
40
+ return { kind: "refused", reason: "chain-limit" };
41
+ if (current.parentRunId === null)
42
+ return { kind: "handoff", parentRunId, chainId: parent.chainId };
43
+ current = origins[current.parentRunId];
44
+ }
45
+ return { kind: "refused", reason: "unknown-handoff-parent" };
46
+ }
@@ -4,6 +4,7 @@ export interface WorldRun {
4
4
  readonly receipt: string;
5
5
  readonly status: string;
6
6
  readonly outcome?: string;
7
+ readonly promotionId?: string;
7
8
  readonly outcomeReason?: string;
8
9
  readonly issueUpdate?: "failed";
9
10
  readonly ticketStatus?: "complete" | "partial";
@@ -1,6 +1,6 @@
1
1
  import { isTicketStatus } from "../ticket-status.js";
2
2
  import { gateContinuation } from "./gate-reduction.js";
3
- import { isBlockedReason } from "../workflow-contracts.js";
3
+ import { isBlockedReason, isPromotionId } from "../workflow-contracts.js";
4
4
  import { continues } from "./gates.js";
5
5
  import { startOperation } from "./reduction.js";
6
6
  import { terminal, } from "./transitions.js";
@@ -111,19 +111,26 @@ function moved(kind, observed) {
111
111
  }
112
112
  function completionOutcome(world) {
113
113
  const { outcome, outcomeReason } = world;
114
- if (outcome !== "handoff_requested" && outcome !== "blocked")
115
- return {};
116
- if (outcome !== "blocked" || !isBlockedReason(outcomeReason))
114
+ if (outcome === "blocked")
117
115
  return {
118
116
  outcome,
119
- ...(outcome === "handoff_requested" && world.issueUpdate === "failed"
120
- ? { issueUpdate: world.issueUpdate }
121
- : {}),
122
- ...(outcome === "handoff_requested" && isTicketStatus(world.ticketStatus)
123
- ? { ticketStatus: world.ticketStatus }
124
- : {}),
117
+ ...(isBlockedReason(outcomeReason) ? { outcomeReason } : {}),
125
118
  };
126
- return { outcome, outcomeReason };
119
+ if (outcome !== "handoff_requested")
120
+ return {};
121
+ return {
122
+ outcome,
123
+ ...(isBlockedReason(outcomeReason) ? { outcomeReason } : {}),
124
+ ...(isPromotionId(world.promotionId)
125
+ ? { promotionId: world.promotionId }
126
+ : {}),
127
+ ...(world.issueUpdate === "failed"
128
+ ? { issueUpdate: world.issueUpdate }
129
+ : {}),
130
+ ...(isTicketStatus(world.ticketStatus)
131
+ ? { ticketStatus: world.ticketStatus }
132
+ : {}),
133
+ };
127
134
  }
128
135
  function noted(observed, evidence) {
129
136
  const { run, world, reason } = observed;
@@ -40,7 +40,7 @@ export interface AuthorityEvent {
40
40
  readonly payload: Readonly<Record<string, string>>;
41
41
  }
42
42
  export declare const numberFields: readonly ["expectedRevision", "generation", "attempt", "limit", "effectLimit", "units", "recoveryLimit", "leaseGeneration", "sourceGeneration", "capacity"];
43
- export declare const textFields: readonly ["workflow", "submission", "input", "resolver", "gateId", "gateKind", "subject", "prompt", "expiresAt", "decision", "answer", "condition", "reason", "evidence", "retryAt", "operationId", "receipt", "capabilities", "capability", "method", "target", "payload", "inputDigest", "resource", "transport", "source", "worker", "outcome", "outcomeReason", "ticketStatus", "issueUpdate", "result"];
43
+ export declare const textFields: readonly ["parentRunId", "chainId", "workflow", "submission", "input", "resolver", "gateId", "gateKind", "subject", "prompt", "expiresAt", "decision", "answer", "condition", "reason", "evidence", "retryAt", "operationId", "receipt", "capabilities", "capability", "method", "target", "payload", "inputDigest", "resource", "transport", "source", "worker", "outcome", "outcomeReason", "promotionId", "ticketStatus", "issueUpdate", "result"];
44
44
  export type NumberField = (typeof numberFields)[number];
45
45
  export type TextField = (typeof textFields)[number];
46
46
  export type AuthorityCommand = {
@@ -31,6 +31,8 @@ export const numberFields = [
31
31
  "capacity",
32
32
  ];
33
33
  export const textFields = [
34
+ "parentRunId",
35
+ "chainId",
34
36
  "workflow",
35
37
  "submission",
36
38
  "input",
@@ -60,6 +62,7 @@ export const textFields = [
60
62
  "worker",
61
63
  "outcome",
62
64
  "outcomeReason",
65
+ "promotionId",
63
66
  "ticketStatus",
64
67
  "issueUpdate",
65
68
  "result",
@@ -1,6 +1,7 @@
1
1
  import type { Database } from "solid-objects";
2
2
  import type { AuthorityCommand, AuthorityEvent } from "../../authority/transitions.ts";
3
3
  import { type SqlConnection } from "../../storage/domain-rows.ts";
4
+ import { type RunLinks, type RunOrigins } from "../../authority/handoff-chain.ts";
4
5
  export interface CommandRecord {
5
6
  readonly commandId: string;
6
7
  readonly sequence: number;
@@ -28,6 +29,7 @@ export interface Sequences {
28
29
  export interface CompletionCursor {
29
30
  readonly runId: string;
30
31
  readonly atOrBefore: number;
32
+ readonly terminal?: boolean;
31
33
  }
32
34
  export interface AuthorityQueries {
33
35
  readonly document: (digest: string) => Promise<string | undefined>;
@@ -36,6 +38,8 @@ export interface AuthorityQueries {
36
38
  readonly latestCompletion: (cursor: CompletionCursor) => Promise<PublishedEvent | undefined>;
37
39
  readonly sequences: () => Promise<Sequences>;
38
40
  readonly workflowIds: () => Promise<Readonly<Record<string, string>>>;
41
+ readonly runOrigins: () => Promise<RunOrigins>;
42
+ readonly runLinks: () => Promise<Readonly<Record<string, RunLinks>>>;
39
43
  }
40
44
  export type Read = <Value>(query: (connection: SqlConnection) => Promise<Value>) => Promise<Value>;
41
45
  export declare function guardedRead(access: {
@@ -1,8 +1,19 @@
1
1
  import { parseCommand } from "../../authority/commands.js";
2
2
  import { documentBody } from "../../storage/decision-rows.js";
3
- import { integer, latestSequence, text, } from "../../storage/domain-rows.js";
3
+ import { integer, optionalText, latestSequence, text, } from "../../storage/domain-rows.js";
4
4
  import { storedEvents } from "../authority-restore.js";
5
5
  import { documentDigest } from "../decision-restore.js";
6
+ import { runLinks, } from "../../authority/handoff-chain.js";
7
+ async function runOrigins(connection, cursor) {
8
+ const rows = await connection.all("SELECT run_id, json_extract(payload, '$.parentRunId') AS parent_run_id, coalesce(json_extract(payload, '$.chainId'), run_id) AS chain_id FROM events WHERE type = 'run.created' AND sequence > ? AND sequence <= ? ORDER BY sequence", [cursor.after, cursor.through]);
9
+ return Object.fromEntries(rows.map((row) => [
10
+ text(row, "run_id"),
11
+ {
12
+ parentRunId: optionalText(row, "parent_run_id"),
13
+ chainId: text(row, "chain_id"),
14
+ },
15
+ ]));
16
+ }
6
17
  async function receipt(connection, commandId) {
7
18
  const row = await connection.get("SELECT c.request, c.sequence, e.run_id, e.recorded_at FROM commands c JOIN events e ON e.sequence = c.sequence WHERE c.command_id = ?", [commandId]);
8
19
  if (row === undefined)
@@ -51,7 +62,10 @@ function publishedEvents(rows) {
51
62
  }));
52
63
  }
53
64
  async function latestCompletion(connection, cursor) {
54
- const row = await connection.get("SELECT sequence, type, run_id, command_id, recorded_at, payload FROM events WHERE run_id = ? AND type = 'run.completed' AND sequence <= ? ORDER BY sequence DESC LIMIT 1", [cursor.runId, cursor.atOrBefore]);
65
+ const types = cursor.terminal === true
66
+ ? "type IN ('run.completed', 'run.failed', 'run.cancelled')"
67
+ : "type = 'run.completed'";
68
+ const row = await connection.get(`SELECT sequence, type, run_id, command_id, recorded_at, payload FROM events WHERE run_id = ? AND ${types} AND sequence <= ? ORDER BY sequence DESC LIMIT 1`, [cursor.runId, cursor.atOrBefore]);
55
69
  return row === undefined ? undefined : publishedEvents([row])[0];
56
70
  }
57
71
  async function sequences(connection) {
@@ -66,6 +80,28 @@ async function workflowIds(connection) {
66
80
  const rows = await connection.all("SELECT d.run_id, json_extract(s.body, '$.workflowId') AS workflow_id FROM run_details d JOIN documents s ON s.digest = d.submission WHERE json_valid(s.body) AND json_type(s.body, '$.workflowId') = 'text'");
67
81
  return Object.fromEntries(rows.map((row) => [text(row, "run_id"), text(row, "workflow_id")]));
68
82
  }
83
+ function cachedOrigins(read) {
84
+ let sequence = 0;
85
+ let origins = {};
86
+ let pending = Promise.resolve();
87
+ return () => {
88
+ const result = pending.then(() => read(async (connection) => {
89
+ const through = await latestSequence(connection);
90
+ if (through === sequence)
91
+ return origins;
92
+ const added = await runOrigins(connection, {
93
+ after: sequence,
94
+ through,
95
+ });
96
+ if (Object.keys(added).length > 0)
97
+ origins = { ...origins, ...added };
98
+ sequence = through;
99
+ return origins;
100
+ }));
101
+ pending = result.then(() => undefined, () => undefined);
102
+ return result;
103
+ };
104
+ }
69
105
  export function guardedRead(access) {
70
106
  const { reader, ready } = access;
71
107
  return async (query) => {
@@ -74,6 +110,17 @@ export function guardedRead(access) {
74
110
  };
75
111
  }
76
112
  export function authorityQueries(read) {
113
+ const origins = cachedOrigins(read);
114
+ let linkedOrigins;
115
+ let links = {};
116
+ const currentLinks = async () => {
117
+ const current = await origins();
118
+ if (current !== linkedOrigins) {
119
+ links = runLinks(current);
120
+ linkedOrigins = current;
121
+ }
122
+ return links;
123
+ };
77
124
  return {
78
125
  document: (digest) => read((connection) => documentBody(connection, digest)),
79
126
  receipt: (commandId) => read((connection) => receipt(connection, commandId)),
@@ -81,5 +128,7 @@ export function authorityQueries(read) {
81
128
  latestCompletion: (cursor) => read((connection) => latestCompletion(connection, cursor)),
82
129
  sequences: () => read(sequences),
83
130
  workflowIds: () => read(workflowIds),
131
+ runOrigins: origins,
132
+ runLinks: currentLinks,
84
133
  };
85
134
  }
@@ -51,6 +51,7 @@ export interface Delivery {
51
51
  readonly worker?: string;
52
52
  } | AdapterOutcome>;
53
53
  readonly reconcile: (intent: DeliveryIntent, signal: AbortSignal) => Promise<AdapterOutcome>;
54
+ readonly retry?: Delivery["reconcile"];
54
55
  readonly stop?: (intent: DeliveryIntent, signal: AbortSignal) => Promise<AdapterOutcome>;
55
56
  }
56
57
  export type AvailableManifest = (pinned: ExecutionManifest) => ExecutionManifest | undefined;
@@ -69,9 +69,16 @@ function decided(parts, attempt) {
69
69
  }), {
70
70
  intent: { ...intent, computedDigest: effectInputDigest(intent) },
71
71
  now,
72
+ ...(attempt.mode === undefined ? {} : { mode: attempt.mode }),
72
73
  }));
73
74
  }
74
75
  const withheld = { kind: "withheld" };
76
+ async function retryEffect(parts, attempt) {
77
+ const retry = await decided(parts, { ...attempt, mode: "retry" });
78
+ return retry === "send"
79
+ ? called(parts, { intent: attempt.intent, name: "retry" })
80
+ : attempt.known;
81
+ }
75
82
  function unsent(decision) {
76
83
  return decision === "stale" ? withheld : { kind: decision };
77
84
  }
@@ -83,6 +90,8 @@ async function attempted(parts, attempt) {
83
90
  if (intent.purpose === "stop")
84
91
  return stopRequested(parts, intent);
85
92
  const known = await called(parts, { intent, name: "reconcile" });
93
+ if (known.kind === "unknown" && parts.delivery.retry !== undefined)
94
+ return retryEffect(parts, { ...attempt, known });
86
95
  if (known.kind !== "absent" || intent.purpose === "reconcile")
87
96
  return known;
88
97
  if (first !== "send")