@astrosheep/keiyaku 4.6.26 → 4.6.28

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 (301) hide show
  1. package/README.md +113 -35
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +14 -26
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +64 -44
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +13 -25
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +42 -29
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +13 -8
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +57 -61
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +14 -26
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +64 -44
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +13 -25
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +42 -29
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +13 -8
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +57 -61
  18. package/build/plugins/opencode/package.json +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +14 -26
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +64 -44
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +13 -25
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +42 -29
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +13 -8
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +57 -61
  26. package/build/plugins/pi/README.md +7 -12
  27. package/build/plugins/pi/akuma-tools.ts +3 -18
  28. package/build/skills/keiyaku/SKILL.md +14 -26
  29. package/build/skills/keiyaku-akuma/SKILL.md +64 -44
  30. package/build/skills/keiyaku-akuma/references/automation.md +13 -25
  31. package/build/skills/keiyaku-babysit/SKILL.md +1 -1
  32. package/build/skills/keiyaku-bind/SKILL.md +42 -29
  33. package/build/skills/keiyaku-debt/SKILL.md +13 -8
  34. package/build/skills/keiyaku-workflow/SKILL.md +57 -61
  35. package/build/src/akuma/akuma-call.d.ts +15 -18
  36. package/build/src/akuma/akuma-call.js +55 -112
  37. package/build/src/akuma/akuma-errors.d.ts +0 -5
  38. package/build/src/akuma/akuma-errors.js +0 -9
  39. package/build/src/akuma/akuma-instance.d.ts +0 -2
  40. package/build/src/akuma/akuma-instance.js +18 -14
  41. package/build/src/akuma/akuma-observe.js +0 -1
  42. package/build/src/akuma/akuma-owner.js +0 -1
  43. package/build/src/akuma/akuma.d.ts +10 -26
  44. package/build/src/akuma/akuma.js +0 -2
  45. package/build/src/akuma/archetype.d.ts +0 -2
  46. package/build/src/akuma/archetype.js +3 -9
  47. package/build/src/akuma/body-launch.d.ts +12 -4
  48. package/build/src/akuma/body.d.ts +2 -5
  49. package/build/src/akuma/body.js +5 -49
  50. package/build/src/akuma/call-initial-tell.d.ts +39 -147
  51. package/build/src/akuma/call-initial-tell.js +0 -48
  52. package/build/src/akuma/caller.d.ts +0 -4
  53. package/build/src/akuma/custody.js +1 -57
  54. package/build/src/akuma/heart/facts.d.ts +0 -39
  55. package/build/src/akuma/heart/facts.js +0 -1
  56. package/build/src/akuma/heart/index.d.ts +1 -2
  57. package/build/src/akuma/heart/index.js +0 -1
  58. package/build/src/akuma/heart/schema.js +0 -26
  59. package/build/src/akuma/heart/soul.d.ts +2 -2
  60. package/build/src/akuma/heart/soul.js +2 -4
  61. package/build/src/akuma/identity.d.ts +0 -1
  62. package/build/src/akuma/identity.js +0 -2
  63. package/build/src/akuma/in-process-body.d.ts +1 -1
  64. package/build/src/akuma/index.d.ts +0 -2
  65. package/build/src/akuma/index.js +0 -1
  66. package/build/src/akuma/projection.d.ts +23 -23
  67. package/build/src/akuma/provider.d.ts +0 -5
  68. package/build/src/akuma/provider.js +0 -1
  69. package/build/src/akuma/providers/acp/core.js +1 -1
  70. package/build/src/akuma/providers/claude/index.js +1 -2
  71. package/build/src/akuma/providers/codex-app-server/events.d.ts +1 -1
  72. package/build/src/akuma/providers/codex-app-server/events.js +1 -3
  73. package/build/src/akuma/providers/codex-app-server/index.js +1 -1
  74. package/build/src/akuma/providers/execution-environment.d.ts +1 -3
  75. package/build/src/akuma/providers/execution-environment.js +1 -7
  76. package/build/src/akuma/providers/opencode-sdk/index.js +0 -1
  77. package/build/src/akuma/providers/opencode-sdk/session.d.ts +0 -1
  78. package/build/src/akuma/providers/opencode-sdk/session.js +4 -4
  79. package/build/src/akuma/providers/paseo/index.js +2 -9
  80. package/build/src/akuma/providers/pi/index.js +8 -14
  81. package/build/src/akuma/publication.d.ts +24 -59
  82. package/build/src/akuma/publication.js +29 -64
  83. package/build/src/akuma/selection-observation.d.ts +47 -2036
  84. package/build/src/akuma/selection-observation.js +1 -59
  85. package/build/src/akuma/turn-drive.d.ts +0 -8
  86. package/build/src/akuma/turn-drive.js +19 -103
  87. package/build/src/akuma-body.js +3 -6
  88. package/build/src/body-host.d.ts +8 -2
  89. package/build/src/body-host.js +30 -4
  90. package/build/src/cli/commands/akuma-grammar.d.ts +0 -2
  91. package/build/src/cli/commands/akuma-grammar.js +14 -37
  92. package/build/src/cli/commands/akuma.js +31 -49
  93. package/build/src/cli/commands/contract-grammar.d.ts +7 -1
  94. package/build/src/cli/commands/contract-grammar.js +15 -0
  95. package/build/src/cli/commands/contract-help.d.ts +13 -1
  96. package/build/src/cli/commands/contract-help.js +88 -81
  97. package/build/src/cli/commands/contract.js +27 -26
  98. package/build/src/cli/commands/debt-grammar.js +15 -15
  99. package/build/src/cli/commands/debt.js +3 -3
  100. package/build/src/cli/commands/install.d.ts +1 -1
  101. package/build/src/cli/commands/install.js +1 -2
  102. package/build/src/cli/commands/whoami.d.ts +0 -2
  103. package/build/src/cli/commands/whoami.js +0 -5
  104. package/build/src/cli/coordinates.js +15 -0
  105. package/build/src/cli/delivery-identity.d.ts +3 -0
  106. package/build/src/cli/delivery-identity.js +23 -0
  107. package/build/src/cli/parse.js +2 -1
  108. package/build/src/cli/render/akuma-activity.d.ts +0 -1
  109. package/build/src/cli/render/akuma-activity.js +1 -4
  110. package/build/src/cli/render/catalog.js +7 -1
  111. package/build/src/cli/render/contract-history.js +16 -38
  112. package/build/src/cli/render/contract-observation.d.ts +23 -10
  113. package/build/src/cli/render/contract-observation.js +9 -6
  114. package/build/src/cli/render/contract-wait.d.ts +2 -0
  115. package/build/src/cli/render/contract-wait.js +18 -0
  116. package/build/src/cli/render/contract.d.ts +2 -2
  117. package/build/src/cli/render/contract.js +57 -39
  118. package/build/src/cli/render/delivery-preview.js +13 -26
  119. package/build/src/cli/render/execution-progress.js +9 -9
  120. package/build/src/cli/render/kanshi.js +4 -11
  121. package/build/src/cli/render/receipt.d.ts +18 -0
  122. package/build/src/cli/render/receipt.js +34 -10
  123. package/build/src/cli/render/reconcile.js +3 -0
  124. package/build/src/cli/render/refusal.js +28 -6
  125. package/build/src/cli/render/whoami.js +1 -4
  126. package/build/src/cli/runtime.d.ts +0 -2
  127. package/build/src/cli/runtime.js +3 -7
  128. package/build/src/cli/selectors.d.ts +1 -2
  129. package/build/src/cli/selectors.js +2 -5
  130. package/build/src/contract-guidance.js +4 -2
  131. package/build/src/contract-worktree.d.ts +3 -3
  132. package/build/src/core/facts/codec.js +38 -5
  133. package/build/src/core/facts/fold.js +1 -0
  134. package/build/src/core/facts/gate.d.ts +10 -4
  135. package/build/src/core/facts/gate.js +56 -39
  136. package/build/src/core/facts/observation.d.ts +7 -1
  137. package/build/src/core/facts/observation.js +15 -0
  138. package/build/src/core/facts/offer.d.ts +2 -2
  139. package/build/src/core/facts/types.d.ts +17 -1
  140. package/build/src/core/facts/types.js +6 -0
  141. package/build/src/core/verbs/amend.js +8 -0
  142. package/build/src/core/verbs/bind.d.ts +3 -1
  143. package/build/src/core/verbs/bind.js +9 -1
  144. package/build/src/core/verbs/deliver.d.ts +2 -1
  145. package/build/src/core/verbs/deliver.js +4 -1
  146. package/build/src/core/verbs/placement.d.ts +2 -1
  147. package/build/src/core/verbs/placement.js +7 -4
  148. package/build/src/core/verbs/reintegrate.d.ts +2 -1
  149. package/build/src/core/verbs/reintegrate.js +4 -1
  150. package/build/src/debt/board.d.ts +10 -10
  151. package/build/src/debt/created-observation.d.ts +3 -3
  152. package/build/src/debt/document.d.ts +1 -1
  153. package/build/src/debt/index.d.ts +2 -24
  154. package/build/src/debt/index.js +11 -71
  155. package/build/src/debt/operation-types.d.ts +44 -3
  156. package/build/src/git/admission.js +18 -6
  157. package/build/src/git/integration.d.ts +4 -4
  158. package/build/src/git/integration.js +7 -1
  159. package/build/src/git/observe.d.ts +6 -4
  160. package/build/src/git/observe.js +18 -17
  161. package/build/src/git/reconcile.d.ts +20 -8
  162. package/build/src/git/reconcile.js +94 -45
  163. package/build/src/git/repository.d.ts +3 -1
  164. package/build/src/git/repository.js +26 -4
  165. package/build/src/git/scratch.d.ts +1 -1
  166. package/build/src/git/scratch.js +19 -18
  167. package/build/src/git/target-placement.d.ts +33 -7
  168. package/build/src/git/target-placement.js +67 -18
  169. package/build/src/git/target.d.ts +32 -0
  170. package/build/src/git/target.js +84 -0
  171. package/build/src/git/terminal-reconcile.d.ts +1 -1
  172. package/build/src/git/terminal-reconcile.js +34 -6
  173. package/build/src/index.d.ts +9 -7
  174. package/build/src/index.js +1 -1
  175. package/build/src/library/address.d.ts +1 -20
  176. package/build/src/library/address.js +3 -24
  177. package/build/src/library/akuma-creation.d.ts +2 -5
  178. package/build/src/library/akuma-creation.js +60 -44
  179. package/build/src/library/akumas.d.ts +3 -9
  180. package/build/src/library/akumas.js +12 -25
  181. package/build/src/library/bind.d.ts +21 -9
  182. package/build/src/library/bind.js +5 -1
  183. package/build/src/library/continuation.d.ts +130 -155
  184. package/build/src/library/continuation.js +1 -4
  185. package/build/src/library/contract-composition.d.ts +4 -9
  186. package/build/src/library/contract-composition.js +8 -12
  187. package/build/src/library/contract-creation.d.ts +1 -3
  188. package/build/src/library/contract-creation.js +2 -3
  189. package/build/src/library/contract-execution.d.ts +3 -5
  190. package/build/src/library/contract-execution.js +55 -96
  191. package/build/src/library/contract-outcomes.d.ts +2 -1
  192. package/build/src/library/contract-types.d.ts +5 -0
  193. package/build/src/library/contract-wait.d.ts +35 -0
  194. package/build/src/library/contract-wait.js +141 -0
  195. package/build/src/library/delivery.d.ts +13 -525
  196. package/build/src/library/delivery.js +1 -12
  197. package/build/src/library/input.js +2 -1
  198. package/build/src/library/invocation.d.ts +5 -1
  199. package/build/src/library/invocation.js +9 -2
  200. package/build/src/library/keiyaku.d.ts +7 -6
  201. package/build/src/library/keiyaku.js +12 -7
  202. package/build/src/library/outcome.d.ts +461 -12586
  203. package/build/src/library/outcome.js +15 -234
  204. package/build/src/library/reconcile.d.ts +12 -0
  205. package/build/src/library/reconcile.js +1 -0
  206. package/build/src/library/refusal.d.ts +251 -34
  207. package/build/src/library/refusal.js +10 -5
  208. package/build/src/library/selection.d.ts +9 -35
  209. package/build/src/library/selection.js +59 -129
  210. package/build/src/plugin/akuma-signals.d.ts +2 -2
  211. package/build/src/plugin/akuma-signals.js +2 -2
  212. package/build/src/plugin/public.d.ts +0 -7
  213. package/build/src/plugin/runtime.d.ts +2 -2
  214. package/build/src/plugin/runtime.js +4 -3
  215. package/build/src/protocol/attempt.js +7 -3
  216. package/build/src/protocol/bind.d.ts +18 -4
  217. package/build/src/protocol/bind.js +102 -35
  218. package/build/src/protocol/completion.d.ts +18 -331
  219. package/build/src/protocol/completion.js +17 -130
  220. package/build/src/protocol/deliver.d.ts +3 -3
  221. package/build/src/protocol/deliver.js +64 -74
  222. package/build/src/protocol/delivery-preview.d.ts +85 -28
  223. package/build/src/protocol/delivery-preview.js +34 -22
  224. package/build/src/protocol/execution-observation.d.ts +12 -9
  225. package/build/src/protocol/execution-observation.js +0 -1
  226. package/build/src/protocol/intent.d.ts +20 -50
  227. package/build/src/protocol/intent.js +37 -44
  228. package/build/src/protocol/operations.d.ts +299 -19
  229. package/build/src/protocol/operations.js +68 -27
  230. package/build/src/protocol/outcome.d.ts +1 -1
  231. package/build/src/protocol/placement.d.ts +2 -2
  232. package/build/src/protocol/placement.js +4 -3
  233. package/build/src/protocol/progress.d.ts +35 -2
  234. package/build/src/protocol/progress.js +12 -1
  235. package/build/src/protocol/read/observation.js +15 -4
  236. package/build/src/protocol/read/status.d.ts +9 -14
  237. package/build/src/protocol/read/status.js +15 -22
  238. package/build/src/protocol/reintegrate.d.ts +4 -3
  239. package/build/src/protocol/reintegrate.js +21 -5
  240. package/build/src/protocol/review.d.ts +9 -15
  241. package/build/src/protocol/review.js +2 -6
  242. package/build/src/protocol/run.d.ts +1 -1
  243. package/build/src/protocol/verify.d.ts +51 -0
  244. package/build/src/protocol/verify.js +128 -0
  245. package/build/src/runtime/proc/windows-launch.exe +0 -0
  246. package/build/src/verification/declaration.d.ts +5 -1
  247. package/build/src/verification/declaration.js +19 -2
  248. package/build/src/verification/execution.d.ts +5 -2
  249. package/build/src/verification/execution.js +48 -53
  250. package/build/src/verification/observation.d.ts +10 -6
  251. package/build/src/verification/observation.js +5 -2
  252. package/package.json +3 -3
  253. package/plugins/paseo/plugin/index.server.ts +3 -0
  254. package/plugins/paseo/plugin/server/attach.ts +42 -0
  255. package/plugins/paseo/plugin/server/mirror-identity.ts +51 -0
  256. package/plugins/paseo/plugin/server/model.ts +26 -0
  257. package/plugins/paseo/plugin/server/provider.ts +4 -6
  258. package/plugins/paseo/plugin/server/reopen.ts +4 -39
  259. package/plugins/pi/README.md +7 -12
  260. package/plugins/pi/akuma-tools.ts +3 -18
  261. package/skills/keiyaku/SKILL.md +14 -26
  262. package/skills/keiyaku-akuma/SKILL.md +64 -44
  263. package/skills/keiyaku-akuma/references/automation.md +13 -25
  264. package/skills/keiyaku-babysit/SKILL.md +1 -1
  265. package/skills/keiyaku-bind/SKILL.md +42 -29
  266. package/skills/keiyaku-debt/SKILL.md +13 -8
  267. package/skills/keiyaku-workflow/SKILL.md +57 -61
  268. package/build/src/akuma/allowed.d.ts +0 -23
  269. package/build/src/akuma/allowed.js +0 -63
  270. package/build/src/akuma/call-request.d.ts +0 -308
  271. package/build/src/akuma/call-request.js +0 -175
  272. package/build/src/akuma/heart/request-authority.d.ts +0 -16
  273. package/build/src/akuma/heart/request-authority.js +0 -140
  274. package/build/src/akuma/heart/request-rows.d.ts +0 -18
  275. package/build/src/akuma/heart/request-rows.js +0 -107
  276. package/build/src/akuma/request-lifecycle.d.ts +0 -42
  277. package/build/src/akuma/request-lifecycle.js +0 -197
  278. package/build/src/akuma/request-observation.d.ts +0 -45
  279. package/build/src/akuma/request-observation.js +0 -162
  280. package/build/src/akuma/request-rendezvous.d.ts +0 -32
  281. package/build/src/akuma/request-rendezvous.js +0 -189
  282. package/build/src/akuma/request-serve.d.ts +0 -16
  283. package/build/src/akuma/request-serve.js +0 -188
  284. package/build/src/akuma/request-wire.d.ts +0 -143
  285. package/build/src/akuma/request-wire.js +0 -146
  286. package/build/src/akuma/requests.d.ts +0 -20
  287. package/build/src/akuma/requests.js +0 -72
  288. package/build/src/akuma/selection-owner-port.d.ts +0 -14
  289. package/build/src/akuma/selection-owner-port.js +0 -54
  290. package/build/src/akuma/selection-request.d.ts +0 -305
  291. package/build/src/akuma/selection-request.js +0 -307
  292. package/build/src/body-requests.d.ts +0 -13
  293. package/build/src/body-requests.js +0 -131
  294. package/build/src/cli/square-identity.d.ts +0 -10
  295. package/build/src/cli/square-identity.js +0 -130
  296. package/build/src/debt/mutation-result.d.ts +0 -981
  297. package/build/src/debt/mutation-result.js +0 -109
  298. package/build/src/debt/mutation.d.ts +0 -424
  299. package/build/src/debt/mutation.js +0 -223
  300. package/build/src/library/contract-operations.d.ts +0 -382
  301. package/build/src/library/contract-operations.js +0 -300
