@astrosheep/keiyaku 4.6.8 → 4.6.9

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 (253) hide show
  1. package/README.md +40 -14
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +5 -6
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +1 -1
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +8 -8
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +9 -9
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +91 -0
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -2
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +5 -6
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +1 -1
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +8 -8
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +9 -9
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +91 -0
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -2
  18. package/build/plugins/opencode/index.js +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +5 -6
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +1 -1
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +8 -8
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +9 -9
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +91 -0
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -2
  26. package/build/skills/keiyaku/SKILL.md +5 -6
  27. package/build/skills/keiyaku-akuma/SKILL.md +1 -1
  28. package/build/skills/keiyaku-akuma/references/automation.md +8 -8
  29. package/build/skills/keiyaku-babysit/SKILL.md +1 -1
  30. package/build/skills/keiyaku-bind/SKILL.md +9 -9
  31. package/build/skills/keiyaku-debt/SKILL.md +91 -0
  32. package/build/skills/keiyaku-workflow/SKILL.md +2 -2
  33. package/build/src/akuma/akuma-instance.d.ts +2 -0
  34. package/build/src/akuma/akuma-instance.js +10 -0
  35. package/build/src/akuma/akuma-observe.d.ts +33 -8
  36. package/build/src/akuma/akuma-observe.js +88 -64
  37. package/build/src/akuma/akuma-owner.d.ts +11 -2
  38. package/build/src/akuma/akuma-owner.js +45 -35
  39. package/build/src/akuma/akuma-selection-execution.js +9 -1
  40. package/build/src/akuma/akuma-stream.d.ts +22 -0
  41. package/build/src/akuma/akuma-stream.js +116 -0
  42. package/build/src/akuma/akuma-wait.d.ts +1 -40
  43. package/build/src/akuma/akuma-wait.js +23 -84
  44. package/build/src/akuma/akuma.d.ts +17 -11
  45. package/build/src/akuma/akuma.js +2 -0
  46. package/build/src/akuma/allowed.d.ts +7 -12
  47. package/build/src/akuma/allowed.js +13 -4
  48. package/build/src/akuma/body-supervisor.d.ts +5 -5
  49. package/build/src/akuma/body-supervisor.js +22 -20
  50. package/build/src/akuma/body.js +28 -1
  51. package/build/src/akuma/call-request.d.ts +12 -22
  52. package/build/src/akuma/heart/activity-schema.d.ts +12 -0
  53. package/build/src/akuma/heart/activity-schema.js +6 -0
  54. package/build/src/akuma/heart/index.d.ts +59 -2
  55. package/build/src/akuma/heart/index.js +87 -8
  56. package/build/src/akuma/heart/rows.js +5 -3
  57. package/build/src/akuma/heart/soul.d.ts +9 -0
  58. package/build/src/akuma/heart/soul.js +29 -0
  59. package/build/src/akuma/heart/storage.d.ts +15 -0
  60. package/build/src/akuma/heart/storage.js +55 -0
  61. package/build/src/akuma/heart/timeline.d.ts +7 -0
  62. package/build/src/akuma/heart/timeline.js +10 -0
  63. package/build/src/akuma/index.d.ts +1 -0
  64. package/build/src/akuma/projection.d.ts +25 -0
  65. package/build/src/akuma/projection.js +24 -7
  66. package/build/src/akuma/provider-recipe.d.ts +11 -0
  67. package/build/src/akuma/provider-recipe.js +23 -0
  68. package/build/src/akuma/provider.d.ts +25 -0
  69. package/build/src/akuma/provider.js +99 -7
  70. package/build/src/akuma/providers/acp/events.js +25 -2
  71. package/build/src/akuma/providers/claude/events.js +76 -10
  72. package/build/src/akuma/providers/claude/index.js +2 -5
  73. package/build/src/akuma/providers/codex-app-server/events.js +17 -2
  74. package/build/src/akuma/providers/codex-app-server/index.js +15 -9
  75. package/build/src/akuma/providers/decode.d.ts +8 -0
  76. package/build/src/akuma/providers/decode.js +21 -0
  77. package/build/src/akuma/providers/grok-build/index.js +10 -26
  78. package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +3 -3
  79. package/build/src/akuma/providers/opencode-sdk/event-stream.js +2 -25
  80. package/build/src/akuma/providers/opencode-sdk/events.d.ts +7 -43
  81. package/build/src/akuma/providers/opencode-sdk/events.js +147 -284
  82. package/build/src/akuma/providers/opencode-sdk/index.js +267 -421
  83. package/build/src/akuma/providers/opencode-sdk/native-http.d.ts +9 -0
  84. package/build/src/akuma/providers/opencode-sdk/native-http.js +69 -0
  85. package/build/src/akuma/providers/opencode-sdk/session.d.ts +42 -36
  86. package/build/src/akuma/providers/opencode-sdk/session.js +75 -82
  87. package/build/src/akuma/providers/paseo/events.d.ts +8 -0
  88. package/build/src/akuma/providers/paseo/events.js +58 -11
  89. package/build/src/akuma/providers/paseo/index.js +11 -7
  90. package/build/src/akuma/providers/pi/events.d.ts +2 -0
  91. package/build/src/akuma/providers/pi/events.js +32 -24
  92. package/build/src/akuma/providers/pi/index.js +21 -35
  93. package/build/src/akuma/request-lifecycle.d.ts +1 -2
  94. package/build/src/akuma/request-lifecycle.js +2 -8
  95. package/build/src/akuma/request-rendezvous.js +38 -55
  96. package/build/src/akuma/request-serve.d.ts +1 -1
  97. package/build/src/akuma/request-serve.js +77 -113
  98. package/build/src/akuma/selection-observation.d.ts +57 -51
  99. package/build/src/akuma/selection-observation.js +3 -3
  100. package/build/src/akuma/turn-drive.d.ts +3 -0
  101. package/build/src/akuma/turn-drive.js +26 -5
  102. package/build/src/akuma-body.js +12 -22
  103. package/build/src/cli/akuma-caller.js +10 -0
  104. package/build/src/cli/commands/akuma-grammar.js +3 -4
  105. package/build/src/cli/commands/akuma.js +13 -51
  106. package/build/src/cli/commands/contract-grammar.d.ts +7 -6
  107. package/build/src/cli/commands/contract-grammar.js +27 -32
  108. package/build/src/cli/commands/contract-help.d.ts +16 -7
  109. package/build/src/cli/commands/contract-help.js +20 -11
  110. package/build/src/cli/commands/contract.js +11 -11
  111. package/build/src/cli/commands/debt-grammar.d.ts +19 -0
  112. package/build/src/cli/commands/debt-grammar.js +323 -0
  113. package/build/src/cli/commands/debt-query.d.ts +5 -0
  114. package/build/src/cli/commands/{task-query.js → debt-query.js} +9 -9
  115. package/build/src/cli/commands/{task.d.ts → debt.d.ts} +2 -2
  116. package/build/src/cli/commands/{task.js → debt.js} +83 -143
  117. package/build/src/cli/coordinates.d.ts +1 -1
  118. package/build/src/cli/coordinates.js +1 -1
  119. package/build/src/cli/parse.d.ts +4 -4
  120. package/build/src/cli/parse.js +17 -16
  121. package/build/src/cli/render/akuma-activity.d.ts +11 -83
  122. package/build/src/cli/render/akuma-activity.js +20 -382
  123. package/build/src/cli/render/catalog.d.ts +2 -2
  124. package/build/src/cli/render/catalog.js +5 -5
  125. package/build/src/cli/render/contract.js +2 -2
  126. package/build/src/cli/render/debt.d.ts +28 -0
  127. package/build/src/cli/render/{task.js → debt.js} +51 -112
  128. package/build/src/cli/render/kanshi.js +28 -28
  129. package/build/src/cli/render/marks.d.ts +5 -5
  130. package/build/src/cli/render/marks.js +4 -10
  131. package/build/src/cli/render/nuke.js +1 -1
  132. package/build/src/cli/runtime.js +3 -3
  133. package/build/src/cli/scan.d.ts +1 -1
  134. package/build/src/cli/usage.d.ts +1 -1
  135. package/build/src/cli/usage.js +4 -4
  136. package/build/src/contract-worktree.js +3 -3
  137. package/build/src/debt/board.d.ts +160 -0
  138. package/build/src/{task → debt}/board.js +89 -89
  139. package/build/src/debt/catalog.d.ts +11 -0
  140. package/build/src/debt/catalog.js +59 -0
  141. package/build/src/{task → debt}/context.d.ts +1 -1
  142. package/build/src/{task → debt}/context.js +1 -1
  143. package/build/src/{task → debt}/created-observation.d.ts +6 -10
  144. package/build/src/{task → debt}/created-observation.js +7 -7
  145. package/build/src/debt/document.d.ts +37 -0
  146. package/build/src/{task → debt}/document.js +37 -37
  147. package/build/src/debt/identity.d.ts +21 -0
  148. package/build/src/{task → debt}/identity.js +35 -35
  149. package/build/src/debt/index.d.ts +111 -0
  150. package/build/src/debt/index.js +203 -0
  151. package/build/src/{task → debt}/input.d.ts +8 -8
  152. package/build/src/{task → debt}/input.js +21 -21
  153. package/build/src/debt/lifecycle-operations.d.ts +6 -0
  154. package/build/src/{task → debt}/lifecycle-operations.js +27 -31
  155. package/build/src/debt/mutation-result.d.ts +981 -0
  156. package/build/src/debt/mutation-result.js +109 -0
  157. package/build/src/debt/mutation.d.ts +424 -0
  158. package/build/src/debt/mutation.js +223 -0
  159. package/build/src/debt/operation-types.d.ts +71 -0
  160. package/build/src/debt/operations.d.ts +28 -0
  161. package/build/src/{task → debt}/operations.js +59 -60
  162. package/build/src/debt/query.d.ts +76 -0
  163. package/build/src/{task → debt}/query.js +55 -55
  164. package/build/src/{task → debt}/store.d.ts +13 -13
  165. package/build/src/{task → debt}/store.js +58 -49
  166. package/build/src/debt/view.d.ts +4 -0
  167. package/build/src/debt/view.js +7 -0
  168. package/build/src/identity/coordinates.d.ts +1 -1
  169. package/build/src/index.d.ts +13 -13
  170. package/build/src/index.js +9 -9
  171. package/build/src/kanshi/index.d.ts +1 -1
  172. package/build/src/kanshi/read.js +33 -33
  173. package/build/src/kanshi/report.d.ts +7 -7
  174. package/build/src/kanshi/select.js +4 -4
  175. package/build/src/library/akumas.d.ts +2 -3
  176. package/build/src/library/bind.d.ts +3 -3
  177. package/build/src/library/bind.js +5 -5
  178. package/build/src/library/contract-creation.js +5 -5
  179. package/build/src/library/contract-execution.js +4 -4
  180. package/build/src/library/contract-types.d.ts +2 -2
  181. package/build/src/library/input.d.ts +2 -2
  182. package/build/src/library/input.js +5 -5
  183. package/build/src/library/invocation.js +2 -2
  184. package/build/src/library/nuke.js +3 -3
  185. package/build/src/library/outcome.d.ts +126 -126
  186. package/build/src/library/outcome.js +3 -3
  187. package/build/src/library/selection.d.ts +1 -4
  188. package/build/src/library/selection.js +11 -62
  189. package/build/src/plugin/public.d.ts +5 -0
  190. package/build/src/plugin/runtime.js +3 -1
  191. package/build/src/runtime/proc/windows-launch.exe +0 -0
  192. package/build/src/settlement/fence.d.ts +3 -3
  193. package/build/src/settlement/fence.js +4 -4
  194. package/build/src/settlement/holder.d.ts +16 -16
  195. package/build/src/settlement/holder.js +69 -63
  196. package/build/src/settlement/settle.d.ts +5 -5
  197. package/build/src/settlement/settle.js +53 -53
  198. package/package.json +12 -6
  199. package/plugins/paseo/plugin/index.server.ts +17 -0
  200. package/plugins/paseo/plugin/paseo-plugin.json +4 -0
  201. package/plugins/paseo/plugin/server/attach.ts +52 -0
  202. package/plugins/paseo/plugin/server/keiyaku.ts +44 -0
  203. package/plugins/paseo/plugin/server/message.ts +60 -0
  204. package/plugins/paseo/plugin/server/mirror.ts +193 -0
  205. package/plugins/paseo/plugin/server/model.ts +14 -0
  206. package/plugins/paseo/plugin/server/provider.ts +276 -0
  207. package/plugins/paseo/plugin/server/sdk-worker.ts +237 -0
  208. package/plugins/paseo/plugin/server/sdk.ts +289 -0
  209. package/plugins/paseo/plugin/server/stop.ts +26 -0
  210. package/plugins/paseo/plugin/server/transport.ts +35 -0
  211. package/plugins/paseo/plugin/shared/attach-rpc.ts +10 -0
  212. package/plugins/paseo/plugin/shared/refresh-rpc.ts +6 -0
  213. package/plugins/paseo/plugin/tsconfig.json +6 -0
  214. package/skills/keiyaku/SKILL.md +5 -6
  215. package/skills/keiyaku-akuma/SKILL.md +1 -1
  216. package/skills/keiyaku-akuma/references/automation.md +8 -8
  217. package/skills/keiyaku-babysit/SKILL.md +1 -1
  218. package/skills/keiyaku-bind/SKILL.md +9 -9
  219. package/skills/keiyaku-debt/SKILL.md +91 -0
  220. package/skills/keiyaku-workflow/SKILL.md +2 -2
  221. package/build/plugins/claude/skills/keiyaku-task/SKILL.md +0 -104
  222. package/build/plugins/codex/skills/keiyaku-task/SKILL.md +0 -104
  223. package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +0 -104
  224. package/build/skills/keiyaku-task/SKILL.md +0 -104
  225. package/build/src/cli/commands/task-grammar.d.ts +0 -19
  226. package/build/src/cli/commands/task-grammar.js +0 -384
  227. package/build/src/cli/commands/task-query.d.ts +0 -5
  228. package/build/src/cli/render/task.d.ts +0 -39
  229. package/build/src/task/board.d.ts +0 -168
  230. package/build/src/task/catalog.d.ts +0 -11
  231. package/build/src/task/catalog.js +0 -59
  232. package/build/src/task/compose-language.d.ts +0 -57
  233. package/build/src/task/compose-language.js +0 -364
  234. package/build/src/task/compose-parser.d.ts +0 -32
  235. package/build/src/task/compose-parser.js +0 -180
  236. package/build/src/task/compose.d.ts +0 -16
  237. package/build/src/task/compose.js +0 -189
  238. package/build/src/task/document.d.ts +0 -39
  239. package/build/src/task/identity.d.ts +0 -21
  240. package/build/src/task/index.d.ts +0 -138
  241. package/build/src/task/index.js +0 -269
  242. package/build/src/task/lifecycle-operations.d.ts +0 -6
  243. package/build/src/task/mutation-result.d.ts +0 -1726
  244. package/build/src/task/mutation-result.js +0 -198
  245. package/build/src/task/mutation.d.ts +0 -590
  246. package/build/src/task/mutation.js +0 -262
  247. package/build/src/task/operation-types.d.ts +0 -71
  248. package/build/src/task/operations.d.ts +0 -28
  249. package/build/src/task/query.d.ts +0 -76
  250. package/build/src/task/view.d.ts +0 -4
  251. package/build/src/task/view.js +0 -7
  252. package/skills/keiyaku-task/SKILL.md +0 -104
  253. /package/build/src/{task → debt}/operation-types.js +0 -0
