@astrosheep/keiyaku 4.6.4 → 4.6.7

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 (247) hide show
  1. package/README.md +7 -0
  2. package/build/{integrations/marketplace → plugins}/.agents/plugins/marketplace.json +1 -1
  3. package/build/plugins/.claude-plugin/marketplace.json +5 -0
  4. package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/.claude-plugin/plugin.json +1 -1
  5. package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/SKILL.md +43 -8
  6. package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/SKILL.md +7 -8
  7. package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-workflow/SKILL.md +3 -3
  8. package/build/{integrations/marketplace/plugins/keiyaku → plugins/codex}/.codex-plugin/plugin.json +1 -1
  9. package/build/plugins/codex/skills/keiyaku/SKILL.md +44 -0
  10. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +130 -0
  11. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +269 -0
  12. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +65 -0
  13. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +216 -0
  14. package/build/plugins/codex/skills/keiyaku-bind/agents/openai.yaml +4 -0
  15. package/build/plugins/codex/skills/keiyaku-task/SKILL.md +104 -0
  16. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +129 -0
  17. package/build/plugins/opencode/package.json +6 -0
  18. package/build/plugins/opencode/skills/keiyaku/SKILL.md +44 -0
  19. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +130 -0
  20. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +269 -0
  21. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +65 -0
  22. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +216 -0
  23. package/build/plugins/opencode/skills/keiyaku-bind/agents/openai.yaml +4 -0
  24. package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +104 -0
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +129 -0
  26. package/build/skills/keiyaku/SKILL.md +44 -0
  27. package/build/skills/keiyaku-akuma/SKILL.md +130 -0
  28. package/build/skills/keiyaku-akuma/references/automation.md +269 -0
  29. package/build/skills/keiyaku-babysit/SKILL.md +65 -0
  30. package/build/skills/keiyaku-bind/SKILL.md +216 -0
  31. package/build/skills/keiyaku-bind/agents/openai.yaml +4 -0
  32. package/build/skills/keiyaku-task/SKILL.md +104 -0
  33. package/build/skills/keiyaku-workflow/SKILL.md +129 -0
  34. package/build/src/akuma/akuma-instance.js +7 -5
  35. package/build/src/akuma/akuma-observe.d.ts +22 -15
  36. package/build/src/akuma/akuma-observe.js +87 -16
  37. package/build/src/akuma/akuma-owner.d.ts +3 -2
  38. package/build/src/akuma/akuma-owner.js +28 -10
  39. package/build/src/akuma/akuma-selection-execution.d.ts +3 -1
  40. package/build/src/akuma/akuma-selection-execution.js +2 -1
  41. package/build/src/akuma/akuma-wait.d.ts +6 -4
  42. package/build/src/akuma/akuma-wait.js +78 -53
  43. package/build/src/akuma/akuma.d.ts +6 -4
  44. package/build/src/akuma/akuma.js +4 -0
  45. package/build/src/akuma/body.d.ts +1 -0
  46. package/build/src/akuma/body.js +12 -23
  47. package/build/src/akuma/call-initial-tell.d.ts +2 -2
  48. package/build/src/akuma/call-initial-tell.js +1 -1
  49. package/build/src/akuma/call-request.d.ts +2 -2
  50. package/build/src/akuma/heart/index.d.ts +7 -2
  51. package/build/src/akuma/heart/index.js +50 -5
  52. package/build/src/akuma/heart/tells.d.ts +33 -2
  53. package/build/src/akuma/heart/tells.js +24 -18
  54. package/build/src/akuma/heart/timeline.d.ts +23 -1
  55. package/build/src/akuma/heart/timeline.js +28 -21
  56. package/build/src/akuma/projection.d.ts +10 -10
  57. package/build/src/akuma/providers/pi/index.js +72 -39
  58. package/build/src/akuma/selection-observation.d.ts +20 -20
  59. package/build/src/akuma/selection-owner-port.d.ts +1 -1
  60. package/build/src/akuma/selection-owner-port.js +16 -5
  61. package/build/src/akuma/selection-request.d.ts +2 -0
  62. package/build/src/akuma/selection-request.js +2 -1
  63. package/build/src/akuma-body.js +5 -2
  64. package/build/src/alias/index.d.ts +0 -1
  65. package/build/src/alias/index.js +0 -4
  66. package/build/src/body/amend.d.ts +0 -4
  67. package/build/src/body/amend.js +0 -3
  68. package/build/src/body/region.d.ts +0 -1
  69. package/build/src/body/region.js +0 -3
  70. package/build/src/body/verification.d.ts +0 -1
  71. package/build/src/cli/commands/akuma-grammar.js +23 -66
  72. package/build/src/cli/commands/akuma.js +23 -42
  73. package/build/src/cli/commands/contract-grammar.d.ts +14 -1
  74. package/build/src/cli/commands/contract-grammar.js +54 -21
  75. package/build/src/cli/commands/contract-help.d.ts +9 -8
  76. package/build/src/cli/commands/contract-help.js +14 -7
  77. package/build/src/cli/commands/contract.js +57 -117
  78. package/build/src/cli/commands/install.d.ts +5 -5
  79. package/build/src/cli/commands/install.js +4 -7
  80. package/build/src/cli/commands/task-grammar.js +10 -66
  81. package/build/src/cli/commands/task.d.ts +0 -1
  82. package/build/src/cli/commands/task.js +34 -53
  83. package/build/src/cli/coordinates.d.ts +1 -2
  84. package/build/src/cli/coordinates.js +1 -4
  85. package/build/src/cli/parse.d.ts +2 -3
  86. package/build/src/cli/parse.js +24 -66
  87. package/build/src/cli/render/akuma.d.ts +3 -16
  88. package/build/src/cli/render/akuma.js +1 -13
  89. package/build/src/cli/render/audit.js +1 -1
  90. package/build/src/cli/render/contract.js +34 -32
  91. package/build/src/cli/render/kanshi-akuma.d.ts +8 -2
  92. package/build/src/cli/render/kanshi-akuma.js +14 -7
  93. package/build/src/cli/render/kanshi.d.ts +3 -1
  94. package/build/src/cli/render/kanshi.js +44 -32
  95. package/build/src/cli/render/receipt.js +6 -1
  96. package/build/src/cli/render/task.d.ts +1 -1
  97. package/build/src/cli/render/task.js +3 -27
  98. package/build/src/cli/render/terminal.d.ts +6 -2
  99. package/build/src/cli/render/terminal.js +8 -2
  100. package/build/src/cli/runtime.js +3 -16
  101. package/build/src/cli/scan.d.ts +26 -0
  102. package/build/src/cli/scan.js +82 -0
  103. package/build/src/cli/streams.d.ts +5 -0
  104. package/build/src/cli/streams.js +11 -0
  105. package/build/src/contract-worktree.js +38 -21
  106. package/build/src/core/facts/codec.d.ts +1 -2
  107. package/build/src/core/facts/codec.js +5 -11
  108. package/build/src/core/facts/types.d.ts +16 -2
  109. package/build/src/core/facts/types.js +15 -0
  110. package/build/src/core/verbs/abandon.js +3 -9
  111. package/build/src/core/verbs/amend.js +2 -9
  112. package/build/src/core/verbs/arc.js +6 -13
  113. package/build/src/core/verbs/attestation.js +2 -9
  114. package/build/src/core/verbs/bind.js +2 -9
  115. package/build/src/core/verbs/deliver.js +2 -9
  116. package/build/src/core/verbs/placement.d.ts +1 -1
  117. package/build/src/core/verbs/placement.js +2 -9
  118. package/build/src/core/verbs/reintegrate.d.ts +1 -1
  119. package/build/src/core/verbs/reintegrate.js +2 -9
  120. package/build/src/dispatch/index.d.ts +2 -2
  121. package/build/src/dispatch/index.js +33 -11
  122. package/build/src/git/hooks.d.ts +2 -4
  123. package/build/src/git/hooks.js +0 -12
  124. package/build/src/git/integration.d.ts +5 -3
  125. package/build/src/git/integration.js +36 -25
  126. package/build/src/git/nuke.js +4 -4
  127. package/build/src/git/observe.d.ts +4 -4
  128. package/build/src/git/observe.js +5 -5
  129. package/build/src/git/process.d.ts +1 -4
  130. package/build/src/git/process.js +1 -11
  131. package/build/src/git/read-observation.js +1 -1
  132. package/build/src/git/reconcile.d.ts +1 -1
  133. package/build/src/git/reconcile.js +15 -13
  134. package/build/src/git/repository.d.ts +2 -6
  135. package/build/src/git/repository.js +18 -31
  136. package/build/src/git/scratch.d.ts +6 -6
  137. package/build/src/git/scratch.js +110 -46
  138. package/build/src/git/target-placement.d.ts +5 -5
  139. package/build/src/git/target-placement.js +18 -33
  140. package/build/src/git/tender.d.ts +6 -2
  141. package/build/src/git/tender.js +19 -12
  142. package/build/src/git/terminal-reconcile.js +24 -13
  143. package/build/src/git/terminal-seal.d.ts +2 -5
  144. package/build/src/git/terminal-seal.js +5 -3
  145. package/build/src/git/workspace.d.ts +17 -13
  146. package/build/src/git/workspace.js +58 -41
  147. package/build/src/kanshi/index.d.ts +2 -2
  148. package/build/src/kanshi/index.js +1 -1
  149. package/build/src/kanshi/read.d.ts +8 -1
  150. package/build/src/kanshi/read.js +72 -7
  151. package/build/src/kanshi/report.d.ts +12 -0
  152. package/build/src/library/akuma-creation.d.ts +4 -4
  153. package/build/src/library/akuma-creation.js +21 -19
  154. package/build/src/library/bind.d.ts +1 -63
  155. package/build/src/library/bind.js +3 -9
  156. package/build/src/library/contract-creation.js +2 -30
  157. package/build/src/library/contract-execution.d.ts +0 -1
  158. package/build/src/library/contract-execution.js +9 -34
  159. package/build/src/library/contract-operations.d.ts +5 -1
  160. package/build/src/library/contract-operations.js +7 -3
  161. package/build/src/library/contract-types.d.ts +1 -1
  162. package/build/src/library/delivery.d.ts +91 -93
  163. package/build/src/library/delivery.js +2 -1
  164. package/build/src/library/input.d.ts +0 -2
  165. package/build/src/library/input.js +0 -4
  166. package/build/src/library/invocation.d.ts +0 -1
  167. package/build/src/library/invocation.js +3 -25
  168. package/build/src/library/outcome.d.ts +651 -602
  169. package/build/src/library/outcome.js +4 -4
  170. package/build/src/library/reconcile.d.ts +6 -0
  171. package/build/src/library/reconcile.js +31 -1
  172. package/build/src/library/repo.d.ts +0 -1
  173. package/build/src/library/selection.d.ts +1 -10
  174. package/build/src/library/selection.js +19 -17
  175. package/build/src/plugin/akuma-signals.d.ts +10 -11
  176. package/build/src/plugin/akuma-signals.js +36 -20
  177. package/build/src/plugin/public.d.ts +5 -0
  178. package/build/src/plugin/runtime.d.ts +1 -0
  179. package/build/src/plugin/runtime.js +34 -23
  180. package/build/src/protocol/abandon.d.ts +1 -1
  181. package/build/src/protocol/abandon.js +3 -10
  182. package/build/src/protocol/amend.js +2 -5
  183. package/build/src/protocol/arc.d.ts +1 -1
  184. package/build/src/protocol/arc.js +2 -9
  185. package/build/src/protocol/attempt.d.ts +3 -20
  186. package/build/src/protocol/attempt.js +6 -5
  187. package/build/src/protocol/audit.d.ts +1 -0
  188. package/build/src/protocol/audit.js +10 -11
  189. package/build/src/protocol/completion.d.ts +129 -55
  190. package/build/src/protocol/completion.js +62 -73
  191. package/build/src/protocol/deliver.d.ts +7 -5
  192. package/build/src/protocol/deliver.js +74 -44
  193. package/build/src/protocol/execution-observation.d.ts +2 -4
  194. package/build/src/protocol/execution-observation.js +3 -7
  195. package/build/src/protocol/intent.d.ts +1 -1
  196. package/build/src/protocol/intent.js +1 -0
  197. package/build/src/protocol/operations.d.ts +24 -12
  198. package/build/src/protocol/operations.js +36 -15
  199. package/build/src/protocol/placement.d.ts +2 -1
  200. package/build/src/protocol/placement.js +21 -5
  201. package/build/src/protocol/progress.d.ts +1 -1
  202. package/build/src/protocol/read/status.js +58 -41
  203. package/build/src/protocol/reintegrate.d.ts +1 -1
  204. package/build/src/protocol/reintegrate.js +10 -19
  205. package/build/src/protocol/review.d.ts +3 -28
  206. package/build/src/protocol/review.js +10 -37
  207. package/build/src/protocol/run.d.ts +19 -7
  208. package/build/src/protocol/run.js +19 -9
  209. package/build/src/runtime/proc/windows-launch.exe +0 -0
  210. package/build/src/settlement/holder.d.ts +2 -4
  211. package/build/src/settlement/holder.js +3 -6
  212. package/build/src/task/board.d.ts +6 -0
  213. package/build/src/task/board.js +30 -1
  214. package/build/src/task/catalog.js +1 -4
  215. package/build/src/task/compose.d.ts +0 -1
  216. package/build/src/task/compose.js +0 -1
  217. package/build/src/task/context.d.ts +0 -1
  218. package/build/src/task/context.js +0 -3
  219. package/build/src/task/created-observation.d.ts +5 -1
  220. package/build/src/task/created-observation.js +12 -5
  221. package/build/src/task/index.d.ts +1 -1
  222. package/build/src/task/index.js +7 -6
  223. package/build/src/task/input.d.ts +0 -6
  224. package/build/src/task/input.js +2 -14
  225. package/build/src/task/mutation.d.ts +3 -4
  226. package/build/src/task/mutation.js +11 -39
  227. package/build/src/task/operations.d.ts +2 -7
  228. package/build/src/task/operations.js +37 -49
  229. package/build/src/task/query.d.ts +0 -1
  230. package/build/src/task/query.js +1 -4
  231. package/build/src/task/store.d.ts +0 -2
  232. package/build/src/task/store.js +27 -11
  233. package/build/src/verification/declaration.js +3 -2
  234. package/build/src/verification/execution.d.ts +3 -2
  235. package/build/src/verification/execution.js +10 -6
  236. package/build/src/workspace-place.d.ts +0 -1
  237. package/build/src/workspace-place.js +0 -11
  238. package/package.json +13 -9
  239. package/build/integrations/marketplace/.claude-plugin/marketplace.json +0 -5
  240. package/build/integrations/marketplace/plugins/keiyaku/package.json +0 -17
  241. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku/SKILL.md +0 -0
  242. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/references/automation.md +0 -0
  243. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-babysit/SKILL.md +0 -0
  244. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/agents/openai.yaml +0 -0
  245. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-task/SKILL.md +0 -0
  246. /package/build/{integrations/marketplace/plugins/keiyaku/opencode.js → plugins/opencode/index.js} +0 -0
  247. /package/build/{integrations → plugins}/pi/keiyaku.ts +0 -0
