@intentius/chant 0.90.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 (402) 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/components.d.ts +8 -0
  4. package/dist/cli/handlers/components.d.ts.map +1 -1
  5. package/dist/cli/handlers/graph.d.ts.map +1 -1
  6. package/dist/cli/handlers/operator.d.ts +20 -0
  7. package/dist/cli/handlers/operator.d.ts.map +1 -1
  8. package/dist/cli/handlers/run.d.ts.map +1 -1
  9. package/dist/cli/main.d.ts.map +1 -1
  10. package/dist/cli/mcp/workspace-tools.d.ts +7 -4
  11. package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
  12. package/dist/cli/plugins.d.ts.map +1 -1
  13. package/dist/cli/registry.d.ts +42 -1
  14. package/dist/cli/registry.d.ts.map +1 -1
  15. package/dist/codegen/pinned-upgrade.d.ts.map +1 -1
  16. package/dist/components/verbs/vuln-scan.d.ts +72 -0
  17. package/dist/components/verbs/vuln-scan.d.ts.map +1 -1
  18. package/dist/config.d.ts +22 -0
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/lexicon-module.d.ts +22 -0
  21. package/dist/lexicon-module.d.ts.map +1 -1
  22. package/dist/lifecycle/converge-ledger.d.ts +19 -0
  23. package/dist/lifecycle/converge-ledger.d.ts.map +1 -1
  24. package/dist/lifecycle/git.d.ts +40 -5
  25. package/dist/lifecycle/git.d.ts.map +1 -1
  26. package/dist/lifecycle/lease.d.ts +72 -16
  27. package/dist/lifecycle/lease.d.ts.map +1 -1
  28. package/dist/lifecycle/member-ledger.d.ts +3 -2
  29. package/dist/lifecycle/member-ledger.d.ts.map +1 -1
  30. package/dist/lifecycle/plan-ledger.d.ts +114 -0
  31. package/dist/lifecycle/plan-ledger.d.ts.map +1 -0
  32. package/dist/lifecycle/run-ledger.d.ts +2 -0
  33. package/dist/lifecycle/run-ledger.d.ts.map +1 -1
  34. package/dist/lifecycle/symptoms.d.ts +51 -0
  35. package/dist/lifecycle/symptoms.d.ts.map +1 -1
  36. package/dist/lifecycle/work-lease.d.ts +140 -0
  37. package/dist/lifecycle/work-lease.d.ts.map +1 -0
  38. package/dist/lint/rules/index.d.ts +4 -2
  39. package/dist/lint/rules/index.d.ts.map +1 -1
  40. package/dist/lint/rules/op/index.d.ts +14 -3
  41. package/dist/lint/rules/op/index.d.ts.map +1 -1
  42. package/dist/lint/rules/op/ops014-converge-rule-refusals.d.ts.map +1 -1
  43. package/dist/lint/rules/op/sys010-key-over-plain-http.d.ts +29 -0
  44. package/dist/lint/rules/op/sys010-key-over-plain-http.d.ts.map +1 -0
  45. package/dist/lint/rules/sys001-no-literal-key.d.ts +3 -0
  46. package/dist/lint/rules/sys001-no-literal-key.d.ts.map +1 -0
  47. package/dist/op/__fixtures__/decide-stub-backend.d.ts +53 -0
  48. package/dist/op/__fixtures__/decide-stub-backend.d.ts.map +1 -0
  49. package/dist/op/activities/activity-contracts.d.ts +203 -2
  50. package/dist/op/activities/activity-contracts.d.ts.map +1 -1
  51. package/dist/op/activities/apply.d.ts.map +1 -1
  52. package/dist/op/activities/change-coverage.d.ts +44 -0
  53. package/dist/op/activities/change-coverage.d.ts.map +1 -0
  54. package/dist/op/activities/converge.d.ts +24 -1
  55. package/dist/op/activities/converge.d.ts.map +1 -1
  56. package/dist/op/activities/decide.d.ts +107 -0
  57. package/dist/op/activities/decide.d.ts.map +1 -0
  58. package/dist/op/activities/index.d.ts +10 -0
  59. package/dist/op/activities/index.d.ts.map +1 -1
  60. package/dist/op/activities/shell.d.ts +32 -0
  61. package/dist/op/activities/shell.d.ts.map +1 -1
  62. package/dist/op/activities/source-release.d.ts +86 -0
  63. package/dist/op/activities/source-release.d.ts.map +1 -0
  64. package/dist/op/activities/source-rollback.d.ts +100 -0
  65. package/dist/op/activities/source-rollback.d.ts.map +1 -0
  66. package/dist/op/activities/work-evidence.d.ts +42 -0
  67. package/dist/op/activities/work-evidence.d.ts.map +1 -0
  68. package/dist/op/activity-contract.d.ts +1 -0
  69. package/dist/op/activity-contract.d.ts.map +1 -1
  70. package/dist/op/activity-profiles.d.ts +16 -0
  71. package/dist/op/activity-profiles.d.ts.map +1 -1
  72. package/dist/op/builders.d.ts +84 -2
  73. package/dist/op/builders.d.ts.map +1 -1
  74. package/dist/op/composites/converge-op.d.ts +31 -4
  75. package/dist/op/composites/converge-op.d.ts.map +1 -1
  76. package/dist/op/decide-backend.d.ts +116 -0
  77. package/dist/op/decide-backend.d.ts.map +1 -0
  78. package/dist/op/decide-config.d.ts +120 -0
  79. package/dist/op/decide-config.d.ts.map +1 -0
  80. package/dist/op/decide-read-inputs.d.ts +40 -0
  81. package/dist/op/decide-read-inputs.d.ts.map +1 -0
  82. package/dist/op/discover.d.ts +25 -0
  83. package/dist/op/discover.d.ts.map +1 -1
  84. package/dist/op/gate-wait.d.ts +43 -0
  85. package/dist/op/gate-wait.d.ts.map +1 -0
  86. package/dist/op/gate.d.ts +5 -2
  87. package/dist/op/gate.d.ts.map +1 -1
  88. package/dist/op/index.d.ts +18 -5
  89. package/dist/op/index.d.ts.map +1 -1
  90. package/dist/op/lifecycle-receipt-store.d.ts +34 -0
  91. package/dist/op/lifecycle-receipt-store.d.ts.map +1 -0
  92. package/dist/op/local-executor.d.ts +48 -4
  93. package/dist/op/local-executor.d.ts.map +1 -1
  94. package/dist/op/local-output.d.ts +2 -0
  95. package/dist/op/local-output.d.ts.map +1 -1
  96. package/dist/op/op-ir.d.ts +12 -1
  97. package/dist/op/op-ir.d.ts.map +1 -1
  98. package/dist/op/op-verb-class.d.ts.map +1 -1
  99. package/dist/op/operator.d.ts +126 -1
  100. package/dist/op/operator.d.ts.map +1 -1
  101. package/dist/op/runtime.d.ts +46 -5
  102. package/dist/op/runtime.d.ts.map +1 -1
  103. package/dist/op/runtimes/local.d.ts.map +1 -1
  104. package/dist/op/source-archive.d.ts +63 -0
  105. package/dist/op/source-archive.d.ts.map +1 -0
  106. package/dist/op/step-output-ref.d.ts +2 -2
  107. package/dist/op/step-output-ref.d.ts.map +1 -1
  108. package/dist/op/steward-points.d.ts +136 -0
  109. package/dist/op/steward-points.d.ts.map +1 -0
  110. package/dist/op/steward-turn.d.ts +53 -0
  111. package/dist/op/steward-turn.d.ts.map +1 -0
  112. package/dist/op/steward.d.ts +161 -0
  113. package/dist/op/steward.d.ts.map +1 -0
  114. package/dist/op/types.d.ts +58 -0
  115. package/dist/op/types.d.ts.map +1 -1
  116. package/dist/op/work-lease-decl.d.ts +18 -0
  117. package/dist/op/work-lease-decl.d.ts.map +1 -0
  118. package/dist/op/work-lease-run.d.ts +173 -0
  119. package/dist/op/work-lease-run.d.ts.map +1 -0
  120. package/dist/workspace/__fixtures__/decide-workspace.d.ts +100 -0
  121. package/dist/workspace/__fixtures__/decide-workspace.d.ts.map +1 -0
  122. package/dist/workspace/answers-ledger.d.ts +76 -0
  123. package/dist/workspace/answers-ledger.d.ts.map +1 -0
  124. package/dist/workspace/box-isolation.d.ts +99 -0
  125. package/dist/workspace/box-isolation.d.ts.map +1 -0
  126. package/dist/workspace/changes-cli.d.ts +16 -0
  127. package/dist/workspace/changes-cli.d.ts.map +1 -0
  128. package/dist/workspace/changes.d.ts +200 -0
  129. package/dist/workspace/changes.d.ts.map +1 -0
  130. package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.d.ts +59 -0
  131. package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.d.ts.map +1 -0
  132. package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.d.ts +51 -0
  133. package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.d.ts.map +1 -0
  134. package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.d.ts +26 -0
  135. package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.d.ts.map +1 -0
  136. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.d.ts +59 -0
  137. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.d.ts.map +1 -0
  138. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.d.ts +22 -0
  139. package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.d.ts.map +1 -0
  140. package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts +71 -0
  141. package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -0
  142. package/dist/workspace/chant-migrations.d.ts +99 -0
  143. package/dist/workspace/chant-migrations.d.ts.map +1 -0
  144. package/dist/workspace/checks/box-isolation.d.ts +18 -0
  145. package/dist/workspace/checks/box-isolation.d.ts.map +1 -0
  146. package/dist/workspace/checks/boxes.d.ts +104 -0
  147. package/dist/workspace/checks/boxes.d.ts.map +1 -0
  148. package/dist/workspace/checks/diagrams.d.ts +31 -0
  149. package/dist/workspace/checks/diagrams.d.ts.map +1 -0
  150. package/dist/workspace/checks/records.d.ts +8 -0
  151. package/dist/workspace/checks/records.d.ts.map +1 -1
  152. package/dist/workspace/checks.d.ts +13 -1
  153. package/dist/workspace/checks.d.ts.map +1 -1
  154. package/dist/workspace/compose-graph.d.ts +2 -0
  155. package/dist/workspace/compose-graph.d.ts.map +1 -1
  156. package/dist/workspace/conformance/index.d.ts.map +1 -1
  157. package/dist/workspace/decide.d.ts +229 -0
  158. package/dist/workspace/decide.d.ts.map +1 -0
  159. package/dist/workspace/decision-points.schema.json +137 -0
  160. package/dist/workspace/declaration.d.ts +103 -0
  161. package/dist/workspace/declaration.d.ts.map +1 -1
  162. package/dist/workspace/declaration.schema.json +285 -0
  163. package/dist/workspace/declared-kinds.d.ts +32 -0
  164. package/dist/workspace/declared-kinds.d.ts.map +1 -1
  165. package/dist/workspace/generated-files.d.ts +7 -0
  166. package/dist/workspace/generated-files.d.ts.map +1 -1
  167. package/dist/workspace/intent.d.ts.map +1 -1
  168. package/dist/workspace/lineage-check.d.ts +3 -0
  169. package/dist/workspace/lineage-check.d.ts.map +1 -1
  170. package/dist/workspace/lineage-upgrade.d.ts +6 -1
  171. package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
  172. package/dist/workspace/ls.d.ts +39 -1
  173. package/dist/workspace/ls.d.ts.map +1 -1
  174. package/dist/workspace/point-answer.schema.json +95 -0
  175. package/dist/workspace/points-cli.d.ts +113 -0
  176. package/dist/workspace/points-cli.d.ts.map +1 -0
  177. package/dist/workspace/points.d.ts +320 -0
  178. package/dist/workspace/points.d.ts.map +1 -0
  179. package/dist/workspace/reason-codes.d.ts +38 -0
  180. package/dist/workspace/reason-codes.d.ts.map +1 -1
  181. package/dist/workspace/record-assets.d.ts.map +1 -1
  182. package/dist/workspace/records-cli.d.ts +23 -1
  183. package/dist/workspace/records-cli.d.ts.map +1 -1
  184. package/dist/workspace/records-close.d.ts +1 -1
  185. package/dist/workspace/records-close.d.ts.map +1 -1
  186. package/dist/workspace/records-write.d.ts +11 -5
  187. package/dist/workspace/records-write.d.ts.map +1 -1
  188. package/dist/workspace/records.d.ts +42 -6
  189. package/dist/workspace/records.d.ts.map +1 -1
  190. package/dist/workspace/status-gates.d.ts +7 -2
  191. package/dist/workspace/status-gates.d.ts.map +1 -1
  192. package/dist/workspace/status-stewards.d.ts +179 -0
  193. package/dist/workspace/status-stewards.d.ts.map +1 -0
  194. package/dist/workspace/status.d.ts +68 -1
  195. package/dist/workspace/status.d.ts.map +1 -1
  196. package/dist/workspace/work-cli.d.ts +189 -0
  197. package/dist/workspace/work-cli.d.ts.map +1 -0
  198. package/dist/workspace/work-evidence.d.ts +74 -0
  199. package/dist/workspace/work-evidence.d.ts.map +1 -0
  200. package/dist/workspace/work.d.ts +43 -1
  201. package/dist/workspace/work.d.ts.map +1 -1
  202. package/package.json +1 -1
  203. package/src/cli/commands/audit.test.ts +9 -1
  204. package/src/cli/commands/build.ts +3 -2
  205. package/src/cli/commands/lint.ts +7 -1
  206. package/src/cli/handlers/components.test.ts +93 -0
  207. package/src/cli/handlers/components.ts +44 -3
  208. package/src/cli/handlers/graph.test.ts +20 -0
  209. package/src/cli/handlers/graph.ts +16 -2
  210. package/src/cli/handlers/operator.ts +141 -4
  211. package/src/cli/handlers/run.test.ts +173 -2
  212. package/src/cli/handlers/run.ts +174 -3
  213. package/src/cli/main.test.ts +50 -0
  214. package/src/cli/main.ts +97 -2
  215. package/src/cli/mcp/workspace-tools.test.ts +48 -19
  216. package/src/cli/mcp/workspace-tools.ts +110 -8
  217. package/src/cli/plugins.ts +11 -3
  218. package/src/cli/registry.ts +42 -1
  219. package/src/codegen/pinned-upgrade.ts +2 -1
  220. package/src/codegen/release-wiring.test.ts +49 -2
  221. package/src/components/capability-plugin-loader.ts +3 -3
  222. package/src/components/cli-support.ts +2 -2
  223. package/src/components/verbs/vuln-scan.test.ts +124 -1
  224. package/src/components/verbs/vuln-scan.ts +142 -1
  225. package/src/config.ts +11 -0
  226. package/src/lexicon-module.ts +56 -1
  227. package/src/lexicon-package.test.ts +96 -0
  228. package/src/lifecycle/converge-ledger.ts +20 -0
  229. package/src/lifecycle/git.ts +65 -15
  230. package/src/lifecycle/lease.test.ts +22 -0
  231. package/src/lifecycle/lease.ts +133 -29
  232. package/src/lifecycle/member-ledger.ts +3 -2
  233. package/src/lifecycle/plan-ledger.test.ts +148 -0
  234. package/src/lifecycle/plan-ledger.ts +158 -0
  235. package/src/lifecycle/run-ledger.ts +6 -0
  236. package/src/lifecycle/symptoms.ts +95 -0
  237. package/src/lifecycle/work-lease.test.ts +236 -0
  238. package/src/lifecycle/work-lease.ts +426 -0
  239. package/src/lint/rules/index.ts +6 -2
  240. package/src/lint/rules/op/index.ts +17 -4
  241. package/src/lint/rules/op/ops014-converge-rule-refusals.test.ts +23 -1
  242. package/src/lint/rules/op/ops014-converge-rule-refusals.ts +10 -6
  243. package/src/lint/rules/op/sys010-key-over-plain-http.test.ts +52 -0
  244. package/src/lint/rules/op/sys010-key-over-plain-http.ts +100 -0
  245. package/src/lint/rules/sys001-no-literal-key.test.ts +31 -0
  246. package/src/lint/rules/sys001-no-literal-key.ts +67 -0
  247. package/src/op/__fixtures__/decide-stub-backend.ts +143 -0
  248. package/src/op/activities/activity-contracts.ts +190 -1
  249. package/src/op/activities/apply.ts +7 -6
  250. package/src/op/activities/change-coverage.ts +60 -0
  251. package/src/op/activities/converge.test.ts +55 -1
  252. package/src/op/activities/converge.ts +208 -29
  253. package/src/op/activities/decide.live.test.ts +78 -0
  254. package/src/op/activities/decide.test.ts +300 -0
  255. package/src/op/activities/decide.ts +267 -0
  256. package/src/op/activities/index.ts +21 -0
  257. package/src/op/activities/shell.test.ts +91 -1
  258. package/src/op/activities/shell.ts +91 -2
  259. package/src/op/activities/source-release.test.ts +118 -0
  260. package/src/op/activities/source-release.ts +168 -0
  261. package/src/op/activities/source-rollback.test.ts +131 -0
  262. package/src/op/activities/source-rollback.ts +239 -0
  263. package/src/op/activities/work-evidence.ts +62 -0
  264. package/src/op/activity-contract-registry.test.ts +2 -0
  265. package/src/op/activity-contract-registry.ts +2 -2
  266. package/src/op/activity-contract.test.ts +12 -0
  267. package/src/op/activity-contract.ts +6 -1
  268. package/src/op/activity-profiles.ts +29 -0
  269. package/src/op/activity-registry.test.ts +1 -1
  270. package/src/op/activity-registry.ts +2 -2
  271. package/src/op/builders.ts +124 -5
  272. package/src/op/command-gate.test.ts +192 -0
  273. package/src/op/composites/converge-op.test.ts +27 -1
  274. package/src/op/composites/converge-op.ts +69 -15
  275. package/src/op/decide-backend.test.ts +44 -0
  276. package/src/op/decide-backend.ts +212 -0
  277. package/src/op/decide-config.test.ts +52 -0
  278. package/src/op/decide-config.ts +80 -0
  279. package/src/op/decide-read-inputs.ts +117 -0
  280. package/src/op/discover.ts +71 -0
  281. package/src/op/gate-approval.ts +2 -2
  282. package/src/op/gate-wait.ts +57 -0
  283. package/src/op/gate.ts +8 -3
  284. package/src/op/generate-pipeline.ts +2 -2
  285. package/src/op/index.ts +34 -6
  286. package/src/op/lifecycle-receipt-store.test.ts +60 -0
  287. package/src/op/lifecycle-receipt-store.ts +61 -0
  288. package/src/op/local-executor.ts +367 -33
  289. package/src/op/local-output.test.ts +33 -0
  290. package/src/op/local-output.ts +33 -2
  291. package/src/op/op-ir.test.ts +10 -0
  292. package/src/op/op-ir.ts +18 -0
  293. package/src/op/op-verb-class.ts +1 -0
  294. package/src/op/operator.ts +360 -10
  295. package/src/op/runtime.ts +37 -8
  296. package/src/op/runtimes/local.ts +6 -1
  297. package/src/op/source-archive.ts +161 -0
  298. package/src/op/step-output-ref.ts +6 -2
  299. package/src/op/steward-points.test.ts +313 -0
  300. package/src/op/steward-points.ts +194 -0
  301. package/src/op/steward-turn.ts +79 -0
  302. package/src/op/steward.test.ts +296 -0
  303. package/src/op/steward.ts +277 -0
  304. package/src/op/types.ts +60 -0
  305. package/src/op/work-lease-decl.ts +80 -0
  306. package/src/op/work-lease-run.test.ts +345 -0
  307. package/src/op/work-lease-run.ts +395 -0
  308. package/src/workspace/__fixtures__/decide-workspace.ts +129 -0
  309. package/src/workspace/__fixtures__/studio-template-84c8b21.json +67 -0
  310. package/src/workspace/answers-ledger.ts +118 -0
  311. package/src/workspace/box-isolation.test.ts +261 -0
  312. package/src/workspace/box-isolation.ts +205 -0
  313. package/src/workspace/changes-cli.ts +56 -0
  314. package/src/workspace/changes.schema.json +472 -0
  315. package/src/workspace/changes.test.ts +315 -0
  316. package/src/workspace/changes.ts +512 -0
  317. package/src/workspace/chant-migrations/chud-lexicon-exit-fly-site.ts +234 -0
  318. package/src/workspace/chant-migrations/chud-lexicon-exit-live-names.ts +164 -0
  319. package/src/workspace/chant-migrations/chud-lexicon-exit-rollback.ts +223 -0
  320. package/src/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.ts +195 -0
  321. package/src/workspace/chant-migrations/chud-lexicon-exit-ship-policy.ts +108 -0
  322. package/src/workspace/chant-migrations/chud-lexicon-exit.ts +882 -0
  323. package/src/workspace/chant-migrations.e2e.test.ts +1089 -0
  324. package/src/workspace/chant-migrations.ts +164 -0
  325. package/src/workspace/check-contract.test.ts +5 -1
  326. package/src/workspace/check.schema.json +25 -7
  327. package/src/workspace/checks/box-isolation.ts +68 -0
  328. package/src/workspace/checks/boxes.test.ts +276 -0
  329. package/src/workspace/checks/boxes.ts +442 -0
  330. package/src/workspace/checks/diagrams.test.ts +134 -0
  331. package/src/workspace/checks/diagrams.ts +108 -0
  332. package/src/workspace/checks/records.ts +72 -0
  333. package/src/workspace/checks.test.ts +7 -0
  334. package/src/workspace/checks.ts +27 -3
  335. package/src/workspace/compose-graph.ts +2 -0
  336. package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +10 -0
  337. package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +26 -0
  338. package/src/workspace/conformance/index.ts +5 -0
  339. package/src/workspace/decide.test.ts +224 -0
  340. package/src/workspace/decide.ts +709 -0
  341. package/src/workspace/decision-points.schema.json +137 -0
  342. package/src/workspace/declaration.schema.json +285 -0
  343. package/src/workspace/declaration.test.ts +58 -0
  344. package/src/workspace/declaration.ts +241 -0
  345. package/src/workspace/declared-kinds.test.ts +5 -5
  346. package/src/workspace/declared-kinds.ts +71 -3
  347. package/src/workspace/generated-files.ts +14 -0
  348. package/src/workspace/graph-cli.ts +1 -1
  349. package/src/workspace/graph.schema.json +9 -1
  350. package/src/workspace/intent.schema.json +12 -3
  351. package/src/workspace/intent.ts +3 -10
  352. package/src/workspace/lineage-check.ts +16 -1
  353. package/src/workspace/lineage-upgrade-cli.ts +1 -1
  354. package/src/workspace/lineage-upgrade.test.ts +70 -0
  355. package/src/workspace/lineage-upgrade.ts +81 -10
  356. package/src/workspace/ls-contract.test.ts +57 -0
  357. package/src/workspace/ls.schema.json +46 -1
  358. package/src/workspace/ls.ts +62 -3
  359. package/src/workspace/point-answer.schema.json +95 -0
  360. package/src/workspace/points-cli.ts +284 -0
  361. package/src/workspace/points-write.schema.json +499 -0
  362. package/src/workspace/points.schema.json +743 -0
  363. package/src/workspace/points.test.ts +264 -0
  364. package/src/workspace/points.ts +564 -0
  365. package/src/workspace/read-contract.test.ts +18 -1
  366. package/src/workspace/reason-codes.test.ts +24 -1
  367. package/src/workspace/reason-codes.ts +49 -0
  368. package/src/workspace/record-assets.test.ts +3 -2
  369. package/src/workspace/record-assets.ts +4 -1
  370. package/src/workspace/records-amend.schema.json +2 -0
  371. package/src/workspace/records-cli.ts +28 -5
  372. package/src/workspace/records-close.schema.json +2 -0
  373. package/src/workspace/records-contract.test.ts +3 -2
  374. package/src/workspace/records-new.schema.json +2 -0
  375. package/src/workspace/records-review.schema.json +2 -0
  376. package/src/workspace/records-sessions-write.e2e.test.ts +77 -0
  377. package/src/workspace/records-sessions-write.test.ts +2 -34
  378. package/src/workspace/records-write.e2e.test.ts +108 -0
  379. package/src/workspace/records-write.test.ts +32 -41
  380. package/src/workspace/records-write.ts +33 -15
  381. package/src/workspace/records.schema.json +53 -2
  382. package/src/workspace/records.test.ts +48 -3
  383. package/src/workspace/records.ts +142 -6
  384. package/src/workspace/status-contract.test.ts +189 -6
  385. package/src/workspace/status-gates.ts +9 -4
  386. package/src/workspace/status-stewards.ts +329 -0
  387. package/src/workspace/status.schema.json +335 -5
  388. package/src/workspace/status.ts +142 -6
  389. package/src/workspace/work-acceptance.test.ts +274 -0
  390. package/src/workspace/work-cli.e2e.test.ts +180 -0
  391. package/src/workspace/work-cli.ts +429 -0
  392. package/src/workspace/work-evidence.schema.json +212 -0
  393. package/src/workspace/work-evidence.ts +169 -0
  394. package/src/workspace/work-history.schema.json +349 -0
  395. package/src/workspace/work-history.test.ts +156 -0
  396. package/src/workspace/work-lease.schema.json +233 -0
  397. package/src/workspace/work-readiness-chud.test.ts +145 -0
  398. package/src/workspace/work.test.ts +3 -2
  399. package/src/workspace/work.ts +100 -1
  400. /package/src/cli/{discovery-skip.test.ts → discovery-skip.e2e.test.ts} +0 -0
  401. /package/src/workspace/conformance/{conformance.test.ts → conformance.e2e.test.ts} +0 -0
  402. /package/src/workspace/{which-chant.test.ts → which-chant.e2e.test.ts} +0 -0