@@ -1,6 +1,7 @@
1
+ import { targetName } from "../../core/facts/types.js";
1
2
  import { effectCleanup, effectExecutionStops, effectLags, effectRecoverySnapshot, effectRetainedCheckouts, effectRetainedWorktrees, effectRetiredWorktrees, effectSettlementLags, } from "./effects.js";
2
3
  import { renderDeliveryPreview } from "./delivery-preview.js";
3
- import { appendHookPayload, executionCleanupLines, executionStopLines, gatesAwaitLines, hookFailureSummary, outcomeLines, receiptPayload, receiptRow, stopLines, titleLines, } from "./receipt.js";
4
+ import { appendHookPayload, executionCleanupLines, executionStopLines, gatesAwaitLines, hookFailureSummary, outcomeLines, standingGateLines, placementLines, receiptPayload, receiptRow, stopLines, titleLines, } from "./receipt.js";
4
5
  import { abbreviateGitIds, displayGitId, lifecycleWord } from "./contract-observation.js";
5
6
  import { renderDiffstat } from "./akuma-tool.js";
6
7
  import { DEFAULT_CLI_COLUMNS, renderOpaqueBlock, safeText, tone } from "./terminal.js";
@@ -12,7 +13,8 @@ function attestationVerdict(facts) {
12
13
  return attestation.data.verdict;
13
14
  }