@@ -1,45 +1,11 @@
1
1
  import { decodeContractDocument } from "../body/decode.js";
2
2
  import { type ActorId, type ContractId } from "../core/facts/types.js";
3
3
  import type { GitDecodeChannel } from "../git/read-observation.js";
4
- import { bindOperation, type BindTargetSelection } from "../protocol/bind.js";
4
+ import { type BindTargetSelection } from "../protocol/bind.js";
5
5
  import { type IntentOutcome, type RepositoryScope } from "../protocol/operations.js";
6
6
  import type { ProtocolProgress } from "../protocol/progress.js";
7
7
  import type { TaskId } from "../task/identity.js";
8
- import type { VerificationDeclarationPreparation } from "../verification/declaration.js";
9
8
  import type { ForkSourceRefusal, OperationRefusals } from "./refusal.js";
10
- type BindAttemptInput = Readonly<{
11
- scope: RepositoryScope;
12
- channel: GitDecodeChannel;
13
- title: string;
14
- terms: Parameters<typeof bindOperation>[0]["terms"];
15
- verification: VerificationDeclarationPreparation;
16
- workspace: "worktree";
17
- targetSelection?: BindTargetSelection;
18
- coordinates?: Readonly<{
19
- start: import("../core/facts/types.js").SnapshotId;
20
- }>;
21
- source?: Parameters<typeof bindOperation>[0]["source"];
22
- task?: TaskId;
23
- progress?: ProtocolProgress;
24
- actor?: ActorId;
25
- }>;
26
- export declare function admitBindWithAppointment(input: BindAttemptInput): Promise<IntentOutcome<Readonly<{
27
- contractId: ContractId;
28
- }>, {
29
- kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
30
- contractId: ContractId;
31
- } | {
32
- kind: "verification-declaration-invalid";
33
- contractId?: ContractId | undefined;
34
- } | {
35
- kind: "fork-source-moved";
36
- contractId: ContractId;
37
- } | {
38
- kind: "unborn-head" | "target-missing" | "invalid-target";
39
- } | {
40
- kind: "fork-source-missing" | "fork-source-unavailable";
41
- contractId: ContractId;
42
- }>>;
43
9
  type ForkBindAdmission = Readonly<{
44
10
  kind: "document";
45
11
  document: ReturnType<typeof decodeContractDocument>;
@@ -62,34 +28,6 @@ export declare function admitForkBindWithAppointment(input: Readonly<{
62
28
  kind: "refused";
63
29
  refusal: ForkSourceRefusal;
64
30
  }> | ForkBindAdmission>;
65
- export declare function admitMarkdownBind(input: Readonly<{
66
- scope: RepositoryScope;
67
- channel: GitDecodeChannel;
68
- title: string;
69
- terms: Parameters<typeof bindOperation>[0]["terms"];
70
- verification: VerificationDeclarationPreparation;
71
- workspace: "worktree";
72
- targetSelection?: BindTargetSelection;
73
- task?: TaskId;
74
- progress?: ProtocolProgress;
75
- actor?: ActorId;
76
- }>): Promise<IntentOutcome<Readonly<{
77
- contractId: ContractId;
78
- }>, {
79
- kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
80
- contractId: ContractId;
81
- } | {
82
- kind: "verification-declaration-invalid";
83
- contractId?: ContractId | undefined;
84
- } | {
85
- kind: "fork-source-moved";
86
- contractId: ContractId;
87
- } | {
88
- kind: "unborn-head" | "target-missing" | "invalid-target";
89
- } | {
90
- kind: "fork-source-missing" | "fork-source-unavailable";
91
- contractId: ContractId;
92
- }>>;
93
31
  export declare function prepareMarkdownBind(input: Readonly<{
94
32
  scope: RepositoryScope;
95
33
  channel: GitDecodeChannel;
@@ -7,7 +7,7 @@ import { mintIdentitySegment } from "../identity/mint.js";
7
7
  import { fitIdentityStemWords, normalizeIdentityStem } from "../identity/normalize.js";
8
8
  import { bindOperation } from "../protocol/bind.js";
9
9
  import { stateOperation } from "../protocol/operations.js";
10
- import { claimTaskHolder, claimTaskHolderWithFence } from "../settlement/holder.js";
10
+ import { admitWithTaskHolderFence, claimTaskHolder } from "../settlement/holder.js";
11
11
  import { KeiyakuError } from "./outcome.js";
12
12
  import { contractTerms, documentDerivation } from "./input.js";
13
13
  const CONTRACT_ID_CODE_POINTS = 32;
@@ -48,9 +48,6 @@ async function attemptCandidates(input) {
48
48
  collision: (result) => result.kind === "refused" && result.refusal.kind === "contract-exists",
49
49
  });
50
50
  }
51
- export async function admitBindWithAppointment(input) {
52
- return await attemptCandidates(input);
53
- }
54
51
  /**
55
52
  * A legally non-forkable source is an expected refusal; corrupt persisted authority for a source that
56
53
  * does exist is exceptional and names that source Contract.
@@ -119,12 +116,9 @@ export async function admitForkBindWithAppointment(input) {
119
116
  });
120
117
  return { kind: "document", admission, document };
121
118
  }
122
- export async function admitMarkdownBind(input) {
123
- return await admitBindWithAppointment(input);
124
- }
125
119
  export async function prepareMarkdownBind(input) {
126
120
  const terms = contractTerms(input.document, input.gates, input.after);
127
- const admitCandidate = () => admitMarkdownBind({
121
+ const admitCandidate = () => attemptCandidates({
128
122
  scope: input.scope,
129
123
  channel: input.channel,
130
124
  title: input.document.title,
@@ -136,6 +130,6 @@ export async function prepareMarkdownBind(input) {
136
130
  ...(input.actor === undefined ? {} : { actor: input.actor }),
137
131
  ...(input.progress === undefined ? {} : { progress: input.progress }),
138
132
  });
139
- const admission = input.task === undefined ? null : await claimTaskHolderWithFence(input.scope, input.task, admitCandidate);
133
+ const admission = input.task === undefined ? null : await admitWithTaskHolderFence(input.scope, input.task, admitCandidate);
140
134
  return { admission, result: admission === null ? await admitCandidate() : admission.result };
141
135
  }
@@ -12,7 +12,7 @@ import { captureLocalContractComposition, derivedGates, derivedHooks, gateNames,
12
12
  import { actorOption, normalizedList, requireInput, requireMarkdown, taskOption } from "./input.js";
13
13
  import { InvocationAccumulator } from "./invocation.js";
14
14
  import { project, validated } from "./outcome.js";
15
- import { completeReconcile } from "./reconcile.js";
15
+ import { reconcileAffectedContracts } from "./reconcile.js";
16
16
  import { observeRegion } from "./region.js";
17
17
  import { scopeForRepo } from "./repo.js";
18
18
  function bindInput(input, composition) {
@@ -122,7 +122,7 @@ function bindValue(keiyaku, region, warnings, workspace, appointmentLag) {
122
122
  // eslint-disable-next-line max-params -- Keep this local operation's custody, admission, and policy witnesses explicit.
123
123
  async function bindComplete(accumulator, id, scope, channel, leading, hooks, value) {
124
124
  retainAdmission(accumulator, id, leading, false);
125
- await reconcileAll(accumulator, id, scope, channel, hooks);
125
+ await reconcileAffectedContracts(accumulator, id, scope, channel, hooks);
126
126
  try {
127
127
  const appointment = await readManagedWorktreeAppointment(scope, id);
128
128
  if (appointment.kind === "appointed")
@@ -139,34 +139,6 @@ async function bindComplete(accumulator, id, scope, channel, leading, hooks, val
139
139
  accumulator.extendConclusions(id, conclusions(built));
140
140
  return built;
141
141
  }
142
- async function reconcileAll(accumulator, id, scope, channel, hooks) {
143
- for (const contract of [...new Set([id, ...accumulator.snapshot().affected])]) {
144
- try {
145
- accumulator.observe({ kind: "stage", contractId: contract, stage: "reconciliation", state: "started" });
146
- const report = await (async () => {
147
- try {
148
- return await completeReconcile({
149
- scope,
150
- channel,
151
- contractId: contract,
152
- hooks,
153
- retryHooks: false,
154
- progress: accumulator,
155
- });
156
- }
157
- finally {
158
- accumulator.observe({ kind: "stage", contractId: contract, stage: "reconciliation", state: "finished" });
159
- }
160
- })();
161
- void report;
162
- }
163
- catch (error) {
164
- if (!isOperationalStop(error, scope.signal))
165
- throw error;
166
- accumulator.recordStop(executionStop(contract, "reconciliation", error, scope.signal));
167
- }
168
- }
169
- }
170
142
  // eslint-disable-next-line max-params -- Keep this local operation's custody, admission, and policy witnesses explicit.
171
143
  async function markdownBind(prepared, document, hooks, scope, channel, accumulator, handle, omittedMarkdownTarget) {
172
144
  const { task, target, actor, gates, after } = prepared;
@@ -27,5 +27,4 @@ export declare class ContractExecution {
27
27
  /** One accumulator before the first admission-capable await, one projector after teardown. */
28
28
  private local;
29
29
  private conclude;
30
- private reconcileContracts;
31
30
  }
@@ -25,7 +25,7 @@ import { deliveryForContract } from "./delivery.js";
25
25
  import { actorOption, contractTerms, documentDerivation, normalizedList, optionalBoolean, optionalNonblank, optionalSignal, requireInput, requireMarkdown, } from "./input.js";
26
26
  import { InvocationAccumulator } from "./invocation.js";
27
27
  import { KeiyakuError, errorCategory, project, validated, } from "./outcome.js";
28
- import { completeReconcile } from "./reconcile.js";
28
+ import { reconcileAffectedContracts } from "./reconcile.js";
29
29
  import { observeChangedRegion } from "./region.js";
30
30
  export class ContractExecution {
31
31
  seat;
@@ -157,6 +157,7 @@ export class ContractExecution {
157
157
  if (outcome.kind !== "accepted")
158
158
  return expected(this.id, outcome);
159
159
  leadingValue = outcome.value;
160
+ accumulator.extendConclusions(this.id, { leading: outcome.value.leading });
160
161
  stage = "verification";
161
162
  await advanceAndContinue(accumulator, scope, localChannel, this.id, this.composition, outcome, values.signal, "verification");
162
163
  }
@@ -168,12 +169,13 @@ export class ContractExecution {
168
169
  const retained = accumulator.conclusions(this.id) ?? {};
169
170
  const value = { ...base, ...leadingValue, ...retained };
170
171
  accumulator.recordConclusions(this.id, value);
171
- await this.reconcileContracts(accumulator, scope, localChannel, hooks);
172
+ await reconcileAffectedContracts(accumulator, this.id, scope, localChannel, hooks);
172
173
  return acceptedOutcome("deliver", this.id, accumulator, deliveryForContract(this.scope, value));
173
174
  }, values.signal, observer);
174
175
  }