@@ -427,19 +427,46 @@ export declare function readBlobBySha(sha: string, opts?: {
427
427
  * Push one arbitrary ref (e.g. a lease ref) to the remote, guarded the same
428
428
  * way {@link pushLifecycle} guards the ledger branch: `--force-with-lease`
429
429
  * keyed to the remote SHA last observed locally, so a concurrent push from a
430
- * second machine is rejected rather than silently clobbered. Plain `--force`
431
- * underneath that lease — a lease ref's value is a bare blob SHA, not a
432
- * commit descending from the previous one, so there is no "fast-forward" to
433
- * preserve, only the CAS the lease guard already provides.
430
+ * second machine is rejected rather than silently clobbered. The lease alone
431
+ * lets a push replace a value that is not an ancestor — a lease ref's value is
432
+ * a bare blob SHA, not a commit descending from the previous one — as long as
433
+ * the remote still holds the expected value. No `--force` beside it: git lets
434
+ * `--force` override `--force-with-lease`, which made every lease push
435
+ * unconditional before #2732.
434
436
  *
435
437
  * Returns `false` (never throws) when no remote is configured — a
436
438
  * remote-less project's lease is local-only by construction (see
437
439
  * `./lease.ts`'s module doc), or when the push itself is rejected (the
438
- * caller re-reads and retries; see `acquireLease`).
440
+ * caller re-reads and retries; see `acquireLease`). {@link pushRefStatus}
441
+ * tells those two apart.
439
442
  */
