@astrosheep/keiyaku 4.6.31 → 4.6.32

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 (335) hide show
  1. package/README.md +34 -17
  2. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +16 -11
  3. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +5 -3
  4. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +4 -3
  5. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +17 -17
  6. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +4 -3
  7. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +16 -11
  8. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +5 -3
  9. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +4 -3
  10. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +17 -17
  11. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +4 -3
  12. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +16 -11
  13. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +5 -3
  14. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +4 -3
  15. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +17 -17
  16. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +4 -3
  17. package/build/plugins/pi/README.md +16 -18
  18. package/build/plugins/pi/akuma-tools.ts +31 -38
  19. package/build/plugins/pi/keiyaku.ts +15 -4
  20. package/build/skills/keiyaku-akuma/SKILL.md +16 -11
  21. package/build/skills/keiyaku-babysit/SKILL.md +5 -3
  22. package/build/skills/keiyaku-bind/SKILL.md +4 -3
  23. package/build/skills/keiyaku-debt/SKILL.md +17 -17
  24. package/build/skills/keiyaku-workflow/SKILL.md +4 -3
  25. package/build/src/akuma/akuma-call.d.ts +3 -5
  26. package/build/src/akuma/akuma-call.js +7 -10
  27. package/build/src/akuma/akuma-errors.d.ts +7 -4
  28. package/build/src/akuma/akuma-errors.js +16 -12
  29. package/build/src/akuma/akuma-instance.d.ts +39 -303
  30. package/build/src/akuma/akuma-instance.js +48 -48
  31. package/build/src/akuma/akuma-observe.d.ts +5 -4
  32. package/build/src/akuma/akuma-observe.js +1 -7
  33. package/build/src/akuma/akuma-owner.d.ts +14 -6
  34. package/build/src/akuma/akuma-owner.js +33 -27
  35. package/build/src/akuma/akuma-selection-execution.d.ts +22 -19
  36. package/build/src/akuma/akuma-selection-execution.js +71 -124
  37. package/build/src/akuma/akuma-wait.d.ts +3 -3
  38. package/build/src/akuma/akuma.d.ts +47 -384
  39. package/build/src/akuma/akuma.js +8 -58
  40. package/build/src/akuma/archetype.d.ts +16 -19
  41. package/build/src/akuma/archetype.js +48 -49
  42. package/build/src/akuma/body.js +31 -26
  43. package/build/src/akuma/call-initial-tell.d.ts +4 -1
  44. package/build/src/akuma/call-initial-tell.js +9 -1
  45. package/build/src/akuma/call-input.d.ts +8 -1
  46. package/build/src/akuma/call-input.js +27 -18
  47. package/build/src/akuma/caller.js +2 -1
  48. package/build/src/akuma/detached-body.js +1 -1
  49. package/build/src/akuma/heart/facts.d.ts +5 -4
  50. package/build/src/akuma/heart/facts.js +5 -5
  51. package/build/src/akuma/heart/soul.js +20 -4
  52. package/build/src/akuma/identity.d.ts +1 -1
  53. package/build/src/akuma/identity.js +9 -4
  54. package/build/src/akuma/index.d.ts +6 -7
  55. package/build/src/akuma/index.js +2 -3
  56. package/build/src/akuma/projection.d.ts +3 -0
  57. package/build/src/akuma/provider-recipe.js +3 -2
  58. package/build/src/akuma/providers/acp/config.js +11 -10
  59. package/build/src/akuma/providers/acp/index.js +2 -1
  60. package/build/src/akuma/providers/codex-app-server/index.js +7 -1
  61. package/build/src/akuma/providers/grok-build/index.js +2 -1
  62. package/build/src/akuma/providers/index.d.ts +0 -1
  63. package/build/src/akuma/providers/index.js +0 -8
  64. package/build/src/akuma/providers/paseo/index.js +7 -4
  65. package/build/src/akuma/providers/pi/index.js +4 -3
  66. package/build/src/akuma/publication.d.ts +1 -2
  67. package/build/src/akuma/publication.js +16 -14
  68. package/build/src/akuma/schema.d.ts +3 -49
  69. package/build/src/akuma/schema.js +6 -147
  70. package/build/src/akuma/selection-observation.d.ts +281 -240
  71. package/build/src/akuma/selection-observation.js +122 -68
  72. package/build/src/akuma/status-projection.d.ts +49 -285
  73. package/build/src/akuma/status-projection.js +178 -138
  74. package/build/src/body/amend.js +2 -1
  75. package/build/src/body/arc.js +3 -2
  76. package/build/src/body/criteria.js +4 -3
  77. package/build/src/body/decode.js +2 -1
  78. package/build/src/body/envelope.js +2 -1
  79. package/build/src/body/region.d.ts +1 -3
  80. package/build/src/body/region.js +3 -8
  81. package/build/src/body-host.d.ts +4 -11
  82. package/build/src/body-host.js +5 -4
  83. package/build/src/bounded-list.js +2 -1
  84. package/build/src/cli/commands/akuma-grammar.d.ts +109 -66
  85. package/build/src/cli/commands/akuma-grammar.js +75 -95
  86. package/build/src/cli/commands/akuma.d.ts +8 -3
  87. package/build/src/cli/commands/akuma.js +63 -122
  88. package/build/src/cli/commands/contract-grammar.d.ts +3 -135
  89. package/build/src/cli/commands/contract-grammar.js +125 -218
  90. package/build/src/cli/commands/contract-help.d.ts +24 -21
  91. package/build/src/cli/commands/contract-help.js +43 -35
  92. package/build/src/cli/commands/contract.d.ts +6 -18
  93. package/build/src/cli/commands/contract.js +65 -272
  94. package/build/src/cli/commands/debt-grammar.d.ts +2 -4
  95. package/build/src/cli/commands/debt-grammar.js +22 -190
  96. package/build/src/cli/commands/debt.js +10 -87
  97. package/build/src/cli/commands/report.d.ts +2 -4
  98. package/build/src/cli/coordinates.d.ts +1 -1
  99. package/build/src/cli/coordinates.js +1 -1
  100. package/build/src/cli/main.js +9 -3
  101. package/build/src/cli/parse.d.ts +80 -3
  102. package/build/src/cli/parse.js +76 -16
  103. package/build/src/cli/render/akuma-activity.d.ts +19 -24
  104. package/build/src/cli/render/akuma-activity.js +164 -259
  105. package/build/src/cli/render/akuma.d.ts +3 -3
  106. package/build/src/cli/render/akuma.js +36 -43
  107. package/build/src/cli/render/catalog.d.ts +2 -5
  108. package/build/src/cli/render/catalog.js +2 -33
  109. package/build/src/cli/render/contract-history.js +1 -2
  110. package/build/src/cli/render/contract-observation.d.ts +0 -7
  111. package/build/src/cli/render/contract-observation.js +0 -3
  112. package/build/src/cli/render/contract.d.ts +7 -9
  113. package/build/src/cli/render/contract.js +35 -64
  114. package/build/src/cli/render/debt.d.ts +3 -11
  115. package/build/src/cli/render/debt.js +17 -88
  116. package/build/src/cli/render/delivery-preview.js +4 -4
  117. package/build/src/cli/render/kanshi-akuma.d.ts +5 -3
  118. package/build/src/cli/render/kanshi-akuma.js +22 -18
  119. package/build/src/cli/render/kanshi.d.ts +1 -3
  120. package/build/src/cli/render/kanshi.js +16 -39
  121. package/build/src/cli/render/receipt.d.ts +21 -12
  122. package/build/src/cli/render/receipt.js +49 -44
  123. package/build/src/cli/render/refusal.d.ts +4 -3
  124. package/build/src/cli/render/refusal.js +15 -17
  125. package/build/src/cli/render/settings.d.ts +1 -1
  126. package/build/src/cli/render/terminal.d.ts +9 -8
  127. package/build/src/cli/render/terminal.js +48 -32
  128. package/build/src/cli/render/verbs.d.ts +3 -1
  129. package/build/src/cli/render/verbs.js +74 -116
  130. package/build/src/cli/runtime.js +66 -65
  131. package/build/src/cli/streams.d.ts +2 -9
  132. package/build/src/cli/streams.js +8 -1
  133. package/build/src/cli/usage.d.ts +2 -1
  134. package/build/src/cli/usage.js +3 -2
  135. package/build/src/contract-worktree.js +2 -10
  136. package/build/src/core/facts/codec.js +9 -23
  137. package/build/src/core/facts/errors.d.ts +2 -1
  138. package/build/src/core/facts/errors.js +3 -3
  139. package/build/src/core/facts/types.d.ts +2 -13
  140. package/build/src/core/facts/types.js +1 -6
  141. package/build/src/core/verbs/abandon.d.ts +1 -2
  142. package/build/src/core/verbs/amend.d.ts +1 -2
  143. package/build/src/core/verbs/arc.d.ts +1 -2
  144. package/build/src/core/verbs/attestation.d.ts +1 -2
  145. package/build/src/core/verbs/bind.d.ts +1 -2
  146. package/build/src/core/verbs/deliver.d.ts +1 -2
  147. package/build/src/core/verbs/placement.d.ts +1 -2
  148. package/build/src/core/verbs/reintegrate.d.ts +1 -2
  149. package/build/src/debt/board.d.ts +14 -94
  150. package/build/src/debt/board.js +25 -160
  151. package/build/src/debt/catalog.d.ts +0 -2
  152. package/build/src/debt/catalog.js +1 -22
  153. package/build/src/debt/document.d.ts +8 -11
  154. package/build/src/debt/document.js +19 -62
  155. package/build/src/debt/identity.d.ts +2 -14
  156. package/build/src/debt/identity.js +19 -49
  157. package/build/src/debt/index.d.ts +81 -219
  158. package/build/src/debt/index.js +61 -110
  159. package/build/src/debt/input.d.ts +19 -5
  160. package/build/src/debt/input.js +51 -177
  161. package/build/src/debt/lifecycle-operations.d.ts +1 -3
  162. package/build/src/debt/lifecycle-operations.js +1 -73
  163. package/build/src/debt/operation-types.d.ts +24 -128
  164. package/build/src/debt/operation-types.js +6 -62
  165. package/build/src/debt/operations.d.ts +8 -17
  166. package/build/src/debt/operations.js +58 -154
  167. package/build/src/debt/store.d.ts +0 -2
  168. package/build/src/debt/store.js +32 -87
  169. package/build/src/errors.d.ts +28 -0
  170. package/build/src/errors.js +26 -0
  171. package/build/src/git/hooks.d.ts +1 -1
  172. package/build/src/git/observe.d.ts +3 -0
  173. package/build/src/git/observe.js +19 -5
  174. package/build/src/git/reconcile.d.ts +3 -16
  175. package/build/src/git/reconcile.js +0 -18
  176. package/build/src/git/repository.d.ts +2 -1
  177. package/build/src/git/repository.js +3 -3
  178. package/build/src/git/target-placement.d.ts +4 -4
  179. package/build/src/git/target.d.ts +2 -2
  180. package/build/src/git/tender.d.ts +1 -2
  181. package/build/src/git/tender.js +5 -12
  182. package/build/src/identity/coordinates.d.ts +1 -1
  183. package/build/src/identity/coordinates.js +3 -2
  184. package/build/src/identity/normalize.js +2 -1
  185. package/build/src/identity/selector.js +4 -3
  186. package/build/src/index.d.ts +34 -57
  187. package/build/src/index.js +11 -36
  188. package/build/src/kanshi/counts.d.ts +3 -8
  189. package/build/src/kanshi/counts.js +6 -14
  190. package/build/src/kanshi/index.d.ts +22 -7
  191. package/build/src/kanshi/index.js +30 -4
  192. package/build/src/kanshi/read.d.ts +81 -270
  193. package/build/src/kanshi/read.js +39 -199
  194. package/build/src/kanshi/report.d.ts +340 -1619
  195. package/build/src/kanshi/report.js +19 -31
  196. package/build/src/library/address.d.ts +11 -11
  197. package/build/src/library/address.js +34 -27
  198. package/build/src/library/akuma-creation.d.ts +210 -79
  199. package/build/src/library/akuma-creation.js +201 -242
  200. package/build/src/library/akumas.d.ts +24 -5
  201. package/build/src/library/akumas.js +96 -29
  202. package/build/src/library/bind.d.ts +7 -10
  203. package/build/src/library/bind.js +2 -8
  204. package/build/src/library/continuation.d.ts +141 -231
  205. package/build/src/library/continuation.js +22 -31
  206. package/build/src/library/contract-address.d.ts +6 -9
  207. package/build/src/library/contract-address.js +11 -16
  208. package/build/src/library/contract-composition.d.ts +2 -3
  209. package/build/src/library/contract-composition.js +12 -19
  210. package/build/src/library/contract-creation.js +33 -34
  211. package/build/src/library/contract-outcomes.d.ts +1278 -806
  212. package/build/src/library/contract-outcomes.js +11 -37
  213. package/build/src/library/contract-settings.d.ts +1 -2
  214. package/build/src/library/contract-settings.js +5 -7
  215. package/build/src/library/contract-types.d.ts +42 -67
  216. package/build/src/library/contract-types.js +15 -56
  217. package/build/src/library/contract-wait.d.ts +40 -3
  218. package/build/src/library/contract-wait.js +28 -21
  219. package/build/src/library/delivery.d.ts +366 -389
  220. package/build/src/library/delivery.js +5 -25
  221. package/build/src/library/input.d.ts +31 -5
  222. package/build/src/library/input.js +40 -40
  223. package/build/src/library/invocation.d.ts +13 -11
  224. package/build/src/library/invocation.js +69 -58
  225. package/build/src/library/kei.d.ts +16 -8
  226. package/build/src/library/kei.js +459 -19
  227. package/build/src/library/keiyaku-attribution.d.ts +0 -8
  228. package/build/src/library/keiyaku-attribution.js +0 -11
  229. package/build/src/library/keiyaku-classify.d.ts +2 -2
  230. package/build/src/library/keiyaku-classify.js +40 -59
  231. package/build/src/library/keiyaku-coordinates.d.ts +3 -8
  232. package/build/src/library/keiyaku-coordinates.js +6 -26
  233. package/build/src/library/keiyaku-debt.d.ts +21 -93
  234. package/build/src/library/keiyaku-debt.js +8 -157
  235. package/build/src/library/keiyaku-identity.js +5 -4
  236. package/build/src/library/keiyaku-verbs.d.ts +4004 -3885
  237. package/build/src/library/keiyaku-verbs.js +309 -271
  238. package/build/src/library/keiyaku.d.ts +30 -860
  239. package/build/src/library/keiyaku.js +169 -256
  240. package/build/src/library/nuke.d.ts +4 -2
  241. package/build/src/library/nuke.js +5 -1
  242. package/build/src/library/outcome.d.ts +424 -307
  243. package/build/src/library/outcome.js +167 -362
  244. package/build/src/library/reconcile.d.ts +331 -143
  245. package/build/src/library/reconcile.js +38 -72
  246. package/build/src/library/refusal.d.ts +20 -28
  247. package/build/src/library/refusal.js +1 -11
  248. package/build/src/library/repo.js +4 -3
  249. package/build/src/library/selection.d.ts +32 -21
  250. package/build/src/library/selection.js +63 -87
  251. package/build/src/mcp/adapter.d.ts +6 -0
  252. package/build/src/mcp/adapter.js +177 -42
  253. package/build/src/mcp/help.d.ts +1 -1
  254. package/build/src/mcp/help.js +12 -7
  255. package/build/src/mcp/output.d.ts +385 -0
  256. package/build/src/mcp/output.js +193 -0
  257. package/build/src/plugin/public.d.ts +4 -0
  258. package/build/src/plugin/runtime.d.ts +1 -1
  259. package/build/src/plugin/runtime.js +2 -2
  260. package/build/src/protocol/amend.d.ts +1 -1
  261. package/build/src/protocol/amend.js +2 -2
  262. package/build/src/protocol/bind.d.ts +5 -7
  263. package/build/src/protocol/bind.js +3 -3
  264. package/build/src/protocol/completion.d.ts +158 -195
  265. package/build/src/protocol/completion.js +55 -19
  266. package/build/src/protocol/deliver.d.ts +11 -6
  267. package/build/src/protocol/deliver.js +30 -30
  268. package/build/src/protocol/delivery-preview.d.ts +13 -11
  269. package/build/src/protocol/delivery-preview.js +2 -2
  270. package/build/src/protocol/execution-observation.d.ts +5 -13
  271. package/build/src/protocol/intent.d.ts +6 -9
  272. package/build/src/protocol/intent.js +18 -31
  273. package/build/src/protocol/operations.d.ts +48 -53
  274. package/build/src/protocol/operations.js +16 -25
  275. package/build/src/protocol/outcome.d.ts +3 -1
  276. package/build/src/protocol/placement.d.ts +1 -2
  277. package/build/src/protocol/placement.js +1 -1
  278. package/build/src/protocol/progress.d.ts +1 -0
  279. package/build/src/protocol/read/status.d.ts +29 -112
  280. package/build/src/protocol/read/status.js +52 -78
  281. package/build/src/protocol/reintegrate.d.ts +1 -2
  282. package/build/src/protocol/reintegrate.js +0 -1
  283. package/build/src/protocol/result-leaves.d.ts +11 -32
  284. package/build/src/protocol/result-leaves.js +18 -57
  285. package/build/src/protocol/result-reasons.d.ts +6 -6
  286. package/build/src/protocol/review.js +0 -1
  287. package/build/src/protocol/verify.d.ts +192 -146
  288. package/build/src/protocol/verify.js +60 -47
  289. package/build/src/runtime/proc/windows-launch.exe +0 -0
  290. package/build/src/settings.d.ts +8 -9
  291. package/build/src/settings.js +16 -13
  292. package/build/src/settlement/holder.js +2 -2
  293. package/build/src/settlement/settle.d.ts +0 -6
  294. package/build/src/settlement/settle.js +0 -4
  295. package/build/src/verification/declaration.d.ts +3 -6
  296. package/build/src/verification/declaration.js +3 -5
  297. package/build/src/verification/observation.d.ts +2 -2
  298. package/build/src/world.d.ts +3 -2
  299. package/build/src/world.js +5 -6
  300. package/package.json +1 -1
  301. package/plugins/paseo/plugin/index.server.ts +1 -1
  302. package/plugins/paseo/plugin/server/attach.ts +74 -67
  303. package/plugins/paseo/plugin/server/keiyaku.ts +80 -14
  304. package/plugins/paseo/plugin/server/message.ts +2 -1
  305. package/plugins/paseo/plugin/server/mirror-identity.ts +6 -4
  306. package/plugins/paseo/plugin/server/sdk.ts +9 -11
  307. package/plugins/paseo/plugin/server/transport.ts +24 -1
  308. package/plugins/pi/README.md +16 -18
  309. package/plugins/pi/akuma-tools.ts +31 -38
  310. package/plugins/pi/keiyaku.ts +15 -4
  311. package/skills/keiyaku-akuma/SKILL.md +16 -11
  312. package/skills/keiyaku-babysit/SKILL.md +5 -3
  313. package/skills/keiyaku-bind/SKILL.md +4 -3
  314. package/skills/keiyaku-debt/SKILL.md +17 -17
  315. package/skills/keiyaku-workflow/SKILL.md +4 -3
  316. package/build/src/akuma/providers/codex-app-server/configuration.d.ts +0 -5
  317. package/build/src/akuma/providers/codex-app-server/configuration.js +0 -72
  318. package/build/src/cli/commands/debt-query.d.ts +0 -5
  319. package/build/src/cli/commands/debt-query.js +0 -194
  320. package/build/src/cli/render/akuma-tool-command.d.ts +0 -6
  321. package/build/src/cli/render/akuma-tool-command.js +0 -143
  322. package/build/src/cli/render/akuma-tool.d.ts +0 -29
  323. package/build/src/cli/render/akuma-tool.js +0 -225
  324. package/build/src/debt/context.d.ts +0 -28
  325. package/build/src/debt/context.js +0 -102
  326. package/build/src/debt/created-observation.d.ts +0 -26
  327. package/build/src/debt/created-observation.js +0 -38
  328. package/build/src/debt/query.d.ts +0 -80
  329. package/build/src/debt/query.js +0 -283
  330. package/build/src/library/contract-execution.d.ts +0 -28
  331. package/build/src/library/contract-execution.js +0 -506
  332. package/build/src/library/keiyaku-policy.d.ts +0 -27
  333. package/build/src/library/keiyaku-policy.js +0 -44
  334. package/build/src/library/keiyaku-status.d.ts +0 -1487
  335. package/build/src/library/keiyaku-status.js +0 -92