14
15
  function bindTarget(facts) {
15
- return facts.findLast((fact) => fact.kind === "bind")?.data.coordinates.target ?? null;
16
+ const target = facts.findLast((fact) => fact.kind === "bind")?.data.coordinates.target;
17
+ return target === undefined ? null : targetName(target);
16
18
  }
17
19
  function arcChapter(facts) {
18
20
  const arc = facts.findLast((fact) => fact.kind === "arc");
@@ -53,6 +55,9 @@ function lagRows(lag, columns) {
53
55
  receiptRow(lines, "!", "lag", [{ text: `contract-file-failed ${lag.worktree} ${lag.path}`, opaque: true }], columns);
54
56
  receiptPayload(lines, "reason", lag.diagnostic);
55
57
  }
58
+ else if (lag.kind === "target-workspace-retained") {
59
+ receiptRow(lines, "!", "target workspace unavailable", [{ text: lag.contractId, opaque: true }, { text: lag.reason.replaceAll("-", " ") }], columns);
60
+ }
56
61
  else {
57
62
  receiptRow(lines, "!", "lag", [{ text: `reconcile-failed ${lag.stage}`, opaque: true }], columns);
58
63
  receiptPayload(lines, "reason", lag.diagnostic);
@@ -211,15 +216,7 @@ function landedChangesLines(scope, columns) {
211
216
  receiptRow(lines, " ", "changes", [{ text: `${files} · ${renderDiffstat({ added: scope.insertions, removed: scope.deletions })}` }], columns);
212
217
  return lines;
213
218
  }
214
- /**
215
- * Shared presentation of a completed placement, so a deliver and a review that placed the same candidate read
216
- * identically: one git-shaped target movement row, naming the reference it advanced, then the final lifecycle
217
- * state. Satisfied Verification adds one fact row naming the integrated result; placement made that commit the
218
- * reference's new head, so the movement and integrated-result rows share one sha. The verdict names reuse in the
219
- * standing-evidence vocabulary and carries no qualifier when this command executed declarations. A completion
220
- * without an advanced reference states no movement. Journal ULIDs stay in JSON and `history`, never in ordinary
221
- * receipt text.
222
- */
219
+ /** One Git movement grammar for completion, independent of which operation triggered it. */
223
220
  function completedPlacementLines(result, columns) {
224
221
  const completion = result.value.completion;
225
222
  if (completion === undefined)
@@ -240,14 +237,6 @@ function completedPlacementLines(result, columns) {
240
237
  { text: completion.target, opaque: true },
241
238
  ], columns);
242
239
  }
243
- const verification = result.value.verification;
244
- if (verification?.kind !== "stopped" && verification?.verdict === "satisfied") {
245
- receiptRow(lines, " ", "integration result", [
246
- {
247
- text: `${displayGitId(completion.integration, abbreviations)} · verification ${verification.kind === "reused" ? "reused " : ""}satisfied`,
248
- },
249
- ], columns);
250
- }
251
240
  lines.push(...landedChangesLines(completion.scope, columns));
252
241
  // Placement admission always admits the claim entry beside the movement, so a completed placement is accepted.
253
242
  receiptRow(lines, "✓", lifecycleWord("claimed"), [], columns);
@@ -334,51 +323,40 @@ function deliverIdentityLines(result, abbreviations, columns, kept) {
334
323
  receiptRow(lines, " ", "integration", [{ text: `${displayGitId(reusedIntegration, abbreviations)} reused · commit message kept from first delivery` }], columns);
335
324
  return lines;
336
325
  }
337
- function deliveryIdentityAbbreviations(value, verificationSnapshot) {
326
+ function deliveryIdentityAbbreviations(value) {
338
327
  return abbreviateGitIds([
339
328
  value.tenderSnapshot ?? "",
340
329
  value.integration?.changeId ?? "",
341
330
  value.integration.snapshot,
342
331
  value.contentChange?.previousChange ?? "",
343
332
  value.contentChange?.currentChange ?? "",
344
- verificationSnapshot ?? "",
345
333
  value.completion?.predecessor ?? "",
346
334
  value.completion?.integration ?? "",
347
335
  ]);
348
336
  }
349
337
  function renderAcceptedDeliver(result, columns) {
350
338
  const complete = result.value.completion !== undefined;
351
- const verification = result.value.verification;
352
- const subject = verification?.kind === "stopped" ? undefined : verification;
353
339
  const lines = titleLines("✓", "delivered", result.contract, columns);
354
- const abbreviations = deliveryIdentityAbbreviations(result.value, subject?.snapshot);
340
+ const abbreviations = deliveryIdentityAbbreviations(result.value);
355
341
  lines.push(...deliverIdentityLines(result, abbreviations, columns, !complete));
342
+ if ((result.value.gates?.length ?? 0) > 0)
343
+ receiptRow(lines, " ", "integration result", [{ text: displayGitId(result.value.integration.snapshot, abbreviations) }], columns);
344
+ lines.push(...standingGateLines(result.value.gates, columns));
356
345
  if (complete)
357
346
  lines.push(...completedPlacementLines(result, columns));
358
- else {
359
- if (subject !== undefined)
360
- receiptRow(lines, " ", "integration result", [
361
- {
362
- text: `${displayGitId(subject.snapshot, abbreviations)} · verification ${subject.kind === "reused" ? "reused " : ""}${subject.verdict}`,
363
- },
364
- ], columns);
347
+ else
365
348
  lines.push(...movementLines(result, columns));
366
- }
367
- if (verification?.kind === "stopped")
368
- lines.push(...stopLines(verification.stop, columns, result.contract));
369
349
  if (!complete && result.value.placement !== undefined)
370
- lines.push(...stopLines(result.value.placement, columns, result.contract));
350
+ lines.push(...placementLines(result.value.placement, columns, result.contract));
371
351
  lines.push(...continuationLines(result, columns), ...recordBlock(result, columns), ...worktreeRetirementLines(result, columns), ...gatesAwaitLines(result.value.placement));
372
352
  return lines.join("\n");
373
353
  }
374
354
  function renderAcceptedReview(result, columns) {
375
355
  const lines = titleLines("✓", `review ${attestationVerdict(result.facts)}`, result.contract, columns);
356
+ lines.push(...standingGateLines(result.value.gates, columns));
376
357
  lines.push(...completedPlacementLines(result, columns));
377
- if (result.value.verification?.kind === "stopped") {
378
- lines.push(...stopLines(result.value.verification.stop, columns, result.contract));
379
- }
380
358
  if (result.value.placement !== undefined) {
381
- lines.push(...stopLines(result.value.placement, columns, result.contract));
359
+ lines.push(...placementLines(result.value.placement, columns, result.contract));
382
360
  }
383
361
  lines.push(...continuationLines(result, columns));
384
362
  lines.push(...recordBlock(result, columns));
@@ -386,6 +364,44 @@ function renderAcceptedReview(result, columns) {
386
364
  lines.push(...gatesAwaitLines(result.value.placement));
387
365
  return lines.join("\n");
388
366
  }
367
+ function renderAcceptedVerify(result, columns) {
368
+ const lines = titleLines("✓", "verify", result.contract, columns);
369
+ const abbreviations = abbreviateGitIds([
370
+ result.value.snapshot,
371
+ ...result.value.checks.map((check) => check.snapshot),
372
+ result.value.completion?.integration ?? "",
373
+ result.value.completion?.predecessor ?? "",
374
+ ]);
375
+ for (const check of result.value.checks) {
376
+ receiptRow(lines, " ", `check ${check.index}`, [
377
+ { text: check.kind === "terminal" ? "executed" : "execution stopped" },
378
+ { text: check.requirement, opaque: true },
379
+ { text: `· snapshot ${displayGitId(check.snapshot, abbreviations)}` },
380
+ ], columns);
381
+ if (check.kind === "terminal") {
382
+ receiptRow(lines, check.verdict === "satisfied" ? "✓" : "×", "verdict", [{ text: check.verdict }], columns);
383
+ if (check.summary !== undefined)
384
+ receiptPayload(lines, "summary", check.summary);
385
+ if (check.admission.kind === "stopped") {
386
+ receiptRow(lines, "!", "admission", [{ text: "stopped" }], columns);
387
+ lines.push(...stopLines(check.admission.stop, columns, result.contract));
388
+ }
389
+ else
390
+ receiptRow(lines, " ", "attestation", [{ text: check.admission.kind }], columns);
391
+ }
392
+ else {
393
+ lines.push(...stopLines(check.stop, columns, result.contract));
394
+ }
395
+ if (check.retainedPath !== undefined)
396
+ receiptRow(lines, " ", "scratch retained", [{ text: check.retainedPath, opaque: true }], columns);
397
+ }
398
+ lines.push(...standingGateLines(result.value.gates, columns));
399
+ lines.push(...completedPlacementLines(result, columns));
400
+ if (result.value.placement !== undefined)
401
+ lines.push(...placementLines(result.value.placement, columns, result.contract));
402
+ lines.push(...continuationLines(result, columns), ...recordBlock(result, columns), ...worktreeRetirementLines(result, columns), ...gatesAwaitLines(result.value.placement));
403
+ return lines.join("\n");
404
+ }
389
405
  function renderAcceptedArc(result, columns) {
390
406
  const lines = titleLines("✓", `chapter ${arcChapter(result.facts).seq} opened · ${arcChapter(result.facts).title}`, result.contract, columns);
391
407
  lines.push(...recordBlock(result, columns));
@@ -409,6 +425,8 @@ export function renderAccepted(result, context) {
409
425
  return renderAcceptedBind(result, columns, context?.color === true);
410
426
  case "amend":
411
427
  return renderAcceptedAmend(result, columns, context?.color === true);
428
+ case "verify":
429
+ return renderAcceptedVerify(result, columns);
412
430
  case "review":
413
431
  return renderAcceptedReview(result, columns);
414
432
  case "arc":
@@ -1,7 +1,7 @@
1
1
  import { effectCleanup, effectExecutionStops } from "./effects.js";
2
- import { executionCleanupLines, executionStopLines, receiptPayload, receiptRow, titleLines } from "./receipt.js";
2
+ import { executionCleanupLines, executionStopLines, standingGateLines, receiptPayload, receiptRow, titleLines, } from "./receipt.js";
3
3
  import { renderRefusalFacts } from "./refusal.js";
4
- import { abbreviateGitIds, displayGitId, gateFact } from "./contract-observation.js";
4
+ import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
5
5
  import { DEFAULT_CLI_COLUMNS, gitShortStat, renderTextBlock, safeText } from "./terminal.js";
6
6
  const CHILD = " ";
7
7
  function workspaceEvidence(workspace) {
@@ -21,8 +21,7 @@ function candidateLines(report, columns, addressed, abbreviations) {
21
21
  if (!/^0{40}$/u.test(identity.integration.changeId))
22
22
  lines.push(`${CHILD}content identity ${displayGitId(identity.integration.changeId, abbreviations)}`);
23
23
  lines.push(...workspaceEvidence(candidate.workspace));
24
- for (const report of candidate.requirements.gates)
25
- lines.push(`${CHILD}${gateFact(report)}`);
24
+ lines.push(...standingGateLines(candidate.requirements.gates.filter((report) => report.gate !== "verified"), columns));
26
25
  for (const prerequisite of candidate.requirements.unmetPrerequisites) {
27
26
  receiptRow(lines, "!", "prerequisite", [{ text: prerequisite.contractId }, { text: prerequisite.state }], columns);
28
27
  }
@@ -37,34 +36,22 @@ function candidateLines(report, columns, addressed, abbreviations) {
37
36
  return lines;
38
37
  }
39
38
  function verificationLines(verification, columns) {
39
+ if (verification.kind === "requirements")
40
+ return standingGateLines([{ gate: "verified", requirements: verification.requirements }], columns);
40
41
  const lines = [];
41
- if (verification.kind !== "recorded") {
42
- const text = verification.kind === "undeclared"
43
- ? "none declared"
44
- : verification.kind === "required"
45
- ? "required · not run"
46
- : "not run";
47
- receiptRow(lines, " ", "verification", [{ text }], columns);
48
- return lines;
49
- }
50
- receiptRow(lines, verification.verdict === "unsatisfied" ? "!" : " ", "verification", [{ text: "recorded" }, { text: verification.verdict }], columns);
51
- if (verification.summary !== undefined)
52
- receiptPayload(lines, "summary", previewSummary(verification.summary));
42
+ receiptRow(lines, " ", "verification", [{ text: verification.kind === "undeclared" ? "none declared" : "not run" }], columns);
53
43
  return lines;
54
44
  }
55
- function previewSummary(summary) {
56
- return summary.replace(/\[(\d+) (bash|zsh|pwsh) exit (-?\d+)( output-truncated)?\]/gu, (_, number, executor, exit, truncated) => `declaration ${number} · ${executor} exit ${exit}${truncated ?? ""}`);
57
- }
58
45
  function admittedCandidateLines(report, columns) {
59
- const delivery = report.delivery;
60
- if (delivery === undefined)
61
- return [];
62
- const verification = delivery.verification;
63
- if (verification.kind === "undeclared")
46
+ if (report.delivery === undefined)
64
47
  return [];
65
- const detail = verification.kind === "recorded" ? `${verification.kind} ${verification.verdict}` : verification.kind;
66
48
  const lines = [];
67
- receiptRow(lines, verification.kind === "unrecorded" ? "!" : " ", "admitted verification", [{ text: detail }], columns);
49
+ receiptRow(lines, " ", "admitted candidate", [
50
+ { text: report.delivery.relation },
51
+ {
52
+ text: `· content identity ${displayGitId(report.delivery.changeId, abbreviateGitIds([report.delivery.changeId]))}`,
53
+ },
54
+ ], columns);
68
55
  return lines;
69
56
  }
70
57
  function targetLines(report, columns, addressed, abbreviations) {
@@ -1,3 +1,4 @@
1
+ import { shortGitId } from "./contract-observation.js";
1
2
  import { StatusLine } from "./status-line.js";
2
3
  import { renderOpaqueBlock, safeText } from "./terminal.js";
3
4
  const LIVE_OUTPUT_BYTES = 4 * 1024;
@@ -18,9 +19,10 @@ function elapsed(ms) {
18
19
  return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m${seconds % 60}s`;
19
20
  }
20
21
  function phaseDetail(observation) {
21
- if (observation.phase === "declaration")
22
- return `declaration ${observation.index ?? "?"}/${observation.total ?? "?"}`;
23
- return observation.name === undefined ? observation.phase : `${observation.phase} · ${safeText(observation.name)}`;
22
+ const detail = observation.phase === "declaration"
23
+ ? `declaration ${observation.index}/${observation.total}`
24
+ : `${observation.phase} · check ${observation.index}/${observation.total}${observation.name === undefined ? "" : ` · ${safeText(observation.name)}`}`;
25
+ return `${detail} · snapshot ${shortGitId(observation.snapshot)} · ${safeText(observation.requirement)}`;
24
26
  }
25
27
  function phaseMark(outcome) {
26
28
  if (outcome === undefined)
@@ -127,8 +129,6 @@ export function executionProgressLines(event, context) {
127
129
  return outputLines(event.observation, context);
128
130
  return event.observation.state === "started" ? [] : [phaseFinishLine(event.observation)];
129
131
  }
130
- case "progress-dropped":
131
- return [`progress dropped ${event.count} event${event.count === 1 ? "" : "s"}`];
132
132
  }
133
133
  }
134
134
  /** Consumes witnessed events into either a live TTY line or sparse text. */
@@ -158,8 +158,8 @@ export class ExecutionProgressRenderer {
158
158
  const now = this.input.now ?? (() => performance.now());
159
159
  const duration = elapsed(now() - this.verificationStartedAt);
160
160
  if (this.declarations !== undefined) {
161
- const { passed, total } = this.declarations;
162
- this.status.finish(`verify ${this.finalMark()} ${passed}/${total} · ${duration}`);
161
+ const { passed, finished } = this.declarations;
162
+ this.status.finish(`verify ${this.finalMark()} ${passed}/${finished} checks · ${duration}`);
163
163
  return;
164
164
  }
165
165
  this.status.finish(`verify ${this.finalMark()} · ${duration}`);
@@ -183,9 +183,9 @@ export class ExecutionProgressRenderer {
183
183
  this.phaseFailed ||= mark === "×";
184
184
  this.phaseUnknown ||= mark === "?";
185
185
  if (observation.phase === "declaration") {
186
- const total = observation.total ?? this.declarations?.total ?? 0;
186
+ const finished = (this.declarations?.finished ?? 0) + 1;
187
187
  const passed = (this.declarations?.passed ?? 0) + (mark === "✓" ? 1 : 0);
188
- this.declarations = { passed, total };
188
+ this.declarations = { passed, finished };
189
189
  this.declarationFailed ||= mark !== "✓";
190
190
  }
191
191
  if (this.status.isTTY)
@@ -1,4 +1,4 @@
1
- import { abbreviateGitIds, afterWording, progressStrip, displayGitId, gateFact, gitIdsInRow, lifecycleWord, mergeSummary, targetMovementFacts, verificationFact, } from "./contract-observation.js";
1
+ import { abbreviateGitIds, afterWording, progressStrip, displayGitId, gateRequirementFacts, gitIdsInRow, lifecycleWord, mergeSummary, targetMovementFacts, } from "./contract-observation.js";
2
2
  import { DEFAULT_CLI_COLUMNS, emptyCatalogue, entityLines, elapsedMilliseconds, identityLine, plumbFacts, RECENT_TONE_MS, renderBoundedPayload, renderSectionBlock, safeText, tone, } from "./terminal.js";
3
3
  import { endpointFact, formatAge, NARROW_COLUMNS, renderAkuma, renderAkumaBoard } from "./kanshi-akuma.js";
4
4
  import { contractMark, debtDispositionMark } from "./marks.js";
@@ -128,12 +128,6 @@ function terminalFacts(row, context, abbreviations) {
128
128
  : []),
129
129
  ];
130
130
  }
131
- function staleVerificationFacts(row) {
132
- if (row.verification?.kind !== "recorded" || row.verification.snapshot === row.delivery?.integration.snapshot)
133
- return [];
134
- const fact = verificationFact(row.verification);
135
- return fact === undefined ? [] : [fact];
136
- }
137
131
  function renderSelectedContractRow(row, facts, context, abbreviations) {
138
132
  const title = row.title ?? "title unavailable";
139
133
  const statusTone = contractStatusTone(row, facts.observedAt);
@@ -155,17 +149,15 @@ function renderSelectedContractRow(row, facts, context, abbreviations) {
155
149
  const deniedReview = row.gates.reports.find((gate) => gate.gate === "reviewed" && gate.current.kind === "attested" && gate.current.verdict === "unsatisfied");
156
150
  lines.push(...semanticBlock("ball", [progressStrip(row)], context));
157
151
  lines.push(...semanticBlock("gates", row.gates.reports
158
- .filter((gate) => gate.current.kind !== "missing")
159
152
  .filter((gate) => gate !== deniedReview || gate.current.kind !== "attested" || gate.current.summary === undefined)
160
- .map(gateFact), context));
153
+ .flatMap(gateRequirementFacts), context));
161
154
  lines.push(...semanticBlock("prerequisites", row.after.filter((edge) => edge.endpoint.kind !== "claimed").map(afterWording), context));
162
155
  if (row.delivery !== null) {
163
156
  lines.push(...semanticBlock("candidate", [
164
157
  `candidate ${displayGitId(row.delivery.tenderSnapshot, abbreviations)}`,
165
- `integration result ${displayGitId(row.delivery.integration.snapshot, abbreviations)}${row.verification?.kind === "recorded" && row.verification.snapshot === row.delivery.integration.snapshot ? ` · verification ${row.verification.verdict}` : ""}${row.targetObservation?.drift === true ? " · target moved since" : ""}`,
158
+ `integration result ${displayGitId(row.delivery.integration.snapshot, abbreviations)}${row.targetObservation?.drift === true ? " · target moved since" : ""}`,
166
159
  ...(row.targetObservation?.drift === true ? targetMovementFacts(row, abbreviations) : []),
167
160
  ], context));
168
- lines.push(...semanticBlock("verification", staleVerificationFacts(row), context));
169
161
  }
170
162
  if (deniedReview?.current.kind === "attested" && deniedReview.current.summary !== undefined)
171
163
  lines.push(...payload("review ×", deniedReview.current.summary, context));
@@ -185,6 +177,7 @@ function renderWorldContractRow(row, facts, context, abbreviations) {
185
177
  .slice(0, 1)
186
178
  : [
187
179
  progressStrip(row),
180
+ ...row.gates.reports.filter((gate) => gate.gate === "verified").flatMap(gateRequirementFacts),
188
181
  ...(linkedAkumaSummary(row, facts.akuma) === undefined ? [] : [linkedAkumaSummary(row, facts.akuma)]),
189
182
  ...liveAlarms(row, facts.debts),
190
183
  ];
@@ -14,6 +14,24 @@ export declare function refusalLines(verb: string, facts: readonly string[], col
14
14
  export declare function titleLines(mark: string, title: string, contract: string, columns?: number): string[];
15
15
  export declare function hookFailureSummary(failure: HookFailure): string;
16
16
  export declare function appendHookPayload(lines: string[], failure: HookFailure): void;
17
+ /** Standing evidence is already adjudicated; every requirement keeps its own verdict or absence. */
18
+ export declare function standingGateLines(reports: readonly Readonly<{
19
+ gate: string;
20
+ requirements: readonly Readonly<{
21
+ requirement: string;
22
+ index?: number | undefined;
23
+ current: Readonly<{
24
+ kind: "missing" | "stale";
25
+ }> | Readonly<{
26
+ kind: "attested";
27
+ verdict: "satisfied" | "unsatisfied";
28
+ at: string;
29
+ summary?: string | undefined;
30
+ }>;
31
+ }>[];
32
+ }>[] | undefined, columns: number): readonly string[];
33
+ /** A receipt with standingGateLines has already named gate evidence once. */
34
+ export declare function placementLines(stop: PlacementStop, columns: number, addressed: string): readonly string[];
17
35
  /**
18
36
  * The pending margin statement: the not-yet-happened requirements a refused placement awaits. A gate in stale
19
37
  * state awaits the same event; when every unmet gate already holds a recorded verdict there is nothing pending and
@@ -1,4 +1,4 @@
1
- import { gateDisplayName, contractOperationName } from "./contract-observation.js";
1
+ import { gateGlyph, requirementDisplayName, contractOperationName } from "./contract-observation.js";
2
2
  import { renderRefusalFacts } from "./refusal.js";
3
3
  import { DEFAULT_CLI_COLUMNS, displayColumns, orderRefusalFacts, renderOpaqueBlock, safeText, quotedText, } from "./terminal.js";
4
4
  export function receiptRow(lines, mark, label, segments, columns) {
@@ -65,6 +65,28 @@ export function appendHookPayload(lines, failure) {
65
65
  if (failure.stderr !== undefined && failure.stderr.length > 0)
66
66
  receiptPayload(lines, "stderr", failure.stderr);
67
67
  }
68
+ /** Standing evidence is already adjudicated; every requirement keeps its own verdict or absence. */
69
+ export function standingGateLines(reports, columns) {
70
+ const lines = [];
71
+ for (const report of reports ?? []) {
72
+ for (const requirement of report.requirements) {
73
+ const { current } = requirement;
74
+ receiptRow(lines, gateGlyph(requirement), requirementDisplayName(report.gate, requirement), [{ text: current.kind === "attested" ? `recorded ${current.verdict} · at ${current.at}` : current.kind }], columns);
75
+ if (current.kind === "attested" && current.summary !== undefined)
76
+ receiptPayload(lines, "summary", current.summary);
77
+ }
78
+ }
79
+ return lines;
80
+ }
81
+ /** A receipt with standingGateLines has already named gate evidence once. */
82
+ export function placementLines(stop, columns, addressed) {
83
+ if (!("refusal" in stop) || stop.refusal.kind !== "gates-unsatisfied")
84
+ return stopLines(stop, columns, addressed);
85
+ const lines = [];
86
+ if (stop.refusal.target !== undefined)
87
+ receiptRow(lines, " ", "target", [{ text: stop.refusal.target, opaque: true }, { text: "· unchanged" }], columns);
88
+ return lines;
89
+ }
68
90
  function prerequisiteRows(stop, columns) {
69
91
  if (!("refusal" in stop) || stop.refusal?.kind !== "prerequisites-unsatisfied")
70
92
  return [];
@@ -80,12 +102,14 @@ function gateAlarmRows(stop, columns) {
80
102
  return [];
81
103
  const lines = [];
82
104
  for (const report of stop.refusal.unmet) {
83
- const { gate, current } = report;
84
- if (current.kind !== "attested")
85
- continue;
86
- receiptRow(lines, "!", gateDisplayName(gate), [{ text: `· ${current.verdict}` }, { text: `· at ${current.at}` }], columns);
87
- if (current.summary !== undefined)
88
- receiptPayload(lines, " summary", current.summary);
105
+ for (const requirement of report.requirements) {
106
+ const { current } = requirement;
107
+ if (current.kind !== "attested" || current.verdict !== "unsatisfied")
108
+ continue;
109
+ receiptRow(lines, "!", requirementDisplayName(report.gate, requirement), [{ text: `· ${current.verdict}` }, { text: `· at ${current.at}` }], columns);
110
+ if (current.summary !== undefined)
111
+ receiptPayload(lines, " summary", current.summary);
112
+ }
89
113
  }
90
114
  return lines;
91
115
  }
@@ -97,9 +121,9 @@ function gateAlarmRows(stop, columns) {
97
121
  export function gatesAwaitLines(placement) {
98
122
  if (placement === undefined || !("refusal" in placement) || placement.refusal?.kind !== "gates-unsatisfied")
99
123
  return [];
100
- const events = placement.refusal.unmet
101
- .filter((report) => report.current.kind !== "attested")
102
- .map((report) => gateDisplayName(report.gate));
124
+ const events = placement.refusal.unmet.flatMap((report) => report.requirements
125
+ .filter((requirement) => requirement.current.kind !== "attested")
126
+ .map((requirement) => requirementDisplayName(report.gate, requirement)));
103
127
  if (events.length === 0)
104
128
  return [];
105
129
  return [`⧗ awaiting ${events.join(", ")}`];
@@ -75,6 +75,9 @@ function lagRow(lines, lag, columns, contract) {
75
75
  ], columns);
76
76
  receiptRow(lines, " ", "reason", [{ text: lag.diagnostic, opaque: true }], columns);
77
77
  break;
78
+ case "target-workspace-retained":
79
+ receiptRow(lines, "!", "target workspace unavailable", [{ text: lag.contractId, opaque: true }, { text: `· ${lag.reason.replaceAll("-", " ")}` }], columns);
80
+ break;
78
81
  case "contract-file-failed":
79
82
  receiptRow(lines, "!", "contract file unavailable", [
80
83
  { text: lag.worktree, opaque: true },
@@ -47,6 +47,24 @@ function renderDirtyRefusal(refusal, indent, columns, identity) {
47
47
  }
48
48
  return lines;
49
49
  }
50
+ function verificationRefusalFacts(refusal, indent, identity) {
51
+ const contract = identity === undefined ? [] : [`${indent}contract ${safeText(identity)}`];
52
+ if (refusal.kind === "verification-declaration-invalid")
53
+ return [
54
+ ...contract,
55
+ `${indent}reason gate 'verified' requires a declared Verification; the Contract declares none`,
56
+ ];
57
+ if (refusal.kind === "verification-not-selected")
58
+ return [`${indent}reason Contract does not select the verified gate`, ...contract];
59
+ if (refusal.kind === "verification-index-out-of-range")
60
+ return [
61
+ `${indent}reason Verification declaration index is out of range`,
62
+ ...contract,
63
+ `${indent}index ${refusal.index}`,
64
+ `${indent}declarations ${refusal.total}`,
65
+ ];
66
+ return undefined;
67
+ }
50
68
  // eslint-disable-next-line complexity -- one closed projection preserves every refusal fact.
51
69
  function refusalFacts(refusal, indent, columns, addressed) {
52
70
  const identity = refusalIdentity(refusal, addressed);
@@ -61,12 +79,9 @@ function refusalFacts(refusal, indent, columns, addressed) {
61
79
  `${indent}option keiyaku nuke --confirm '${world.replaceAll("'", "'\"'\"'")}'`,
62
80
  ];
63
81
  }
64
- if (refusal.kind === "verification-declaration-invalid") {
65
- return [
66
- ...(identity === undefined ? [] : [`${indent}contract ${safeText(identity)}`]),
67
- `${indent}reason gate 'verified' requires a declared Verification; the Contract declares none`,
68
- ];
69
- }
82
+ const verification = verificationRefusalFacts(refusal, indent, identity);
83
+ if (verification !== undefined)
84
+ return verification;
70
85
  if (refusal.kind === "dirty-workspace")
71
86
  return renderDirtyRefusal(refusal, indent, columns, identity);
72
87
  if (refusal.kind === "unmerged-paths") {
@@ -104,6 +119,13 @@ function refusalFacts(refusal, indent, columns, addressed) {
104
119
  if (refusal.kind === "checkout-not-followable") {
105
120
  return checkoutNotFollowableLines(refusal);
106
121
  }
122
+ if (refusal.kind === "target-workspace-unavailable") {
123
+ return [
124
+ `${indent}reason target workspace unavailable`,
125
+ `${indent}contract ${safeText(refusal.contractId)}`,
126
+ `${indent}detail ${safeText(refusal.reason.replaceAll("-", " "))}`,
127
+ ];
128
+ }
107
129
  const lines = [`${indent}reason ${refusalWords(refusal.kind)}`];
108
130
  if (identity !== undefined)
109
131
  lines.push(`${indent}contract ${safeText(identity)}`);
@@ -6,9 +6,7 @@ function callerText(caller) {
6
6
  return caller.kind === "akuma" ? `${caller.akuId} · world ${caller.world}` : `${caller.integration}:${caller.id}`;
7
7
  }
8
8
  function originText(origin) {
9
- return origin.kind === "request"
10
- ? `request · ${origin.parent} · ${origin.requestId}`
11
- : `fork · ${origin.parent} · ${origin.at}`;
9
+ return `fork · ${origin.parent} · ${origin.at}`;
12
10
  }
13
11
  function selfHead(facts, dispatch, workdir) {
14
12
  const self = facts.self;
@@ -44,7 +42,6 @@ export function renderWhoami(facts) {
44
42
  const context = contextText(facts.contract);
45
43
  if (context !== dispatch)
46
44
  lines.push(row("context", context));
47
- lines.push(row("requests", facts.requests));
48
45
  if (self.kind === "akuma" && facts.profile?.kind === "unavailable")
49
46
  lines.push(row("profile", `unavailable · ${facts.profile.reason}`));
50
47
  if (profile !== undefined) {
@@ -1,4 +1,3 @@
1
- import { type LibraryExecution } from "../akuma/requests.js";
2
1
  import { type ActorId } from "../index.js";
3
2
  import type { ExecutionObserver } from "../protocol/execution-observation.js";
4
3
  import { type ParsedCommand, type ParsedInvocation } from "./parse.js";
@@ -13,7 +12,6 @@ type ExecutionProgressDriver = Readonly<{
13
12
  /** Everything one invocation's leaves need at the process edge; Product JSON never sees this. */
14
13
  export type CliRuntime = Readonly<{
15
14
  environment: NodeJS.ProcessEnv;
16
- execution: LibraryExecution;
17
15
  home?: string;
18
16
  readStdin: () => Promise<string>;
19
17
  signal: AbortSignal;
@@ -1,8 +1,7 @@
1
1
  import { AkumaNotBornError, AkumaObservationError } from "../akuma/akuma-errors.js";
2
- import { executionForEnvironment, localExecutionContext } from "../akuma/requests.js";
3
2
  import { AkumaArchetypeError } from "../index.js";
4
3
  import { AkumaAddressError, AkumaWorldScopeError } from "../library/address.js";
5
- import { encodeFailureWire, KeiyakuError } from "../library/outcome.js";
4
+ import { projectFailure, KeiyakuError } from "../library/outcome.js";
6
5
  import { isParsedAkumaCommand, runAkumaCommand } from "./commands/akuma.js";
7
6
  import { admitBindMarkdown, runContractCommand, runContractHistoryCommand } from "./commands/contract.js";
8
7
  import { installOutcome, installHarnesses, renderInstallText } from "./commands/install.js";
@@ -114,7 +113,7 @@ async function writeFailure(error, command) {
114
113
  if (error instanceof KeiyakuError) {
115
114
  const diagnostic = error.message;
116
115
  if (command.output === "json")
117
- writeJson(encodeFailureWire(error));
116
+ writeJson(projectFailure(error));
118
117
  else if (error.outcome !== undefined) {
119
118
  writeStdout(executionFailureLines(error.outcome, error.category, diagnostic, displayContext().columns).join("\n"));
120
119
  }
@@ -139,7 +138,7 @@ async function writeFailure(error, command) {
139
138
  }, () => renderStructuredRefusal("call", `${diagnostic} · ${error.archetype}`, [...error.searched.map((path) => `searched ${path}`), ...(missing ? ["available keiyaku ls aku/"] : [])], usageGuideForCommand(command)), "refused");
140
139
  }
141
140
  if (command.output === "json")
142
- writeJson(encodeFailureWire(error));
141
+ writeJson(projectFailure(error));
143
142
  else {
144
143
  const diagnostic = error instanceof Error ? error.message : String(error);
145
144
  writeStderr(error instanceof CliUsageError ? diagnostic : `× ${command.command} failed\n reason ${safeText(diagnostic)}`);
@@ -168,9 +167,6 @@ async function runCommand(invocation, input) {
168
167
  try {
169
168
  const runtime = {
170
169
  environment,
171
- execution: ["whoami", "report"].includes(command.command)
172
- ? localExecutionContext()
173
- : await executionForEnvironment(environment, cancellation.signal),
174
170
  ...(home === undefined ? {} : { home }),
175
171
  readStdin: memoized(input.readStdin ?? processStdin),
176
172
  signal: cancellation.signal,
@@ -1,10 +1,9 @@
1
- import { type ExecutionContext } from "../akuma/requests.js";
2
1
  import { Keiyaku, type ContractId, type Repo } from "../index.js";
3
2
  type SelectedContract = Readonly<{
4
3
  id: ContractId;
5
4
  contract: Keiyaku;
6
5
  }>;
7
- export declare function contractFromInput(repo: Repo, value: string, execution?: ExecutionContext): SelectedContract;
6
+ export declare function contractFromInput(repo: Repo, value: string): SelectedContract;
8
7
  /** Adapt public Contract resolution evidence to the existing CLI usage diagnostics. */
9
8
  export declare function resolveContractId(repo: Repo, selector: string | undefined, cwd: string): Promise<ContractId>;
10
9
  export declare function canonicalContractSelector(selector: string): ContractId;
@@ -1,13 +1,10 @@
1
- import { localExecutionContext } from "../akuma/requests.js";
2
1
  import { identitySegments } from "../identity/coordinates.js";
3
2
  import { Keiyaku } from "../index.js";
4
- import { composeContractLibrary } from "../library/contract-composition.js";
5
- import { createKeiyakuHandle } from "../library/keiyaku.js";
6
3
  import { CliUsageError } from "./parse.js";
7
- export function contractFromInput(repo, value, execution = localExecutionContext()) {
4
+ export function contractFromInput(repo, value) {
8
5
  try {
9
6
  const id = value;
10
- return { id, contract: composeContractLibrary(execution, createKeiyakuHandle).select({ repo, id }) };
7
+ return { id, contract: Keiyaku.with().select({ repo, id }) };
11
8
  }
12
9
  catch (error) {
13
10
  throw new CliUsageError(error instanceof Error ? error.message : String(error));
@@ -38,18 +38,20 @@ export const CONTRACT_DELIVERER_SKILL = [
38
38
  "1. Read the Contract document, the current Arc if one is dispatched, and the read-first owners and source your commission names.",
39
39
  "2. Do the work. Public outcomes — surfaces, semantics, observable behavior — are what the terms pin. Private decomposition, helper names, and control flow are yours unless the Contract explicitly pins them. Stay within the dispatched Arc; Contract lifecycle is not yours to decide.",
40
40
  "3. Stop and ask upward when you hit a contradiction between terms, an ungrounded term — one that presupposes a decision nobody has made — or an open design choice. Do not silently pick a public meaning, and do not treat an assumption in a prompt as a decided term. Standing terms change only as journaled amends.",
41
- "4. Run the Contract's Verification and gather the evidence the terms and your commission require.",
41
+ "4. Run explicit `keiyaku verify <contract>` for the Contract's selected Verification declarations and gather the required evidence. Each declaration has its own clean scratch; put prerequisites in that declaration's script or setup hook. Use `--index <n>` to run one current declaration by its one-based index, and `--include-dirty` when capturing unfinished worktree bytes is intended.",
42
42
  "5. Deliver the candidate. You owe a candidate, not decisions about the Contract: you do not hold its fulfillment loop unless your commission explicitly hands you the whole loop.",
43
43
  "",
44
44
  "## Deliver",
45
45
  "",
46
- "`deliver` creates the immutable candidate commit and prepares its integration with the target as it exists for that invocation. It runs or reuses Verification, records the candidate, and requests placement. If the target moves, run `deliver` again; Keiyaku recomputes the current-target integration. A manual rebase is optional candidate shaping, not target refresh.",
46
+ "`deliver` creates the immutable candidate commit and prepares its integration with the target as it exists for that invocation. It records the candidate and requests placement using existing evidence; it never executes Verification. Explicit `verify` can run before or after delivery. Each current requirement needs satisfied evidence for the exact integration snapshot. If the target moves, delivery recomputes the integration and the new snapshot needs its own applicable evidence. A manual rebase is optional candidate shaping, not target refresh.",
47
47
  "",
48
48
  "`keiyaku deliver` submits the current state of the whole worktree as the Contract's candidate.",
49
49
  "",
50
50
  "When the finished worktree itself is the candidate, use `deliver --include-dirty`; Keiyaku captures its complete non-ignored state without moving this worktree's HEAD or real index. When materializing a conflict, the same flag preserves those bytes as the handoff base before projecting the judged conflict.",
51
51
  "",
52
52
  "```bash",
53
+ "keiyaku verify <contract> --include-dirty",
54
+ "keiyaku verify <contract> --index 1 --include-dirty",
53
55
  "keiyaku deliver <contract> --include-dirty",
54
56
  "keiyaku deliver <contract> --materialize-conflict --include-dirty",
55
57
  "```",