440
443
  export declare function pushRef(ref: string, opts?: {
441
444
  cwd?: string;
445
+ expect?: string | null;
442
446
  }): Promise<boolean>;
447
+ /** What {@link pushRefStatus} did: the remote took the ref, there is no remote, or the remote refused it. */
448
+ export type PushRefStatus = "pushed" | "no-remote" | "rejected";
449
+ /**
450
+ * {@link pushRef}, saying why a push did not land (#2732).
451
+ *
452
+ * `opts.expect` is the value the caller last saw the ref at on the remote
453
+ * (`null`: absent there), and becomes the `--force-with-lease` expectation.
454
+ * Without it the expectation is `refs/remotes/<remote>/<ref>`, which nothing
455
+ * fetches a lease ref into, so it reads as "absent" and only a first push
456
+ * lands. A lease passes the value of its own remote-tracking ref instead
457
+ * (`./lease.ts`'s `readLease`).
458
+ *
459
+ * A ref that no longer exists locally is pushed as a deletion, under the same
460
+ * expectation, so a released lease is released on the remote too. Deleting a
461
+ * ref the caller expects to be absent already is a no-op that reports
462
+ * `pushed`.
463
+ */
464
+ export declare function pushRefStatus(ref: string, opts?: {
465
+ cwd?: string;
466
+ expect?: string | null;
467
+ }): Promise<PushRefStatus>;
468
+ /** What {@link fetchRefIntoStatus} found: the ref fetched, no remote, the remote answered without the ref, or the fetch failed. */
469
+ export type FetchRefStatus = "fetched" | "no-remote" | "missing" | "failed";
443
470
  /**
444
471
  * Fetch one arbitrary remote ref into a local ref of a possibly *different*
445
472
  * name (#1959 finding 3). `+` forces the update even when it isn't a
@@ -455,6 +482,14 @@ export declare function pushRef(ref: string, opts?: {
455
482
  export declare function fetchRefInto(remoteRef: string, localRef: string, opts?: {
456
483
  cwd?: string;
457
484
  }): Promise<boolean>;
485
+ /**
486
+ * {@link fetchRefInto}, saying why nothing was fetched (#2732). `missing`
487
+ * means the remote answered and does not carry the ref, which for a lease is
488
+ * the news that it was released there.
489
+ */
490
+ export declare function fetchRefIntoStatus(remoteRef: string, localRef: string, opts?: {
491
+ cwd?: string;
492
+ }): Promise<FetchRefStatus>;
458
493
  /**
459
494
  * Fetch one arbitrary ref from remote into the same local ref name.
460
495
  *
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAGrF;AA2ED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC1D,O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CAAA;CAAE,GACtB,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,cAAc,CAAC,CAQzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAErF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5E"}
@@ -27,7 +27,7 @@ export declare const DEFAULT_LEASE_TTL_MS: number;
27
27
  * Two members may then run Ops of the same name without sharing a lease.
28
28
  */