@@ -3,7 +3,7 @@ import { renderRefusalFacts } from "./refusal.js";
3
3
  import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
4
4
  import { DEFAULT_CLI_COLUMNS, gitShortStat, safeText } from "./terminal.js";
5
5
  import { contractIssueLines } from "./contract.js";
6
- function targetLines(report, columns, ids) {
6
+ function targetLines(report, columns, ids, surface) {
7
7
  const target = report.target;
8
8
  const lines = [];
9
9
  if (target === undefined)
@@ -38,7 +38,7 @@ function targetLines(report, columns, ids) {
38
38
  }
39
39
  else {
40
40
  receiptRow(lines, "!", "target", [{ text: "refused" }], columns);
41
- lines.push(...renderRefusalFacts(target.reason, " ", columns, report.contractId));
41
+ lines.push(...renderRefusalFacts(target.reason, " ", columns, report.contractId, surface));
42
42
  }
43
43
  return lines;
44
44
  }
@@ -77,7 +77,7 @@ export function renderDeliveryPreview(report, context) {
77
77
  const lines = titleLines(report.kind === "ready" ? "✓" : "!", "deliver --dry-run", report.contractId, columns);
78
78
  if (report.kind === "blocked") {
79
79
  receiptRow(lines, "!", "candidate", [{ text: "blocked" }], columns);
80
- lines.push(...renderRefusalFacts(report.reason, " ", columns, report.contractId), ...contractIssueLines(report, columns));
80
+ lines.push(...renderRefusalFacts(report.reason, " ", columns, report.contractId, context?.surface), ...contractIssueLines(report, columns));
81
81
  return lines.join("\n");
82
82
  }
83
83
  const ids = previewGitIds(report);
@@ -96,6 +96,6 @@ export function renderDeliveryPreview(report, context) {
96
96
  receiptRow(lines, "!", "diff", [{ text: "unavailable" }], columns);
97
97
  if (report.previousContentId !== undefined)
98
98
  receiptRow(lines, " ", "admitted candidate", [{ text: `previous content ${displayGitId(report.previousContentId, ids)}` }], columns);
99
- lines.push(...targetLines(report, columns, ids), ...contractIssueLines(report, columns));
99
+ lines.push(...targetLines(report, columns, ids, context?.surface), ...contractIssueLines(report, columns));
100
100
  return lines.join("\n");
101
101
  }
@@ -5,12 +5,14 @@ declare function akumaLabel(row: Pick<AkumaKanshiRow, "aliases">, aliasesUnavail
5
5
  declare function associationFact(contract: NonNullable<AkumaKanshiRow["contract"]>): string;
6
6
  /**
7
7
  * One Akuma board section. The World board omits an empty section because its other
8
- * sections already say what the World holds; a category board states that emptiness
9
- * itself, since it is the whole answer. A failed Alias observation belongs to the
8
+ * sections already say what the World holds; a standalone catalogue states its
9
+ * own emptiness. A failed Alias observation belongs to the
10
10
  * section, so an empty roster still states its emptiness rather than dropping that
11
11
  * evidence.
12
12
  */
13
- declare function renderAkumaBoard(section: BoardSection<AkumaKanshiWorld>, observedAt: string, context: TextRenderContext, emptyRows: readonly string[]): readonly string[];
13
+ declare function renderAkumaBoard(section: BoardSection<AkumaKanshiWorld>, observedAt: string, context: TextRenderContext & Readonly<{
14
+ caller?: string;
15
+ }>, emptyRows?: readonly string[]): readonly string[];
14
16
  declare function renderAkuma(report: KanshiReport, context: TextRenderContext): readonly string[];
15
17
  declare function formatAge(source: string | null | undefined, observedAt: string): string;
16
18
  export { akumaLabel, associationFact, formatAge, NARROW_COLUMNS, renderAkuma, renderAkumaBoard };
@@ -1,4 +1,4 @@
1
- import { activityRowLines } from "./akuma-activity.js";
1
+ import { currentWorkLines } from "./akuma-activity.js";
2
2
  import { akumaMark } from "./marks.js";
3
3
  import { ageText, elapsedMilliseconds, emptyCatalogue, entityLines, identityLine, RECENT_TONE_MS, renderSectionBlock, safeText, tone, } from "./terminal.js";
4
4
  const NARROW_COLUMNS = 72;
@@ -27,16 +27,12 @@ function akumaStatusTone(row, observedAt) {
27
27
  /** The native owner's current actionable row pair, rendered by the shared activity grammar. */
28
28
  function rowPreviewLines(row, context) {
29
29
  const bounded = { ...context, columns: Math.max(1, context.columns - ACTIVITY_INDENT.length) };
30
- const activity = row.activity;
31
- const preview = activity === undefined
30
+ const work = row.work;
31
+ return (work === undefined
32
32
  ? []
33
- : activity.kind === "unavailable"
34
- ? [`! activity unavailable · ${activity.diagnostic}`]
35
- : activityRowLines(activity, bounded, { compact: true });
36
- return [
37
- ...preview,
38
- ...(row.outcome === undefined ? [] : activityRowLines(row.outcome, bounded, { compact: true, tailAnswer: true })),
39
- ].map((line) => `${ACTIVITY_INDENT}${line}`);
33
+ : work.kind === "unavailable"
34
+ ? [`! work unavailable · ${work.diagnostic}`]
35
+ : currentWorkLines(work, bounded)).map((line) => `${ACTIVITY_INDENT}${line}`);
40
36
  }
41
37
  function akumaLabel(row, aliasesUnavailable) {
42
38
  const aliases = row.aliases ?? [];
@@ -49,7 +45,7 @@ function associationFact(contract) {
49
45
  return "contract association unavailable";
50
46
  return contract.contractId;
51
47
  }
52
- function akumaRowLines(row, aliasesUnavailable, observedAt, context) {
48
+ function akumaRowLines(row, aliasesUnavailable, observedAt, context, caller) {
53
49
  const statusTone = akumaStatusTone(row, observedAt);
54
50
  const mark = statusTone === null ? akumaMark(row.life) : tone(akumaMark(row.life), statusTone, context.color);
55
51
  const lifeAt = "lifeAt" in row ? row.lifeAt : undefined;
@@ -59,7 +55,15 @@ function akumaRowLines(row, aliasesUnavailable, observedAt, context) {
59
55
  const activityAge = lastActivityAt === undefined ? null : formatAge(lastActivityAt, observedAt);
60
56
  const activity = activityAge === null || activityAge === lifeAge ? [] : [`activity ${activityAge}`];
61
57
  const key = [life, ...activity];
62
- const relation = row.contract === undefined ? [] : [associationFact(row.contract)];
58
+ const relation = [
59
+ ...(row.contract === undefined ? [] : [associationFact(row.contract)]),
60
+ ...(caller !== undefined &&
61
+ "parentAkumaId" in row &&
62
+ row.parentAkumaId !== undefined &&
63
+ row.parentAkumaId !== caller
64
+ ? [`by ${safeText(row.parentAkumaId)}`]
65
+ : []),
66
+ ];
63
67
  const aliases = akumaLabel(row, aliasesUnavailable);
64
68
  const previewLines = rowPreviewLines(row, context);
65
69
  if (context.columns > NARROW_COLUMNS) {
@@ -79,23 +83,23 @@ function akumaRowLines(row, aliasesUnavailable, observedAt, context) {
79
83
  ...previewLines,
80
84
  ];
81
85
  }
82
- function akumaBoardRows(board, rows, observedAt, context) {
86
+ function akumaBoardRows(board, rows, observedAt, context, caller) {
83
87
  const aliasesUnavailable = board.aliasesError !== undefined;
84
88
  const rendered = renderSectionBlock({
85
89
  name: "AKUMA",
86
- rows: rows.map((row) => akumaRowLines(row, aliasesUnavailable, observedAt, context)),
90
+ rows: rows.map((row) => akumaRowLines(row, aliasesUnavailable, observedAt, context, caller)),
87
91
  hasMore: board.more === true,
88
92
  });
89
93
  return [`AKUMA // ${rows.length} recent`, ...rendered.slice(1)];
90
94
  }
91
95
  /**
92
96
  * One Akuma board section. The World board omits an empty section because its other
93
- * sections already say what the World holds; a category board states that emptiness
94
- * itself, since it is the whole answer. A failed Alias observation belongs to the
97
+ * sections already say what the World holds; a standalone catalogue states its
98
+ * own emptiness. A failed Alias observation belongs to the
95
99
  * section, so an empty roster still states its emptiness rather than dropping that
96
100
  * evidence.
97
101
  */
98
- function renderAkumaBoard(section, observedAt, context, emptyRows) {
102
+ function renderAkumaBoard(section, observedAt, context, emptyRows = [emptyCatalogue("akuma")]) {
99
103
  if (section.kind === "absent")
100
104
  return ["AKUMA // absent"];
101
105
  if (section.kind === "failed") {
@@ -113,7 +117,7 @@ function renderAkumaBoard(section, observedAt, context, emptyRows) {
113
117
  tone(`! aliases unavailable · ${aliasFailure}`, "alert", context.color),
114
118
  ];
115
119
  }
116
- return akumaBoardRows(board, rows, observedAt, context);
120
+ return akumaBoardRows(board, rows, observedAt, context, context.caller);
117
121
  }
118
122
  function renderAkuma(report, context) {
119
123
  return renderAkumaBoard(report.akumas, report.observedAt, context, []);
@@ -1,5 +1,3 @@
1
- import type { KanshiCategoryByOwner, KanshiCategoryReport, KanshiContractReport, KanshiReport } from "../../kanshi/report.js";
1
+ import type { KanshiContractReport, KanshiReport } from "../../kanshi/report.js";
2
2
  import { type TextRenderContext } from "./terminal.js";
3
3
  export declare function renderKanshiText(report: KanshiReport | KanshiContractReport, context?: TextRenderContext): string;
4
- /** Invocation context selects the owner renderer without inspecting result rows. */
5
- export declare function renderKanshiCategoryText<C extends keyof KanshiCategoryByOwner>(report: KanshiCategoryReport<C>, category: C, context?: TextRenderContext): string;
@@ -1,6 +1,6 @@
1
1
  import { contractAttentionFacts, abbreviateGitIds, afterWording, displayGitId, gateGlyph, requirementDisplayName, gateRequirementFacts, gitIdsInDetail, lifecycleWord, mergeSummary, progressStrip, targetMoved, targetMovementFacts, workspaceState, } from "./contract-observation.js";
2
- import { DEFAULT_CLI_COLUMNS, emptyCatalogue, elapsedMilliseconds, entityLines, identityLine, plumbFacts, renderBoundedPayload, renderSectionBlock, safeText, tone, } from "./terminal.js";
3
- import { associationFact, formatAge, NARROW_COLUMNS, renderAkuma, renderAkumaBoard } from "./kanshi-akuma.js";
2
+ import { DEFAULT_CLI_COLUMNS, elapsedMilliseconds, entityLines, identityLine, renderBoundedPayload, renderSectionBlock, safeText, tone, } from "./terminal.js";
3
+ import { associationFact, formatAge, NARROW_COLUMNS, renderAkuma } from "./kanshi-akuma.js";
4
4
  import { contractDetailMark, contractMark, debtDispositionMark } from "./marks.js";
5
5
  import { dispositionText } from "./debt.js";
6
6
  const REVIEW_ATTENTION_MS = 15 * 60 * 1_000;
@@ -49,10 +49,7 @@ function renderWorldContractRow(row, observedAt, context) {
49
49
  context,
50
50
  });
51
51
  }
52
- /**
53
- * One Contract board section. A category board states its own emptiness; the World
54
- * board leaves an empty section out because the world is its surrounding answer.
55
- */
52
+ /** The World omits an empty Contract section. */
56
53
  function contractBoardRows(board, observedAt, context) {
57
54
  const rendered = renderSectionBlock({
58
55
  name: "CONTRACTS",
@@ -61,17 +58,16 @@ function contractBoardRows(board, observedAt, context) {
61
58
  });
62
59
  return ["CONTRACTS // recent", ...rendered.slice(1)];
63
60
  }
64
- function renderContractBoard(section, observedAt, context, emptyRows) {
61
+ function renderContractBoard(section, observedAt, context) {
65
62
  if (section.kind === "absent")
66
63
  return ["CONTRACTS // absent"];
67
64
  if (section.kind === "failed") {
68
65
  const failure = ["CONTRACTS // unavailable", "", tone(`! ${safeText(section.diagnostic)}`, "alert", context.color)];
69
66
  return failure;
70
67
  }
71
- const board = section;
72
- if ((board.rows ?? []).length === 0)
73
- return emptyRows;
74
- return contractBoardRows(board, observedAt, context);
68
+ if ((section.rows ?? []).length === 0)
69
+ return [];
70
+ return contractBoardRows(section, observedAt, context);
75
71
  }
76
72
  function detailHasError(row) {
77
73
  if (row.title === undefined)
@@ -151,41 +147,27 @@ function issueAlarm(issue, target) {
151
147
  function liveAlarms(row) {
152
148
  return [
153
149
  ...mergeFacts(row),
154
- ...(typeof row.holder === "object" ? ["debt unavailable"] : []),
155
- ...(typeof row.holder === "string" && row.namespaceDebts.kind !== "present" ? ["debt unavailable"] : []),
156
150
  ...(row.issue === undefined ? [] : [issueAlarm(row.issue, row.target)]),
157
151
  ...(row.workspace.kind === "unavailable" ? [workspaceState(row.workspace)] : []),
158
152
  ].map((alarm) => `! ${alarm}`);
159
153
  }
160
- /** One Debt row grammar serves the World board and the selected Contract's owned namespace view. */
161
154
  function debtRowLines(row, context) {
162
- const contract = "contract" in row ? row.contract : undefined;
155
+ const contract = row.contract;
163
156
  const relation = contract === undefined ? [] : [associationFact(contract)];
164
- const childFacts = [];
165
157
  const association = relation.length === 0 ? "" : ` · ${relation.join(" · ")}`;
166
158
  if (context.columns > NARROW_COLUMNS)
167
159
  return [
168
160
  identityLine(debtDispositionMark(row.disposition), row.id, `· ${dispositionText(row.disposition)} · P${row.priority} · ${row.title}${association}`),
169
- ...plumbFacts(childFacts, context.columns),
170
161
  ];
171
162
  return entityLines({
172
163
  mark: debtDispositionMark(row.disposition),
173
164
  identity: row.id,
174
165
  state: `${dispositionText(row.disposition)} · P${row.priority}`,
175
166
  title: row.title,
176
- facts: [...relation, ...childFacts],
167
+ facts: relation,
177
168
  context,
178
169
  });
179
170
  }
180
- function namespaceDebtLines(row, context) {
181
- const debts = row.namespaceDebts;
182
- if (debts.kind === "absent")
183
- return [];
184
- if (debts.kind === "failed")
185
- return [tone(` ! debt ${safeText(debtFailureFact(debts))}`, "alert", context.color)];
186
- const bounded = { ...context, columns: Math.max(1, context.columns - 2) };
187
- return (debts.rows ?? []).flatMap((debt) => debtRowLines(debt, bounded).map((line) => ` ${line}`));
188
- }
189
171
  function worktreeFacts(row) {
190
172
  return row.workspace.kind === "unappointed" ? [] : [`worktree ${row.workspace.path}`];
191
173
  }
@@ -198,7 +180,11 @@ function renderSelectedContractRow(id, row, context) {
198
180
  identity: id,
199
181
  state: lifecycleWord(row.phase),
200
182
  title: row.title ?? "title unavailable",
201
- facts: [],
183
+ facts: typeof row.holder === "string"
184
+ ? [`debt ${row.holder}`]
185
+ : row.holder === undefined
186
+ ? []
187
+ : ["debt association unavailable"],
202
188
  context,
203
189
  }),
204
190
  ];
@@ -207,7 +193,7 @@ function renderSelectedContractRow(id, row, context) {
207
193
  lines.push(...outcome.map((fact) => (fact.startsWith(" ") ? fact : ` ${safeText(fact)}`)));
208
194
  // A terminal Contract still carries a physical retention issue; its worktree is expected to be gone.
209
195
  lines.push(...semanticBlock("alarms", row.issue === undefined ? [] : [`! ${issueAlarm(row.issue, row.target)}`], context));
210
- lines.push(...linkedAkumaRows(row), ...namespaceDebtLines(row, context));
196
+ lines.push(...linkedAkumaRows(row));
211
197
  return lines;
212
198
  }
213
199
  const deniedReview = (row.gates ?? [])
@@ -229,7 +215,6 @@ function renderSelectedContractRow(id, row, context) {
229
215
  lines.push(...linkedAkumaRows(row));
230
216
  lines.push(...semanticBlock("worktree", worktreeFacts(row), context));
231
217
  lines.push(...semanticBlock("alarms", liveAlarms(row), context));
232
- lines.push(...namespaceDebtLines(row, context));
233
218
  return lines;
234
219
  }
235
220
  function debtFailureFact(failure) {
@@ -269,17 +254,9 @@ export function renderKanshiText(report, context = { columns: DEFAULT_CLI_COLUMN
269
254
  if (!("contracts" in report))
270
255
  return renderSelectedContract(report, context).join("\n");
271
256
  const blocks = [
272
- renderContractBoard(report.contracts, report.observedAt, context, []),
257
+ renderContractBoard(report.contracts, report.observedAt, context),
273
258
  renderAkuma(report, context),
274
259
  renderDebts(report, context),
275
260
  ].filter((block) => block.length > 0);
276
261
  return blocks.length === 0 ? "○ world empty" : blocks.map((block) => block.join("\n")).join("\n\n");
277
262
  }
278
- const categoryRenderers = {
279
- contract: (report, context) => renderContractBoard(report.section, report.observedAt, context, [emptyCatalogue("contracts")]),
280
- akuma: (report, context) => renderAkumaBoard(report.section, report.observedAt, context, [emptyCatalogue("akuma")]),
281
- };
282
- /** Invocation context selects the owner renderer without inspecting result rows. */
283
- export function renderKanshiCategoryText(report, category, context = { columns: DEFAULT_CLI_COLUMNS, color: false }) {
284
- return categoryRenderers[category](report, context).join("\n");
285
- }
@@ -1,4 +1,5 @@
1
- import type { ContinuationReport, PartialOutcomeEnvelope, Placement, RequirementProblem, VerificationCheck } from "../../index.js";
1
+ import type { PartialOutcomeEnvelope, Placement, RequirementProblem, VerificationCheck } from "../../index.js";
2
+ import { type TextRenderContext } from "./terminal.js";
2
3
  export type ReceiptSegment = Readonly<{
3
4
  text: string;
4
5
  opaque?: boolean;
@@ -14,23 +15,31 @@ type PlacementStop = Exclude<Placement, {
14
15
  type TerminalCheck = Extract<VerificationCheck, {
15
16
  kind: "terminal";
16
17
  }>;
17
- type CheckAdmissionStop = Exclude<NonNullable<TerminalCheck["admission"]>, "reused">;
18
- type RuntimeCheck = Exclude<VerificationCheck, {
19
- kind: "terminal";
20
- }>;
21
- export type ContinuationStop = NonNullable<ContinuationReport["stopped"]>[number];
22
- export type ReceiptStop = PlacementStop | CheckAdmissionStop | RuntimeCheck | ContinuationStop;
18
+ type CheckAdmissionStop = Exclude<NonNullable<TerminalCheck["admission"]>, string>;
19
+ type RuntimeCheck = Extract<VerificationCheck, {
20
+ kind: "stopped";
21
+ }>["stop"];
22
+ type ReceiptStop = PlacementStop | CheckAdmissionStop | RuntimeCheck;
23
23
  declare function unmetRequirementLines(unmet: readonly RequirementProblem[], columns: number): readonly string[];
24
24
  export { unmetRequirementLines };
25
25
  /**
26
26
  * One flat stop vocabulary for placement, test admission, and dependent continuation. The native
27
27
  * stop supplies every distinction; rendering never reconstructs a wrapper or a second conclusion.
28
28
  */
29
- export declare function stopLines(stop: ReceiptStop, columns: number, addressed: string, dependent?: string): readonly string[];
30
- export declare function placementLines(stop: PlacementStop, columns: number, addressed: string): readonly string[];
29
+ export declare function stopLines(stop: ReceiptStop, columns: number, addressed: string, dependent?: string, surface?: TextRenderContext["surface"]): readonly string[];
30
+ export declare function deliveryIdentityRows(lines: string[], identity: Readonly<{
31
+ candidate: string;
32
+ integration: string;
33
+ contentId: string | undefined;
34
+ }>, columns: number): void;
35
+ export declare function targetMovementRows(lines: string[], placement: Readonly<{
36
+ target?: string;
37
+ predecessor?: string;
38
+ integration: string;
39
+ }>, columns: number): void;
31
40
  export declare function gatesAwaitLines(placement: PlacementStop | undefined): readonly string[];
32
41
  /** The performed work and its admission conclusion, with no aggregate gate testimony. */
33
- export declare function verificationCheckLines(checks: readonly VerificationCheck[], snapshot: string, columns: number, addressed: string): readonly string[];
42
+ export declare function verificationCheckLines(checks: readonly VerificationCheck[], snapshot: string, columns: number, addressed: string, surface?: TextRenderContext["surface"]): readonly string[];
34
43
  type RecoverySnapshot = string | Readonly<{
35
44
  snapshot: string;
36
45
  contractId?: string;
@@ -39,10 +48,10 @@ export declare function recoverySnapshotLines(recoveries: readonly RecoverySnaps
39
48
  /** Confirmed admissions and irreversible movement survive a trailing failure without a journal reread. */
40
49
  export declare function executionEvidenceLines(receipt: Extract<PartialOutcomeEnvelope, {
41
50
  kind: "contract";
42
- }>, columns: number): readonly string[];
51
+ }>, columns: number, surface?: TextRenderContext["surface"]): readonly string[];
43
52
  export declare function executionFailureLines(operation: string, receipt: PartialOutcomeEnvelope, failure: Readonly<{
44
53
  category: string;
45
54
  diagnostic: string;
46
55
  causeClass?: string;
47
56
  causeDiagnostic?: string;
48
- }>, columns: number): readonly string[];
57
+ }>, columns: number, surface?: TextRenderContext["surface"]): readonly string[];
@@ -133,9 +133,9 @@ function availabilityStopRows(stop, columns, dependent) {
133
133
  receiptRow(lines, "!", "target workspace unavailable", [{ text: stop.targetContractId, opaque: true }, { text: words(stop.reason) }], columns);
134
134
  return lines;
135
135
  }
136
- function outcomeStopRows(stop, columns, addressed, dependent) {
136
+ function outcomeStopRows(stop, columns, addressed, dependent, surface) {
137
137
  if (stop.kind !== "failed")
138
- return renderRefusalFacts(stop, " ", columns, addressed);
138
+ return renderRefusalFacts(stop, " ", columns, addressed, surface);
139
139
  const lines = [];
140
140
  receiptRow(lines, "×", "not accepted", dependent === undefined ? [] : [{ text: dependent, opaque: true }], columns);
141
141
  receiptPayload(lines, "reason", stop.diagnostic);
@@ -162,7 +162,7 @@ function targetMovementStopRows(stop, columns, related) {
162
162
  ], columns);
163
163
  return lines;
164
164
  }
165
- function placementStopRows(stop, columns, addressed, dependent) {
165
+ function placementStopRows(stop, columns, addressed, dependent, surface) {
166
166
  switch (stop.kind) {
167
167
  case "gates-unsatisfied":
168
168
  case "prerequisites-unsatisfied":
@@ -180,7 +180,7 @@ function placementStopRows(stop, columns, addressed, dependent) {
180
180
  case "integration-conflict":
181
181
  case "integration-unsupported":
182
182
  case "failed":
183
- return outcomeStopRows(stop, columns, addressed, dependent);
183
+ return outcomeStopRows(stop, columns, addressed, dependent, surface);
184
184
  case "target-content-identical":
185
185
  case "target-moved":
186
186
  return targetMovementStopRows(stop, columns, dependent);
@@ -190,9 +190,8 @@ function placementStopRows(stop, columns, addressed, dependent) {
190
190
  * One flat stop vocabulary for placement, test admission, and dependent continuation. The native
191
191
  * stop supplies every distinction; rendering never reconstructs a wrapper or a second conclusion.
192
192
  */
193
- export function stopLines(stop, columns, addressed, dependent) {
194
- const owner = "contractId" in stop ? stop.contractId : undefined;
195
- const related = dependent ?? owner;
193
+ export function stopLines(stop, columns, addressed, dependent, surface) {
194
+ const related = dependent;
196
195
  switch (stop.kind) {
197
196
  case "execution-stopped": {
198
197
  const lines = [];
@@ -200,13 +199,15 @@ export function stopLines(stop, columns, addressed, dependent) {
200
199
  receiptPayload(lines, "reason", stop.diagnostic);
201
200
  return lines;
202
201
  }
203
- case "already-terminal":
204
- case "physical-lag":
205
- return []; // the continuation renderer owns the caller-facing row
202
+ case "physical-lag": {
203
+ const lines = [];
204
+ dependentRow(lines, dependent, "physical follow stopped", columns);
205
+ return lines;
206
+ }
206
207
  case "retry":
207
208
  return retryRows(stop, columns, dependent);
208
209
  case "refused":
209
- return renderRefusalFacts(stop.reason, " ", columns, addressed);
210
+ return renderRefusalFacts(stop.reason, " ", columns, addressed, surface);
210
211
  case "cancelled":
211
212
  case "unknown-exit":
212
213
  case "candidate-unavailable":
@@ -218,15 +219,28 @@ export function stopLines(stop, columns, addressed, dependent) {
218
219
  const lines = [];
219
220
  if (dependent !== undefined)
220
221
  receiptRow(lines, "!", "dependent", [{ text: dependent, opaque: true }], columns);
221
- lines.push(...renderRefusalFacts(stop, "", columns, addressed));
222
+ lines.push(...renderRefusalFacts(stop, "", columns, addressed, surface));
222
223
  return lines;
223
224
  }
224
225
  default:
225
- return placementStopRows(stop, columns, addressed, dependent);
226
+ return placementStopRows(stop, columns, addressed, dependent, surface);
226
227
  }
227
228
  }
228
- export function placementLines(stop, columns, addressed) {
229
- return stopLines(stop, columns, addressed);
229
+ export function deliveryIdentityRows(lines, identity, columns) {
230
+ for (const [label, value] of [
231
+ ["candidate", identity.candidate],
232
+ ["integration result", identity.integration],
233
+ ["content identity", identity.contentId],
234
+ ])
235
+ if (value !== undefined)
236
+ receiptRow(lines, " ", label, [{ text: value, opaque: true }], columns);
237
+ }
238
+ export function targetMovementRows(lines, placement, columns) {
239
+ const ids = abbreviateGitIds([placement.predecessor ?? "", placement.integration]);
240
+ const movement = placement.predecessor === undefined
241
+ ? displayGitId(placement.integration, ids)
242
+ : `${displayGitId(placement.predecessor, ids)}..${displayGitId(placement.integration, ids)}`;
243
+ receiptRow(lines, " ", "target", [{ text: movement }, ...(placement.target === undefined ? [] : [{ text: placement.target, opaque: true }])], columns);
230
244
  }
231
245
  export function gatesAwaitLines(placement) {
232
246
  if (placement?.kind !== "gates-unsatisfied")
@@ -237,7 +251,7 @@ export function gatesAwaitLines(placement) {
237
251
  return events.length === 0 ? [] : [`⧗ awaiting ${events.join(", ")}`];
238
252
  }
239
253
  /** The performed work and its admission conclusion, with no aggregate gate testimony. */
240
- export function verificationCheckLines(checks, snapshot, columns, addressed) {
254
+ export function verificationCheckLines(checks, snapshot, columns, addressed, surface) {
241
255
  const ids = abbreviateGitIds([snapshot]);
242
256
  const lines = [];
243
257
  for (const check of checks) {
@@ -247,18 +261,18 @@ export function verificationCheckLines(checks, snapshot, columns, addressed) {
247
261
  { text: `· snapshot ${displayGitId(snapshot, ids)}` },
248
262
  ], columns);
249
263
  if (check.kind !== "terminal") {
250
- lines.push(...stopLines(check, columns, addressed));
264
+ lines.push(...stopLines(check.stop, columns, addressed, undefined, surface));
251
265
  }
252
266
  else {
253
267
  receiptRow(lines, check.verdict === "satisfied" ? "✓" : "×", "verdict", [{ text: check.verdict }], columns);
254
268
  if (check.verdict === "unsatisfied")
255
269
  receiptPayload(lines, "summary", check.summary);
256
270
  const admission = check.admission;
257
- if (admission === "reused")
258
- receiptRow(lines, " ", "attestation", [{ text: "reused" }], columns);
259
- else if (admission !== undefined) {
271
+ if (typeof admission === "string")
272
+ receiptRow(lines, " ", "attestation", [{ text: admission === "unrecorded" ? "not recorded" : admission }], columns);
273
+ else {
260
274
  receiptRow(lines, "!", "admission", [{ text: "stopped" }], columns);
261
- lines.push(...stopLines(admission, columns, addressed));
275
+ lines.push(...stopLines(admission, columns, addressed, undefined, surface));
262
276
  }
263
277
  }
264
278
  if (check.retainedPath !== undefined)
@@ -285,9 +299,11 @@ function admittedLines(admission, columns, primary) {
285
299
  case "deliver": {
286
300
  receiptRow(lines, " ", "admitted", [{ text: "deliver" }, ...owned], columns);
287
301
  const ids = abbreviateGitIds([admission.candidate, admission.integration, admission.contentId]);
288
- receiptRow(lines, " ", "candidate", [{ text: displayGitId(admission.candidate, ids), opaque: true }], columns);
289
- receiptRow(lines, " ", "integration result", [{ text: displayGitId(admission.integration, ids), opaque: true }], columns);
290
- receiptRow(lines, " ", "content identity", [{ text: displayGitId(admission.contentId, ids), opaque: true }], columns);
302
+ deliveryIdentityRows(lines, {
303
+ candidate: displayGitId(admission.candidate, ids),
304
+ integration: displayGitId(admission.integration, ids),
305
+ contentId: displayGitId(admission.contentId, ids),
306
+ }, columns);
291
307
  return lines;
292
308
  }
293
309
  case "reintegrated": {
@@ -348,47 +364,36 @@ function effectLines(effect, columns, primary) {
348
364
  case "debt-settled":
349
365
  receiptRow(lines, " ", "settled", [{ text: effect.debtId, opaque: true }], columns);
350
366
  return lines;
351
- case "placed": {
352
- const ids = abbreviateGitIds([effect.predecessor ?? "", effect.integration]);
353
- receiptRow(lines, " ", "target", [
354
- {
355
- text: `${effect.predecessor === undefined ? "" : `${displayGitId(effect.predecessor, ids)}..`}${displayGitId(effect.integration, ids)}`,
356
- },
357
- ...(effect.target === undefined ? [] : [{ text: effect.target, opaque: true }]),
358
- ], columns);
367
+ case "placed":
368
+ targetMovementRows(lines, effect, columns);
359
369
  return lines;
360
- }
361
370
  case "worktree-created":
362
371
  case "worktree-removed":
363
372
  receiptRow(lines, " ", words(effect.kind), [{ text: effect.path, opaque: true }], columns);
364
373
  return lines;
365
374
  }
366
375
  }
367
- function placementEvidenceLines(placement, columns, addressed) {
376
+ function placementEvidenceLines(placement, columns, addressed, surface) {
368
377
  if (placement.kind !== "placed")
369
- return stopLines(placement, columns, addressed);
370
- const ids = abbreviateGitIds([placement.predecessor ?? "", placement.integration]);
378
+ return stopLines(placement, columns, addressed, undefined, surface);
371
379
  if (placement.target === undefined)
372
380
  return [];
373
- const movement = placement.predecessor === undefined
374
- ? displayGitId(placement.integration, ids)
375
- : `${displayGitId(placement.predecessor, ids)}..${displayGitId(placement.integration, ids)}`;
376
381
  const lines = [];
377
- receiptRow(lines, " ", "target", [{ text: movement }, { text: placement.target, opaque: true }], columns);
382
+ targetMovementRows(lines, placement, columns);
378
383
  return lines;
379
384
  }
380
385
  /** Confirmed admissions and irreversible movement survive a trailing failure without a journal reread. */
381
- export function executionEvidenceLines(receipt, columns) {
386
+ export function executionEvidenceLines(receipt, columns, surface) {
382
387
  const lines = [];
383
388
  for (const admission of receipt.admitted ?? [])
384
389
  lines.push(...admittedLines(admission, columns, receipt.contractId));
385
390
  if (receipt.placement !== undefined)
386
- lines.push(...placementEvidenceLines(receipt.placement, columns, receipt.contractId ?? ""));
391
+ lines.push(...placementEvidenceLines(receipt.placement, columns, receipt.contractId ?? "", surface));
387
392
  for (const effect of receipt.effects ?? [])
388
393
  lines.push(...effectLines(effect, columns, receipt.contractId));
389
394
  return lines;
390
395
  }
391
- export function executionFailureLines(operation, receipt, failure, columns) {
396
+ export function executionFailureLines(operation, receipt, failure, columns, surface) {
392
397
  const lines = [];
393
398
  const identity = receipt.kind === "contract" ? receipt.contractId : receipt.world;
394
399
  receiptRow(lines, "!", `${contractOperationName(operation)} failed`, [{ text: failure.category }, ...(identity === undefined ? [] : [{ text: identity, opaque: true }])], columns);
@@ -396,7 +401,7 @@ export function executionFailureLines(operation, receipt, failure, columns) {
396
401
  if (failure.causeClass !== undefined || failure.causeDiagnostic !== undefined)
397
402
  receiptPayload(lines, "cause", [failure.causeClass, failure.causeDiagnostic].filter((part) => part !== undefined).join(": "));
398
403
  if (receipt.kind === "contract")
399
- lines.push(...executionEvidenceLines(receipt, columns));
404
+ lines.push(...executionEvidenceLines(receipt, columns, surface));
400
405
  else {
401
406
  for (const [owner, count] of Object.entries(receipt.removed ?? {}))
402
407
  receiptRow(lines, " ", `${owner} removed`, [{ text: String(count) }], columns);
@@ -1,3 +1,4 @@
1
+ import type { NextCall } from "../../errors.js";
1
2
  import type { BindDraftReceipt } from "../draft.js";
2
3
  import { type CliUsageGuide } from "../usage.js";
3
4
  import type { ContractId, KeiyakuRefusal } from "../../index.js";
@@ -7,7 +8,7 @@ type DirtyWithOption = Extract<KeiyakuRefusal, {
7
8
  kind: "dirty-workspace";
8
9
  }> & {
9
10
  option?: Readonly<{
10
- flag: string;
11
+ next: NextCall;
11
12
  available: boolean;
12
13
  }>;
13
14
  };
@@ -17,7 +18,7 @@ type CliEdgeRefusal = Readonly<{
17
18
  diagnostic: string;
18
19
  }>;
19
20
  export type RenderableRefusal = KeiyakuRefusal | DirtyWithOption | CliEdgeRefusal;
20
- export declare function renderRefusalFacts(refusal: RenderableRefusal, indent: string, columns: number, addressed?: string): readonly string[];
21
+ export declare function renderRefusalFacts(refusal: RenderableRefusal, indent: string, columns: number, addressed?: string, surface?: TextRenderContext["surface"]): readonly string[];
21
22
  /**
22
23
  * The one refusal receipt assembly: a denied-verdict title, a labeled reason, labeled facts, and the
23
24
  * applicable acceptance grammar. Typed refusals and bare command refusals both render through here.
@@ -30,6 +31,6 @@ type RefusedInvocation = Readonly<{
30
31
  refusal: RenderableRefusal;
31
32
  }>;
32
33
  export declare function renderRefusal(refused: RefusedInvocation, draft?: BindDraftReceipt, context?: TextRenderContext): string;
33
- export declare function renderConflictMaterialized(result: HandoffOutcome, _context?: TextRenderContext): string;
34
+ export declare function renderConflictMaterialized(result: HandoffOutcome, context?: TextRenderContext): string;
34
35
  export declare function renderBindDraftReceipt(receipt: BindDraftReceipt): string;
35
36
  export {};