@intentius/chant 0.91.0 → 0.93.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 (344) hide show
  1. package/dist/cli/commands/build.d.ts.map +1 -1
  2. package/dist/cli/commands/lint.d.ts.map +1 -1
  3. package/dist/cli/handlers/graph.d.ts.map +1 -1
  4. package/dist/cli/handlers/operator.d.ts +6 -0
  5. package/dist/cli/handlers/operator.d.ts.map +1 -1
  6. package/dist/cli/handlers/run.d.ts.map +1 -1
  7. package/dist/cli/main.d.ts.map +1 -1
  8. package/dist/cli/mcp/workspace-tools.d.ts +2 -1
  9. package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
  10. package/dist/cli/plugins.d.ts.map +1 -1
  11. package/dist/cli/registry.d.ts +12 -2
  12. package/dist/cli/registry.d.ts.map +1 -1
  13. package/dist/codegen/pinned-upgrade.d.ts.map +1 -1
  14. package/dist/config.d.ts +22 -0
  15. package/dist/config.d.ts.map +1 -1
  16. package/dist/lexicon-module.d.ts +22 -0
  17. package/dist/lexicon-module.d.ts.map +1 -1
  18. package/dist/lifecycle/converge-ledger.d.ts +19 -0
  19. package/dist/lifecycle/converge-ledger.d.ts.map +1 -1
  20. package/dist/lifecycle/run-ledger.d.ts +2 -0
  21. package/dist/lifecycle/run-ledger.d.ts.map +1 -1
  22. package/dist/lifecycle/symptoms.d.ts +51 -0
  23. package/dist/lifecycle/symptoms.d.ts.map +1 -1
  24. package/dist/lint/rules/index.d.ts +4 -2
  25. package/dist/lint/rules/index.d.ts.map +1 -1
  26. package/dist/lint/rules/op/index.d.ts +14 -3
  27. package/dist/lint/rules/op/index.d.ts.map +1 -1
  28. package/dist/lint/rules/op/ops014-converge-rule-refusals.d.ts.map +1 -1
  29. package/dist/lint/rules/op/sys010-key-over-plain-http.d.ts +29 -0
  30. package/dist/lint/rules/op/sys010-key-over-plain-http.d.ts.map +1 -0
  31. package/dist/lint/rules/sys001-no-literal-key.d.ts +3 -0
  32. package/dist/lint/rules/sys001-no-literal-key.d.ts.map +1 -0
  33. package/dist/op/__fixtures__/decide-stub-backend.d.ts +53 -0
  34. package/dist/op/__fixtures__/decide-stub-backend.d.ts.map +1 -0
  35. package/dist/op/activities/activity-contracts.d.ts +201 -0
  36. package/dist/op/activities/activity-contracts.d.ts.map +1 -1
  37. package/dist/op/activities/apply.d.ts.map +1 -1
  38. package/dist/op/activities/change-coverage.d.ts +44 -0
  39. package/dist/op/activities/change-coverage.d.ts.map +1 -0
  40. package/dist/op/activities/converge.d.ts +24 -1
  41. package/dist/op/activities/converge.d.ts.map +1 -1
  42. package/dist/op/activities/decide.d.ts +107 -0
  43. package/dist/op/activities/decide.d.ts.map +1 -0
  44. package/dist/op/activities/index.d.ts +10 -0
  45. package/dist/op/activities/index.d.ts.map +1 -1
  46. package/dist/op/activities/shell.d.ts +32 -0
  47. package/dist/op/activities/shell.d.ts.map +1 -1
  48. package/dist/op/activities/source-release.d.ts +86 -0
  49. package/dist/op/activities/source-release.d.ts.map +1 -0
  50. package/dist/op/activities/source-rollback.d.ts +100 -0
  51. package/dist/op/activities/source-rollback.d.ts.map +1 -0
  52. package/dist/op/activities/work-evidence.d.ts +42 -0
  53. package/dist/op/activities/work-evidence.d.ts.map +1 -0
  54. package/dist/op/activity-contract.d.ts +1 -0
  55. package/dist/op/activity-contract.d.ts.map +1 -1
  56. package/dist/op/activity-profiles.d.ts +16 -0
  57. package/dist/op/activity-profiles.d.ts.map +1 -1
  58. package/dist/op/builders.d.ts +84 -2
  59. package/dist/op/builders.d.ts.map +1 -1
  60. package/dist/op/composites/converge-op.d.ts +31 -4
  61. package/dist/op/composites/converge-op.d.ts.map +1 -1
  62. package/dist/op/decide-backend.d.ts +116 -0
  63. package/dist/op/decide-backend.d.ts.map +1 -0
  64. package/dist/op/decide-config.d.ts +120 -0
  65. package/dist/op/decide-config.d.ts.map +1 -0
  66. package/dist/op/decide-read-inputs.d.ts +40 -0
  67. package/dist/op/decide-read-inputs.d.ts.map +1 -0
  68. package/dist/op/gate-wait.d.ts +43 -0
  69. package/dist/op/gate-wait.d.ts.map +1 -0
  70. package/dist/op/gate.d.ts +5 -2
  71. package/dist/op/gate.d.ts.map +1 -1
  72. package/dist/op/index.d.ts +11 -4
  73. package/dist/op/index.d.ts.map +1 -1
  74. package/dist/op/local-executor.d.ts +29 -4
  75. package/dist/op/local-executor.d.ts.map +1 -1
  76. package/dist/op/local-output.d.ts +2 -0
  77. package/dist/op/local-output.d.ts.map +1 -1
  78. package/dist/op/op-ir.d.ts +2 -0
  79. package/dist/op/op-ir.d.ts.map +1 -1
  80. package/dist/op/op-verb-class.d.ts.map +1 -1
  81. package/dist/op/operator.d.ts +97 -1
  82. package/dist/op/operator.d.ts.map +1 -1
  83. package/dist/op/runtime.d.ts +37 -5
  84. package/dist/op/runtime.d.ts.map +1 -1
  85. package/dist/op/runtimes/local.d.ts.map +1 -1
  86. package/dist/op/source-archive.d.ts +63 -0
  87. package/dist/op/source-archive.d.ts.map +1 -0
  88. package/dist/op/steward-points.d.ts +136 -0
  89. package/dist/op/steward-points.d.ts.map +1 -0
  90. package/dist/op/steward-turn.d.ts +53 -0
  91. package/dist/op/steward-turn.d.ts.map +1 -0
  92. package/dist/op/steward.d.ts +22 -1
  93. package/dist/op/steward.d.ts.map +1 -1
  94. package/dist/op/types.d.ts +7 -0
  95. package/dist/op/types.d.ts.map +1 -1
  96. package/dist/op/work-lease-run.d.ts +1 -1
  97. package/dist/op/work-lease-run.d.ts.map +1 -1
  98. package/dist/workspace/__fixtures__/decide-workspace.d.ts +100 -0
  99. package/dist/workspace/__fixtures__/decide-workspace.d.ts.map +1 -0
  100. package/dist/workspace/answers-ledger.d.ts +76 -0
  101. package/dist/workspace/answers-ledger.d.ts.map +1 -0
  102. package/dist/workspace/changes-cli.d.ts +16 -0
  103. package/dist/workspace/changes-cli.d.ts.map +1 -0
  104. package/dist/workspace/changes.d.ts +200 -0
  105. package/dist/workspace/changes.d.ts.map +1 -0
  106. package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.d.ts +59 -0
  107. package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.d.ts.map +1 -0
  108. package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.d.ts +51 -0
  109. package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.d.ts.map +1 -0
  110. package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.d.ts +26 -0
  111. package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.d.ts.map +1 -0
  112. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.d.ts +59 -0
  113. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.d.ts.map +1 -0
  114. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.d.ts +22 -0
  115. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.d.ts.map +1 -0
  116. package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts +71 -0
  117. package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -0
  118. package/dist/workspace/chant-migrations.d.ts +99 -0
  119. package/dist/workspace/chant-migrations.d.ts.map +1 -0
  120. package/dist/workspace/checks/boxes.d.ts +34 -1
  121. package/dist/workspace/checks/boxes.d.ts.map +1 -1
  122. package/dist/workspace/checks/diagrams.d.ts +31 -0
  123. package/dist/workspace/checks/diagrams.d.ts.map +1 -0
  124. package/dist/workspace/checks/records.d.ts +7 -0
  125. package/dist/workspace/checks/records.d.ts.map +1 -1
  126. package/dist/workspace/checks.d.ts +3 -0
  127. package/dist/workspace/checks.d.ts.map +1 -1
  128. package/dist/workspace/compose-graph.d.ts +2 -0
  129. package/dist/workspace/compose-graph.d.ts.map +1 -1
  130. package/dist/workspace/conformance/index.d.ts.map +1 -1
  131. package/dist/workspace/decide.d.ts +49 -4
  132. package/dist/workspace/decide.d.ts.map +1 -1
  133. package/dist/workspace/declaration.d.ts +52 -0
  134. package/dist/workspace/declaration.d.ts.map +1 -1
  135. package/dist/workspace/declaration.schema.json +114 -1
  136. package/dist/workspace/declared-kinds.d.ts +20 -0
  137. package/dist/workspace/declared-kinds.d.ts.map +1 -1
  138. package/dist/workspace/generated-files.d.ts +7 -0
  139. package/dist/workspace/generated-files.d.ts.map +1 -1
  140. package/dist/workspace/intent.d.ts.map +1 -1
  141. package/dist/workspace/lineage-check.d.ts +3 -0
  142. package/dist/workspace/lineage-check.d.ts.map +1 -1
  143. package/dist/workspace/lineage-upgrade.d.ts +6 -1
  144. package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
  145. package/dist/workspace/ls.d.ts +39 -1
  146. package/dist/workspace/ls.d.ts.map +1 -1
  147. package/dist/workspace/point-answer.schema.json +95 -0
  148. package/dist/workspace/points-cli.d.ts.map +1 -1
  149. package/dist/workspace/points.d.ts +1 -1
  150. package/dist/workspace/reason-codes.d.ts +14 -2
  151. package/dist/workspace/reason-codes.d.ts.map +1 -1
  152. package/dist/workspace/records-cli.d.ts +11 -1
  153. package/dist/workspace/records-cli.d.ts.map +1 -1
  154. package/dist/workspace/records-close.d.ts +1 -1
  155. package/dist/workspace/records-close.d.ts.map +1 -1
  156. package/dist/workspace/records-write.d.ts +11 -5
  157. package/dist/workspace/records-write.d.ts.map +1 -1
  158. package/dist/workspace/records.d.ts +34 -4
  159. package/dist/workspace/records.d.ts.map +1 -1
  160. package/dist/workspace/status-gates.d.ts +7 -2
  161. package/dist/workspace/status-gates.d.ts.map +1 -1
  162. package/dist/workspace/status-stewards.d.ts +59 -1
  163. package/dist/workspace/status-stewards.d.ts.map +1 -1
  164. package/dist/workspace/status.d.ts +16 -0
  165. package/dist/workspace/status.d.ts.map +1 -1
  166. package/dist/workspace/work-cli.d.ts +113 -2
  167. package/dist/workspace/work-cli.d.ts.map +1 -1
  168. package/dist/workspace/work-evidence.d.ts +74 -0
  169. package/dist/workspace/work-evidence.d.ts.map +1 -0
  170. package/dist/workspace/work.d.ts +43 -1
  171. package/dist/workspace/work.d.ts.map +1 -1
  172. package/package.json +1 -1
  173. package/src/cli/commands/audit.test.ts +9 -1
  174. package/src/cli/commands/build.ts +3 -2
  175. package/src/cli/commands/lint.ts +7 -1
  176. package/src/cli/handlers/graph.test.ts +20 -0
  177. package/src/cli/handlers/graph.ts +16 -2
  178. package/src/cli/handlers/operator.ts +34 -2
  179. package/src/cli/handlers/run.test.ts +154 -2
  180. package/src/cli/handlers/run.ts +121 -2
  181. package/src/cli/main.test.ts +10 -0
  182. package/src/cli/main.ts +19 -0
  183. package/src/cli/mcp/workspace-tools.test.ts +35 -19
  184. package/src/cli/mcp/workspace-tools.ts +62 -4
  185. package/src/cli/plugins.ts +11 -3
  186. package/src/cli/registry.ts +12 -2
  187. package/src/codegen/pinned-upgrade.ts +2 -1
  188. package/src/codegen/release-wiring.test.ts +49 -2
  189. package/src/components/capability-plugin-loader.ts +3 -3
  190. package/src/components/cli-support.ts +2 -2
  191. package/src/config.ts +11 -0
  192. package/src/lexicon-module.ts +56 -1
  193. package/src/lexicon-package.test.ts +96 -0
  194. package/src/lifecycle/converge-ledger.ts +20 -0
  195. package/src/lifecycle/run-ledger.ts +6 -0
  196. package/src/lifecycle/symptoms.ts +95 -0
  197. package/src/lint/rules/index.ts +6 -2
  198. package/src/lint/rules/op/index.ts +17 -4
  199. package/src/lint/rules/op/ops014-converge-rule-refusals.test.ts +23 -1
  200. package/src/lint/rules/op/ops014-converge-rule-refusals.ts +10 -6
  201. package/src/lint/rules/op/sys010-key-over-plain-http.test.ts +52 -0
  202. package/src/lint/rules/op/sys010-key-over-plain-http.ts +100 -0
  203. package/src/lint/rules/sys001-no-literal-key.test.ts +31 -0
  204. package/src/lint/rules/sys001-no-literal-key.ts +67 -0
  205. package/src/op/__fixtures__/decide-stub-backend.ts +143 -0
  206. package/src/op/activities/activity-contracts.ts +190 -1
  207. package/src/op/activities/apply.ts +7 -6
  208. package/src/op/activities/change-coverage.ts +60 -0
  209. package/src/op/activities/converge.test.ts +55 -1
  210. package/src/op/activities/converge.ts +208 -29
  211. package/src/op/activities/decide.live.test.ts +78 -0
  212. package/src/op/activities/decide.test.ts +300 -0
  213. package/src/op/activities/decide.ts +267 -0
  214. package/src/op/activities/index.ts +21 -0
  215. package/src/op/activities/shell.test.ts +91 -1
  216. package/src/op/activities/shell.ts +91 -2
  217. package/src/op/activities/source-release.test.ts +118 -0
  218. package/src/op/activities/source-release.ts +168 -0
  219. package/src/op/activities/source-rollback.test.ts +131 -0
  220. package/src/op/activities/source-rollback.ts +239 -0
  221. package/src/op/activities/work-evidence.ts +62 -0
  222. package/src/op/activity-contract-registry.test.ts +2 -0
  223. package/src/op/activity-contract-registry.ts +2 -2
  224. package/src/op/activity-contract.test.ts +12 -0
  225. package/src/op/activity-contract.ts +6 -1
  226. package/src/op/activity-profiles.ts +29 -0
  227. package/src/op/activity-registry.test.ts +1 -1
  228. package/src/op/activity-registry.ts +2 -2
  229. package/src/op/builders.ts +119 -5
  230. package/src/op/command-gate.test.ts +192 -0
  231. package/src/op/composites/converge-op.test.ts +27 -1
  232. package/src/op/composites/converge-op.ts +69 -15
  233. package/src/op/decide-backend.test.ts +44 -0
  234. package/src/op/decide-backend.ts +212 -0
  235. package/src/op/decide-config.test.ts +52 -0
  236. package/src/op/decide-config.ts +80 -0
  237. package/src/op/decide-read-inputs.ts +117 -0
  238. package/src/op/gate-approval.ts +2 -2
  239. package/src/op/gate-wait.ts +57 -0
  240. package/src/op/gate.ts +8 -3
  241. package/src/op/generate-pipeline.ts +2 -2
  242. package/src/op/index.ts +18 -3
  243. package/src/op/local-executor.ts +151 -15
  244. package/src/op/local-output.test.ts +33 -0
  245. package/src/op/local-output.ts +20 -2
  246. package/src/op/op-ir.test.ts +10 -0
  247. package/src/op/op-ir.ts +4 -0
  248. package/src/op/op-verb-class.ts +1 -0
  249. package/src/op/operator.ts +290 -11
  250. package/src/op/runtime.ts +31 -8
  251. package/src/op/runtimes/local.ts +3 -1
  252. package/src/op/source-archive.ts +161 -0
  253. package/src/op/steward-points.test.ts +313 -0
  254. package/src/op/steward-points.ts +194 -0
  255. package/src/op/steward-turn.ts +79 -0
  256. package/src/op/steward.test.ts +87 -3
  257. package/src/op/steward.ts +25 -1
  258. package/src/op/types.ts +7 -0
  259. package/src/op/work-lease-run.test.ts +20 -1
  260. package/src/op/work-lease-run.ts +2 -2
  261. package/src/workspace/__fixtures__/decide-workspace.ts +129 -0
  262. package/src/workspace/__fixtures__/studio-template-84c8b21.json +67 -0
  263. package/src/workspace/answers-ledger.ts +118 -0
  264. package/src/workspace/changes-cli.ts +56 -0
  265. package/src/workspace/changes.schema.json +472 -0
  266. package/src/workspace/changes.test.ts +315 -0
  267. package/src/workspace/changes.ts +512 -0
  268. package/src/workspace/chant-migrations/chud-lexicon-exit-fly-site.ts +234 -0
  269. package/src/workspace/chant-migrations/chud-lexicon-exit-live-names.ts +164 -0
  270. package/src/workspace/chant-migrations/chud-lexicon-exit-rollback.ts +223 -0
  271. package/src/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.ts +195 -0
  272. package/src/workspace/chant-migrations/chud-lexicon-exit-ship-policy.ts +108 -0
  273. package/src/workspace/chant-migrations/chud-lexicon-exit.ts +882 -0
  274. package/src/workspace/chant-migrations.e2e.test.ts +1089 -0
  275. package/src/workspace/chant-migrations.ts +164 -0
  276. package/src/workspace/check-contract.test.ts +4 -2
  277. package/src/workspace/check.schema.json +15 -5
  278. package/src/workspace/checks/boxes.test.ts +80 -1
  279. package/src/workspace/checks/boxes.ts +136 -1
  280. package/src/workspace/checks/diagrams.test.ts +134 -0
  281. package/src/workspace/checks/diagrams.ts +108 -0
  282. package/src/workspace/checks/records.ts +47 -0
  283. package/src/workspace/checks.ts +8 -1
  284. package/src/workspace/compose-graph.ts +2 -0
  285. package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +10 -0
  286. package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +26 -0
  287. package/src/workspace/conformance/index.ts +5 -0
  288. package/src/workspace/decide.test.ts +1 -1
  289. package/src/workspace/decide.ts +156 -23
  290. package/src/workspace/declaration.schema.json +114 -1
  291. package/src/workspace/declaration.test.ts +58 -0
  292. package/src/workspace/declaration.ts +104 -0
  293. package/src/workspace/declared-kinds.test.ts +5 -5
  294. package/src/workspace/declared-kinds.ts +46 -1
  295. package/src/workspace/generated-files.ts +14 -0
  296. package/src/workspace/graph-cli.ts +1 -1
  297. package/src/workspace/graph.schema.json +9 -1
  298. package/src/workspace/intent.schema.json +8 -2
  299. package/src/workspace/intent.ts +3 -10
  300. package/src/workspace/lineage-check.ts +16 -1
  301. package/src/workspace/lineage-upgrade-cli.ts +1 -1
  302. package/src/workspace/lineage-upgrade.test.ts +70 -0
  303. package/src/workspace/lineage-upgrade.ts +81 -10
  304. package/src/workspace/ls-contract.test.ts +57 -0
  305. package/src/workspace/ls.schema.json +46 -1
  306. package/src/workspace/ls.ts +62 -3
  307. package/src/workspace/points-cli.ts +14 -3
  308. package/src/workspace/points-write.schema.json +11 -1
  309. package/src/workspace/points.schema.json +33 -0
  310. package/src/workspace/points.test.ts +1 -1
  311. package/src/workspace/points.ts +1 -1
  312. package/src/workspace/read-contract.test.ts +1 -1
  313. package/src/workspace/reason-codes.test.ts +11 -1
  314. package/src/workspace/reason-codes.ts +18 -2
  315. package/src/workspace/records-amend.schema.json +2 -0
  316. package/src/workspace/records-cli.ts +13 -3
  317. package/src/workspace/records-close.schema.json +2 -0
  318. package/src/workspace/records-new.schema.json +2 -0
  319. package/src/workspace/records-review.schema.json +2 -0
  320. package/src/workspace/records-sessions-write.e2e.test.ts +77 -0
  321. package/src/workspace/records-sessions-write.test.ts +2 -34
  322. package/src/workspace/records-write.e2e.test.ts +108 -0
  323. package/src/workspace/records-write.test.ts +32 -41
  324. package/src/workspace/records-write.ts +33 -15
  325. package/src/workspace/records.schema.json +36 -2
  326. package/src/workspace/records.test.ts +48 -3
  327. package/src/workspace/records.ts +109 -3
  328. package/src/workspace/status-contract.test.ts +13 -8
  329. package/src/workspace/status-gates.ts +9 -4
  330. package/src/workspace/status-stewards.ts +108 -4
  331. package/src/workspace/status.schema.json +111 -7
  332. package/src/workspace/status.ts +36 -1
  333. package/src/workspace/work-acceptance.test.ts +274 -0
  334. package/src/workspace/{work-cli.test.ts → work-cli.e2e.test.ts} +1 -1
  335. package/src/workspace/work-cli.ts +193 -10
  336. package/src/workspace/work-evidence.schema.json +212 -0
  337. package/src/workspace/work-evidence.ts +169 -0
  338. package/src/workspace/work-history.schema.json +349 -0
  339. package/src/workspace/work-history.test.ts +156 -0
  340. package/src/workspace/work.test.ts +3 -2
  341. package/src/workspace/work.ts +100 -1
  342. /package/src/cli/{discovery-skip.test.ts → discovery-skip.e2e.test.ts} +0 -0
  343. /package/src/workspace/conformance/{conformance.test.ts → conformance.e2e.test.ts} +0 -0
  344. /package/src/workspace/{which-chant.test.ts → which-chant.e2e.test.ts} +0 -0