29
29
  export declare function leaseRef(opName: string, memberPrefix?: string): string;
30
- /** One lease's live state — the entire durable record; there is no history, only the current holder (see this module's doc on why no separate ledger). */
30
+ /** One lease's live state: the current holder only. An operator lease keeps no history; a work lease (./work-lease.ts) appends each change to `_leases/<id>.jsonl` beside it. */
31
31
  export interface LeaseRecord {
32
32
  op: string;
33
33
  /** `<hostname>:<pid>:<random>` — a diagnostic identity, not itself the fencing mechanism (`token` is). */
@@ -43,6 +43,17 @@ export interface ReadLeaseResult {
43
43
  /** The ref's current SHA (the CAS anchor for the next write), or `null` if no lease has ever been written. */
44
44
  sha: string | null;
45
45
  record?: LeaseRecord;
46
+ /**
47
+ * The value of the remote-tracking ref (`refs/chant/lease-remote/<op>`)
48
+ * after the fetch: what the remote held when last seen, or `null` when it
49
+ * held nothing. The `--force-with-lease` expectation of the next push
50
+ * (#2732).
51
+ */
52
+ remoteSha: string | null;
53
+ }
54
+ /** Options every lease read and write takes. `cwd` also picks the ledger, and so the member prefix of the refs (./member-ledger.ts). */
55
+ export interface LeaseOptions {
56
+ cwd?: string;
46
57
  }
47
58
  /**
48
59
  * Read the live lease for `opName`, fetching the remote ref first (best-
@@ -64,15 +75,60 @@ export interface ReadLeaseResult {
64
75
  * against — is always the local ref's own actual value; only the local
65
76
  * canonical ref is ever a valid basis for a `updateRefCAS`/`deleteRefCAS`
66
77
  * call against it, regardless of what the comparison decided about `record`.
78
+ *
79
+ * When the remote answers without the ref, the lease was released there, and
80
+ * the tracking ref is dropped so a stale copy of it no longer counts (#2732).
81
+ * A read-only report that must stay off the network reads the refs itself
82
+ * (`./work-lease.ts`'s `listWorkLeases`).
67
83
  */
68
- export declare function readLease(opName: string, opts?: {
69
- cwd?: string;
70
- }): Promise<ReadLeaseResult>;
84
+ export declare function readLease(opName: string, opts?: LeaseOptions): Promise<ReadLeaseResult>;
85
+ /** Why {@link acquireLease} did not acquire (#2732). */
86
+ export type LeaseRefusal =
87
+ /** Someone holds it live: another holder, or, under `mode: "claim"`, anyone. */
88
+ "held"
89
+ /** `mode: "renew"` and nobody holds it live any more: it expired or was released. */
90
+ | "not-held"
91
+ /** `mode: "renew"` and the live lease has another token than the one given. */
92
+ | "token-mismatch"
93
+ /** Another writer changed the ref between this call's read and its write. */
94
+ | "race"
95
+ /** `requirePush` and the remote refused the push: another clone got there first, or the remote could not be reached. */
96
+ | "push-rejected";
71
97
  export interface AcquireLeaseResult {
72
98
  acquired: boolean;
73
99
  lease?: LeaseRecord;
74
100
  /** Present when not acquired: the lease record currently held by someone else. */
75
101
  heldBy?: LeaseRecord;
102
+ /** Present when not acquired: why (#2732). */
103
+ reason?: LeaseRefusal;
104
+ }
105
+ /** Options for {@link acquireLease}. */
106
+ export interface AcquireLeaseOptions extends LeaseOptions {
107
+ ttlMs?: number;
108
+ now?: () => Date;
109
+ /**
110
+ * `acquire` (the default, the operator's): take it when free or expired,
111
+ * renew it when `holder` already holds it. `claim`: take it only when free
112
+ * or expired, and refuse even its own holder. `renew`: only move the expiry
113
+ * of a live lease `holder` holds (#2732).
114
+ */
115
+ mode?: "acquire" | "claim" | "renew";
116
+ /** With `mode: "renew"`, the token the caller holds; a live lease with another token is refused. */
117
+ token?: string;
118
+ /**
119
+ * Count the write only once the remote has taken it, when there is a
120
+ * remote. A rejected push undoes the local write and refuses with
121
+ * `push-rejected`, so two clones racing for one lease cannot both hold it.
122
+ * The operator leaves it off: its push is best-effort (#2732).
123
+ */
124
+ requirePush?: boolean;
125
+ /**
126
+ * Wait out a `.lock` another process holds on the ref for up to this long,
127
+ * retrying, before surfacing it as a {@link StaleLockError}. A lock left by
128
+ * a killed process outlives the wait; one held by a racing writer does
129
+ * not. Off (0) by default, as the operator has always had it.
130
+ */
131
+ lockWaitMs?: number;
76
132
  }
77
133
  /**
78
134
  * Acquire or renew the lease for `opName` as `holder`. Succeeds when the ref
@@ -91,30 +147,30 @@ export interface AcquireLeaseResult {
91
147
  * against a lease nobody can ever actually acquire again without manual
92
148
  * intervention. It propagates instead, so the caller (`../op/operator.ts`'s
93
149
  * `runOperatorRound`) can surface it as its own distinct, diagnosable event
94
- * rather than a silent, permanent skip.
150
+ * rather than a silent, permanent skip. `lockWaitMs` waits a racing writer's
151
+ * lock out first.
152
+ *
153
+ * `mode`, `token` and `requirePush` are the work lease's (#2732,
154
+ * ./work-lease.ts); the operator uses none of them.
95
155
  */
96
- export declare function acquireLease(opName: string, holder: string, opts?: {
97
- cwd?: string;
98
- ttlMs?: number;
99
- now?: () => Date;
100
- }): Promise<AcquireLeaseResult>;
156
+ export declare function acquireLease(opName: string, holder: string, opts?: AcquireLeaseOptions): Promise<AcquireLeaseResult>;
101
157
  /**
102
158
  * Release the lease, but only when `holder`/`token` still match the live
103
159
  * value — releasing a lease this caller no longer actually holds would
104
160
  * silently drop someone else's. Best-effort courtesy: a lease nobody
105
161
  * releases is reclaimed anyway once its TTL passes, so a failed release
106
162
  * (returns `false`, never throws) is not itself a correctness problem.
163
+ *
164
+ * The deletion is pushed to the remote, expecting the value last fetched
165
+ * there, so another clone sees the lease free without waiting out its TTL
166
+ * (#2732).
107
167
  */
108
- export declare function releaseLease(opName: string, holder: string, token: string, opts?: {
109
- cwd?: string;
110
- }): Promise<boolean>;
168
+ export declare function releaseLease(opName: string, holder: string, token: string, opts?: LeaseOptions): Promise<boolean>;
111
169
  /**
112
170
  * Does `holder`/`token` still match the live lease? The fencing check a
113
171
  * tick uses right before trusting its own work as authoritative (see
114
172
  * `../op/operator.ts`). Fetches first, so a lease stolen by another machine
115
173
  * is detected, not just a stale local read.
116
174
  */
117
- export declare function stillHoldsLease(opName: string, holder: string, token: string, opts?: {
118
- cwd?: string;
119
- }): Promise<boolean>;
175
+ export declare function stillHoldsLease(opName: string, holder: string, token: string, opts?: LeaseOptions): Promise<boolean>;
120
176
  //# sourceMappingURL=lease.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lease.d.ts","sourceRoot":"","sources":["../../src/lifecycle/lease.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,QAAa,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,MAAM,CAElE;AA0BD,0JAA0J;AAC1J,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,0GAA0G;IAC1G,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,gOAAgO;AAChO,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAwBD,MAAM,WAAW,eAAe;IAC9B,8GAA8G;IAC9G,GAAG,EAAE,MAAM,GAAG,IAAI,CA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,EAAE,YAAY,CAAC;CACvB;AAED,wCAAwC;AACxC,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACrC,oGAAoG;IACpG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,mBAAmB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAU7B;AAuDD;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,YAAY,GAClB,OAAO,CAAC,OAAO,CAAC,CAclB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,YAAY,GAClB,OAAO,CAAC,OAAO,CAAC,CAGlB"}
@@ -5,8 +5,9 @@
5
5
  * A workspace member writes every lifecycle store under
6
6
  * `_members/<member>/` on the one existing branch: releases, snapshots, runs,
7
7
  * converge records and observation baselines under `<env>/`, gates under
8
- * `_gates/`, build records under `_builds/`. Its operator leases move the same
9
- * way, to `refs/chant/lease/_members/<member>/<op>`. Push, fetch, lease and
8
+ * `_gates/`, build records under `_builds/`, release plans under `_plans/`
9
+ * (ws-055, #2733). Its operator leases move the same way, to
10
+ * `refs/chant/lease/_members/<member>/<op>`. Push, fetch, lease and
10
11
  * staleness code are untouched: they still see one branch and plain refs.
11
12
  *
12
13
  * Everything else keeps today's flat layout, byte for byte:
@@ -1 +1 @@
1
- {"version":3,"file":"member-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/member-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,2EAA2E;AAC3E,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,oDAAoD;AACpD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAID;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAU7E;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
1
+ {"version":3,"file":"member-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/member-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,2EAA2E;AAC3E,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,oDAAoD;AACpD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAID;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAU7E;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Release plan store (ws-055, #2733, part of the chud retirement epic
3
+ * #2715): persists a release plan — the work items and evidence a release
4
+ * ships — to the `chant/lifecycle` orphan branch, content-addressed by the
5
+ * plan's own digest.
6
+ *
7
+ * **Why this exists.** ws-055 (docs/design/decisions/ws-055-dev-model-
8
+ * ledgers.md) decided where a development model's plans live: "a release
9
+ * plan is written content-addressed to `_plans/<digest>.json` on
10
+ * chant/lifecycle, and the release ledger record already names that
11
+ * digest." A `ReleaseRecord.digest` (../lifecycle/release-ledger.ts) is
12
+ * ordinarily an artifact digest; for a release a runner (the studio kit
13
+ * today, chud before it) plans work-item by work-item, that same field
14
+ * *is* the plan's own digest — the release ledger needs no new field to
15
+ * point at it, it already names the plan. Reading a release through the
16
+ * read contract (../workspace/status.ts) resolves that digest to the plan
17
+ * exactly the way it already resolves a build archive digest to a
18
+ * `BuildArchiveManifest` (./build-ledger-store.ts) — this module is that
19
+ * store's plan-shaped sibling, same plumbing, same directory-per-kind
20
+ * convention on the one orphan branch.
21
+ *
22
+ * **Storage.** Reuses `writeBlobToPath`/`readBlobFromPath` (./git.ts) —
23
+ * the identical hash-object -> mktree -> commit-tree -> update-ref
24
+ * pipeline `writeSnapshot`/`persistBuildManifest` already use. Plans live
25
+ * under a fixed top-level `_plans/` directory, a peer of `_builds/` and the
26
+ * per-env directories, never nested inside one — a plan is not env-scoped,
27
+ * it is named by its own content. Per #2524 D7 / #2538, `writeBlobToPath`'s
28
+ * `ledgerDir` already folds a workspace member's own `_members/<member>/`
29
+ * prefix in ahead of `_plans/`, so a member's plans live at
30
+ * `_members/<member>/_plans/<digest>.json` the same way its build records
31
+ * live at `_members/<member>/_builds/` — this module does nothing itself
32
+ * to earn that; it falls out of reusing the shared plumbing.
33
+ *
34
+ * **Content-addressed, keyed by the plan's own `digest`.** One file per
35
+ * plan, `_plans/<digest-with-":"->"_">.json` (`:` is not usable in a git
36
+ * tree entry name the way `readBlobFromPath`'s `<ref>:<path>` spelling
37
+ * reads it back, the same reason `./build-ledger-store.ts` substitutes it
38
+ * for `_builds/`). The digest is computed by whoever plans the release —
39
+ * the release Op, or a runner like the studio kit — not by chant; this
40
+ * module only trusts and stores it, exactly as `persistBuildManifest`
41
+ * trusts a manifest's own `manifestDigest`.
42
+ *
43
+ * **A plan already written is never rewritten (#2733 acceptance).**
44
+ * Unlike `persistBuildManifest`, which writes unconditionally every call
45
+ * (safe only because identical content produces an identical blob and,
46
+ * usually, an identical tree — but still a new, redundant commit on the
47
+ * branch each time), `persistReleasePlan` reads the path first and returns
48
+ * without writing when a plan is already stored under that digest. A plan
49
+ * is immutable by construction (it is named by a hash of its own content),
50
+ * so there is never a reason to overwrite one — only ever a reason to skip
51
+ * the write.
52
+ */
53
+ /**
54
+ * A release plan (ws-055): the work items and evidence a release ships.
55
+ * chant does not own this shape — it is a runner's own record, the way a
56
+ * record kind's schema is the kind's own (../workspace/records.ts) — only
57
+ * `digest` is required, since it is the storage key. Every other field is
58
+ * read back and returned exactly as written.
59
+ */
60
+ export interface ReleasePlan {
61
+ /**
62
+ * Content-addressed digest of this plan (`sha256:...`) — the same digest
63
+ * the release ledger record names (`ReleaseRecord.digest`,
64
+ * ../lifecycle/release-ledger.ts), so a record leads to its plan.
65
+ * Computed by the caller before persisting; this module trusts it rather
66
+ * than recomputing it, the same way `persistBuildManifest` trusts a
67
+ * manifest's own `manifestDigest`.
68
+ */
69
+ digest: string;
70
+ [key: string]: unknown;
71
+ }
72
+ /** Thrown by `persistReleasePlan` when the plan carries no usable `digest` — a plan can't be content-addressed without one. */
73
+ export declare class InvalidReleasePlanError extends Error {
74
+ constructor(message: string);
75
+ }
76
+ /**
77
+ * Persist a release plan to the orphan branch, keyed by its own `digest`.
78
+ * Does not push to the remote — call `pushLifecycle` (./git.ts) afterward,
79
+ * the same two-step (`write` then `push`) shape `appendReleaseRecord`/
80
+ * `persistBuildManifest` use, so a caller persisting a plan alongside the
81
+ * release record it names can batch both into one push.
82
+ *
83
+ * Never rewrites a plan already stored under `plan.digest` (#2733
84
+ * acceptance) — reads the path first, and returns `{ commit: null, written:
85
+ * false }` without writing when it is already there. A `RefCASConflictError`
86
+ * from a genuine race (another writer persisted the same digest's plan
87
+ * between this call's read and its write) is treated the same way: the
88
+ * plan is content-addressed, so whatever is already at that path under this
89
+ * digest is authoritative, never overwritten.
90
+ */
91
+ export declare function persistReleasePlan(plan: ReleasePlan, opts?: {
92
+ cwd?: string;
93
+ }): Promise<{
94
+ commit: string | null;
95
+ written: boolean;
96
+ }>;
97
+ /**
98
+ * Read a persisted release plan back by its own digest — the same digest a
99
+ * `ReleaseRecord.digest` names. Returns `null` when no plan was ever
100
+ * persisted under that digest (never throws — most releases carry no plan
101
+ * at all, and reading one for status is a normal, expected miss), and when
102
+ * the stored blob fails to parse as JSON.
103
+ *
104
+ * `prefix` lets a multi-member reader (../workspace/status.ts) resolve a
105
+ * specific member's plan directory directly, the same way
106
+ * `readReleaseLedgerLines` is handed an already-member-prefixed path there
107
+ * — `cwd` alone can't do it, since one status read walks every member from
108
+ * one process without changing directory per member.
109
+ */
110
+ export declare function readReleasePlan(digest: string, opts?: {
111
+ cwd?: string;
112
+ prefix?: string;
113
+ }): Promise<ReleasePlan | null>;
114
+ //# sourceMappingURL=plan-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/plan-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAQH;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,+HAA+H;AAC/H,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAI5B;AAWD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,WAAW,EACjB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAgBtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAS7B"}
@@ -22,6 +22,8 @@ export declare function buildRunRecord(config: Pick<OpConfig, "name" | "labels">
22
22
  status: OpRunRecord["status"];
23
23
  id?: string;
24
24
  gate?: OpRunRecord["gate"];
25
+ point?: OpRunRecord["point"];
26
+ steward?: string;
25
27
  }): OpRunRecordInput;
26
28
  /**
27
29
  * Append one immutable run record. Does not push to the remote — call
@@ -1 +1 @@
1
- {"version":3,"file":"run-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/run-ledger.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAqC,MAAM,eAAe,CAAC;AAStG,0EAA0E;A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
60
60
  export declare function deriveSymptoms(env: string, cs: ChangeSet, statusRows: ComponentStatusRow[]): ConvergeSymptom;
61
61
  /** Every field name a `ConvergeSymptom` produces — the runtime whitelist `OPS014` (packages/core/src/lint/rules/op/ops014-converge-rule-refusals.ts) re-validates a serialized rule table's predicates against. Kept in sync with {@link ConvergeSymptom} by hand (deliberately small, changes rarely). */
62
62
  export declare const CONVERGE_SYMPTOM_FIELDS: ReadonlySet<string>;
63
+ /**
64
+ * One resource's verdict, as an observer step reports it: `in-sync` when it
65
+ * is what its declaration says, `drifted` when it isn't, and `unknown` when
66
+ * the observer could not tell.
67
+ */
68
+ export type ResourceStatus = "in-sync" | "drifted" | "unknown";
69
+ /** One resource an observer step looked at. */
70
+ export interface ObservedResource {
71
+ name: string;
72
+ status: ResourceStatus;
73
+ /** Why the observer gave that verdict, in one line. */
74
+ detail?: string;
75
+ }
76
+ /**
77
+ * What a `ConvergeOp`'s observer step returns (#2778), for resources no
78
+ * lexicon declares or observes: the processes a supervisor runs in a box,
79
+ * for example. `ConvergeOp({ observe })` evaluates its rules once per
80
+ * resource, against a {@link ResourceSymptom}.
81
+ */
82
+ export interface ResourceObservation {
83
+ resources: ObservedResource[];
84
+ }
85
+ /**
86
+ * The record a `ConvergeOp` with an observer step evaluates each rule
87
+ * against, once per observed resource (#2778). A rule reads `status` (and
88
+ * may read `resource` to single one out); a `run()` it fires is dispatched
89
+ * for that resource, which the dispatched Op reads from
90
+ * `CHANT_CONVERGE_RESOURCE`.
91
+ */
92
+ export interface ResourceSymptom {
93
+ env: string;
94
+ /** The resource's name, as the observer reported it. */
95
+ resource: string;
96
+ status: ResourceStatus;
97
+ /** The observer's one-line reason, or "". */
98
+ detail: string;
99
+ }
100
+ /**
101
+ * The environment variable a dispatched Op reads the resource from, when a
102
+ * ConvergeOp with an observer step fired its rule for one resource (#2778).
103
+ */
104
+ export declare const CONVERGE_RESOURCE_ENV = "CHANT_CONVERGE_RESOURCE";
105
+ /** Every field a {@link ResourceSymptom} produces: OPS014's whitelist for a ConvergeOp with an observer step. */
106
+ export declare const RESOURCE_SYMPTOM_FIELDS: ReadonlySet<string>;
107
+ /**
108
+ * Read an observer step's result as a {@link ResourceObservation}. The
109
+ * result is the observation itself, or a `shell()` step's result whose
110
+ * stdout is the observation as JSON. Throws, naming what is wrong, on
111
+ * anything else: a tick must not converge from a reading it can't parse.
112
+ */
113
+ export declare function parseResourceObservation(value: unknown): ResourceObservation;
63
114
  //# sourceMappingURL=symptoms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"symptoms.d.ts","sourceRoot":"","sources":["../../src/lifecycle/symptoms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkB7E,qKAAqK;AACrK,wBAAgB,WAAW,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAM5F;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,gHAAgH;IAChH,MAAM,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,wIAAwI;IACxI,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wLAAwL;IACxL,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,eAAe,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC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wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,eAAe,CAwB5G;AAED,2SAA2S;AAC3S,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAatD,CAAC;AAIH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/D,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,gBAAgB,EAAE,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAE/D,iHAAiH;AACjH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAoD,CAAC;AAI7G;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAiC5E"}
@@ -0,0 +1,140 @@
1
+ /** The key prefix of a work lease under the operator lease's ref namespace. */
2
+ export declare const WORK_LEASE_KEY_PREFIX = "work/";
3
+ /** The directory on `chant/lifecycle` that holds lease histories, under a member's prefix when it has one. */
4
+ export declare const LEASES_DIR = "_leases";
5
+ /** How long a claim lasts unless renewed: chud's default, which its dispatcher renews at a third of. */
6
+ export declare const DEFAULT_WORK_LEASE_TTL_MS: number;
7
+ /** A work item id a lease can be keyed by: one ref path segment and one file name. */
8
+ export declare const WORK_ITEM_ID_PATTERN: RegExp;
9
+ /** The lease key of work item `id`. */
10
+ export declare function workLeaseKey(id: string): string;
11
+ /** The lease ref of work item `id` in the ledger with `memberPrefix`. */
12
+ export declare function workLeaseRef(id: string, memberPrefix?: string): string;
13
+ /** The path of work item `id`'s lease history on `chant/lifecycle`. */
14
+ export declare function leaseHistoryPath(id: string, memberPrefix?: string): string;
15
+ /** One work item's lease, as the read contract reports it. */
16
+ export interface WorkLease {
17
+ /** The work item's id. */
18
+ item: string;
19
+ holder: string;
20
+ /** The fencing token: new on every claim, kept by every renew. */
21
+ token: string;
22
+ acquiredAt: string;
23
+ expiresAt: string;
24
+ }
25
+ /** A lease with whether it is still live at the time it was read. */
26
+ export interface WorkLeaseState extends WorkLease {
27
+ state: "active" | "expired";
28
+ /** The lease ref. */
29
+ ref: string;
30
+ }
31
+ /** One line of `_leases/<id>.jsonl`. */
32
+ export interface LeaseHistoryRecord {
33
+ version: 1;
34
+ event: "claim" | "renew" | "release";
35
+ item: string;
36
+ /** The lease's holder. */
37
+ holder: string;
38
+ /** Who wrote this line: the holder, or, for the release of an expired lease, whoever closed it out. */
39
+ by: string;
40
+ token: string;
41
+ acquiredAt: string;
42
+ /** The lease's expiry after this event; a release keeps the expiry it had. */
43
+ expiresAt: string;
44
+ /** When the event happened. */
45
+ timestamp: string;
46
+ /** How the work ended, on a release. Free text such as done, not_done or skipped. */
47
+ outcome?: string;
48
+ note?: string;
49
+ }
50
+ /** Why a claim, renew or release was refused. Closed: a new code is a contract change. */
51
+ export declare const WORK_LEASE_REFUSALS: readonly ["lease-held", "lease-not-held", "lease-token-mismatch", "lease-race", "lease-push-rejected"];
52
+ export type WorkLeaseRefusal = (typeof WORK_LEASE_REFUSALS)[number];
53
+ /** Where the history line went. */
54
+ export interface LeaseHistoryWrite {
55
+ path: string;
56
+ commit: string;
57
+ /** Whether `chant/lifecycle` reached the remote; false with no remote too. */
58
+ pushed: boolean;
59
+ }
60
+ export type WorkLeaseResult = {
61
+ ok: true;
62
+ lease: WorkLease;
63
+ history: LeaseHistoryWrite;
64
+ } | {
65
+ ok: false;
66
+ reason: WorkLeaseRefusal;
67
+ message: string;
68
+ heldBy?: WorkLease;
69
+ };
70
+ export interface WorkLeaseOptions {
71
+ /** A directory in the repository, inside the member whose ledger holds the lease. */
72
+ cwd: string;
73
+ now?: () => Date;
74
+ }
75
+ /**
76
+ * Claim work item `id` for `holder` for `ttlMs`. Refused with `lease-held`,
77
+ * naming the holder, when anyone holds it live, `holder` included; an expired
78
+ * lease does not refuse a claim, and the new claim gets a new token.
79
+ */
80
+ export declare function claimWorkLease(id: string, holder: string, opts: WorkLeaseOptions & {
81
+ ttlMs?: number;
82
+ note?: string;
83
+ }): Promise<WorkLeaseResult>;
84
+ /**
85
+ * Move the expiry of `holder`'s live lease on `id` to `ttlMs` from now,
86
+ * keeping its token. With `token`, the live lease must carry it. Refused with
87
+ * `lease-not-held` once the lease has expired or was released: the holder
88
+ * claims it again, and gets a new token.
89
+ */
90
+ export declare function renewWorkLease(id: string, holder: string, opts: WorkLeaseOptions & {
91
+ ttlMs?: number;
92
+ token?: string;
93
+ note?: string;
94
+ }): Promise<WorkLeaseResult>;
95
+ /**
96
+ * Give the lease on `id` back. The holder releases a live lease (with
97
+ * `token`, only that one); anyone may release an expired one, which is how an
98
+ * abandoned claim is closed out. `outcome` says how the work ended. Refused
99
+ * with `lease-not-held` when there is no lease, and `lease-held` when someone
100
+ * else holds it live.
101
+ */
102
+ export declare function releaseWorkLease(id: string, by: string, opts: WorkLeaseOptions & {
103
+ token?: string;
104
+ outcome?: string;
105
+ note?: string;
106
+ }): Promise<WorkLeaseResult>;
107
+ /** Parse the text of a lease history file, oldest first. Malformed lines are counted and skipped. */
108
+ export declare function parseLeaseHistory(content: string): {
109
+ records: LeaseHistoryRecord[];
110
+ malformed: number;
111
+ };
112
+ /** Read work item `id`'s lease history in the ledger of the project at `opts.cwd`. Empty when it has none. */
113
+ export declare function readLeaseHistory(id: string, opts: {
114
+ cwd: string;
115
+ }): Promise<{
116
+ records: LeaseHistoryRecord[];
117
+ malformed: number;
118
+ }>;
119
+ /**
120
+ * Every work lease in the ledger with `memberPrefix`, read from the local
121
+ * refs only: the lease refs this clone wrote, and the remote's as last
122
+ * fetched (`refs/chant/lease-remote/`), the fresher of the two per item, as
123
+ * `readLease` picks. It never fetches, so a read-only report stays off the
124
+ * network; a claim or renew fetches before it decides. Released leases have
125
+ * no ref and are not listed; expired ones are, with `state: "expired"`.
126
+ * Sorted by item.
127
+ */
128
+ export declare function listWorkLeases(opts: {
129
+ cwd: string;
130
+ memberPrefix: string;
131
+ now?: Date;
132
+ }): Promise<WorkLeaseState[]>;
133
+ /**
134
+ * The active lease of each work item of the kind at `kindFile`, by item id,
135
+ * for `chant workspace records --json`. Read from the local refs of the
136
+ * ledger owning the kind file's directory, without fetching. Empty when
137
+ * nothing can be read.
138
+ */
139
+ export declare function activeWorkLeases(kindFile: string, now?: Date): Promise<Map<string, Omit<WorkLease, "item">>>;
140
+ //# sourceMappingURL=work-lease.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-lease.d.ts","sourceRoot":"","sources":["../../src/lifecycle/work-lease.ts"],"names":[],"mappings":"AAqDA,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAE7C,8GAA8G;AAC9G,eAAO,MAAM,UAAU,YAAY,CAAC;AAEpC,wGAAwG;AACxG,eAAO,MAAM,yBAAyB,QAAc,CAAC;AAErD,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,QAAsC,CAAC;AAMxE,uCAAuC;AACvC,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,MAAM,CAElE;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY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A;CAAE,CAiBvG;AAED,8GAA8G;AAC9G,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAIvI;AAaD;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAyBvH;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAa,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CASxH"}
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Core lint rules for chant projects (COR + EVL).
2
+ * Core lint rules for chant projects (COR + EVL, and SYS001 for the `decide`
3
+ * activity's backends, #2828).
3
4
  */
4
5
  import type { LintRule } from "../rule.js";
5
6
  export { flatDeclarationsRule } from "./flat-declarations.js";
@@ -27,9 +28,10 @@ export { cor018CompositePreferLexiconTypeRule } from "./cor018-composite-prefer-
27
28
  export { cor021EnvLiteralNameRule } from "./cor021-env-literal-name.js";
28
29
  export { cor022ReceiptLeafRule, collectReceiptVariables, receiptFactoryCall } from "./cor022-receipt-leaf.js";
29
30
  export { cor024ReceiptSecretPointerRule } from "./cor024-receipt-secret-pointer.js";
31
+ export { noLiteralKeyRule } from "./sys001-no-literal-key.js";
30
32
  export { isInsideCompositeFactory } from "./composite-scope.js";
31
33
  /**
32
- * Load all 24 core lint rules (COR + EVL).
34
+ * Load all core lint rules (COR + EVL + SYS001).
33
35
  */
34
36
  export declare function loadCoreRules(): LintRule[];
35
37
  //# sourceMappingURL=index.d.ts.map