175
176
  async review(input, options) {
176
- const values = validated(() => requireInput(input, "review input", ["verdict", "summary", "signal"]));
177
+ const values = validated(() => requireInput(input, "review input", ["verdict", "summary", "actor", "signal"]));
178
+ const actor = validated(() => actorOption(values.actor));
177
179
  const verdict = values.verdict;
178
180
  if (verdict !== "satisfied" && verdict !== "unsatisfied")
179
181
  throw new KeiyakuError("invalid-input", "verdict must be satisfied or unsatisfied", {
@@ -195,6 +197,7 @@ export class ContractExecution {
195
197
  contractId: this.id,
196
198
  verdict,
197
199
  ...(summary === undefined ? {} : { summary }),
200
+ ...actor,
198
201
  },
199
202
  });
200
203
  const hooks = derivedHooks(this.composition);
@@ -209,6 +212,7 @@ export class ContractExecution {
209
212
  contractId: this.id,
210
213
  progress: accumulator,
211
214
  ...(this.composition.actor === undefined ? {} : { actor: this.composition.actor }),
215
+ ...actor,
212
216
  ...(signal === undefined ? {} : { signal }),
213
217
  verdict,
214
218
  ...(summary === undefined ? {} : { summary }),
@@ -229,7 +233,7 @@ export class ContractExecution {
229
233
  }
230
234
  const retained = { ...value, ...accumulator.conclusions(this.id) };
231
235
  accumulator.extendConclusions(this.id, retained);
232
- await this.reconcileContracts(accumulator, scope, localChannel, hooks);
236
+ await reconcileAffectedContracts(accumulator, this.id, scope, localChannel, hooks);
233
237
  return acceptedOutcome("review", this.id, accumulator, retained);
234
238
  }, signal, observer);