@@ -1,8 +1,8 @@
1
1
  import type { AkumaList } from "../../akuma/akuma.js";
2
2
  import type { ArchetypeCatalog } from "../../index.js";
3
3
  import type { ContractList } from "../../library/contract-types.js";
4
- import type { TaskPage, TaskRow } from "../../task/index.js";
4
+ import type { DebtPage, DebtRow } from "../../debt/index.js";
5
5
  export declare function renderAkumaCatalogue(list: AkumaList, archetype: string | null): string;
6
6
  export declare function renderContractCatalogue(list: ContractList): string;
7
7
  export declare function renderArchetypeCatalogue(list: ArchetypeCatalog): string;
8
- export declare function renderTaskCatalogue(list: TaskPage<TaskRow>, namespace: readonly string[]): string;
8
+ export declare function renderDebtCatalogue(list: DebtPage<DebtRow>, namespace: readonly string[]): string;
@@ -1,7 +1,7 @@
1
1
  import { abbreviateGitIds, displayGitId, gitIdsInRow, lifecycleWord, progressStrip } from "./contract-observation.js";
2
2
  import { ageText, emptyCatalogue, renderBoundedPayload, safeText } from "./terminal.js";
3
3
  import { akumaMark, contractMark } from "./marks.js";
4
- import { dispositionText, taskFrameHead, taskMark } from "./task.js";
4
+ import { dispositionText, debtFrameHead, debtMark } from "./debt.js";
5
5
  function relativeAge(source, observedAt) {
6
6
  if (source === null)
7
7
  return null;
@@ -92,14 +92,14 @@ export function renderArchetypeCatalogue(list) {
92
92
  ]),