@@ -60,11 +60,52 @@ export declare function discoverConvergeOps(opts?: {
60
60
  errors: string[];
61
61
  }>;
62
62
  /** One discovered ConvergeOp's outcome for one round — what `chant operator`'s one-line-per-tick log (and its tests) key off of. */
63
- export type OperatorTickEvent = {
63
+ export type OperatorTickEvent =
64
+ /**
65
+ * The Op ran. `resumed` names the decision point question it was waiting on
66
+ * (#2749) when a steward ran it because that question is now answered,
67
+ * rather than because its cron fired.
68
+ */
69
+ {
64
70
  kind: "ticked";
65
71
  op: string;
66
72
  env: string;
67
73
  result: OpRunResult;
74
+ resumed?: string;
75
+ /**
76
+ * The gate the Op's last run stopped at (#2779), when a steward ran it
77
+ * because that gate is now approved rather than because its cron fired.
78
+ */
79
+ approved?: {
80
+ op: string;
81
+ gate: string;
82
+ };
83
+ }
84
+ /**
85
+ * A steward's Op whose last run stopped on an open decision point (#2749),
86
+ * and the question is still open, so the Op is not run this round. A person
87
+ * answers it through hud or `points answer`; the steward never does.
88
+ */
89
+ | {
90
+ kind: "waiting-on-point";
91
+ op: string;
92
+ env: string;
93
+ point: string;
94
+ question: string;
95
+ state: string;
96
+ }
97
+ /**
98
+ * A steward's Op whose last run stopped at a gate (#2779), and nobody has
99
+ * approved it since, so the Op is not run this round. `gateOp` is the op
100
+ * the gate is recorded under: the Op's own, or a command's such as
101
+ * `workspace-upgrade`.
102
+ */
103
+ | {
104
+ kind: "waiting-on-gate";
105
+ op: string;
106
+ env: string;
107
+ gateOp: string;
108
+ gate: string;
68
109
  } | {
69
110
  kind: "skipped-lease-held";
70
111
  op: string;
@@ -118,6 +159,22 @@ export type OperatorTickEvent = {
118
159
  env: string;
119
160
  steward: string;
120
161
  heldBy?: string;
162
+ }
163
+ /**
164
+ * A local steward's round (#2750) found its turn lease
165
+ * (`stewardTurnLeaseName`) held by someone else already mid-run — a `chant
166
+ * run <op>` typed by hand, or another round somehow still finishing one.
167
+ * Nothing ticked: the round stops here rather than trying its remaining
168
+ * ops, since every one of them would fail the same check (the turn is one
169
+ * lease for the whole steward, not one per op). The next round tries
170
+ * again.
171
+ */
172
+ | {
173
+ kind: "turn-busy";
174
+ op: string;
175
+ env: string;
176
+ steward: string;
177
+ heldBy?: string;
121
178
  };
122
179
  export interface OperatorRoundOptions {
123
180
  cwd?: string;
@@ -150,6 +207,12 @@ export interface OperatorRoundOptions {
150
207
  * lease, and ticks nothing when another holder has it.
151
208
  */
152
209
  steward?: StewardDeclaration;
210
+ /**
211
+ * How a steward's round reads the state of the questions its waiting runs
212
+ * stopped on (#2749): question id to state, or null when they can't be
213
+ * read. Defaults to the workspace's `points` read; a test injects one.
214
+ */
215
+ readQuestions?: (cwd: string) => Promise<Map<string, string> | null>;
153
216
  }
154
217
  /** Take or renew a local steward's own lease (#2731). */
155
218
  export declare function acquireStewardLease(steward: string, holder: string, opts?: {
@@ -157,6 +220,39 @@ export declare function acquireStewardLease(steward: string, holder: string, opt
157
220
  ttlMs?: number;
158
221
  now?: () => Date;
159
222
  }): Promise<AcquireLeaseResult>;
223
+ /**
224
+ * How long a caller contending for a steward's turn lease
225
+ * (`acquireStewardTurn`) retries before giving up (#2750). Long enough to
226
+ * ride out a race with a turn that is just ending; short enough that a
227
+ * genuinely busy steward is reported back promptly. A round never waits
228
+ * (`waitMs` omitted there): it already runs on its own timer and simply
229
+ * tries the turn again next round, exactly as it already does for a busy
230
+ * per-op lease. `chant run <op>` (`../cli/handlers/run.ts`) is the caller
231
+ * that waits, since a human is standing at the terminal for the answer.
232
+ */
233
+ export declare const STEWARD_TURN_WAIT_MS = 2000;
234
+ /**
235
+ * Take the steward's turn lease (#2750): the lease every run of one of its
236
+ * Ops — a round's scheduled tick, or `chant run <op>` typed by hand — holds
237
+ * for exactly as long as that one run takes, so the two are never beside each
238
+ * other. Distinct from {@link acquireStewardLease}, which one `chant operator
239
+ * --steward` process holds for its whole life: this one is held per-run, so a
240
+ * hand run succeeds the moment a round's tick ends, not only once the daemon
241
+ * itself stops.
242
+ *
243
+ * Contention never queues past `waitMs` (0 by default): consistent with a
244
+ * round's own leases, which skip and report rather than wait (see this
245
+ * module's doc), and with the fountain form, whose busy teammate is likewise
246
+ * refused rather than retried. A caller that wants to ride out a race with a
247
+ * turn about to end passes `waitMs`, and this polls every
248
+ * {@link STEWARD_TURN_POLL_MS} until it acquires or the wait runs out.
249
+ */
250
+ export declare function acquireStewardTurn(steward: string, holder: string, opts?: {
251
+ cwd?: string;
252
+ ttlMs?: number;
253
+ now?: () => Date;
254
+ waitMs?: number;
255
+ }): Promise<AcquireLeaseResult>;
160
256
  /**
161
257
  * Run exactly one round: for every discovered ConvergeOp (filtered per
162
258
  * `opts.env`), try its lease; tick the ones this holder wins. Returns one
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/op/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAA8B,KAAK,WAAW,EAAE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AC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAC/D,iFAAiF;GAC/E;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAWnE;AAED,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wKAAwK;IACxK,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC1C,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFjF;AAED,wiBAAwiB;AACxiB,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CA2BhE"}
@@ -17,18 +17,22 @@
17
17
  */
18
18
  import type { OpConfig } from "./types.js";
19
19
  import type { StepRecord, OpRunResult } from "./local-executor.js";
20
+ import type { WaitingPoint } from "./steward-points.js";
20
21
  import type { GateResolutionRecord } from "../lifecycle/gate-ledger.js";
21
22
  import type { RunComponentsOptions, RunComponentsResult } from "../components/cli-support.js";
22
23
  /**
23
24
  * How a run ended, or that it has not. `gated` is the state a run reaches when
24
- * a gate has no recorded resolution — a fact, not a wait (#2119).
25
+ * a gate has no recorded resolution — a fact, not a wait (#2119). `waiting` is
26
+ * the state it reaches when an activity asked a decision point that is still
27
+ * open (#2749), a fact of the same kind: a person answers the question, and
28
+ * the next run reads the answer.
25
29
  *
26
30
  * This is the coarse state a *runtime* reports. The ledger records the
27
31
  * executor's own three-state outcome instead ({@link OpRunRecord.status}),
28
32
  * which has no `running` or `cancelled`: a record is only written once a run
29
33
  * has settled.
30
34
  */
31
- export type OpRunState = "running" | "completed" | "failed" | "gated" | "cancelled";
35
+ export type OpRunState = "running" | "completed" | "failed" | "gated" | "waiting" | "cancelled";
32
36
  /** Map a settled run's ledger status onto the coarser runtime state. */
33
37
  export declare function runStateOf(status: OpRunRecord["status"]): OpRunState;
34
38
  /** One step's outcome as the run ledger keeps it — `StepRecord` minus the fields only a live renderer needs. */
@@ -53,6 +57,13 @@ export interface OpRunStepRecord {
53
57
  error?: string;
54
58
  /** Why a gate declined a standing approval that was for another plan (#2300) — see {@link StepRecord.refusal}. */
55
59
  refusal?: string;
60
+ /** The open decision point this step asked (#2749), for a step skipped because it is waiting on one. */
61
+ point?: WaitingPoint;
62
+ /** The gate this step's command stopped at (#2779), for a step skipped because of it. */
63
+ gate?: {
64
+ op: string;
65
+ gate: string;
66
+ };
56
67
  }
57
68
  /** One phase's steps and the verdict they add up to. */
58
69
  export interface OpRunPhaseRecord {
@@ -81,10 +92,15 @@ export interface OpRunStatus {
81
92
  records?: StepRecord[];
82
93
  /** The executor's own result, when the runtime is executing in this process. */
83
94
  result?: OpRunResult;
84
- /** The gate this run is waiting on, when `state` is `gated`. */
95
+ /** The gate this run is waiting on, when `state` is `gated`; `op` names the op it is recorded under when that isn't the run's own (#2779). */
85
96
  gate?: {
86
97
  name: string;
87
98
  since: string;
99
+ op?: string;
100
+ };
101
+ /** The open decision point this run is waiting on, when `state` is `waiting` (#2749). */
102
+ point?: WaitingPoint & {
103
+ since: string;
88
104
  };
89
105
  /** Free-text detail for a failed run. */
90
106
  error?: string;
@@ -119,18 +135,34 @@ export interface OpRunRecord {
119
135
  * failure: the run reached a gate nobody has approved, recorded the fact,
120
136
  * and stopped (#2119).
121
137
  */
122
- status: "ok" | "fail" | "gated";
138
+ status: "ok" | "fail" | "gated" | "waiting";
123
139
  /** The Op's own `labels`, copied at run time. */
124
140
  labels: Record<string, string>;
125
141
  /** Every `outcomeAttribute` the run captured, name → value. */
126
142
  outcomes: Record<string, unknown>;
127
143
  /** Per-phase, per-step status, in execution order. */
128
144
  phases: OpRunPhaseRecord[];
129
- /** The gate the run stopped on, for `status: "gated"`. */
145
+ /**
146
+ * The gate the run stopped on, for `status: "gated"`. `op` is set when the
147
+ * gate is recorded under another op than the run's (#2779): a step whose
148
+ * command stopped at its own gate, such as `chant workspace upgrade`'s
149
+ * `workspace-upgrade` / `<scope>`.
150
+ */
130
151
  gate?: {
131
152
  name: string;
132
153
  since: string;
154
+ op?: string;
155
+ };
156
+ /**
157
+ * The open decision point the run stopped on, for `status: "waiting"`
158
+ * (#2749): the answer record's id, the point, its state then, and when the
159
+ * run stopped. `points --open` and hud read the question itself.
160
+ */
161
+ point?: WaitingPoint & {
162
+ since: string;
133
163
  };
164
+ /** The steward whose turn the run was, when a steward ran it (#2749). */
165
+ steward?: string;
134
166
  }
135
167
  /** An {@link OpRunRecord} before the ledger stamps its version and mints an id. */
136
168
  export type OpRunRecordInput = Omit<OpRunRecord, "version" | "id"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/op/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE3F;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AAEpF,wEAAw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CAAC;IAExF;;;OAGG;IACH,aAAa,CAAC,CACZ,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/op/runtimes/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAwCpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,CAkJ3F"}
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/op/runtimes/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AA0CpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,CAkJ3F"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * A source tree as a release artifact (#2782): one directory of a commit,
3
+ * archived with `git archive`, and read back only when its bytes still hash
4
+ * to the digest a gate approved.
5
+ *
6
+ * `git archive <commit> -- <dir>` gives every entry the commit's own
7
+ * timestamp, so the same commit always archives to the same bytes, and the
8
+ * archive's sha256 names the tree exactly. A release plan carries that digest,
9
+ * the ship gate approves the plan, and whatever ships the release reads the
10
+ * archive through {@link readSourceArchive}, which refuses bytes that do not
11
+ * hash to the approved digest.
12
+ *
13
+ * Pure except for the git and file reads each function names.
14
+ */
15
+ /** One file of an archived tree. */
16
+ export interface SourceFile {
17
+ /** Its path inside the archived directory, with `/` separators. */
18
+ path: string;
19
+ /** Whether git records it executable. */
20
+ executable: boolean;
21
+ data: Buffer;
22
+ }
23
+ /** A directory of a commit, archived. */
24
+ export interface SourceArchive {
25
+ /** `sha256:<hex>` of the archive's bytes. */
26
+ digest: string;
27
+ /** Where the archive was written. */
28
+ archive: string;
29
+ /** The commit it was archived from. */
30
+ commit: string;
31
+ /** The archived directory, relative to the repository root (`.` for the root). */
32
+ dir: string;
33
+ /** Files in it. */
34
+ files: number;
35
+ /** Size of the archive in bytes. */
36
+ bytes: number;
37
+ }
38
+ export declare const sha256Digest: (data: Buffer | string) => string;
39
+ /**
40
+ * Archive `dir` (relative to `cwd`) as committed at `ref` (default HEAD) to
41
+ * `out` (default `<cwd>/dist/releases/<commit>.tar`). Uncommitted changes are
42
+ * not in it: a release ships what is committed. Running it again for the same
43
+ * commit writes the same bytes.
44
+ */
45
+ export declare function archiveSourceTree(opts: {
46
+ dir: string;
47
+ ref?: string;
48
+ out?: string;
49
+ cwd?: string;
50
+ }): SourceArchive;
51
+ /**
52
+ * The files of an archive `archiveSourceTree` wrote, relative to the directory
53
+ * it archived, once its bytes hash to `digest`. Throws, naming both digests,
54
+ * when they do not: whatever would ship them is not what was approved.
55
+ *
56
+ * A symbolic link in the tree is refused rather than followed or dropped.
57
+ */
58
+ export declare function readSourceArchive(opts: {
59
+ archive: string;
60
+ digest: string;
61
+ dir?: string;
62
+ }): SourceFile[];
63
+ //# sourceMappingURL=source-archive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-archive.d.ts","sourceRoot":"","sources":["../../src/op/source-archive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,oCAAoC;AACpC,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,yCAAyC;AACzC,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,GAAG,MAAM,KAAG,MAAqE,CAAC;AAM3H;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAoBhH;AA2DD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,EAAE,CAiBvG"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * A decision point asked inside an Op run (#2749), and in a steward's turn in
3
+ * particular.
4
+ *
5
+ * An Op that needs a decision (the factory's builder tier, whether to ship)
6
+ * calls {@link askPointInRun} from one of its activities, such as the decide
7
+ * activity (#2740). It asks the point through `askPoint` (ws-058,
8
+ * `../workspace/decide.ts`), which records the question and its answer as a
9
+ * record, and then:
10
+ *
11
+ * - an `answered` question returns its answer, and the Op goes on;
12
+ * - an `escalated` or `proposed` question is open, so the activity throws
13
+ * {@link PointWait}. The executor ends the run there with status `waiting`,
14
+ * as a gate ends it with `gated`: no later step runs, no `onFailure` phase
15
+ * runs, and the run ledger records the question the run is waiting on.
16
+ *
17
+ * The question stays open in the workspace, where `chant workspace points
18
+ * --open`, MCP's `workspace-points` and hud read it, and a person answers it
19
+ * with `points answer`. Nothing waits in the meantime: the next run asks the
20
+ * same point with the same inputs, finds the answer record, and goes on. A
21
+ * local steward re-runs a waiting Op on the first round after its question is
22
+ * answered (`./operator.ts`).
23
+ *
24
+ * ## In a steward's turn
25
+ *
26
+ * A steward runs unattended, so two more rules hold when the process is a
27
+ * steward's turn (`./steward-turn.ts`):
28
+ *
29
+ * - The model call goes through the broker. The caller supplies the call as a
30
+ * {@link BrokeredModelAsk}, which is handed the box capability to reach the
31
+ * model through, and only a capability the steward declares
32
+ * (`declareSteward({ capabilities })`, #2726). A steward that names none,
33
+ * or holds a vault, makes no model call: the model decider is recorded as
34
+ * not reached and the question goes to people.
35
+ * - The question is written on the `chant/lifecycle` branch, not in the
36
+ * checkout (#2786): the working tree is the coding agent's, and an Op's
37
+ * leased worktree goes when the run ends. `points` reads it from there
38
+ * (`../workspace/answers-ledger.ts`), and a person's answer goes there too.
39
+ * - The question names the steward and its run in its source block, and
40
+ * neither the steward's turn nor the steward's name can answer it: `points
41
+ * answer` refuses inside a steward's turn (`answer-in-steward-turn`) and
42
+ * leaves the asking steward out of the quorum.
43
+ *
44
+ * The question never goes to the steward's own thread: on Fountain that thread
45
+ * is the steward's, and nobody reads it for questions.
46
+ */
47
+ import type { ModelAsk, ModelRequest, WireAnswer } from "../workspace/points.js";
48
+ import type { QuestionView } from "../workspace/decide.js";
49
+ import { type StewardTurn } from "./steward-turn.js";
50
+ /** The box capability a model call goes through when the caller names none. */
51
+ export declare const DEFAULT_INFERENCE_CAPABILITY = "inference";
52
+ /** The open question a run stopped on, as the run ledger records it. */
53
+ export interface WaitingPoint {
54
+ /** The answer record's id: what `points answer` and hud name. */
55
+ id: string;
56
+ /** The point asked. */
57
+ point: string;
58
+ /** Its state when the run stopped: `escalated` to people, or `proposed` by a model and waiting for a person to confirm it. */
59
+ state: "escalated" | "proposed";
60
+ /** The answer record, from the repository root. */
61
+ path: string;
62
+ /** What the question is about, or null. */
63
+ subject: string | null;
64
+ /** The steward whose turn asked it, or null. */
65
+ steward: string | null;
66
+ }
67
+ /** The marker {@link PointWait} carries, so a copy of core linked twice still recognises it. */
68
+ declare const POINT_WAIT: unique symbol;
69
+ /**
70
+ * Thrown by an activity whose decision point is open. Not a failure: the
71
+ * executor ends the run with status `waiting` (see the module doc).
72
+ */
73
+ export declare class PointWait extends Error {
74
+ readonly question: WaitingPoint;
75
+ readonly [POINT_WAIT] = true;
76
+ constructor(question: WaitingPoint);
77
+ }
78
+ /** Is this a {@link PointWait}? Duck-typed on the shared symbol. */
79
+ export declare function isPointWait(err: unknown): err is PointWait;
80
+ /**
81
+ * The model call, supplied by the caller (the decide activity, #2740, or a
82
+ * test's stub), made through a box capability. `via.capability` is the
83
+ * capability to reach the model through and `via.broker` the broker the
84
+ * member's box block names for it, when that is known. The function holds no
85
+ * credential: the broker does.
86
+ */
87
+ export type BrokeredModelAsk = (request: ModelRequest, via: {
88
+ capability: string;
89
+ broker: string | null;
90
+ }) => Promise<{
91
+ model: string;
92
+ answer: WireAnswer;
93
+ }>;
94
+ export interface AskPointInRunOptions {
95
+ /** Where the workspace and the answer kind are found. */
96
+ cwd: string;
97
+ point: string;
98
+ inputs: unknown;
99
+ subject?: string;
100
+ /** The answer kind file, or a declared kind's name. */
101
+ kind?: string;
102
+ /** The model call. Without it, a model decider is not asked. */
103
+ ask?: BrokeredModelAsk;
104
+ /** The box capability the model call goes through. Default `inference`. */
105
+ capability?: string;
106
+ /** The broker the member's box block names for the capability, when the caller has read it. */
107
+ broker?: string | null;
108
+ /** The date written as asked_on, YYYY-MM-DD. */
109
+ on?: string;
110
+ /** The steward turn, when the caller has it. Default: this process's (`currentStewardTurn`). */
111
+ turn?: StewardTurn | null;
112
+ }
113
+ /**
114
+ * The {@link ModelAsk} a point is asked with. In a steward's turn the call is
115
+ * made only through a capability the steward declares; otherwise it throws,
116
+ * which the chain records as the model not being reached.
117
+ */
118
+ export declare function brokeredModelAsk(ask: BrokeredModelAsk, opts: {
119
+ capability?: string;
120
+ broker?: string | null;
121
+ turn?: StewardTurn | null;
122
+ cwd: string;
123
+ }): Promise<ModelAsk>;
124
+ /**
125
+ * Ask a decision point from inside an Op run. Resolves with the answer when
126
+ * the question is answered, and throws {@link PointWait} when it is open.
127
+ * Any other problem (the points can't be read, the inputs are wrong, a model
128
+ * declared `unreachable: "fail"` could not answer) throws an ordinary error,
129
+ * which fails the step.
130
+ */
131
+ export declare function askPointInRun(opts: AskPointInRunOptions): Promise<{
132
+ answer: string | boolean;
133
+ question: QuestionView;
134
+ }>;
135
+ export {};
136
+ //# sourceMappingURL=steward-points.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steward-points.d.ts","sourceRoot":"","sources":["../../src/op/steward-points.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtE,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,8HAA8H;IAC9H,KAAK,EAAE,WAAW,GAAG,UAAU,CAAC;IAChC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gDAAgD;IAChD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,gGAAgG;AAChG,QAAA,MAAM,UAAU,eAAmC,CAAC;AAEpD;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAEtB,QAAQ,CAAC,QAAQ,EAAE,YAA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;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,CAAC,CAyB7H"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Whether this process is a steward's turn, and whose (#2749).
3
+ *
4
+ * A steward runs unattended. In the local form, `chant operator --steward`
5
+ * is the steward for as long as it runs; on Fountain, the Agent's `chant acp
6
+ * --steward <name>` session is. Two things read this: a decision point asked
7
+ * during the turn (`./steward-points.ts`), which records the steward on the
8
+ * question and makes its model call through the steward's brokered
9
+ * capability, and `points answer`, which refuses to record an answer from a
10
+ * steward's own turn, as the gate ledger's origin rule refuses a gate
11
+ * resolved on the channel that reached it.
12
+ *
13
+ * Like the gate origin (`../lifecycle/gate-origin.ts`) this is a property of
14
+ * the process, set once at its entry point, not a parameter threaded through
15
+ * every executor and activity. It is also exported to child processes as
16
+ * `CHANT_STEWARD`, so a `chant workspace points answer` an Op shells out to
17
+ * is refused the same way.
18
+ */
19
+ /** The environment variable a steward's turn carries into child processes. */
20
+ export declare const STEWARD_ENV = "CHANT_STEWARD";
21
+ /** A steward's turn, as the process knows it. */
22
+ export interface StewardTurn {
23
+ /** The steward's name. */
24
+ steward: string;
25
+ /**
26
+ * The box capabilities the steward reaches through the broker (#2726), or
27
+ * undefined when the process was told only the steward's name (a child
28
+ * process, or `chant acp --steward <name>`): the declaration is then read
29
+ * from the project's `*.op.ts` files when a model call needs it.
30
+ */
31
+ capabilities?: readonly string[];
32
+ /** The vault the steward holds, by name, when it is not behind a broker. */
33
+ vault?: string | null;
34
+ /** The run the steward is in, when an Op is running. */
35
+ run?: string;
36
+ }
37
+ /**
38
+ * Declare that this process is a steward's turn. Called once by `chant
39
+ * operator --steward` and `chant acp --steward`; also exports
40
+ * {@link STEWARD_ENV} so a child process knows it too.
41
+ */
42
+ export declare function setStewardTurn(turn: StewardTurn): void;
43
+ /**
44
+ * Be a steward's turn until the returned function is called, which puts back
45
+ * whatever was there before. `chant operator --steward` enters one per Op run,
46
+ * naming the run, so a question asked during it names the run too.
47
+ */
48
+ export declare function enterStewardTurn(turn: StewardTurn): () => void;
49
+ /** The steward whose turn this process is, or undefined. */
50
+ export declare function currentStewardTurn(): StewardTurn | undefined;
51
+ /** Forget the turn. For tests, which must not leak a steward into each other. */
52
+ export declare function resetStewardTurn(): void;
53
+ //# sourceMappingURL=steward-turn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steward-turn.d.ts","sourceRoot":"","sources":["../../src/op/steward-turn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,iDAAiD;AACjD,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI,CAS9D;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI,WAAW,GAAG,SAAS,CAI5D;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
@@ -41,7 +41,8 @@
41
41
  * ## What a steward writes
42
42
  *
43
43
  * A steward's writes are chant writes: run, converge and gate records on the
44
- * `chant/lifecycle` branch and lease refs under `refs/chant/lease/`, all made
44
+ * `chant/lifecycle` branch, the answer records of the decision points its
45
+ * Ops ask (`_answers/`, #2786), and lease refs under `refs/chant/lease/`, all made
45
46
  * with git plumbing (`../lifecycle/git.ts`: `hash-object`, `mktree`,
46
47
  * `commit-tree`, `update-ref`). None of them reads or writes the checkout's
47
48
  * index or working tree, so a coding agent editing the app in the same
@@ -130,6 +131,26 @@ export declare function stewardFormFor(steward: StewardDeclaration, env?: string
130
131
  * `_` keeps out of any Op's name.
131
132
  */
132
133
  export declare function stewardLeaseName(steward: string): string;
134
+ /**
135
+ * The lease a local steward holds for as long as one of its Ops is actually
136
+ * running: one turn (#2750). Distinct from {@link stewardLeaseName}, which one
137
+ * `chant operator --steward` process holds for its whole life (renewed
138
+ * between ticks, released only when the process stops) — this one is taken
139
+ * right before a run starts and released right after it ends, whether the
140
+ * run is a round's scheduled tick or `chant run <op>` typed by hand. That is
141
+ * what makes an on-request run wait its turn behind a turn already in
142
+ * progress, and succeed again the moment that turn ends, rather than only
143
+ * once the whole steward process stops.
144
+ *
145
+ * `_turns/<name>`, not `_stewards/<name>/turn`: a git ref name is a path
146
+ * component in the loose-refs tree, and `refs/chant/lease/_stewards/<name>`
147
+ * (the lease {@link stewardLeaseName} names) already exists as a *leaf* —
148
+ * git refuses to also create anything *under* it (`fatal: ... exists;
149
+ * cannot create ...`), so nesting the turn lease inside the steward lease's
150
+ * own name is unusable the moment both are live at once. A sibling
151
+ * top-level segment sidesteps that entirely.
152
+ */
153
+ export declare function stewardTurnLeaseName(steward: string): string;
133
154
  /**
134
155
  * Pick the steward `--steward [<name>]` names, or the project's only one.
135
156
  * Returns the steward, or the message to refuse with.
@@ -1 +1 @@
1
- {"version":3,"file":"steward.d.ts","sourceRoot":"","sources":["../../src/op/steward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,uDAAuD;AACvD,eAAO,MAAM,YAAY,mBAAmB,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AAE,EAAE,cAAc,GAAG,QAAQ,CAG5D;AASD,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAWnH;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB,CAyDnF;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAWhF;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,GAAE,MAA4B,GAAG,WAAW,CAE1G;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,WAAW,EAAE,kBAAkB,CAAA;CAAE,CAAC,EAC1D,IAAI,EAAE,MAAM,GACX,kBAAkB,GAAG,MAAM,CAU7B"}
@@ -145,6 +145,13 @@ export interface ActivityStep {
145
145
  * Default: "fastIdempotent"
146
146
  */
147
147
  profile?: ActivityProfileName;
148
+ /**
149
+ * How long one attempt may run, such as `"45m"`, in place of the
150
+ * profile's timeout (#2787). The profile's retry policy is kept, so a
151
+ * `shell` step stays one attempt. At most `MAX_STEP_TIMEOUT` (six hours); a longer
152
+ * wait is a gate, not a step.
153
+ */
154
+ timeout?: string;
148
155
  /**
149
156
  * Surface this activity's return value as a named run outcome.
150
157
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/op/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAA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0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC;CACpB,CACJ,CAAC"}
@@ -168,6 +168,6 @@ export declare class RunWorkLease {
168
168
  * keeps what was committed), and give the lease back with the outcome
169
169
  * unless it was lost.
170
170
  */
171
- finish(status: "ok" | "fail" | "gated", resultsById: ReadonlyMap<string, unknown>): Promise<WorkLeaseRunResult>;
171
+ finish(status: "ok" | "fail" | "gated" | "waiting", resultsById: ReadonlyMap<string, unknown>): Promise<WorkLeaseRunResult>;
172
172
  }
173
173
  //# sourceMappingURL=work-lease-run.d.ts.map