235
239
  }
@@ -379,38 +383,9 @@ export class ContractExecution {
379
383
  retainAdmission(accumulator, this.id, input.leading, input.verificationResidueRecorded);
380
384
  const value = input.value(input.leading.value);
381
385
  accumulator.extendConclusions(this.id, conclusions(value));
382
- await this.reconcileContracts(accumulator, input.scope, input.channel, input.hooks);
386
+ await reconcileAffectedContracts(accumulator, this.id, input.scope, input.channel, input.hooks);
383
387
  return value;
384
388
  }
385
- async reconcileContracts(accumulator, scope, channel, hooks) {
386
- for (const contract of [...new Set([this.id, ...accumulator.snapshot().affected])]) {
387
- try {
388
- scope.signal?.throwIfAborted();
389
- accumulator.observe({ kind: "stage", contractId: contract, stage: "reconciliation", state: "started" });
390
- const report = await (async () => {
391
- try {
392
- return await completeReconcile({
393
- scope,
394
- channel,
395
- contractId: contract,
396
- hooks,
397
- retryHooks: false,
398
- progress: accumulator,
399
- });
400
- }
401
- finally {
402
- accumulator.observe({ kind: "stage", contractId: contract, stage: "reconciliation", state: "finished" });
403
- }
404
- })();
405
- void report;
406
- }
407
- catch (error) {
408
- if (!isOperationalStop(error, scope.signal))
409
- throw error;
410
- accumulator.recordStop(executionStop(contract, "reconciliation", error, scope.signal));
411
- }
412
- }
413
- }
414
389
  }
