@astrosheep/keiyaku 4.0.4 → 4.0.6
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.
- package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +4 -4
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +15 -7
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +5 -3
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +24 -4
- package/build/src/akuma/akuma.d.ts +2 -1
- package/build/src/akuma/akuma.js +27 -9
- package/build/src/akuma/allowed.d.ts +1 -1
- package/build/src/akuma/allowed.js +3 -10
- package/build/src/akuma/archetype.d.ts +3 -1
- package/build/src/akuma/archetype.js +11 -6
- package/build/src/akuma/body-turn.d.ts +64 -0
- package/build/src/akuma/body-turn.js +449 -0
- package/build/src/akuma/body.d.ts +4 -5
- package/build/src/akuma/body.js +9 -414
- package/build/src/akuma/heart/facts.d.ts +37 -9
- package/build/src/akuma/heart/facts.js +3 -1
- package/build/src/akuma/heart/index.d.ts +4 -13
- package/build/src/akuma/heart/index.js +14 -135
- package/build/src/akuma/heart/request-authority.d.ts +12 -0
- package/build/src/akuma/heart/request-authority.js +119 -0
- package/build/src/akuma/heart/request-rows.d.ts +16 -0
- package/build/src/akuma/heart/request-rows.js +88 -0
- package/build/src/akuma/heart/rows.d.ts +1 -28
- package/build/src/akuma/heart/rows.js +4 -138
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +11 -3
- package/build/src/akuma/heart/soul.js +0 -36
- package/build/src/akuma/heart/timeline.d.ts +1 -0
- package/build/src/akuma/heart/timeline.js +19 -0
- package/build/src/akuma/index.d.ts +1 -1
- package/build/src/akuma/nuke.d.ts +2 -0
- package/build/src/akuma/nuke.js +152 -0
- package/build/src/akuma/provider-recipe.js +1 -11
- package/build/src/akuma/provider.d.ts +4 -7
- package/build/src/akuma/providers/acp/config.d.ts +8 -0
- package/build/src/akuma/providers/acp/config.js +37 -0
- package/build/src/akuma/providers/acp/core.js +12 -2
- package/build/src/akuma/providers/acp/index.d.ts +1 -8
- package/build/src/akuma/providers/acp/index.js +2 -38
- package/build/src/akuma/providers/claude/index.d.ts +0 -4
- package/build/src/akuma/providers/claude/index.js +12 -3
- package/build/src/akuma/providers/codex-app-server/index.d.ts +2 -27
- package/build/src/akuma/providers/codex-app-server/index.js +5 -2
- package/build/src/akuma/providers/grok-build/index.js +1 -2
- package/build/src/akuma/providers/index.d.ts +3 -2
- package/build/src/akuma/providers/index.js +36 -36
- package/build/src/akuma/providers/opencode-sdk/index.d.ts +2 -28
- package/build/src/akuma/providers/opencode-sdk/index.js +14 -4
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +2 -2
- package/build/src/akuma/providers/opencode-sdk/session.js +2 -2
- package/build/src/akuma/providers/pi/index.d.ts +1 -1
- package/build/src/akuma/providers/pi/index.js +29 -6
- package/build/src/akuma/request-serve.d.ts +88 -0
- package/build/src/akuma/request-serve.js +484 -0
- package/build/src/akuma/request-wire.d.ts +125 -0
- package/build/src/akuma/request-wire.js +383 -0
- package/build/src/akuma/requests.d.ts +28 -94
- package/build/src/akuma/requests.js +52 -562
- package/build/src/akuma-body.d.ts +7 -0
- package/build/src/akuma-body.js +69 -2
- package/build/src/alias/index.d.ts +1 -0
- package/build/src/alias/index.js +34 -1
- package/build/src/body/arc.js +4 -29
- package/build/src/body/decode.js +5 -39
- package/build/src/body/envelope.d.ts +7 -0
- package/build/src/body/envelope.js +37 -0
- package/build/src/cli/accepted.js +21 -9
- package/build/src/cli/commands/akuma-invoke.js +1 -0
- package/build/src/cli/commands/akuma.d.ts +1 -0
- package/build/src/cli/commands/akuma.js +13 -10
- package/build/src/cli/commands/contract.d.ts +28 -17
- package/build/src/cli/commands/contract.js +23 -17
- package/build/src/cli/commands/install.d.ts +2 -2
- package/build/src/cli/commands/install.js +6 -6
- package/build/src/cli/commands/nuke.d.ts +10 -0
- package/build/src/cli/commands/nuke.js +20 -0
- package/build/src/cli/commands/task-invoke.d.ts +15 -0
- package/build/src/cli/commands/task-invoke.js +144 -24
- package/build/src/cli/commands/task-query.d.ts +2 -2
- package/build/src/cli/commands/task-query.js +1 -2
- package/build/src/cli/commands/task.js +22 -22
- package/build/src/cli/coordinates.d.ts +6 -2
- package/build/src/cli/coordinates.js +12 -56
- package/build/src/cli/invoke.d.ts +5 -4
- package/build/src/cli/invoke.js +112 -58
- package/build/src/cli/main.d.ts +0 -2
- package/build/src/cli/main.js +4 -140
- package/build/src/cli/parse.d.ts +17 -4
- package/build/src/cli/parse.js +93 -15
- package/build/src/cli/render/akuma.js +111 -53
- package/build/src/cli/render/audit.js +2 -6
- package/build/src/cli/render/contract.js +61 -20
- package/build/src/cli/render/kanshi.js +15 -5
- package/build/src/cli/render/nuke.d.ts +3 -0
- package/build/src/cli/render/nuke.js +8 -0
- package/build/src/cli/render/receipt.js +28 -1
- package/build/src/cli/render/refusal.d.ts +2 -1
- package/build/src/cli/render/refusal.js +31 -0
- package/build/src/cli/render/terminal.d.ts +0 -2
- package/build/src/cli/render/terminal.js +0 -29
- package/build/src/cli/render/text.js +6 -1
- package/build/src/cli/result.d.ts +36 -9
- package/build/src/cli/runtime.d.ts +2 -0
- package/build/src/cli/runtime.js +140 -0
- package/build/src/cli/usage.d.ts +0 -2
- package/build/src/cli/usage.js +0 -4
- package/build/src/contract-worktree.d.ts +29 -14
- package/build/src/contract-worktree.js +131 -70
- package/build/src/core/facts/codec.js +9 -0
- package/build/src/core/facts/fold.js +13 -1
- package/build/src/core/facts/types.d.ts +8 -1
- package/build/src/core/subject.js +4 -3
- package/build/src/core/verbs/placement.d.ts +9 -1
- package/build/src/core/verbs/placement.js +24 -6
- package/build/src/core/verbs/reintegrate.d.ts +13 -0
- package/build/src/core/verbs/reintegrate.js +24 -0
- package/build/src/dispatch/index.d.ts +1 -1
- package/build/src/git/admission.d.ts +2 -1
- package/build/src/git/hooks.d.ts +2 -0
- package/build/src/git/hooks.js +34 -1
- package/build/src/git/integration.d.ts +9 -2
- package/build/src/git/integration.js +92 -1
- package/build/src/git/nuke.d.ts +2 -0
- package/build/src/git/nuke.js +97 -0
- package/build/src/git/observe.d.ts +2 -1
- package/build/src/git/observe.js +6 -5
- package/build/src/git/process.d.ts +28 -0
- package/build/src/git/process.js +94 -0
- package/build/src/git/read-observation.d.ts +2 -1
- package/build/src/git/read-observation.js +3 -2
- package/build/src/git/reconcile.d.ts +4 -1
- package/build/src/git/reconcile.js +42 -8
- package/build/src/git/repository.d.ts +2 -29
- package/build/src/git/repository.js +7 -118
- package/build/src/git/scratch.d.ts +1 -1
- package/build/src/git/scratch.js +1 -1
- package/build/src/git/target-placement.d.ts +3 -2
- package/build/src/git/target-placement.js +15 -14
- package/build/src/git/tender.d.ts +2 -1
- package/build/src/git/tender.js +4 -3
- package/build/src/git/terminal-seal.d.ts +2 -2
- package/build/src/git/terminal-seal.js +3 -6
- package/build/src/git/workspace.d.ts +4 -1
- package/build/src/git/workspace.js +1 -1
- package/build/src/index.d.ts +1 -2
- package/build/src/index.js +1 -1
- package/build/src/kanshi/read.js +5 -1
- package/build/src/library/address.js +7 -1
- package/build/src/library/akuma-creation.d.ts +1 -0
- package/build/src/library/akuma-creation.js +8 -1
- package/build/src/library/audit.d.ts +3 -1
- package/build/src/library/audit.js +2 -1
- package/build/src/library/bind.d.ts +2 -1
- package/build/src/library/bind.js +1 -1
- package/build/src/library/configuration.d.ts +1 -1
- package/build/src/library/configuration.js +52 -18
- package/build/src/library/contract.d.ts +59 -4
- package/build/src/library/contract.js +195 -34
- package/build/src/library/delivery.d.ts +4 -2
- package/build/src/library/fleet.d.ts +27 -7
- package/build/src/library/fleet.js +79 -39
- package/build/src/library/input.d.ts +0 -1
- package/build/src/library/input.js +0 -5
- package/build/src/library/keiyaku.d.ts +6 -2
- package/build/src/library/keiyaku.js +2 -0
- package/build/src/library/mutation.d.ts +3 -1
- package/build/src/library/mutation.js +3 -0
- package/build/src/library/nuke.d.ts +14 -0
- package/build/src/library/nuke.js +54 -0
- package/build/src/library/reconcile.d.ts +2 -1
- package/build/src/library/reconcile.js +8 -3
- package/build/src/library/refusal.d.ts +10 -1
- package/build/src/library/region.d.ts +1 -1
- package/build/src/library/repo.d.ts +4 -1
- package/build/src/library/repo.js +10 -4
- package/build/src/protocol/abandon.d.ts +9 -0
- package/build/src/protocol/abandon.js +15 -0
- package/build/src/protocol/amend.d.ts +16 -0
- package/build/src/protocol/amend.js +77 -0
- package/build/src/protocol/arc.d.ts +6 -0
- package/build/src/protocol/arc.js +12 -0
- package/build/src/protocol/attempt.d.ts +2 -1
- package/build/src/protocol/audit.d.ts +53 -0
- package/build/src/protocol/audit.js +147 -0
- package/build/src/protocol/bind.d.ts +1 -1
- package/build/src/protocol/completion.d.ts +42 -0
- package/build/src/protocol/completion.js +183 -0
- package/build/src/protocol/deliver.d.ts +49 -0
- package/build/src/protocol/deliver.js +261 -0
- package/build/src/protocol/intent.d.ts +2 -1
- package/build/src/protocol/intent.js +8 -2
- package/build/src/protocol/operations.d.ts +93 -202
- package/build/src/protocol/operations.js +23 -642
- package/build/src/protocol/placement.d.ts +12 -13
- package/build/src/protocol/placement.js +8 -19
- package/build/src/protocol/read/status.d.ts +17 -5
- package/build/src/protocol/read/status.js +57 -13
- package/build/src/protocol/reconcile.d.ts +35 -0
- package/build/src/protocol/reconcile.js +41 -0
- package/build/src/protocol/reintegrate.d.ts +31 -0
- package/build/src/protocol/reintegrate.js +74 -0
- package/build/src/protocol/review.d.ts +34 -0
- package/build/src/protocol/review.js +156 -0
- package/build/src/protocol/run.d.ts +1 -1
- package/build/src/runtime/proc/run.js +9 -5
- package/build/src/settlement/fence.d.ts +3 -1
- package/build/src/settlement/fence.js +24 -0
- package/build/src/settlement/holder.d.ts +1 -1
- package/build/src/settlement/settle.d.ts +1 -1
- package/build/src/settlement/settle.js +1 -2
- package/build/src/task/board.d.ts +0 -1
- package/build/src/task/board.js +0 -3
- package/build/src/task/compose.d.ts +2 -2
- package/build/src/task/compose.js +13 -11
- package/build/src/task/context.d.ts +14 -2
- package/build/src/task/context.js +30 -7
- package/build/src/task/index.d.ts +7 -6
- package/build/src/task/index.js +17 -145
- package/build/src/task/input.d.ts +18 -0
- package/build/src/task/input.js +189 -0
- package/build/src/task/mutation.d.ts +44 -0
- package/build/src/task/mutation.js +93 -0
- package/build/src/task/operations.d.ts +14 -6
- package/build/src/task/operations.js +57 -57
- package/build/src/task/store.d.ts +1 -0
- package/build/src/task/store.js +91 -3
- package/build/src/verification/execution.d.ts +1 -1
- package/build/src/workspace-place.d.ts +3 -4
- package/build/src/workspace-place.js +26 -15
- package/package.json +3 -3
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { materializeIntegrationSnapshot, materializeJudgedConflict, planIntegration, workspaceMergeStatePresent, worktreeChangeId, } from "../git/integration.js";
|
|
2
|
+
import { captureTender, dirtyTenderRefusal, materializeTenderSnapshot, prepareDeliveryCommitMetadata, } from "../git/tender.js";
|
|
3
|
+
import { worktreePath } from "../git/workspace.js";
|
|
4
|
+
import { currentBranch, observeContractsForAdmissionAt } from "../git/observe.js";
|
|
5
|
+
import { contractState } from "../core/facts/observation.js";
|
|
6
|
+
import { decideDeliver } from "../core/verbs/deliver.js";
|
|
7
|
+
import { admitDecidedOffer, mintAttempts } from "./attempt.js";
|
|
8
|
+
import { admitted } from "./outcome.js";
|
|
9
|
+
import { completeCandidate } from "./completion.js";
|
|
10
|
+
import { appointmentFor, readPlaceRegister } from "../workspace-place.js";
|
|
11
|
+
import { timestamp } from "./operations.js";
|
|
12
|
+
const DELIVER_CONFLICT_RECOVERY = Object.freeze({
|
|
13
|
+
materialize: "deliver --materialize-conflict",
|
|
14
|
+
continue: "deliver",
|
|
15
|
+
});
|
|
16
|
+
export async function prepareDelivery(repository, stage, input) {
|
|
17
|
+
const { contractId, coordinates } = stage;
|
|
18
|
+
if (coordinates.workspace === "here" && coordinates.target !== undefined) {
|
|
19
|
+
const branch = await currentBranch(repository, stage.workspacePath);
|
|
20
|
+
if (branch !== coordinates.target) {
|
|
21
|
+
return {
|
|
22
|
+
kind: "refused",
|
|
23
|
+
refusal: { kind: "workspace-not-on-target", contractId, target: coordinates.target, branch },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const appointed = coordinates.workspace === "worktree"
|
|
28
|
+
? stage.appointment === undefined
|
|
29
|
+
? appointmentFor(await readPlaceRegister(repository), contractId)
|
|
30
|
+
: { contract: contractId, place: stage.appointment.place }
|
|
31
|
+
: undefined;
|
|
32
|
+
const tender = await captureTender(repository, {
|
|
33
|
+
contractId,
|
|
34
|
+
coordinates,
|
|
35
|
+
...(appointed === undefined ? {} : { place: appointed.place }),
|
|
36
|
+
...(stage.workspacePath === undefined ? {} : { workspacePath: stage.workspacePath }),
|
|
37
|
+
});
|
|
38
|
+
if (tender.kind === "refused")
|
|
39
|
+
return tender;
|
|
40
|
+
if ((tender.data.dirty && input.includeDirty !== true) || tender.data.changes.submodules.length > 0) {
|
|
41
|
+
return { kind: "refused", refusal: await dirtyTenderRefusal(repository, contractId, tender.data) };
|
|
42
|
+
}
|
|
43
|
+
const commit = await prepareDeliveryCommitMetadata(repository, {
|
|
44
|
+
contractId,
|
|
45
|
+
title: input.title,
|
|
46
|
+
document: input.document,
|
|
47
|
+
at: tender.data.at,
|
|
48
|
+
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
49
|
+
...(input.message === undefined ? {} : { message: input.message }),
|
|
50
|
+
});
|
|
51
|
+
const tenderSnapshot = await materializeTenderSnapshot(repository, tender.data, commit);
|
|
52
|
+
const requireBranchesToBeUpToDate = input.requireBranchesToBeUpToDate ?? false;
|
|
53
|
+
const integration = await planIntegration(repository, { contractId, coordinates }, { ...tender.data, head: tenderSnapshot }, requireBranchesToBeUpToDate);
|
|
54
|
+
if (integration.kind === "refused")
|
|
55
|
+
return integration;
|
|
56
|
+
const integrationSnapshot = coordinates.target === undefined
|
|
57
|
+
? tenderSnapshot
|
|
58
|
+
: await materializeIntegrationSnapshot(repository, integration.data.tree, integration.data.predecessor, commit);
|
|
59
|
+
return {
|
|
60
|
+
kind: "prepared",
|
|
61
|
+
data: {
|
|
62
|
+
tenderSnapshot,
|
|
63
|
+
integration: {
|
|
64
|
+
predecessor: integration.data.predecessor,
|
|
65
|
+
snapshot: integrationSnapshot,
|
|
66
|
+
changeId: await worktreeChangeId(repository, { contractId, coordinates }, tender.data),
|
|
67
|
+
},
|
|
68
|
+
method: "squash",
|
|
69
|
+
policy: { requireBranchesToBeUpToDate },
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async function deliverAttempt(input, attempt) {
|
|
74
|
+
const decisionObservation = await observeContractsForAdmissionAt(input.scope, input.channel, [input.contractId]);
|
|
75
|
+
const state = contractState(decisionObservation.decision, input.contractId);
|
|
76
|
+
const derivation = state === null ? undefined : input.deriveDocument(state);
|
|
77
|
+
let preparation;
|
|
78
|
+
let workspacePath;
|
|
79
|
+
if (state === null || derivation === undefined) {
|
|
80
|
+
preparation = { kind: "unavailable" };
|
|
81
|
+
}
|
|
82
|
+
else if (derivation.verification.kind === "refused") {
|
|
83
|
+
preparation = { kind: "refused", document: derivation.document, refusal: derivation.verification.refusal };
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
workspacePath = state.terminal === null && state.coordinates.workspace === "here"
|
|
87
|
+
? await input.resolveHereWorkspace?.(state.id)
|
|
88
|
+
: undefined;
|
|
89
|
+
const prepared = await prepareDelivery(input.scope, {
|
|
90
|
+
contractId: state.id,
|
|
91
|
+
coordinates: state.coordinates,
|
|
92
|
+
...(workspacePath === undefined ? {} : { workspacePath }),
|
|
93
|
+
}, {
|
|
94
|
+
title: derivation.title,
|
|
95
|
+
document: derivation.bytes,
|
|
96
|
+
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
97
|
+
...(input.message === undefined ? {} : { message: input.message }),
|
|
98
|
+
requireBranchesToBeUpToDate: input.requireBranchesToBeUpToDate,
|
|
99
|
+
includeDirty: input.includeDirty,
|
|
100
|
+
});
|
|
101
|
+
preparation = prepared.kind === "refused"
|
|
102
|
+
? { kind: "refused", document: derivation.document, refusal: prepared.refusal }
|
|
103
|
+
: {
|
|
104
|
+
kind: "prepared",
|
|
105
|
+
document: derivation.document,
|
|
106
|
+
data: prepared.data,
|
|
107
|
+
...(workspacePath === undefined ? {} : { workspacePath }),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const decision = decideDeliver({
|
|
111
|
+
input: {
|
|
112
|
+
contractId: input.contractId,
|
|
113
|
+
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
114
|
+
at: timestamp(),
|
|
115
|
+
preparation,
|
|
116
|
+
},
|
|
117
|
+
attempt,
|
|
118
|
+
observation: decisionObservation.decision,
|
|
119
|
+
});
|
|
120
|
+
if (decision.kind === "refused")
|
|
121
|
+
return { kind: "refused", refusal: decision.refusal };
|
|
122
|
+
if (preparation.kind !== "prepared")
|
|
123
|
+
throw new Error("offered delivery is missing its mechanical preparation");
|
|
124
|
+
const admission = await admitDecidedOffer({
|
|
125
|
+
channel: input.channel,
|
|
126
|
+
repository: input.scope,
|
|
127
|
+
decisionObservation,
|
|
128
|
+
attempt,
|
|
129
|
+
offer: decision.offer,
|
|
130
|
+
primaryContract: input.contractId,
|
|
131
|
+
});
|
|
132
|
+
if (admission.kind === "accepted") {
|
|
133
|
+
if (derivation === undefined)
|
|
134
|
+
throw new Error("accepted delivery is missing its document derivation");
|
|
135
|
+
return {
|
|
136
|
+
...admission,
|
|
137
|
+
value: {
|
|
138
|
+
delivery: preparation.data,
|
|
139
|
+
derivation,
|
|
140
|
+
...(workspacePath === undefined ? {} : { workspacePath }),
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return admission;
|
|
145
|
+
}
|
|
146
|
+
async function completeDelivery(input, first) {
|
|
147
|
+
const derivation = first.value.derivation;
|
|
148
|
+
if (derivation.verification.kind !== "prepared") {
|
|
149
|
+
throw new Error("accepted delivery is missing its Verification preparation");
|
|
150
|
+
}
|
|
151
|
+
const completed = await completeCandidate({
|
|
152
|
+
channel: input.channel,
|
|
153
|
+
repository: input.scope,
|
|
154
|
+
contractId: input.contractId,
|
|
155
|
+
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
156
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
157
|
+
...(first.value.workspacePath === undefined ? {} : { hereWorkspacePath: first.value.workspacePath }),
|
|
158
|
+
...(first.state.coordinates.target === undefined ? {} : { target: first.state.coordinates.target }),
|
|
159
|
+
verification: derivation.verification,
|
|
160
|
+
initial: first,
|
|
161
|
+
verifyInitial: true,
|
|
162
|
+
});
|
|
163
|
+
return admitted(completed.admission, {
|
|
164
|
+
...first.value.delivery,
|
|
165
|
+
...completed.evidence,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function isIntegrationConflict(refusal) {
|
|
169
|
+
return refusal.kind === "integration-failed" && refusal.reason === "conflict";
|
|
170
|
+
}
|
|
171
|
+
function conflictDeliverRefusal(refusal) {
|
|
172
|
+
if (refusal.conflictPaths === undefined)
|
|
173
|
+
throw new Error("conflicted integration is missing conflict paths");
|
|
174
|
+
return {
|
|
175
|
+
kind: "integration-failed",
|
|
176
|
+
contractId: refusal.contractId,
|
|
177
|
+
reason: "conflict",
|
|
178
|
+
targetHead: refusal.targetHead,
|
|
179
|
+
conflictPaths: refusal.conflictPaths,
|
|
180
|
+
recovery: DELIVER_CONFLICT_RECOVERY,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async function appointedDeliverWorkspace(input) {
|
|
184
|
+
const observation = await observeContractsForAdmissionAt(input.scope, input.channel, [input.contractId]);
|
|
185
|
+
const state = contractState(observation.decision, input.contractId);
|
|
186
|
+
if (state === null)
|
|
187
|
+
return { kind: "refused", refusal: { kind: "worktree-missing", contractId: input.contractId } };
|
|
188
|
+
if (state.coordinates.workspace === "here") {
|
|
189
|
+
const path = await input.resolveHereWorkspace?.(state.id);
|
|
190
|
+
if (path === undefined) {
|
|
191
|
+
return { kind: "refused", refusal: { kind: "worktree-missing", contractId: input.contractId } };
|
|
192
|
+
}
|
|
193
|
+
return { workspace: { kind: "here", path }, coordinates: state.coordinates };
|
|
194
|
+
}
|
|
195
|
+
const appointment = appointmentFor(await readPlaceRegister(input.scope), input.contractId);
|
|
196
|
+
if (appointment === undefined) {
|
|
197
|
+
return { kind: "refused", refusal: { kind: "worktree-missing", contractId: input.contractId } };
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
workspace: { kind: "worktree", path: worktreePath(input.scope, appointment.place) },
|
|
201
|
+
coordinates: state.coordinates,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
async function materializeDeliverConflict(input, refusal) {
|
|
205
|
+
if (refusal.conflictPaths === undefined)
|
|
206
|
+
throw new Error("conflicted integration is missing conflict paths");
|
|
207
|
+
const appointed = await appointedDeliverWorkspace(input);
|
|
208
|
+
if ("kind" in appointed)
|
|
209
|
+
return appointed;
|
|
210
|
+
const { workspace, coordinates } = appointed;
|
|
211
|
+
if (await workspaceMergeStatePresent(input.scope, workspace.path)) {
|
|
212
|
+
return {
|
|
213
|
+
kind: "refused",
|
|
214
|
+
refusal: { kind: "merge-state-present", contractId: input.contractId, workspace },
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const tender = await captureTender(input.scope, {
|
|
218
|
+
contractId: input.contractId,
|
|
219
|
+
coordinates,
|
|
220
|
+
workspacePath: workspace.path,
|
|
221
|
+
});
|
|
222
|
+
if (tender.kind === "refused")
|
|
223
|
+
return tender;
|
|
224
|
+
if (tender.data.dirty || tender.data.changes.submodules.length > 0) {
|
|
225
|
+
return { kind: "refused", refusal: await dirtyTenderRefusal(input.scope, input.contractId, tender.data) };
|
|
226
|
+
}
|
|
227
|
+
await materializeJudgedConflict(input.scope, workspace.path, refusal.targetHead);
|
|
228
|
+
return {
|
|
229
|
+
kind: "integration-conflict-materialized",
|
|
230
|
+
targetHead: refusal.targetHead,
|
|
231
|
+
conflictPaths: refusal.conflictPaths,
|
|
232
|
+
workspace,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
async function finishDeliverRefusal(input, refusal) {
|
|
236
|
+
if (!isIntegrationConflict(refusal))
|
|
237
|
+
return { kind: "refused", refusal };
|
|
238
|
+
if (input.materializeConflict !== true)
|
|
239
|
+
return { kind: "refused", refusal: conflictDeliverRefusal(refusal) };
|
|
240
|
+
return await materializeDeliverConflict(input, refusal);
|
|
241
|
+
}
|
|
242
|
+
export async function deliverOperation(input) {
|
|
243
|
+
const attempts = mintAttempts({ entryCount: 2 });
|
|
244
|
+
let first = null;
|
|
245
|
+
for (let index = 0; index < attempts.length; index += 1) {
|
|
246
|
+
const result = await deliverAttempt(input, attempts[index]);
|
|
247
|
+
if (result.kind === "accepted") {
|
|
248
|
+
first = result;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
if (result.kind === "refused")
|
|
252
|
+
return await finishDeliverRefusal(input, result.refusal);
|
|
253
|
+
if (result.kind === "publication-failed")
|
|
254
|
+
return { kind: "retry", reason: result };
|
|
255
|
+
if (result.kind === "collision" && index + 1 === attempts.length)
|
|
256
|
+
return { kind: "retry", reason: result };
|
|
257
|
+
}
|
|
258
|
+
if (first === null)
|
|
259
|
+
return { kind: "retry", reason: { kind: "exhausted" } };
|
|
260
|
+
return await completeDelivery(input, first);
|
|
261
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GitDecisionObservation } from "../git/observe.js";
|
|
2
2
|
import type { GitDecodeChannel, GitTreeSelection } from "../git/read-observation.js";
|
|
3
|
-
import type { GitRepository } from "../git/
|
|
3
|
+
import type { GitRepository } from "../git/process.js";
|
|
4
4
|
import type { GitRefAssertion } from "../git/repository.js";
|
|
5
5
|
import { type WorktreeLeak } from "../git/scratch.js";
|
|
6
6
|
import type { HookFailure } from "../git/hooks.js";
|
|
@@ -81,6 +81,7 @@ export type VerificationResult = Readonly<{
|
|
|
81
81
|
export type CurrentVerifiedAttestation = Readonly<{
|
|
82
82
|
entry: EntryUlid;
|
|
83
83
|
verdict: "satisfied" | "unsatisfied";
|
|
84
|
+
summary?: string;
|
|
84
85
|
}>;
|
|
85
86
|
/** Read the latest current verified attestation through the generic currentness judge. */
|
|
86
87
|
export declare function currentVerifiedAttestation(state: ContractState): CurrentVerifiedAttestation | undefined;
|
|
@@ -47,11 +47,17 @@ function verificationInput(outcome, input, subject) {
|
|
|
47
47
|
/** Read the latest current verified attestation through the generic currentness judge. */
|
|
48
48
|
export function currentVerifiedAttestation(state) {
|
|
49
49
|
const current = latestCurrentAttestations(state, new Set([VERIFIED])).get(VERIFIED);
|
|
50
|
-
return current === undefined
|
|
50
|
+
return current === undefined
|
|
51
|
+
? undefined
|
|
52
|
+
: {
|
|
53
|
+
entry: current.entry,
|
|
54
|
+
verdict: current.data.verdict,
|
|
55
|
+
...(current.data.summary === undefined ? {} : { summary: current.data.summary }),
|
|
56
|
+
};
|
|
51
57
|
}
|
|
52
58
|
/** Run Verification against an explicit or admitted integration snapshot. */
|
|
53
59
|
export async function verifyDelivery(input) {
|
|
54
|
-
const snapshot = input.snapshot ?? input.state.
|
|
60
|
+
const snapshot = input.snapshot ?? input.state.currentIntegration?.snapshot;
|
|
55
61
|
if (snapshot === undefined || input.verification === undefined)
|
|
56
62
|
return null;
|
|
57
63
|
const subject = dependencyKeySet([
|
|
@@ -1,252 +1,143 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import
|
|
3
|
-
import { type
|
|
4
|
-
import type { WorktreeHooks } from "../git/hooks.js";
|
|
5
|
-
import { NoGitWorldError, type GitRepository } from "../git/repository.js";
|
|
6
|
-
import { type GitDecodeChannel, type GitTreeSelection } from "../git/read-observation.js";
|
|
1
|
+
import { type DirtyWorkspaceRefusal } from "../git/tender.js";
|
|
2
|
+
import type { GitRepository } from "../git/process.js";
|
|
3
|
+
import { type GitDecodeChannel } from "../git/read-observation.js";
|
|
7
4
|
import type { WorktreeLeak } from "../git/scratch.js";
|
|
8
|
-
import type {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { type DeliverRefusal } from "../core/verbs/deliver.js";
|
|
5
|
+
import type { AbandonRefusal } from "../core/verbs/abandon.js";
|
|
6
|
+
import type { AmendRefusal } from "../core/verbs/amend.js";
|
|
7
|
+
import type { ArcRefusal } from "../core/verbs/arc.js";
|
|
8
|
+
import type { DeliverRefusal } from "../core/verbs/deliver.js";
|
|
13
9
|
import type { PlacementRefusal } from "../core/verbs/placement.js";
|
|
14
|
-
import {
|
|
10
|
+
import type { AttestationRefusal } from "../core/verbs/attestation.js";
|
|
11
|
+
import type { ContractId, ContractState, DeliverData, DocumentKey, SnapshotId } from "../core/facts/types.js";
|
|
12
|
+
import type { BindRefusal, TargetInputRefusal } from "./bind.js";
|
|
13
|
+
import type { IntegrationPreparationRefusal } from "../git/integration.js";
|
|
14
|
+
import type { TargetPlacementRefusal } from "../git/target-placement.js";
|
|
15
|
+
import type { VerificationCleanupFailure, VerificationRuntimeStop, VerificationResult } from "./intent.js";
|
|
15
16
|
import type { VerificationDeclarationPreparation, VerificationDeclarationRefusal } from "../verification/declaration.js";
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
17
|
+
import type { PlacementProtocolResult } from "./placement.js";
|
|
18
|
+
import type { AcceptedAdmission, DecidedOfferResult } from "./attempt.js";
|
|
19
|
+
import type { AcceptedProtocolStep, IntentOutcome as ProtocolIntentOutcome } from "./outcome.js";
|
|
20
|
+
import type { ProtocolResult, ProtocolTerminal } from "./run.js";
|
|
18
21
|
import { type ContractDocumentProjection } from "./read/documents.js";
|
|
19
|
-
import { type ContractBoard, type
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export type
|
|
22
|
+
import { type ContractBoard, type ContractObservation } from "./read/status.js";
|
|
23
|
+
export type MergeStatePresentRefusal = Readonly<{
|
|
24
|
+
kind: "merge-state-present";
|
|
25
|
+
contractId: ContractId;
|
|
26
|
+
workspace: Readonly<{
|
|
27
|
+
kind: "here" | "worktree";
|
|
28
|
+
path: string;
|
|
29
|
+
}>;
|
|
30
|
+
}>;
|
|
31
|
+
export type DeliverConflictRefusal = Readonly<{
|
|
32
|
+
kind: "integration-failed";
|
|
33
|
+
contractId: ContractId;
|
|
34
|
+
reason: "conflict";
|
|
35
|
+
targetHead: SnapshotId;
|
|
36
|
+
conflictPaths: readonly string[];
|
|
37
|
+
recovery: Readonly<{
|
|
38
|
+
materialize: "deliver --materialize-conflict";
|
|
39
|
+
continue: "deliver";
|
|
40
|
+
}>;
|
|
41
|
+
}>;
|
|
29
42
|
export type DeliveryPreparationRefusal = Readonly<{
|
|
30
43
|
kind: "target-missing" | "worktree-missing";
|
|
31
44
|
contractId: ContractId;
|
|
32
|
-
}> | DirtyWorkspaceRefusal | IntegrationPreparationRefusal | TargetPlacementRefusal;
|
|
33
|
-
type
|
|
34
|
-
kind: "worktree-missing";
|
|
35
|
-
contractId: ContractId;
|
|
36
|
-
}> | DirtyWorkspaceRefusal;
|
|
37
|
-
type ReviewRefusal = AttestationRefusal | ReviewPreparationRefusal;
|
|
38
|
-
export type IntentRefusal = AbandonRefusal | AmendRefusal | ArcRefusal | BindRefusal | DeliverRefusal | DeliveryPreparationRefusal | PlacementRefusal | ReviewRefusal | TargetInputRefusal | VerificationDeclarationRefusal;
|
|
39
|
-
export type { TargetInputRefusal } from "./bind.js";
|
|
45
|
+
}> | DirtyWorkspaceRefusal | IntegrationPreparationRefusal | MergeStatePresentRefusal | TargetPlacementRefusal;
|
|
46
|
+
export type IntentRefusal = AbandonRefusal | AmendRefusal | ArcRefusal | BindRefusal | DeliverRefusal | DeliveryPreparationRefusal | DeliverConflictRefusal | PlacementRefusal | AttestationRefusal | TargetInputRefusal | VerificationDeclarationRefusal;
|
|
40
47
|
export type IntentRetry = ProtocolTerminal;
|
|
41
48
|
export type IntentOutcome<Value, Refusal = IntentRefusal> = ProtocolIntentOutcome<Value, Refusal>;
|
|
42
49
|
type OperationInput = Readonly<{
|
|
43
50
|
scope: RepositoryScope;
|
|
44
51
|
contractId: ContractId;
|
|
45
|
-
actor?: ActorId;
|
|
52
|
+
actor?: import("../core/facts/types.js").ActorId;
|
|
46
53
|
}>;
|
|
47
|
-
type
|
|
54
|
+
export type HereWorkspaceResolver = (contractId: ContractId) => Promise<string | undefined>;
|
|
55
|
+
export type MutationOperationInput = OperationInput & Readonly<{
|
|
48
56
|
channel: GitDecodeChannel;
|
|
57
|
+
resolveHereWorkspace?: HereWorkspaceResolver;
|
|
49
58
|
}>;
|
|
50
|
-
export type AuditWorkspace = Readonly<{
|
|
51
|
-
kind: "worktree" | "here";
|
|
52
|
-
path: string;
|
|
53
|
-
}>;
|
|
54
|
-
export type DiffScope = DeliveryDiffScope;
|
|
55
|
-
export type AuditReport = Readonly<{
|
|
56
|
-
candidate: Readonly<{
|
|
57
|
-
kind: "blocked";
|
|
58
|
-
refusal: DeliveryPreparationRefusal;
|
|
59
|
-
}> | Readonly<{
|
|
60
|
-
kind: "ready";
|
|
61
|
-
workspace: AuditWorkspace;
|
|
62
|
-
identity: DeliveryIdentity;
|
|
63
|
-
scope: DiffScope;
|
|
64
|
-
diff?: string;
|
|
65
|
-
}>;
|
|
66
|
-
verification: Readonly<{
|
|
67
|
-
kind: "not-run";
|
|
68
|
-
}> | Readonly<{
|
|
69
|
-
kind: "satisfied";
|
|
70
|
-
passed: number;
|
|
71
|
-
total: number;
|
|
72
|
-
summary?: string;
|
|
73
|
-
}> | Readonly<{
|
|
74
|
-
kind: "unsatisfied";
|
|
75
|
-
passed: number;
|
|
76
|
-
total: number;
|
|
77
|
-
summary?: string;
|
|
78
|
-
}> | Readonly<{
|
|
79
|
-
kind: "stopped";
|
|
80
|
-
stop: VerificationStop;
|
|
81
|
-
}>;
|
|
82
|
-
target: Readonly<{
|
|
83
|
-
kind: "not-observed";
|
|
84
|
-
}> | AuditTargetAnswer;
|
|
85
|
-
delivery?: Readonly<{
|
|
86
|
-
changeId: ChangeId;
|
|
87
|
-
relation: "identical" | "differs";
|
|
88
|
-
}>;
|
|
89
|
-
}>;
|
|
90
|
-
export type VerificationReuse = CurrentVerifiedAttestation;
|
|
91
59
|
export type DocumentDerivation = Readonly<{
|
|
92
60
|
document: DocumentKey;
|
|
93
61
|
bytes: string;
|
|
94
62
|
title: string;
|
|
95
63
|
verification: VerificationDeclarationPreparation;
|
|
96
64
|
}>;
|
|
97
|
-
|
|
65
|
+
type StepStop<R> = Readonly<{
|
|
98
66
|
refusal: R;
|
|
99
67
|
retry?: never;
|
|
100
68
|
} | {
|
|
101
69
|
retry: IntentRetry;
|
|
102
70
|
refusal?: never;
|
|
103
71
|
}>;
|
|
104
|
-
export type VerificationStop = StepStop<AttestationRefusal> | VerificationRuntimeStop;
|
|
105
|
-
export type PlacementStop = StepStop<PlacementRefusal | TargetPlacementRefusal | IntegrationPreparationRefusal
|
|
72
|
+
export type VerificationStop = StepStop<AttestationRefusal | VerificationDeclarationRefusal> | VerificationRuntimeStop;
|
|
73
|
+
export type PlacementStop = StepStop<PlacementRefusal | TargetPlacementRefusal | IntegrationPreparationRefusal | Readonly<{
|
|
74
|
+
kind: "target-missing";
|
|
75
|
+
contractId: ContractId;
|
|
76
|
+
}>> | Readonly<{
|
|
106
77
|
failure: "target-moved";
|
|
107
78
|
contractId: ContractId;
|
|
108
79
|
target: string;
|
|
109
80
|
expected: SnapshotId;
|
|
110
81
|
observed: SnapshotId | null;
|
|
82
|
+
}> | Readonly<{
|
|
83
|
+
failure: "target-moved";
|
|
84
|
+
contractId: ContractId;
|
|
85
|
+
target: string;
|
|
86
|
+
integratedAt: SnapshotId;
|
|
87
|
+
observed: SnapshotId | null;
|
|
88
|
+
attempts: number;
|
|
111
89
|
}> | Readonly<{
|
|
112
90
|
failure: "target-placement-failed";
|
|
113
91
|
diagnostic: string;
|
|
114
92
|
}>;
|
|
115
|
-
type
|
|
116
|
-
|
|
93
|
+
export type AttemptDecision<Value, Refusal = IntentRefusal> = (AcceptedAdmission & Readonly<{
|
|
94
|
+
value: Value;
|
|
95
|
+
}>) | Readonly<{
|
|
96
|
+
kind: "refused";
|
|
97
|
+
refusal: Refusal;
|
|
98
|
+
}> | Readonly<{
|
|
99
|
+
kind: "redecide";
|
|
100
|
+
}> | Readonly<{
|
|
101
|
+
kind: "collision";
|
|
102
|
+
}> | Extract<DecidedOfferResult, {
|
|
103
|
+
kind: "publication-failed";
|
|
104
|
+
}>;
|
|
105
|
+
export declare function timestamp(): string;
|
|
106
|
+
export declare function mergeAdmissions(current: AcceptedProtocolStep, next: AcceptedProtocolStep): AcceptedProtocolStep;
|
|
107
|
+
export declare function stepStop<Refusal>(result: ProtocolResult<Refusal>): StepStop<Refusal> | undefined;
|
|
108
|
+
export declare function unpackVerificationOutcome(verification: VerificationResult): Readonly<{
|
|
109
|
+
cleanup?: VerificationCleanupFailure;
|
|
110
|
+
leak?: WorktreeLeak;
|
|
111
|
+
stop?: VerificationStop;
|
|
112
|
+
admission?: AcceptedProtocolStep;
|
|
113
|
+
counts?: NonNullable<VerificationResult["counts"]>;
|
|
117
114
|
}>;
|
|
115
|
+
export declare function placementStop(result: PlacementProtocolResult<IntegrationPreparationRefusal>): PlacementStop | undefined;
|
|
118
116
|
export type RepositoryScope = GitRepository;
|
|
119
|
-
export
|
|
120
|
-
|
|
117
|
+
export declare function scopeOperation(input: Readonly<{
|
|
118
|
+
coordinate: string;
|
|
119
|
+
gitPath?: string;
|
|
120
|
+
}>): Promise<RepositoryScope>;
|
|
121
121
|
export declare function currentBranchOperation(input: Readonly<{
|
|
122
122
|
scope: RepositoryScope;
|
|
123
123
|
}>): Promise<string | null>;
|
|
124
124
|
export declare function contractsOperation(input: Readonly<{
|
|
125
125
|
scope: RepositoryScope;
|
|
126
126
|
channel: GitDecodeChannel;
|
|
127
|
+
hereWorkspace?: import("./read/status.js").HereWorkspaceObservationResolver;
|
|
127
128
|
}>): Promise<ContractBoard>;
|
|
128
|
-
export declare function contractObservationOperation(input:
|
|
129
|
-
|
|
129
|
+
export declare function contractObservationOperation(input: Readonly<{
|
|
130
|
+
scope: RepositoryScope;
|
|
131
|
+
channel: GitDecodeChannel;
|
|
132
|
+
contractId: ContractId;
|
|
133
|
+
hereWorkspace?: import("./read/status.js").HereWorkspaceObservationResolver;
|
|
134
|
+
}>): Promise<ContractObservation>;
|
|
130
135
|
export declare function documentsOperationAt(scope: RepositoryScope, channel: GitDecodeChannel): Promise<readonly ContractDocumentProjection[]>;
|
|
131
136
|
export declare function stateOperation(input: MutationOperationInput): Promise<ContractState>;
|
|
132
|
-
|
|
133
|
-
export declare function
|
|
134
|
-
type DeliveryDiffOperationInput = Readonly<{
|
|
137
|
+
export declare function deliveryOperation(input: MutationOperationInput): Promise<DeliverData | null>;
|
|
138
|
+
export declare function deliveryDiffOperation(input: Readonly<{
|
|
135
139
|
scope: RepositoryScope;
|
|
136
140
|
integrationPredecessor: SnapshotId;
|
|
137
141
|
integrationSnapshot: SnapshotId;
|
|
138
|
-
}>;
|
|
139
|
-
export
|
|
140
|
-
type AmendOperationInput = MutationOperationInput & Readonly<{
|
|
141
|
-
source?: ContractTerms;
|
|
142
|
-
deriveAmendment?: (source: ContractTerms) => Readonly<{
|
|
143
|
-
terms: AmendData;
|
|
144
|
-
verification: VerificationDeclarationPreparation;
|
|
145
|
-
}>;
|
|
146
|
-
}>;
|
|
147
|
-
type Amendment = Readonly<{
|
|
148
|
-
source: ContractTerms;
|
|
149
|
-
}> & ReturnType<NonNullable<AmendOperationInput["deriveAmendment"]>>;
|
|
150
|
-
export declare function amendOperation(input: AmendOperationInput): Promise<IntentOutcome<Amendment, AmendRefusal | VerificationDeclarationRefusal>>;
|
|
151
|
-
export type DeliverValue = DeliveryIdentity & Readonly<{
|
|
152
|
-
verification?: VerificationStop;
|
|
153
|
-
verificationReuse?: VerificationReuse;
|
|
154
|
-
placement?: PlacementStop;
|
|
155
|
-
cleanup?: VerificationCleanupFailure;
|
|
156
|
-
leak?: WorktreeLeak;
|
|
157
|
-
}>;
|
|
158
|
-
type DeliverOperationInput = MutationOperationInput & Readonly<{
|
|
159
|
-
deriveDocument: (state: ContractState) => DocumentDerivation;
|
|
160
|
-
message?: string;
|
|
161
|
-
requireBranchesToBeUpToDate: boolean;
|
|
162
|
-
includeDirty: boolean;
|
|
163
|
-
signal?: AbortSignal;
|
|
164
|
-
}>;
|
|
165
|
-
export declare function prepareDelivery(repository: GitRepository, stage: Readonly<{
|
|
166
|
-
contractId: ContractId;
|
|
167
|
-
coordinates: ContractState["coordinates"];
|
|
168
|
-
appointment?: Extract<ManagedWorktreeAppointment, {
|
|
169
|
-
kind: "appointed";
|
|
170
|
-
}>;
|
|
171
|
-
}>, input: Readonly<{
|
|
172
|
-
title: string;
|
|
173
|
-
document: string;
|
|
174
|
-
actor?: ActorId;
|
|
175
|
-
message?: string;
|
|
176
|
-
requireBranchesToBeUpToDate?: boolean;
|
|
177
|
-
includeDirty?: boolean;
|
|
178
|
-
}>): Promise<{
|
|
179
|
-
kind: "prepared";
|
|
180
|
-
data: DeliverData;
|
|
181
|
-
} | {
|
|
182
|
-
kind: "refused";
|
|
183
|
-
refusal: DeliveryPreparationRefusal;
|
|
184
|
-
}>;
|
|
185
|
-
export declare function prepareReview(repository: GitRepository, stage: Readonly<{
|
|
186
|
-
contractId: ContractId;
|
|
187
|
-
coordinates: ContractState["coordinates"];
|
|
188
|
-
}>): Promise<{
|
|
189
|
-
kind: "prepared";
|
|
190
|
-
data: Readonly<{
|
|
191
|
-
changeId: DeliverData["integration"]["changeId"];
|
|
192
|
-
workspace?: WorkspaceDirtyDelta;
|
|
193
|
-
}>;
|
|
194
|
-
} | {
|
|
195
|
-
kind: "refused";
|
|
196
|
-
refusal: ReviewPreparationRefusal;
|
|
197
|
-
}>;
|
|
198
|
-
export declare function deliverOperation(input: DeliverOperationInput): Promise<IntentOutcome<DeliverValue>>;
|
|
199
|
-
export declare function abandonOperation(input: MutationOperationInput & Readonly<{
|
|
200
|
-
note?: string;
|
|
201
|
-
decorateOffer?: CompanionDecorator;
|
|
202
|
-
observationSelection?: GitTreeSelection;
|
|
203
|
-
}>): Promise<IntentOutcome<void, AbandonRefusal>>;
|
|
204
|
-
export declare function arcOperation(input: MutationOperationInput & Readonly<{
|
|
205
|
-
chapter: Omit<ArcData, "seq">;
|
|
206
|
-
}>): Promise<IntentOutcome<void, ArcRefusal>>;
|
|
207
|
-
type ReviewOperationInput = MutationOperationInput & Readonly<{
|
|
208
|
-
verdict: AttestationData["verdict"];
|
|
209
|
-
summary?: string;
|
|
210
|
-
}>;
|
|
211
|
-
export type ReviewValue = Readonly<{
|
|
212
|
-
placement?: PlacementStop;
|
|
213
|
-
workspace?: WorkspaceDirtyDelta;
|
|
214
|
-
}>;
|
|
215
|
-
export declare function reviewOperation(input: ReviewOperationInput): Promise<IntentOutcome<ReviewValue, ReviewRefusal>>;
|
|
216
|
-
type AuditOperationInput = MutationOperationInput & Readonly<{
|
|
217
|
-
deriveDocument?: (state: ContractState) => DocumentDerivation;
|
|
218
|
-
requireBranchesToBeUpToDate?: boolean;
|
|
219
|
-
includeDirty?: boolean;
|
|
220
|
-
showDiff?: boolean;
|
|
221
|
-
signal?: AbortSignal;
|
|
222
|
-
}>;
|
|
223
|
-
export declare function auditOperation(input: AuditOperationInput): Promise<IntentOutcome<AuditReport>>;
|
|
224
|
-
export type ReconcileReport = ReconcileResult;
|
|
225
|
-
export type ReconcileObservation = Readonly<{
|
|
226
|
-
state: ContractState | null;
|
|
227
|
-
report: ReconcileReport;
|
|
228
|
-
}>;
|
|
229
|
-
type ReconcileOptions = Readonly<{
|
|
230
|
-
hooks: WorktreeHooks;
|
|
231
|
-
retryHooks: boolean;
|
|
232
|
-
retainTerminalWorktree?: boolean;
|
|
233
|
-
place?: string;
|
|
234
|
-
places?: ReadonlyMap<ContractId, string>;
|
|
235
|
-
}>;
|
|
236
|
-
export declare function reconcileOperation(input: MutationOperationInput & ReconcileOptions): Promise<ReconcileObservation>;
|
|
237
|
-
type RepoReconcileItem = Readonly<{
|
|
238
|
-
contractId: ContractId;
|
|
239
|
-
state: ContractState | null;
|
|
240
|
-
report: ReconcileReport;
|
|
241
|
-
}>;
|
|
242
|
-
export type RepoReconcileReport = Readonly<{
|
|
243
|
-
contracts: readonly RepoReconcileItem[];
|
|
244
|
-
}>;
|
|
245
|
-
export declare function worldContractStates(input: Readonly<{
|
|
246
|
-
scope: RepositoryScope;
|
|
247
|
-
channel: GitDecodeChannel;
|
|
248
|
-
}>): Promise<readonly ContractState[]>;
|
|
249
|
-
export declare function reconcileAllOperation(input: Readonly<{
|
|
250
|
-
scope: RepositoryScope;
|
|
251
|
-
channel: GitDecodeChannel;
|
|
252
|
-
}> & ReconcileOptions): Promise<RepoReconcileReport>;
|
|
142
|
+
}>): Promise<string | null>;
|
|
143
|
+
export {};
|