93
93
  ].join("\n");
94
94
  }
95
- export function renderTaskCatalogue(list, namespace) {
95
+ export function renderDebtCatalogue(list, namespace) {
96
96
  const scope = namespace.length === 0 ? "root" : `namespace ${namespace.join("/")}`;
97
- const head = taskFrameHead("tasks", scope);
97
+ const head = debtFrameHead("debts", scope);
98
98
  if (list.rows.length === 0)
99
- return emptyCatalogue("tasks");
99
+ return emptyCatalogue("debts");
100
100
  return [
101
101
  head,
102
- ...list.rows.map((row) => `${taskMark(row.disposition)} ${safeText(row.id)} · ${dispositionText(row.disposition)} · P${row.priority} — ${safeText(row.title)}`),
102
+ ...list.rows.map((row) => `${debtMark(row.disposition)} ${safeText(row.id)} · ${dispositionText(row.disposition)} · P${row.priority} — ${safeText(row.title)}`),
103
103
  ...(list.hasMore ? ["…"] : []),
104
104
  ].join("\n");
105
105
  }
@@ -62,8 +62,8 @@ function lagRows(lag, columns) {
62
62
  function settlementLagRows(lag, columns) {
63
63
  const lines = [];
64
64
  receiptRow(lines, "!", "settlement", [{ text: lag.surface.replaceAll("-", " ") }], columns);
65
- if (lag.taskId !== undefined)
66
- receiptRow(lines, " ", "task", [{ text: lag.taskId, opaque: true }], columns);
65
+ if (lag.debtId !== undefined)
66
+ receiptRow(lines, " ", "debt", [{ text: lag.debtId, opaque: true }], columns);
67
67
  if (lag.path !== undefined)
68
68
  receiptRow(lines, " ", "path", [{ text: lag.path, opaque: true }], columns);
69
69
  receiptPayload(lines, "reason", lag.diagnostic);
@@ -0,0 +1,28 @@
1
+ import type { BlockedDebtList, DebtBatchResult, DebtContextResult, DebtDecompositionTree, DebtDetail, DebtDoctorReport, DebtList, DebtMutationResult, DebtQueryResult, DebtUpdateResult } from "../../debt/index.js";
2
+ import { type TextRenderContext } from "./terminal.js";
3
+ export { debtMark } from "./marks.js";
4
+ type DebtListOutcome = DebtList | BlockedDebtList | DebtQueryResult;
5
+ /** One addressed show selection: native details, or a refusal naming a missing addressed read. */
6
+ export type DebtShowResult = DebtDetail | DebtDetail[] | Extract<DebtMutationResult, {
7
+ kind: "refused";
8
+ }>;
9
+ /** Presentation-only list scope the leaf acquired; never part of a product value. */
10
+ export type DebtListScope = "world" | "current" | Readonly<{
11
+ namespace: string;
12
+ }>;
13
+ /** The union of native Debt SDK answers one leaf renders directly; the CLI adds no result envelope. */
14
+ type DebtNativeResult = DebtMutationResult | DebtUpdateResult | DebtBatchResult | DebtShowResult | DebtList | BlockedDebtList | DebtQueryResult | DebtDecompositionTree | DebtDoctorReport | DebtContextResult;
15
+ /** Debt dispositions and relation states are snake_case facts; people read them as words. */
16
+ export declare function dispositionText(word: string): string;
17
+ export declare function debtFrameHead(view: string, scope: string): string;
18
+ export declare function renderDebtList(action: "ls" | "ready" | "blocked" | "query", scope: DebtListScope, result: DebtListOutcome, context?: TextRenderContext): string;
19
+ export declare function renderDebtShow(result: DebtShowResult, context?: TextRenderContext): string;
20
+ export declare function renderDoctor(report: DebtDoctorReport): string;
21
+ export declare function renderDebtUpdate(result: DebtUpdateResult, context?: TextRenderContext): string;
22
+ export declare function renderDebtTree(result: DebtDecompositionTree, context?: TextRenderContext): string;
23
+ export declare function renderDebtContext(result: DebtContextResult, context?: TextRenderContext): string;
24
+ /** One single-Debt mutation answer; `verb` is the literal action the leaf invoked. */
25
+ export declare function renderDebtMutation(verb: string, result: DebtMutationResult, context?: TextRenderContext): string;
26
+ /** One lifecycle answer: a single mutation or a plural batch, both native shapes. */
27
+ export declare function renderDebtLifecycle(verb: string, result: DebtMutationResult | DebtBatchResult, context?: TextRenderContext): string;
28
+ export declare function debtExitCode(result: DebtNativeResult): number;
@@ -1,9 +1,9 @@
1
- import { taskMark } from "./marks.js";
1
+ import { debtMark } from "./marks.js";
2
2
  import { outcomeLines, receiptPayload, receiptRow, refusalLines } from "./receipt.js";
3
3
  import { DEFAULT_CLI_COLUMNS, displayColumns, emptyCatalogue, renderTextBlock, safeText, } from "./terminal.js";
4
- export { taskMark } from "./marks.js";
4
+ export { debtMark } from "./marks.js";
5
5
  const DEFAULT_CONTEXT = { columns: DEFAULT_CLI_COLUMNS, color: false };
6
- /** Task dispositions and relation states are snake_case facts; people read them as words. */
6
+ /** Debt dispositions and relation states are snake_case facts; people read them as words. */
7
7
  export function dispositionText(word) {
8
8
  return word === "drop" ? "dropped" : word.replaceAll("_", " ");
9
9
  }
@@ -12,8 +12,8 @@ function priorityText(priority) {
12
12
  }
13
13
  function scanUnit(id, priority, word) {
14
14
  return word === undefined
15
- ? `${taskMark("ready")} ${id} · ${priorityText(priority)}`
16
- : `${taskMark(word)} ${id} · ${dispositionText(word)} · ${priorityText(priority)}`;
15
+ ? `${debtMark("ready")} ${id} · ${priorityText(priority)}`
16
+ : `${debtMark(word)} ${id} · ${dispositionText(word)} · ${priorityText(priority)}`;
17
17
  }
18
18
  function entityLines(entity, columns, indent = "") {
19
19
  const scan = `${indent}${scanUnit(entity.id, entity.priority, entity.word)}${entity.facts === undefined ? "" : ` · ${entity.facts}`}`;
@@ -25,20 +25,20 @@ function entityLines(entity, columns, indent = "") {
25
25
  return [inline];
26
26
  return [scan, ...renderTextBlock(title, `${indent} `, columns, "—")];
27
27
  }
28
- function stateEntity(task) {
28
+ function stateEntity(debt) {
29
29
  return {
30
- id: task.id,
31
- priority: "priority" in task && task.priority !== undefined ? task.priority : null,
32
- word: task.state,
33
- title: task.title,
30
+ id: debt.id,
31
+ priority: "priority" in debt && debt.priority !== undefined ? debt.priority : null,
32
+ word: debt.state,
33
+ title: debt.title,
34
34
  };
35
35
  }
36
36
  function projectRefusal(refusal) {
37
37
  const diagnostic = refusal.kind.replaceAll("-", " ");
38
- if (refusal.kind === "task-missing")
39
- return { diagnostic, facts: [`task ${refusal.taskId}`] };
38
+ if (refusal.kind === "debt-missing")
39
+ return { diagnostic, facts: [`debt ${refusal.debtId}`] };
40
40
  if (refusal.kind === "invalid-lifecycle-transition") {
41
- return { diagnostic, facts: [`task ${refusal.taskId}`, `state ${refusal.state} · verb ${refusal.verb}`] };
41
+ return { diagnostic, facts: [`debt ${refusal.debtId}`, `state ${refusal.state} · verb ${refusal.verb}`] };
42
42
  }
43
43
  if (refusal.kind === "invalid-namespace-context")
44
44
  return { diagnostic, facts: [`path ${refusal.path}`] };
@@ -46,14 +46,12 @@ function projectRefusal(refusal) {
46
46
  return {
47
47
  diagnostic,
48
48
  facts: [
49
- `task ${refusal.taskId}`,
50
- `related task ${refusal.related}`,
51
- `declaring task ${refusal.declaringTask}`,
49
+ `debt ${refusal.debtId}`,
50
+ `related debt ${refusal.related}`,
51
+ `declaring debt ${refusal.declaringDebt}`,
52
52
  ],
53
53
  };
54
54
  }
55
- if (refusal.kind === "invalid-composition")
56
- return { diagnostic, compositionDiagnostics: refusal.diagnostics };
57
55
  return refusal.diagnostic === undefined ? { diagnostic } : { diagnostic, facts: [`detail ${refusal.diagnostic}`] };
58
56
  }
59
57
  function renderFailure(verb, result, columns) {
@@ -61,13 +59,13 @@ function renderFailure(verb, result, columns) {
61
59
  return [...outcomeLines("?", verb, "retry", undefined, columns), result.reason].join("\n");
62
60
  }
63
61
  const facts = projectRefusal(result.refusal);
64
- return refusalLines(verb, [`reason ${facts.diagnostic}`, ...(facts.facts ?? [])], columns, (facts.compositionDiagnostics ?? []).map((item) => `line ${item.line} · ${safeText(item.reason)} · ${safeText(item.token)}`)).join("\n");
62
+ return refusalLines(verb, [`reason ${facts.diagnostic}`, ...(facts.facts ?? [])], columns).join("\n");
65
63
  }
66
64
  function edge(label, ref, mark) {
67
65
  const prefix = mark === undefined ? ` ${label}` : ` ${mark} ${label}`;
68
66
  return `${prefix} ${ref.id} · ${dispositionText(ref.state)}`;
69
67
  }
70
- export function taskFrameHead(view, scope) {
68
+ export function debtFrameHead(view, scope) {
71
69
  return `${view.toUpperCase()} // ${scope}`;
72
70
  }
73
71
  function updatedAge(updatedAt) {
@@ -103,18 +101,18 @@ function renderListRow(item, columns, omitDisposition) {
103
101
  }
104
102
  return lines;
105
103
  }
106
- export function renderTaskList(action, scope, result, context = DEFAULT_CONTEXT) {
104
+ export function renderDebtList(action, scope, result, context = DEFAULT_CONTEXT) {
107
105
  const columns = context.columns;
108
106
  if (result.kind !== "accepted")
109
107
  return renderFailure(action, result, columns);
110
- const view = action === "ls" ? "tasks" : action;
108
+ const view = action === "ls" ? "debts" : action;
111
109
  const footer = result.value.hasMore ? ["…"] : [];
112
110
  const scopeText = scope === "world"
113
111
  ? "world"
114
112
  : scope === "current"
115
113
  ? "current namespace"
116
- : `namespace ${scope.namespace.replace(/^task\//u, "").replace(/\/$/u, "") || "root"}`;
117
- const heading = taskFrameHead(view, scopeText);
114
+ : `namespace ${scope.namespace.replace(/^debt\//u, "").replace(/\/$/u, "") || "root"}`;
115
+ const heading = debtFrameHead(view, scopeText);
118
116
  if (result.value.rows.length === 0)
119
117
  return emptyCatalogue(view);
120
118
  return [
@@ -127,12 +125,12 @@ function textTimestamp(timestamp) {
127
125
  return timestamp.replace(/\.\d+(?=Z$)/u, "");
128
126
  }
129
127
  function renderShowDetail(result, columns) {
130
- const task = result.task;
128
+ const debt = result.debt;
131
129
  const lines = [
132
- ...entityLines(stateEntity(task), columns),
133
- ` created ${textTimestamp(task.createdAt)}`,
134
- ` updated ${textTimestamp(task.updatedAt)}`,
135
- ...(task.createdBy === undefined ? [] : [` created by ${task.createdBy}`]),
130
+ ...entityLines(stateEntity(debt), columns),
131
+ ` created ${textTimestamp(debt.createdAt)}`,
132
+ ` updated ${textTimestamp(debt.updatedAt)}`,
133
+ ...(debt.createdBy === undefined ? [] : [` created by ${debt.createdBy}`]),
136
134
  ];
137
135
  for (const need of result.needs.filter((item) => !item.released))
138
136
  lines.push(edge("needs", need, "!"));
@@ -150,13 +148,13 @@ function renderShowDetail(result, columns) {
150
148
  lines.push(edge("superseded-by", item));
151
149
  for (const item of result.related)
152
150
  lines.push(edge("related", item));
153
- if (task.note.length > 0)
154
- receiptPayload(lines, "note", task.note);
155
- if (task.body.length > 0)
156
- receiptPayload(lines, "body", task.body);
151
+ if (debt.note.length > 0)
152
+ receiptPayload(lines, "note", debt.note);
153
+ if (debt.body.length > 0)
154
+ receiptPayload(lines, "body", debt.body);
157
155
  return lines.join("\n");
158
156
  }
159
- export function renderTaskShow(result, context = DEFAULT_CONTEXT) {
157
+ export function renderDebtShow(result, context = DEFAULT_CONTEXT) {
160
158
  const columns = context.columns;
161
159
  if (Array.isArray(result))
162
160
  return result.map((detail) => renderShowDetail(detail, columns)).join("\n\n");
@@ -167,18 +165,18 @@ export function renderTaskShow(result, context = DEFAULT_CONTEXT) {
167
165
  function treeLines(node, columns, depth = 0) {
168
166
  const indent = " ".repeat(depth);
169
167
  if (node.cycle === true)
170
- return [`${indent}! ${node.task.id} · cycle`];
168
+ return [`${indent}! ${node.debt.id} · cycle`];
171
169
  return [
172
- ...entityLines(stateEntity(node.task), columns, indent),
170
+ ...entityLines(stateEntity(node.debt), columns, indent),
173
171
  ...node.children.flatMap((child) => treeLines(child, columns, depth + 1)),
174
172
  ];
175
173
  }
176
174
  function doctorIssue(issue) {
177
175
  if (issue.kind === "missing-target")
178
- return `! missing-target ${issue.taskId} ${issue.relation} ${issue.target}`;
176
+ return `! missing-target ${issue.debtId} ${issue.relation} ${issue.target}`;
179
177
  if (issue.kind === "self-relation")
180
- return `! self-relation ${issue.taskId} ${issue.relation}`;
181
- return `! cycle ${issue.relation} ${issue.tasks.join(" ")}`;
178
+ return `! self-relation ${issue.debtId} ${issue.relation}`;
179
+ return `! cycle ${issue.relation} ${issue.debts.join(" ")}`;
182
180
  }
183
181
  export function renderDoctor(report) {
184
182
  if (report.issues.length === 0)
@@ -188,18 +186,14 @@ export function renderDoctor(report) {
188
186
  }
189
187
  const PAST_VERBS = {
190
188
  add: "added",
191
- start: "started",
192
- stop: "stopped",
193
- hold: "held",
194
- resume: "resumed",
195
189
  done: "done",
196
190
  drop: "dropped",
197
191
  update: "updated",
198
192
  };
199
- function renderAcceptedMutation(verb, task, columns, changes = []) {
193
+ function renderAcceptedMutation(verb, debt, columns, changes = []) {
200
194
  const lines = [];
201
- receiptRow(lines, "✓", PAST_VERBS[verb] ?? verb, [{ text: task.id, opaque: true }], columns);
202
- lines.push(...entityLines(stateEntity(task), columns));
195
+ receiptRow(lines, "✓", PAST_VERBS[verb] ?? verb, [{ text: debt.id, opaque: true }], columns);
196
+ lines.push(...entityLines(stateEntity(debt), columns));
203
197
  for (const change of changes)
204
198
  lines.push(` ${change.field} ${change.action}`);
205
199
  return lines.join("\n");
@@ -209,11 +203,11 @@ function renderMutation(action, result, columns) {
209
203
  return renderFailure(action, result, columns);
210
204
  return renderAcceptedMutation(action, result.value, columns);
211
205
  }
212
- export function renderTaskUpdate(result, context = DEFAULT_CONTEXT) {
206
+ export function renderDebtUpdate(result, context = DEFAULT_CONTEXT) {
213
207
  const columns = context.columns;
214
208
  if (result.kind !== "accepted")
215
209
  return renderFailure("update", result, columns);
216
- return renderAcceptedMutation("update", result.value.task, columns, result.value.changedFields);
210
+ return renderAcceptedMutation("update", result.value.debt, columns, result.value.changedFields);
217
211
  }
218
212
  function renderBatchItem(verb, item, columns) {
219
213
  if (item.outcome.kind === "accepted")
@@ -221,87 +215,32 @@ function renderBatchItem(verb, item, columns) {
221
215
  if (item.outcome.kind === "retry")
222
216
  return `? ${verb} ${item.id} ${item.outcome.reason}`;
223
217
  const facts = projectRefusal(item.outcome.refusal);
224
- const rest = (facts.facts ?? []).filter((fact) => fact !== `task ${item.id}`);
225
- return refusalLines(verb, [`task ${item.id}`, `reason ${facts.diagnostic}`, ...rest], columns).join("\n");
218
+ const rest = (facts.facts ?? []).filter((fact) => fact !== `debt ${item.id}`);
219
+ return refusalLines(verb, [`debt ${item.id}`, `reason ${facts.diagnostic}`, ...rest], columns).join("\n");
226
220
  }
227
221
  function renderBatch(verb, batch, columns) {
228
222
  return batch.items.map((item) => renderBatchItem(verb, item, columns)).join("\n");
229
223
  }
230
- function admissionLines(admissions) {
231
- return admissions.map((admission) => `admit ${admission.position} ${admission.kind === "new" ? "+" : `@${admission.taskId}`} ${safeText(admission.title)}${admission.kind === "new" && admission.alias !== undefined ? ` as ^${admission.alias}` : ""}`);
232
- }
233
- function stoppedLines(stopped) {
234
- if (stopped.kind === "retry")
235
- return [`? stopped ${stopped.reason}`];
236
- const facts = projectRefusal(stopped);
237
- return refusalLines("stopped", [`reason ${facts.diagnostic}`, ...(facts.facts ?? [])], DEFAULT_CLI_COLUMNS);
238
- }
239
- function aliasLines(aliases) {
240
- return aliases.map((binding) => `alias ^${binding.alias} ${binding.taskId}`);
241
- }
242
- function planAliasLines(aliases) {
243
- return aliases.map((binding) => `alias ^${binding.alias} ${binding.position}`);
244
- }
245
- function renderPlan(result) {
246
- const lines = [
247
- `compose plan · ${result.admissionOrder.length} documents`,
248
- ...planAliasLines(result.aliases),
249
- ...admissionLines(result.admissions),
250
- ];
251
- for (const body of result.bodies) {
252
- lines.push(`body ${body.position} + ${safeText(body.title)} · ${body.bytes} bytes`);
253
- lines.push(` first ${safeText(body.firstLine)}`);
254
- lines.push(` last ${safeText(body.lastLine)}`);
255
- }
256
- return lines.join("\n");
257
- }
258
- export function renderTaskCompose(result, context = DEFAULT_CONTEXT) {
259
- const columns = context.columns;
260
- if (result.kind === "incomplete")
261
- return "";
262
- if (result.kind === "planned")
263
- return renderPlan(result);
264
- if (result.kind !== "accepted")
265
- return renderFailure("compose", result, columns);
266
- return [
267
- `✓ composed · ${result.documentChanges.length} changed`,
268
- ...aliasLines(result.aliases),
269
- ...admissionLines(result.admissions),
270
- ].join("\n");
271
- }
272
- export function renderTaskTree(result, context = DEFAULT_CONTEXT) {
224
+ export function renderDebtTree(result, context = DEFAULT_CONTEXT) {
273
225
  return result.kind === "accepted"
274
226
  ? treeLines(result.value, context.columns).join("\n")
275
227
  : renderFailure("tree", result, context.columns);
276
228
  }
277
- export function renderTaskContext(result, context = DEFAULT_CONTEXT) {
229
+ export function renderDebtContext(result, context = DEFAULT_CONTEXT) {
278
230
  if (result.kind !== "accepted")
279
231
  return renderFailure("context", result, context.columns);
280
232
  const value = result.value.namespace.length === 0 ? "root" : result.value.namespace.join("/");
281
233
  return `context ${value} · ${result.value.source}`;
282
234
  }
283
- /** One single-Task mutation answer; `verb` is the literal action the leaf invoked. */
284
- export function renderTaskMutation(verb, result, context = DEFAULT_CONTEXT) {
235
+ /** One single-Debt mutation answer; `verb` is the literal action the leaf invoked. */
236
+ export function renderDebtMutation(verb, result, context = DEFAULT_CONTEXT) {
285
237
  return renderMutation(verb, result, context.columns);
286
238
  }
287
239
  /** One lifecycle answer: a single mutation or a plural batch, both native shapes. */
288
- export function renderTaskLifecycle(verb, result, context = DEFAULT_CONTEXT) {
240
+ export function renderDebtLifecycle(verb, result, context = DEFAULT_CONTEXT) {
289
241
  return "items" in result ? renderBatch(verb, result, context.columns) : renderMutation(verb, result, context.columns);
290
242
  }
291
- /** A native refusal the CLI edge raised for one action, through the shared refusal grammar. */
292
- export function renderTaskFailure(verb, result, context = DEFAULT_CONTEXT) {
293
- return renderFailure(verb, result, context.columns);
294
- }
295
- export function renderTaskIncompleteDiagnostic(result) {
296
- if (result.kind !== "incomplete")
297
- return "";
298
- return [
299
- `! compose incomplete ${result.documentChanges.length} admitted`,
300
- ...admissionLines(result.admissions.slice(0, result.documentChanges.length)),
301
- ...stoppedLines(result.stopped),
302
- ].join("\n");
303
- }
304
- export function taskExitCode(result) {
243
+ export function debtExitCode(result) {
305
244
  if ("issues" in result)
306
245
  return result.issues.length === 0 ? 0 : 1;
307
246
  if ("items" in result) {
@@ -311,7 +250,7 @@ export function taskExitCode(result) {
311
250
  if ("kind" in result) {
312
251
  if (result.kind === "retry")
313
252
  return 2;
314
- if (result.kind === "refused" || result.kind === "incomplete")
253
+ if (result.kind === "refused")
315
254
  return 1;
316
255
  }
317
256
  return 0;
@@ -1,8 +1,8 @@
1
1
  import { abbreviateGitIds, afterWording, progressStrip, displayGitId, gateFact, gitIdsInRow, lifecycleWord, mergeSummary, targetMovementFacts, verificationFact, } 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
- import { contractMark, taskDispositionMark } from "./marks.js";
5
- import { dispositionText } from "./task.js";
4
+ import { contractMark, debtDispositionMark } from "./marks.js";
5
+ import { dispositionText } from "./debt.js";
6
6
  const REVIEW_ATTENTION_MS = 15 * 60 * 1_000;
7
7
  const PENDING_ATTENTION_MS = 60 * 60 * 1_000;
8
8
  function contractHasError(row) {
@@ -52,13 +52,13 @@ function mergeFacts(row) {
52
52
  const summary = mergeSummary(row.workspaceObservation);
53
53
  return summary === undefined ? [] : [summary];
54
54
  }
55
- function linkedTask(tasks, taskId) {
56
- if (tasks.kind !== "present")
57
- return `! ${taskId} · unavailable`;
58
- const task = tasks.value.rows.find((candidate) => candidate.id === taskId);
59
- return task === undefined
60
- ? `! ${taskId} · unavailable`
61
- : `${taskDispositionMark(task.disposition)} ${task.id} · ${dispositionText(task.disposition)}`;
55
+ function linkedDebt(debts, debtId) {
56
+ if (debts.kind !== "present")
57
+ return `! ${debtId} · unavailable`;
58
+ const debt = debts.value.rows.find((candidate) => candidate.id === debtId);
59
+ return debt === undefined
60
+ ? `! ${debtId} · unavailable`
61
+ : `${debtDispositionMark(debt.disposition)} ${debt.id} · ${dispositionText(debt.disposition)}`;
62
62
  }
63
63
  function isTerminalAkuma(life) {
64
64
  return life === "killed" || life === "stillborn";
@@ -102,12 +102,12 @@ function payload(label, text, context) {
102
102
  truncated: false,
103
103
  });
104
104
  }
105
- function liveAlarms(row, tasks) {
105
+ function liveAlarms(row, debts) {
106
106
  return [
107
107
  ...mergeFacts(row),
108
- ...(row.holder.kind === "unavailable" ? ["task unavailable"] : []),
109
- ...(row.holder.kind === "held" && tasks !== undefined && linkedTask(tasks, row.holder.taskId).startsWith("!")
110
- ? ["task unavailable"]
108
+ ...(row.holder.kind === "unavailable" ? ["debt unavailable"] : []),
109
+ ...(row.holder.kind === "held" && debts !== undefined && linkedDebt(debts, row.holder.debtId).startsWith("!")
110
+ ? ["debt unavailable"]
111
111
  : []),
112
112
  ...(row.issue === undefined ? [] : ["pending reconciliation"]),
113
113
  ...(row.workspaceObservation.kind === "failed" || row.workspaceObservation.kind === "unavailable"
@@ -173,7 +173,7 @@ function renderSelectedContractRow(row, facts, context, abbreviations) {
173
173
  lines.push(...semanticBlock("akuma", [akuma], context));
174
174
  if (row.worktreePath !== null)
175
175
  lines.push(...semanticBlock("worktree", [`worktree ${row.worktreePath}`], context));
176
- lines.push(...semanticBlock("alarms", liveAlarms(row, facts.tasks), context));
176
+ lines.push(...semanticBlock("alarms", liveAlarms(row, facts.debts), context));
177
177
  return lines;
178
178
  }
179
179
  function renderWorldContractRow(row, facts, context, abbreviations) {
@@ -185,7 +185,7 @@ function renderWorldContractRow(row, facts, context, abbreviations) {
185
185
  : [
186
186
  progressStrip(row),
187
187
  ...(linkedAkumaSummary(row, facts.akuma) === undefined ? [] : [linkedAkumaSummary(row, facts.akuma)]),
188
- ...liveAlarms(row, facts.tasks),
188
+ ...liveAlarms(row, facts.debts),
189
189
  ];
190
190
  const statusTone = contractStatusTone(row, facts.observedAt);
191
191
  return entityLines({
@@ -217,7 +217,7 @@ function renderContractBoard(section, facts, context, emptyRows) {
217
217
  return [header, ...rendered.slice(1), ...(section.value.hasMore === true ? ["…"] : [])];
218
218
  }
219
219
  function renderContracts(report, context) {
220
- return renderContractBoard(report.contracts, { observedAt: report.observedAt, akuma: report.akuma, tasks: report.tasks }, context, []);
220
+ return renderContractBoard(report.contracts, { observedAt: report.observedAt, akuma: report.akuma, debts: report.debts }, context, []);
221
221
  }
222
222
  function renderSelectedContract(report, context) {
223
223
  const section = report.contracts;
@@ -228,20 +228,20 @@ function renderSelectedContract(report, context) {
228
228
  const row = section.value.rows[0];
229
229
  return row === undefined
230
230
  ? [" keiyaku absent"]
231
- : renderSelectedContractRow(row, { observedAt: report.observedAt, akuma: report.akuma, tasks: report.tasks }, context, contractAbbreviations(section.value));
231
+ : renderSelectedContractRow(row, { observedAt: report.observedAt, akuma: report.akuma, debts: report.debts }, context, contractAbbreviations(section.value));
232
232
  }
233
- function taskFailureFact(failure) {
233
+ function debtFailureFact(failure) {
234
234
  return failure.coordinate === undefined ? failure.message : `${failure.coordinate} · failed ${failure.message}`;
235
235
  }
236
- function renderTasks(report, context) {
237
- const section = report.tasks;
236
+ function renderDebts(report, context) {
237
+ const section = report.debts;
238
238
  if (section.kind === "absent")
239
- return ["TASKS // absent"];
239
+ return ["DEBTS // absent"];
240
240
  if (section.kind === "failed")
241
241
  return [
242
- "TASKS // unavailable",
242
+ "DEBTS // unavailable",
243
243
  "",
244
- tone(`! ${safeText(taskFailureFact(section.failure))}`, "alert", context.color),
244
+ tone(`! ${safeText(debtFailureFact(section.failure))}`, "alert", context.color),
245
245
  ];
246
246
  const rows = section.value.rows;
247
247
  if (rows.length === 0)
@@ -253,12 +253,12 @@ function renderTasks(report, context) {
253
253
  const association = relation.length === 0 ? "" : ` · ${relation.join(" · ")}`;
254
254
  if (context.columns > NARROW_COLUMNS) {
255
255
  return [
256
- identityLine(taskDispositionMark(row.disposition), row.id, `· ${dispositionText(row.disposition)} · P${row.priority} · ${row.title}${association}`),
256
+ identityLine(debtDispositionMark(row.disposition), row.id, `· ${dispositionText(row.disposition)} · P${row.priority} · ${row.title}${association}`),
257
257
  ...plumbFacts([...childFacts, ...blockerFacts], context.columns),
258
258
  ];
259
259
  }
260
260
  return entityLines({
261
- mark: taskDispositionMark(row.disposition),
261
+ mark: debtDispositionMark(row.disposition),
262
262
  identity: row.id,
263
263
  state: `${dispositionText(row.disposition)} · P${row.priority}`,
264
264
  title: row.title,
@@ -267,9 +267,9 @@ function renderTasks(report, context) {
267
267
  });
268
268
  });
269
269
  return [
270
- "TASKS // recent",
270
+ "DEBTS // recent",
271
271
  ...renderSectionBlock({
272
- name: "TASKS",
272
+ name: "DEBTS",
273
273
  rows: rowLines,
274
274
  }).slice(1),
275
275
  ...(section.value.hasMore ? ["…"] : []),
@@ -278,7 +278,7 @@ function renderTasks(report, context) {
278
278
  export function renderKanshiText(report, context = { columns: DEFAULT_CLI_COLUMNS, color: false }, selection = "world") {
279
279
  if (selection === "contract")
280
280
  return renderSelectedContract(report, context).join("\n");
281
- const blocks = [renderContracts(report, context), renderAkuma(report, context), renderTasks(report, context)].filter((block) => block.length > 0);
281
+ const blocks = [renderContracts(report, context), renderAkuma(report, context), renderDebts(report, context)].filter((block) => block.length > 0);
282
282
  return blocks.length === 0 ? "○ world empty" : blocks.map((block) => block.join("\n")).join("\n\n");
283
283
  }
284
284
  /** One category board: the section the selector asked for, and nothing it did not read. */
@@ -1,13 +1,13 @@
1
1
  import type { AkumaLife } from "../../akuma/heart/index.js";
2
2
  import type { ContractRow } from "../../protocol/read/status.js";
3
- import type { TaskDisposition } from "../../task/board.js";
4
- import type { TaskState } from "../../task/document.js";
5
- export type TaskMarkWord = TaskDisposition | TaskState | "missing";
3
+ import type { DebtDisposition } from "../../debt/board.js";
4
+ import type { DebtState } from "../../debt/document.js";
5
+ export type DebtMarkWord = DebtDisposition | DebtState | "missing";
6
6
  /** Akuma life marks are one vocabulary; render surfaces consume and never re-derive them. */
7
7
  export declare function akumaMark(life: AkumaLife | "unborn" | "stillborn"): string;
8
8
  /** Contract board marks weigh phase, gates, and target knowledge in one fixed order. */
9
9
  export declare function contractMark(row: ContractRow): string;
10
10
  /** The board's derived dispositions have their own exhaustive source lock. */
11
- export declare function taskDispositionMark(disposition: TaskDisposition): string;
11
+ export declare function debtDispositionMark(disposition: DebtDisposition): string;
12
12
  /** Document states and missing references reuse the board marks where they overlap. */
13
- export declare function taskMark(word: TaskMarkWord): string;
13
+ export declare function debtMark(word: DebtMarkWord): string;
@@ -1,5 +1,5 @@
1
1
  function unreachable(value) {
2
- throw new Error(`unhandled Task mark word: ${String(value)}`);
2
+ throw new Error(`unhandled Debt mark word: ${String(value)}`);
3
3
  }
4
4
  /** Akuma life marks are one vocabulary; render surfaces consume and never re-derive them. */
5
5
  export function akumaMark(life) {
@@ -36,16 +36,12 @@ export function contractMark(row) {
36
36
  return "⧗";
37
37
  }
38
38
  /** The board's derived dispositions have their own exhaustive source lock. */
39
- export function taskDispositionMark(disposition) {
39
+ export function debtDispositionMark(disposition) {
40
40
  switch (disposition) {
41
41
  case "ready":
42
42
  return "○";
43
43
  case "blocked":
44
44
  return "‖";
45
- case "in_progress":
46
- return "●";
47
- case "on_hold":
48
- return "⧗";
49
45
  case "done":
50
46
  return "✓";
51
47
  case "drop":
@@ -55,7 +51,7 @@ export function taskDispositionMark(disposition) {
55
51
  }
56
52
  }
57
53
  /** Document states and missing references reuse the board marks where they overlap. */
58
- export function taskMark(word) {
54
+ export function debtMark(word) {
59
55
  switch (word) {
60
56
  case "open":
61
57
  return "○";
@@ -63,11 +59,9 @@ export function taskMark(word) {
63
59
  return "!";
64
60
  case "ready":
65
61
  case "blocked":
66
- case "in_progress":
67
- case "on_hold":
68
62
  case "done":
69
63
  case "drop":
70
- return taskDispositionMark(word);
64
+ return debtDispositionMark(word);
71
65
  default:
72
66
  return unreachable(word);
73
67
  }
@@ -8,7 +8,7 @@ export function renderNukeText(result) {
8
8
  `✓ nuke ${result.world}`,
9
9
  ` refs removed ${result.value.removed.refs}`,
10
10
  ` worktrees removed ${result.value.removed.worktrees}`,
11
- ` task stores removed ${result.value.removed.tasks}`,
11
+ ` debt stores removed ${result.value.removed.debts}`,
12
12
  " locks may remain · SQLite coordination files cannot be removed safely while concurrent writers may still hold them",
13
13
  ...seatClose,
14
14
  ].join("\n");
@@ -6,7 +6,7 @@ import { encodeFailureWire, KeiyakuError } from "../library/outcome.js";
6
6
  import { isParsedAkumaCommand, runAkumaCommand } from "./commands/akuma.js";
7
7
  import { admitBindMarkdown, runContractCommand, runContractHistoryCommand } from "./commands/contract.js";
8
8
  import { installExitCode, installHarnesses, renderInstallText, } from "./commands/install.js";
9
- import { runTaskCommand } from "./commands/task.js";
9
+ import { runDebtCommand } from "./commands/debt.js";
10
10
  import { resolveInvocationCoordinates } from "./coordinates.js";
11
11
  import { BindDraftError } from "./draft.js";
12
12
  import { assertExplicitRepoUse, CliUsageError, usageGuideForCommand, } from "./parse.js";
@@ -189,8 +189,8 @@ export async function runCliCommand(invocation, input = {}) {
189
189
  ...(invocation.workdir === undefined ? {} : { workdir: invocation.workdir }),
190
190
  command,
191
191
  }, environment);
192
- if (command.command === "task")
193
- return await runTaskCommand(command, coordinates, runtime);
192
+ if (command.command === "debt")
193
+ return await runDebtCommand(command, coordinates, runtime);
194
194
  if (isParsedAkumaCommand(command))
195
195
  return await runAkumaCommand(command, coordinates, invocation.workdir, runtime);
196
196
  if (command.command === "history" && "contract" in command)
@@ -1,7 +1,7 @@
1
1
  /** One surface's option table, named the way its refusal text names the surface. */
2
2
  export type ScanFlagKind = "boolean" | "value" | "raw-value" | "repeat";
3
3
  export type ScanSpec<Reader extends string = string> = Readonly<{
4
- /** Names this surface in refusal text: `bind`, `call`, `task add`. */
4
+ /** Names this surface in refusal text: `bind`, `call`, `debt add`. */
5
5
  subject: string;
6
6
  flags: Readonly<Record<string, ScanFlagKind>>;
7
7
  /** The reader that consumes `-` input; absent makes `-` invalid here. */