415
390
  function changedAmendTerms(before, after) {
416
391
  return {
@@ -55,17 +55,20 @@ declare const reviewRequestSchema: z.ZodPipe<z.ZodObject<{
55
55
  unsatisfied: "unsatisfied";
56
56
  }>;
57
57
  summary: z.ZodOptional<z.ZodString>;
58
+ actor: z.ZodOptional<z.ZodString>;
58
59
  }, z.core.$strict>, z.ZodTransform<{
59
60
  repoRoot: string;
60
61
  contractId: import("../core/facts/types.js").ContractId;
61
62
  verdict: "satisfied" | "unsatisfied";
62
63
  summary?: string | undefined;
64
+ actor?: string | undefined;
63
65
  action: "contract.review";
64
66
  }, {
65
67
  repoRoot: string;
66
68
  contractId: import("../core/facts/types.js").ContractId;
67
69
  verdict: "satisfied" | "unsatisfied";
68
70
  summary?: string | undefined;
71
+ actor?: string | undefined;
69
72
  }>>;
70
73
  export type ContractRequest = z.infer<typeof auditRequestSchema> | z.infer<typeof deliverRequestSchema> | z.infer<typeof reviewRequestSchema>;
71
74
  type DeliverRequest = Extract<ContractRequest, {
@@ -174,6 +177,7 @@ declare const contractServiceSchema: z.ZodUnion<readonly [z.ZodObject<{
174
177
  path: z.ZodString;
175
178
  }, z.core.$strict>;
176
179
  identity: z.ZodObject<{
180
+ note: z.ZodOptional<z.ZodString>;
177
181
  tenderSnapshot: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
178
182
  integration: z.ZodObject<{
179
183
  predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
@@ -376,7 +380,7 @@ declare const contractServiceSchema: z.ZodUnion<readonly [z.ZodObject<{
376
380
  contractId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ContractId, string>>;
377
381
  reviewFactId: z.ZodString;
378
382
  }, z.core.$strict>]>;
379
- export type ContractService = z.infer<typeof contractServiceSchema>;
383
+ type ContractService = z.infer<typeof contractServiceSchema>;
380
384
  type ContractReference = ContractService | z.infer<typeof materializedHandoffReferenceSchema>;
381
385
  export type ContractRequestPort = Readonly<{
382
386
  audit(input: AuditRequest & Readonly<{
@@ -4,7 +4,7 @@ import { AkumaBodyRequestError, requestBodyCommand } from "../akuma/request-rend
4
4
  import { eraseRequestCommand, } from "../akuma/request-wire.js";
5
5
  import { auditReportSchema } from "../protocol/audit.js";
6
6
  import { materializedConflictSchema } from "../protocol/deliver.js";
7
- import { decodeExecutionObservation, observeExecution, } from "../protocol/execution-observation.js";
7
+ import { observationSchema, observeExecution } from "../protocol/execution-observation.js";
8
8
  import { contractIdSchema } from "../protocol/operations.js";
9
9
  import { deliveryValueSchema } from "./delivery.js";
10
10
  import { InvocationAccumulator } from "./invocation.js";
@@ -27,7 +27,11 @@ const deliverRequestSchema = contractRequestBaseSchema
27
27
  })
28
28
  .transform((request) => ({ action: "contract.deliver", ...request }));
29
29
  const reviewRequestSchema = contractRequestBaseSchema
30
- .extend({ verdict: z.enum(["satisfied", "unsatisfied"]), summary: nonblankStringSchema.optional() })
30
+ .extend({
31
+ verdict: z.enum(["satisfied", "unsatisfied"]),
32
+ summary: nonblankStringSchema.optional(),
33
+ actor: z.string().optional(),
34
+ })
31
35
  .transform((request) => ({ action: "contract.review", ...request }));
32
36
  const auditServiceSchema = z
33
37
  .object({
@@ -250,7 +254,7 @@ export async function requestForwardedContractLive(input) {
250
254
  value: input.request,
251
255
  onProgress: (value) => {
252
256
  try {
253
- observeExecution(input.observe, decodeExecutionObservation(value));
257
+ observeExecution(input.observe, observationSchema.parse(value));
254
258
  }
255
259
  catch {
256
260
  observeExecution(input.observe, { kind: "progress-dropped", count: 1 });
@@ -72,7 +72,7 @@ export type KeiyakuSelectInput = Readonly<{
72
72
  repo: Repo;
73
73
  id: ContractId;
74
74
  }>;
75
- export type ReviewInput = Readonly<{
75
+ export type ReviewInput = ActorOptions & Readonly<{
76
76
  verdict: AttestationData["verdict"];
77
77
  summary?: string;
78
78
  signal?: AbortSignal;
@@ -11,108 +11,99 @@ export declare const deliveryValueSchema: z.ZodObject<{
11
11
  filesChanged: z.ZodNumber;
12
12
  insertions: z.ZodNumber;
13
13
  }, z.core.$strict>>;
14
- verification: z.ZodOptional<z.ZodObject<{
15
- mode: z.ZodEnum<{
16
- reused: "reused";
17
- ran: "ran";
18
- }>;
19
- verdict: z.ZodEnum<{
20
- satisfied: "satisfied";
21
- unsatisfied: "unsatisfied";
22
- }>;
23
- }, z.core.$strict>>;
24
14
  }, z.core.$strict>>;
25
- verification: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
26
- refusal: z.ZodUnion<readonly [z.ZodObject<{
27
- kind: z.ZodEnum<{
28
- terminal: "terminal";
29
- "contract-missing": "contract-missing";
30
- }>;
31
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ContractId, string>>;
32
- }, z.core.$strict>, z.ZodObject<{
33
- kind: z.ZodLiteral<"verification-declaration-invalid">;
34
- contractId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ContractId, string>>>;
35
- }, z.core.$strict>]>;
36
- }, z.core.$strict>, z.ZodObject<{
37
- retry: z.ZodUnion<readonly [z.ZodObject<{
38
- kind: z.ZodEnum<{
39
- exhausted: "exhausted";
40
- collision: "collision";
41
- }>;
42
- }, z.core.$strict>, z.ZodObject<{
43
- kind: z.ZodLiteral<"publication-failed">;
44
- diagnostic: z.ZodString;
45
- }, z.core.$strict>]>;
46
- }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
47
- stdout: z.ZodOptional<z.ZodString>;
48
- stderr: z.ZodOptional<z.ZodString>;
49
- truncated: z.ZodOptional<z.ZodLiteral<true>>;
50
- failure: z.ZodEnum<{
51
- cancelled: "cancelled";
52
- "unknown-exit": "unknown-exit";
15
+ verification: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
16
+ snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
17
+ verdict: z.ZodEnum<{
18
+ satisfied: "satisfied";
19
+ unsatisfied: "unsatisfied";
53
20
  }>;
21
+ summary: z.ZodOptional<z.ZodString>;
22
+ kind: z.ZodLiteral<"ran">;
23
+ entry: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>>;
54
24
  }, z.core.$strict>, z.ZodObject<{
55
- stdout: z.ZodOptional<z.ZodString>;
56
- stderr: z.ZodOptional<z.ZodString>;
57
- truncated: z.ZodOptional<z.ZodLiteral<true>>;
58
- failure: z.ZodEnum<{
59
- "spawn-error": "spawn-error";
60
- "candidate-unavailable": "candidate-unavailable";
25
+ snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
26
+ verdict: z.ZodEnum<{
27
+ satisfied: "satisfied";
28
+ unsatisfied: "unsatisfied";
61
29
  }>;
62
- diagnostic: z.ZodString;
63
- }, z.core.$strict>, z.ZodObject<{
64
- stdout: z.ZodOptional<z.ZodString>;
65
- stderr: z.ZodOptional<z.ZodString>;
66
- truncated: z.ZodOptional<z.ZodLiteral<true>>;
67
- failure: z.ZodLiteral<"environment-failure">;
68
- diagnostic: z.ZodString;
30
+ entry: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
31
+ summary: z.ZodOptional<z.ZodString>;
32
+ kind: z.ZodLiteral<"reused">;
69
33
  }, z.core.$strict>, z.ZodObject<{
70
- stdout: z.ZodOptional<z.ZodString>;
71
- stderr: z.ZodOptional<z.ZodString>;
72
- truncated: z.ZodOptional<z.ZodLiteral<true>>;
73
- failure: z.ZodLiteral<"environment-failure">;
74
- name: z.ZodString;
75
- detail: z.ZodUnion<readonly [z.ZodObject<{
76
- kind: z.ZodLiteral<"exit">;
77
- code: z.ZodNumber;
78
- stdout: z.ZodString;
79
- stderr: z.ZodString;
80
- truncated: z.ZodBoolean;
34
+ kind: z.ZodLiteral<"stopped">;
35
+ stop: z.ZodUnion<readonly [z.ZodObject<{
36
+ refusal: z.ZodUnion<readonly [z.ZodObject<{
37
+ kind: z.ZodEnum<{
38
+ terminal: "terminal";
39
+ "contract-missing": "contract-missing";
40
+ }>;
41
+ contractId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ContractId, string>>;
42
+ }, z.core.$strict>, z.ZodObject<{
43
+ kind: z.ZodLiteral<"verification-declaration-invalid">;
44
+ contractId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ContractId, string>>>;
45
+ }, z.core.$strict>]>;
81
46
  }, z.core.$strict>, z.ZodObject<{
47
+ retry: z.ZodUnion<readonly [z.ZodObject<{
48
+ kind: z.ZodEnum<{
49
+ exhausted: "exhausted";
50
+ collision: "collision";
51
+ }>;
52
+ }, z.core.$strict>, z.ZodObject<{
53
+ kind: z.ZodLiteral<"publication-failed">;
54
+ diagnostic: z.ZodString;
55
+ }, z.core.$strict>]>;
56
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
82
57
  stdout: z.ZodOptional<z.ZodString>;
83
58
  stderr: z.ZodOptional<z.ZodString>;
84
- truncated: z.ZodOptional<z.ZodBoolean>;
85
- kind: z.ZodLiteral<"timeout">;
59
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
60
+ failure: z.ZodEnum<{
61
+ cancelled: "cancelled";
62
+ "unknown-exit": "unknown-exit";
63
+ }>;
86
64
  }, z.core.$strict>, z.ZodObject<{
87
65
  stdout: z.ZodOptional<z.ZodString>;
88
66
  stderr: z.ZodOptional<z.ZodString>;
89
- truncated: z.ZodOptional<z.ZodBoolean>;
90
- kind: z.ZodLiteral<"unknown-exit">;
67
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
68
+ failure: z.ZodEnum<{
69
+ "spawn-error": "spawn-error";
70
+ "candidate-unavailable": "candidate-unavailable";
71
+ }>;
72
+ diagnostic: z.ZodString;
91
73
  }, z.core.$strict>, z.ZodObject<{
92
- kind: z.ZodLiteral<"spawn-error">;
74
+ stdout: z.ZodOptional<z.ZodString>;
75
+ stderr: z.ZodOptional<z.ZodString>;
76
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
77
+ failure: z.ZodLiteral<"environment-failure">;
93
78
  diagnostic: z.ZodString;
94
- }, z.core.$strict>]>;
95
- }, z.core.$strict>]>]>>;
96
- verificationReuse: z.ZodOptional<z.ZodObject<{
97
- entry: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
98
- verdict: z.ZodEnum<{
99
- satisfied: "satisfied";
100
- unsatisfied: "unsatisfied";
101
- }>;
102
- summary: z.ZodOptional<z.ZodString>;
103
- }, z.core.$strict>>;
104
- verificationSubject: z.ZodOptional<z.ZodObject<{
105
- mode: z.ZodEnum<{
106
- reused: "reused";
107
- ran: "ran";
108
- }>;
109
- verdict: z.ZodEnum<{
110
- satisfied: "satisfied";
111
- unsatisfied: "unsatisfied";
112
- }>;
113
- snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
114
- }, z.core.$strict>>;
115
- verificationSummary: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ stdout: z.ZodOptional<z.ZodString>;
81
+ stderr: z.ZodOptional<z.ZodString>;
82
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
83
+ failure: z.ZodLiteral<"environment-failure">;
84
+ name: z.ZodString;
85
+ detail: z.ZodUnion<readonly [z.ZodObject<{
86
+ kind: z.ZodLiteral<"exit">;
87
+ code: z.ZodNumber;
88
+ stdout: z.ZodString;
89
+ stderr: z.ZodString;
90
+ truncated: z.ZodBoolean;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ stdout: z.ZodOptional<z.ZodString>;
93
+ stderr: z.ZodOptional<z.ZodString>;
94
+ truncated: z.ZodOptional<z.ZodBoolean>;
95
+ kind: z.ZodLiteral<"timeout">;
96
+ }, z.core.$strict>, z.ZodObject<{
97
+ stdout: z.ZodOptional<z.ZodString>;
98
+ stderr: z.ZodOptional<z.ZodString>;
99
+ truncated: z.ZodOptional<z.ZodBoolean>;
100
+ kind: z.ZodLiteral<"unknown-exit">;
101
+ }, z.core.$strict>, z.ZodObject<{
102
+ kind: z.ZodLiteral<"spawn-error">;
103
+ diagnostic: z.ZodString;
104
+ }, z.core.$strict>]>;
105
+ }, z.core.$strict>]>]>;
106
+ }, z.core.$strict>], "kind">>;
116
107
  placement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
117
108
  refusal: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
118
109
  kind: z.ZodEnum<{
@@ -235,7 +226,14 @@ export declare const deliveryValueSchema: z.ZodObject<{
235
226
  "already-admitted": "already-admitted";
236
227
  }>;
237
228
  fact: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
229
+ reusedIntegration: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
238
230
  }, z.core.$strict>;
231
+ contentChange: z.ZodOptional<z.ZodObject<{
232
+ kind: z.ZodLiteral<"candidate-content-changed">;
233
+ target: z.ZodOptional<z.ZodString>;
234
+ previousChange: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ChangeId, string>>;
235
+ currentChange: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ChangeId, string>>;
236
+ }, z.core.$strict>>;
239
237
  continuation: z.ZodOptional<z.ZodObject<{
240
238
  claimed: z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ContractId, string>>>>;
241
239
  stopped: z.ZodReadonly<z.ZodArray<z.ZodObject<{
@@ -511,6 +509,7 @@ export declare const deliveryValueSchema: z.ZodObject<{
511
509
  }, z.core.$strict>]>;
512
510
  }, z.core.$strict>>>;
513
511
  }, z.core.$strict>>;
512
+ note: z.ZodOptional<z.ZodString>;
514
513
  tenderSnapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
515
514
  integration: z.ZodObject<{
516
515
  predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
@@ -526,18 +525,17 @@ export type DeliveryValue = z.infer<typeof deliveryValueSchema>;
526
525
  declare class DeliveryHandle {
527
526
  private readonly readDiff;
528
527
  readonly leading?: DeliveryValue["leading"];
528
+ readonly contentChange?: DeliveryValue["contentChange"];
529
529
  readonly completion?: DeliveryValue["completion"];
530
530
  readonly verification?: DeliveryValue["verification"];
531
- readonly verificationReuse?: DeliveryValue["verificationReuse"];
532
- readonly verificationSubject?: DeliveryValue["verificationSubject"];
533
- readonly verificationSummary?: DeliveryValue["verificationSummary"];
534
531
  readonly placement?: DeliveryValue["placement"];
535
532
  readonly continuation?: DeliveryValue["continuation"];
536
533
  readonly tenderSnapshot: SnapshotId;
534
+ readonly note?: string;
537
535
  readonly integration: DeliveryValue["integration"];
538
536
  readonly method: DeliveryValue["method"];
539
537
  readonly policy: DeliveryValue["policy"];
540
- constructor(identity: Pick<DeliveryValue, "tenderSnapshot" | "integration" | "method" | "policy">, readDiff: () => Promise<string | null>, outcomes?: Partial<Pick<DeliveryValue, "leading" | "completion" | "verification" | "verificationReuse" | "verificationSubject" | "verificationSummary" | "placement" | "continuation">>);
538
+ constructor(identity: Pick<DeliveryValue, "tenderSnapshot" | "integration" | "method" | "policy">, readDiff: () => Promise<string | null>, outcomes?: Partial<Pick<DeliveryValue, "leading" | "contentChange" | "completion" | "verification" | "placement" | "continuation">>);
541
539
  diff(): Promise<string | null>;
542
540
  }
543
541
  export type Delivery = DeliveryHandle;
@@ -1,11 +1,12 @@
1
1
  import { completionEvidenceSchema } from "../protocol/completion.js";
2
2
  import { deliverLeadingSchema } from "../protocol/deliver.js";
3
- import { deliverDataSchema, deliveryDiffOperation } from "../protocol/operations.js";
3
+ import { candidateContentChangeSchema, deliverDataSchema, deliveryDiffOperation, } from "../protocol/operations.js";
4
4
  import { continuationReportSchema } from "./continuation.js";
5
5
  export const deliveryValueSchema = completionEvidenceSchema
6
6
  .extend({
7
7
  ...deliverDataSchema.shape,
8
8
  leading: deliverLeadingSchema,
9
+ contentChange: candidateContentChangeSchema.optional(),
9
10
  continuation: continuationReportSchema.optional(),
10
11
  })
11
12
  .strict();
@@ -7,8 +7,6 @@ export declare function actorOption(actor: unknown): Readonly<{
7
7
  }>;
8
8
  export declare function requireMarkdown(value: unknown, label?: string): string;
9
9
  export declare function requireInput(value: unknown, label: string, allowed?: readonly string[]): Record<string, unknown>;
10
- /** Shared public-input failure path for operation owners. */
11
- export declare function invalidInput(message: string): never;
12
10
  export declare function taskOption(value: unknown): TaskId | undefined;
13
11
  export declare function optionalNonblank(value: unknown, label: string): string | undefined;
14
12
  export declare function optionalBoolean(value: unknown, label: string): boolean | undefined;
@@ -32,10 +32,6 @@ export function requireInput(value, label, allowed) {
32
32
  }
33
33
  return value;
34
34
  }
35
- /** Shared public-input failure path for operation owners. */
36
- export function invalidInput(message) {
37
- throw new TypeError(message);
38
- }
39
35
  export function taskOption(value) {
40
36
  if (value === undefined)
41
37
  return undefined;
@@ -83,5 +83,4 @@ export declare class InvocationAccumulator implements ProtocolProgress {
83
83
  private recordSeatClose;
84
84
  private recordLag;
85
85
  }
86
- export declare function physicalOf(snapshot: InvocationSnapshot): ReconcileResult;
87
86
  export {};