@astrosheep/keiyaku 4.6.32 → 4.6.33
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/README.md +8 -6
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/pi/README.md +55 -97
- package/build/plugins/pi/keiyaku.ts +2 -9
- package/build/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/src/akuma/akuma-instance.d.ts +11 -0
- package/build/src/akuma/akuma-instance.js +1 -2
- package/build/src/akuma/akuma-observe.js +73 -14
- package/build/src/akuma/akuma-selection-execution.d.ts +82 -7
- package/build/src/akuma/akuma-selection-execution.js +26 -27
- package/build/src/akuma/akuma-wait.d.ts +40 -1
- package/build/src/akuma/akuma-wait.js +58 -29
- package/build/src/akuma/akuma.d.ts +11 -0
- package/build/src/akuma/body.js +13 -18
- package/build/src/akuma/call-initial-tell.d.ts +0 -1
- package/build/src/akuma/call-initial-tell.js +0 -1
- package/build/src/akuma/heart/activity-schema.d.ts +16 -0
- package/build/src/akuma/heart/activity-schema.js +7 -0
- package/build/src/akuma/heart/index.d.ts +1 -1
- package/build/src/akuma/heart/index.js +9 -1
- package/build/src/akuma/heart/timeline.js +4 -4
- package/build/src/akuma/projection-read.d.ts +4 -2
- package/build/src/akuma/projection-read.js +21 -14
- package/build/src/akuma/projection.d.ts +94 -2
- package/build/src/akuma/projection.js +47 -47
- package/build/src/akuma/provider.d.ts +2 -2
- package/build/src/akuma/provider.js +27 -20
- package/build/src/akuma/providers/acp/core.js +2 -5
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +2 -1
- package/build/src/akuma/providers/opencode-sdk/events.js +31 -1
- package/build/src/akuma/publication.js +3 -2
- package/build/src/akuma/selection-observation.d.ts +23 -0
- package/build/src/akuma/selection-observation.js +15 -4
- package/build/src/akuma/status-projection.d.ts +14 -1
- package/build/src/akuma/status-projection.js +40 -2
- package/build/src/akuma/turn-drive.js +21 -15
- package/build/src/body/amend.js +5 -17
- package/build/src/body/decode.js +11 -1
- package/build/src/body/envelope.d.ts +5 -1
- package/build/src/body/envelope.js +4 -2
- package/build/src/body/render.js +4 -6
- package/build/src/cli/commands/akuma-grammar.d.ts +3 -5
- package/build/src/cli/commands/akuma-grammar.js +22 -40
- package/build/src/cli/commands/akuma.d.ts +1 -2
- package/build/src/cli/commands/akuma.js +6 -58
- package/build/src/cli/commands/contract-grammar.d.ts +1 -0
- package/build/src/cli/commands/contract-grammar.js +7 -11
- package/build/src/cli/commands/contract-help.d.ts +3 -2
- package/build/src/cli/commands/contract-help.js +11 -5
- package/build/src/cli/commands/contract.js +3 -0
- package/build/src/cli/commands/debt-grammar.js +2 -4
- package/build/src/cli/parse.js +1 -4
- package/build/src/cli/render/akuma-activity.d.ts +3 -15
- package/build/src/cli/render/akuma-activity.js +19 -73
- package/build/src/cli/render/akuma.d.ts +5 -11
- package/build/src/cli/render/akuma.js +22 -30
- package/build/src/cli/render/catalog.js +1 -4
- package/build/src/cli/render/contract-history.js +2 -0
- package/build/src/cli/render/contract-observation.d.ts +2 -1
- package/build/src/cli/render/contract-observation.js +25 -1
- package/build/src/cli/render/contract-wait.d.ts +2 -2
- package/build/src/cli/render/contract-wait.js +13 -17
- package/build/src/cli/render/contract.js +12 -9
- package/build/src/cli/render/debt.js +1 -2
- package/build/src/cli/render/execution-progress.js +1 -3
- package/build/src/cli/render/kanshi-akuma.js +1 -2
- package/build/src/cli/render/kanshi.js +11 -17
- package/build/src/cli/render/receipt.d.ts +1 -1
- package/build/src/cli/render/receipt.js +33 -28
- package/build/src/cli/render/reconcile.js +2 -5
- package/build/src/cli/render/refusal.js +3 -6
- package/build/src/cli/render/terminal.d.ts +2 -4
- package/build/src/cli/render/terminal.js +10 -17
- package/build/src/cli/render/verbs.d.ts +1 -0
- package/build/src/cli/render/verbs.js +19 -17
- package/build/src/cli/runtime.js +3 -9
- package/build/src/core/facts/codec.js +7 -2
- package/build/src/core/facts/eligibility.d.ts +4 -4
- package/build/src/core/facts/eligibility.js +11 -0
- package/build/src/core/facts/fold.js +9 -5
- package/build/src/core/facts/gate.d.ts +5 -1
- package/build/src/core/facts/gate.js +14 -10
- package/build/src/core/facts/types.d.ts +5 -1
- package/build/src/core/facts/types.js +7 -0
- package/build/src/core/subject.d.ts +4 -1
- package/build/src/core/subject.js +10 -2
- package/build/src/core/verbs/amend.d.ts +15 -4
- package/build/src/core/verbs/amend.js +19 -9
- package/build/src/debt/index.d.ts +0 -1
- package/build/src/debt/index.js +6 -11
- package/build/src/debt/input.d.ts +2 -1
- package/build/src/debt/input.js +6 -4
- package/build/src/dispatch/index.d.ts +0 -17
- package/build/src/dispatch/index.js +1 -10
- package/build/src/git/identity.js +16 -45
- package/build/src/git/nuke.js +13 -23
- package/build/src/git/observe.d.ts +3 -0
- package/build/src/git/observe.js +25 -23
- package/build/src/git/process.js +11 -18
- package/build/src/git/read-observation.d.ts +5 -4
- package/build/src/git/repository.d.ts +2 -0
- package/build/src/git/repository.js +13 -1
- package/build/src/git/scratch.js +2 -14
- package/build/src/git/terminal-reconcile.js +1 -13
- package/build/src/index.d.ts +2 -0
- package/build/src/kanshi/index.d.ts +0 -1
- package/build/src/kanshi/index.js +0 -1
- package/build/src/kanshi/read.d.ts +21 -0
- package/build/src/kanshi/read.js +2 -1
- package/build/src/kanshi/report.d.ts +94 -0
- package/build/src/library/address.d.ts +12 -5
- package/build/src/library/address.js +18 -32
- package/build/src/library/akuma-creation.d.ts +39 -0
- package/build/src/library/akuma-creation.js +3 -9
- package/build/src/library/continuation.d.ts +10 -0
- package/build/src/library/contract-creation.js +10 -11
- package/build/src/library/contract-outcomes.d.ts +72 -1
- package/build/src/library/contract-outcomes.js +1 -0
- package/build/src/library/contract-types.d.ts +18 -0
- package/build/src/library/contract-types.js +2 -0
- package/build/src/library/contract-wait.d.ts +7 -0
- package/build/src/library/contract-wait.js +53 -49
- package/build/src/library/delivery.d.ts +25 -0
- package/build/src/library/input.d.ts +5 -23
- package/build/src/library/input.js +12 -7
- package/build/src/library/kei.js +39 -20
- package/build/src/library/keiyaku-classify.js +3 -3
- package/build/src/library/keiyaku-debt.js +1 -2
- package/build/src/library/keiyaku-identity.d.ts +3 -3
- package/build/src/library/keiyaku-identity.js +11 -6
- package/build/src/library/keiyaku-verbs.d.ts +456 -1362
- package/build/src/library/keiyaku-verbs.js +80 -92
- package/build/src/library/keiyaku-wait.d.ts +183 -0
- package/build/src/library/keiyaku-wait.js +213 -0
- package/build/src/library/keiyaku.d.ts +3 -1
- package/build/src/library/keiyaku.js +49 -73
- package/build/src/{mcp/output.d.ts → library/model-tools.d.ts} +227 -56
- package/build/src/library/model-tools.js +347 -0
- package/build/src/library/outcome.js +5 -6
- package/build/src/library/refusal.d.ts +25 -1
- package/build/src/library/refusal.js +4 -5
- package/build/src/library/selection.d.ts +12 -0
- package/build/src/library/selection.js +1 -2
- package/build/src/mcp/adapter.d.ts +0 -6
- package/build/src/mcp/adapter.js +10 -159
- package/build/src/mcp/description.d.ts +2 -0
- package/build/src/mcp/description.js +2 -0
- package/build/src/mcp/help.d.ts +1 -1
- package/build/src/mcp/help.js +6 -4
- package/build/src/pi/index.d.ts +3 -0
- package/build/src/pi/index.js +83 -0
- package/build/src/protocol/amend.d.ts +14 -3
- package/build/src/protocol/amend.js +113 -46
- package/build/src/protocol/bind.d.ts +1 -1
- package/build/src/protocol/bind.js +5 -16
- package/build/src/protocol/completion.d.ts +30 -0
- package/build/src/protocol/completion.js +8 -5
- package/build/src/protocol/deliver.js +7 -20
- package/build/src/protocol/delivery-preview.d.ts +5 -0
- package/build/src/protocol/execution-observation.d.ts +8 -0
- package/build/src/protocol/intent.d.ts +1 -0
- package/build/src/protocol/intent.js +4 -1
- package/build/src/protocol/operations.d.ts +54 -16
- package/build/src/protocol/operations.js +17 -31
- package/build/src/protocol/placement.js +7 -1
- package/build/src/protocol/progress.js +0 -6
- package/build/src/protocol/read/status.d.ts +40 -0
- package/build/src/protocol/read/status.js +7 -10
- package/build/src/protocol/reintegrate.js +2 -2
- package/build/src/protocol/result-leaves.d.ts +56 -8
- package/build/src/protocol/result-leaves.js +11 -2
- package/build/src/protocol/run.js +1 -4
- package/build/src/protocol/verify.d.ts +10 -0
- package/build/src/protocol/verify.js +1 -0
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/settle.js +19 -68
- package/package.json +7 -3
- package/plugins/pi/README.md +55 -97
- package/plugins/pi/keiyaku.ts +2 -9
- package/skills/keiyaku-akuma/SKILL.md +13 -9
- package/skills/keiyaku-babysit/SKILL.md +8 -6
- package/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/pi/akuma-tools.ts +0 -283
- package/build/src/body/keys.d.ts +0 -4
- package/build/src/body/keys.js +0 -11
- package/build/src/kanshi/roster.d.ts +0 -2
- package/build/src/kanshi/roster.js +0 -2
- package/build/src/mcp/output.js +0 -193
- package/plugins/pi/akuma-tools.ts +0 -283
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { LiveStatusObservation } from "../../akuma/akuma-observe.js";
|
|
2
2
|
import type { TellResult } from "../../akuma/body.js";
|
|
3
3
|
import type { AkumaId } from "../../akuma/identity.js";
|
|
4
|
-
import type { AkumaAskResult,
|
|
5
|
-
import type { ForkResult, SpawnResult
|
|
6
|
-
import { type ObservedCallHead } from "./akuma-activity.js";
|
|
4
|
+
import type { AkumaAskResult, AkumaKillResult } from "../../akuma/selection-observation.js";
|
|
5
|
+
import type { ForkResult, SpawnResult } from "../../library/akuma-creation.js";
|
|
7
6
|
import { type TextRenderContext } from "./terminal.js";
|
|
8
7
|
type AskProgress = Readonly<{
|
|
9
8
|
admitted: (tell: TellResult, id: AkumaId) => readonly string[];
|
|
10
9
|
observe: (observation: LiveStatusObservation) => readonly string[];
|
|
11
10
|
frame: () => readonly string[];
|
|
12
11
|
flush: () => readonly string[];
|
|
13
|
-
conclude: (result: AkumaAskResult
|
|
12
|
+
conclude: (result: AkumaAskResult) => readonly string[];
|
|
14
13
|
}>;
|
|
15
14
|
export declare function askProgressStream(akuma: AkumaId | undefined, alias: string | undefined, context: TextRenderContext, now?: () => number | undefined): AskProgress;
|
|
16
|
-
export declare function waitedTellProgress(result: AkumaAskResult
|
|
15
|
+
export declare function waitedTellProgress(result: AkumaAskResult, input: Readonly<{
|
|
17
16
|
prompt: string;
|
|
18
17
|
alias?: string;
|
|
19
18
|
}>, context: TextRenderContext): string;
|
|
@@ -23,13 +22,8 @@ type SpawnPresentation = Readonly<{
|
|
|
23
22
|
alias?: string;
|
|
24
23
|
contractId?: string;
|
|
25
24
|
}>;
|
|
26
|
-
|
|
27
|
-
export declare function callObservationHead(input: SpawnResult | (SpawnWaitHead & Readonly<{
|
|
28
|
-
akumaId: string;
|
|
29
|
-
}>), presentation?: SpawnPresentation): ObservedCallHead;
|
|
30
|
-
export declare function renderCallText(result: SpawnResult, streamed: boolean, context: TextRenderContext, input?: SpawnPresentation): string;
|
|
25
|
+
export declare function renderCallText(result: SpawnResult, context: TextRenderContext, input?: SpawnPresentation): string;
|
|
31
26
|
export declare function renderSpawnFailure(result: SpawnResult, diagnostic: string, context: TextRenderContext, input?: SpawnPresentation): string;
|
|
32
|
-
export declare function renderFailedCallObservation(result: SpawnResult, context: TextRenderContext, input?: SpawnPresentation): string;
|
|
33
27
|
export declare function renderForkText(receipt: ForkResult, input: Readonly<{
|
|
34
28
|
akuma: string;
|
|
35
29
|
at: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { actionReceipt,
|
|
1
|
+
import { actionReceipt, inputWaitStream, killResultText, subordinateLines, tellAdmissionRow, callFailureLines, askRawAnswer, observationCompletedAt, tellControlLines, tellPayloadLines, } from "./akuma-activity.js";
|
|
2
2
|
import { safeText } from "./terminal.js";
|
|
3
3
|
export function askProgressStream(akuma, alias, context, now) {
|
|
4
4
|
let target = akuma;
|
|
5
5
|
const stream = inputWaitStream(context, () => {
|
|
6
6
|
if (target === undefined)
|
|
7
|
-
throw new Error("
|
|
7
|
+
throw new Error("Ask progress used before admission");
|
|
8
8
|
return { id: target, ...(alias === undefined ? {} : { alias }), contract: { kind: "none" }, facts: [] };
|
|
9
9
|
}, { cursor: "admission", answerSeparator: true, ...(now === undefined ? {} : { now }) });
|
|
10
10
|
return {
|
|
@@ -21,8 +21,14 @@ export function askProgressStream(akuma, alias, context, now) {
|
|
|
21
21
|
flush: () => stream.flush(),
|
|
22
22
|
conclude: (result) => {
|
|
23
23
|
const controls = tellControlLines(result, context);
|
|
24
|
+
const observation = result;
|
|
25
|
+
const completedAt = observationCompletedAt(observation);
|
|
24
26
|
return [
|
|
25
|
-
stream.conclude({
|
|
27
|
+
stream.conclude({
|
|
28
|
+
kind: "observed",
|
|
29
|
+
observation,
|
|
30
|
+
...(completedAt === undefined ? {} : { completedAt }),
|
|
31
|
+
}),
|
|
26
32
|
...subordinateLines([
|
|
27
33
|
...(controls.length === 0 && askRawAnswer(result) !== undefined ? [] : [`input ${result.tellId}`]),
|
|
28
34
|
...controls,
|
|
@@ -39,31 +45,27 @@ export function waitedTellProgress(result, input, context) {
|
|
|
39
45
|
facts: [],
|
|
40
46
|
}), { cursor: "admission", answerSeparator: true, now: () => context.now });
|
|
41
47
|
const admitted = stream.admitted({ rows: [tellAdmissionRow(input.prompt, context, result.wake)] });
|
|
48
|
+
const observation = result;
|
|
49
|
+
const completedAt = observationCompletedAt(observation);
|
|
42
50
|
return [
|
|
43
51
|
...admitted,
|
|
44
52
|
stream.conclude({
|
|
45
53
|
kind: "observed",
|
|
46
|
-
observation
|
|
54
|
+
observation,
|
|
55
|
+
...(completedAt === undefined ? {} : { completedAt }),
|
|
47
56
|
}),
|
|
48
57
|
...subordinateLines([`input ${result.tellId}`, ...tellControlLines(result, context)]),
|
|
49
58
|
...(askRawAnswer(result) === undefined ? [] : [askRawAnswer(result)]),
|
|
50
59
|
...(result.kind === "invalid-output" ? ["invalid answer", result.answer] : []),
|
|
51
60
|
].join("\n");
|
|
52
61
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const failures = "failures" in input ? (input.failures ?? []) : [];
|
|
62
|
+
function spawnHead(input, presentation = {}) {
|
|
63
|
+
const failures = input.kind === "failed" ? input.failures : [];
|
|
56
64
|
const alias = failures.some((failure) => failure.stage === "dispatch" || failure.stage === "alias")
|
|
57
65
|
? undefined
|
|
58
|
-
:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const contractId = failures.some((failure) => failure.stage === "dispatch")
|
|
62
|
-
? undefined
|
|
63
|
-
: "contractId" in input
|
|
64
|
-
? input.contractId
|
|
65
|
-
: presentation.contractId;
|
|
66
|
-
const cwd = "cwd" in input ? input.cwd : presentation.cwd;
|
|
66
|
+
: presentation.alias;
|
|
67
|
+
const contractId = failures.some((failure) => failure.stage === "dispatch") ? undefined : presentation.contractId;
|
|
68
|
+
const cwd = presentation.cwd;
|
|
67
69
|
const facts = [
|
|
68
70
|
...(input.dispatchWarning === undefined ? [] : [`dispatch lag ${safeText(input.dispatchWarning)}`]),
|
|
69
71
|
...(input.alias === undefined ? [] : [`alias moved · previous ${input.alias.previousAkumaId}`]),
|
|
@@ -77,7 +79,7 @@ export function callObservationHead(input, presentation = {}) {
|
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
81
|
function spawnEvidence(result, context, input) {
|
|
80
|
-
const head =
|
|
82
|
+
const head = spawnHead(result, input);
|
|
81
83
|
return [
|
|
82
84
|
...(head.contract.kind === "associated" ? [safeText(head.contract.contractId)] : []),
|
|
83
85
|
...(head.cwd === undefined ? [] : [safeText(head.cwd)]),
|
|
@@ -90,14 +92,8 @@ function spawnEvidence(result, context, input) {
|
|
|
90
92
|
...(result.kind === "failed" ? callFailureLines(result.failures, context) : []),
|
|
91
93
|
];
|
|
92
94
|
}
|
|
93
|
-
export function renderCallText(result,
|
|
94
|
-
|
|
95
|
-
return "";
|
|
96
|
-
const head = callObservationHead(result, input);
|
|
97
|
-
if (result.input !== undefined) {
|
|
98
|
-
const stream = callObservationStream(context, head, { now: () => context.now });
|
|
99
|
-
return [stream.conclude(result), ...(result.input.kind === "answered" ? [result.input.answer] : [])].join("\n");
|
|
100
|
-
}
|
|
95
|
+
export function renderCallText(result, context, input = {}) {
|
|
96
|
+
const head = spawnHead(result, input);
|
|
101
97
|
return actionReceipt({
|
|
102
98
|
mark: result.kind === "failed" ? "!" : "✓",
|
|
103
99
|
verb: "spawned",
|
|
@@ -107,7 +103,7 @@ export function renderCallText(result, streamed, context, input = {}) {
|
|
|
107
103
|
}).join("\n");
|
|
108
104
|
}
|
|
109
105
|
export function renderSpawnFailure(result, diagnostic, context, input = {}) {
|
|
110
|
-
const head =
|
|
106
|
+
const head = spawnHead(result, input);
|
|
111
107
|
return actionReceipt({
|
|
112
108
|
mark: "!",
|
|
113
109
|
verb: "spawn failed",
|
|
@@ -116,10 +112,6 @@ export function renderSpawnFailure(result, diagnostic, context, input = {}) {
|
|
|
116
112
|
evidence: [...spawnEvidence(result, context, input), `reason ${safeText(diagnostic)}`],
|
|
117
113
|
}).join("\n");
|
|
118
114
|
}
|
|
119
|
-
export function renderFailedCallObservation(result, context, input = {}) {
|
|
120
|
-
const failure = callObservationStream(context, callObservationHead(result, input), input);
|
|
121
|
-
return failure.conclude(result);
|
|
122
|
-
}
|
|
123
115
|
export function renderForkText(receipt, input) {
|
|
124
116
|
const parent = receipt.parentAkumaId ?? input.akuma;
|
|
125
117
|
if (receipt.kind !== "forked" && receipt.kind !== "failed") {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { contractAttentionFacts, progressStrip } from "./contract-observation.js";
|
|
2
2
|
import { ageText, emptyCatalogue, safeText } from "./terminal.js";
|
|
3
3
|
import { contractMark } from "./marks.js";
|
|
4
|
-
function formatAge(source, observedAt) {
|
|
5
|
-
return ageText(source, observedAt, "future");
|
|
6
|
-
}
|
|
7
4
|
/** One summary row names identity, age, title, and a terminal outcome or the current candidate strip. */
|
|
8
5
|
function contractCatalogueBlock(row, observedAt) {
|
|
9
|
-
const head = `${contractMark(row)} ${safeText(row.id)} · ${
|
|
6
|
+
const head = `${contractMark(row)} ${safeText(row.id)} · ${ageText(row.phaseAt, observedAt, "future")} · ${safeText(row.title ?? "title unavailable")}`;
|
|
10
7
|
return [head, ` ${progressStrip(row)}`, ...contractAttentionFacts(row).map((fact) => ` ${safeText(fact)}`)].join("\n");
|
|
11
8
|
}
|
|
12
9
|
export function renderContractCatalogue(list) {
|
|
@@ -34,6 +34,7 @@ function eventLine(event, dispatches = []) {
|
|
|
34
34
|
...(event.changedSections ?? []),
|
|
35
35
|
...(event.gates === undefined ? [] : ["gates"]),
|
|
36
36
|
...(event.after === undefined ? [] : ["after"]),
|
|
37
|
+
...(event.target === undefined ? [] : [`target ${targetName(event.target)}`]),
|
|
37
38
|
];
|
|
38
39
|
return `amended${changed.length === 0 ? "" : ` · ${changed.join(" · ")}`}`;
|
|
39
40
|
}
|
|
@@ -67,6 +68,7 @@ function semanticBody(event) {
|
|
|
67
68
|
case "amend":
|
|
68
69
|
return [
|
|
69
70
|
...listFact("changed sections", event.changedSections),
|
|
71
|
+
...(event.target === undefined ? [] : [` target ${targetName(event.target)}`]),
|
|
70
72
|
...listFact("gates", event.gates),
|
|
71
73
|
...listFact("after", event.after),
|
|
72
74
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContractAfterEdge, ContractDetail, ContractGateReport, ContractSummary } from "../../index.js";
|
|
1
|
+
import type { ContractAfterEdge, ContractDetail, ContractGateReport, ContractSummary, GateStaleReason } from "../../index.js";
|
|
2
2
|
import type { ContractDetailWorkspace } from "../../protocol/read/status.js";
|
|
3
3
|
export declare function shortGitId(value: string): string;
|
|
4
4
|
export declare function contractOperationName(operation: string): string;
|
|
@@ -21,6 +21,7 @@ export declare function requirementDisplayName(gate: string, requirement: Readon
|
|
|
21
21
|
requirement?: string | undefined;
|
|
22
22
|
index?: number | undefined;
|
|
23
23
|
}>): string;
|
|
24
|
+
export declare function staleReasonFact(reason: GateStaleReason): string;
|
|
24
25
|
/** Currentness is supplied by the owner for every requirement; rendering never aggregates testimony. */
|
|
25
26
|
export declare function gateRequirementFacts(report: ContractGateReport): readonly string[];
|
|
26
27
|
/** Every unresolved prerequisite edge names the condition that still blocks the candidate. */
|
|
@@ -72,9 +72,33 @@ export function requirementDisplayName(gate, requirement) {
|
|
|
72
72
|
? name
|
|
73
73
|
: `${name} ${requirement.requirement}`;
|
|
74
74
|
}
|
|
75
|
+
export function staleReasonFact(reason) {
|
|
76
|
+
switch (reason.kind) {
|
|
77
|
+
case "snapshot-changed": {
|
|
78
|
+
const ids = abbreviateGitIds([reason.previousSnapshot, reason.currentSnapshot]);
|
|
79
|
+
return `snapshot changed ${displayGitId(reason.previousSnapshot, ids)} -> ${displayGitId(reason.currentSnapshot, ids)}`;
|
|
80
|
+
}
|
|
81
|
+
case "candidate-content-changed": {
|
|
82
|
+
const ids = abbreviateGitIds([reason.previousChange, reason.currentChange]);
|
|
83
|
+
return `candidate content changed ${displayGitId(reason.previousChange, ids)} -> ${displayGitId(reason.currentChange, ids)}${reason.target === undefined ? "" : ` · ${reason.target}`}`;
|
|
84
|
+
}
|
|
85
|
+
default: {
|
|
86
|
+
const exhaustive = reason;
|
|
87
|
+
return exhaustive;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
75
91
|
/** Currentness is supplied by the owner for every requirement; rendering never aggregates testimony. */
|
|
76
92
|
export function gateRequirementFacts(report) {
|
|
77
|
-
return report.requirements.map((requirement) =>
|
|
93
|
+
return report.requirements.map((requirement) => {
|
|
94
|
+
const current = requirement.current;
|
|
95
|
+
const detail = current.kind === "stale"
|
|
96
|
+
? ` · stale${current.reason === undefined ? "" : ` · ${staleReasonFact(current.reason)}`}`
|
|
97
|
+
: current.kind === "missing"
|
|
98
|
+
? " · missing"
|
|
99
|
+
: "";
|
|
100
|
+
return `${gateGlyph(requirement)} ${requirementDisplayName(report.gate, requirement)}${detail}`;
|
|
101
|
+
});
|
|
78
102
|
}
|
|
79
103
|
/** Every unresolved prerequisite edge names the condition that still blocks the candidate. */
|
|
80
104
|
export function afterWording(edge) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function
|
|
1
|
+
import type { ContractWaitMember } from "../../library/contract-wait.js";
|
|
2
|
+
export declare function contractWaitMemberText(member: ContractWaitMember): string;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
export function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return `${member.id}${facts.length === 0 ? "" : ` (${facts.join(", ")})`}`;
|
|
16
|
-
})
|
|
17
|
-
.join(", ")}`;
|
|
1
|
+
export function contractWaitMemberText(member) {
|
|
2
|
+
const facts = [];
|
|
3
|
+
if (member.presence === "unknown")
|
|
4
|
+
facts.push("unobserved");
|
|
5
|
+
else if (member.presence === "missing")
|
|
6
|
+
facts.push("missing");
|
|
7
|
+
else {
|
|
8
|
+
if (member.changed === true)
|
|
9
|
+
facts.push("changed");
|
|
10
|
+
if (member.terminal !== undefined)
|
|
11
|
+
facts.push(member.terminal === "claimed" ? "accepted" : "abandoned");
|
|
12
|
+
}
|
|
13
|
+
return `${member.id}${facts.length === 0 ? "" : ` (${facts.join(", ")})`}`;
|
|
18
14
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { deliveryIdentityRows, gatesAwaitLines, targetMovementRows, receiptPayload, receiptRow, recoverySnapshotLines, stopLines, titleLines, verificationCheckLines, outcomeLines, } from "./receipt.js";
|
|
2
2
|
import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
|
|
3
|
-
import { DEFAULT_CLI_COLUMNS, quotedText, renderOpaqueBlock, safeText, tone, } from "./terminal.js";
|
|
4
|
-
function words(kind) {
|
|
5
|
-
return kind.replaceAll("-", " ");
|
|
6
|
-
}
|
|
3
|
+
import { DEFAULT_CLI_COLUMNS, kindWords, quotedText, renderOpaqueBlock, safeText, tone, } from "./terminal.js";
|
|
7
4
|
function checkoutBehindRows(path, target, columns) {
|
|
8
5
|
const lines = [];
|
|
9
6
|
receiptRow(lines, "!", "lag", [{ text: "checkout behind" }, { text: path, opaque: true }, { text: `· ${target}`, opaque: true }], columns);
|
|
@@ -28,7 +25,7 @@ function retainedIssueRows(issue, columns) {
|
|
|
28
25
|
receiptPayload(lines, "reason", issue.diagnostic);
|
|
29
26
|
return lines;
|
|
30
27
|
case "worktree-follow-retained":
|
|
31
|
-
receiptRow(lines, " ", "worktree follow kept at", [{ text: issue.path, opaque: true }, { text: `· ${
|
|
28
|
+
receiptRow(lines, " ", "worktree follow kept at", [{ text: issue.path, opaque: true }, { text: `· ${kindWords(issue.reason)}` }], columns);
|
|
32
29
|
return lines;
|
|
33
30
|
case "unsealed-bytes":
|
|
34
31
|
receiptRow(lines, " ", "unsealed bytes kept at", [{ text: issue.path, opaque: true }], columns);
|
|
@@ -38,7 +35,7 @@ function retainedIssueRows(issue, columns) {
|
|
|
38
35
|
receiptPayload(lines, "reason", issue.diagnostic);
|
|
39
36
|
return lines;
|
|
40
37
|
case "target-workspace-retained":
|
|
41
|
-
receiptRow(lines, "!", "target workspace unavailable", [{ text: issue.targetContractId, opaque: true }, { text:
|
|
38
|
+
receiptRow(lines, "!", "target workspace unavailable", [{ text: issue.targetContractId, opaque: true }, { text: kindWords(issue.reason) }], columns);
|
|
42
39
|
return lines;
|
|
43
40
|
case "worktree-hook-failed":
|
|
44
41
|
receiptRow(lines, "!", "lag", [{ text: `worktree-hook-failed ${issue.phase} ${issue.path} name ${issue.name}`, opaque: true }], columns);
|
|
@@ -187,7 +184,10 @@ function bind(result, columns, color) {
|
|
|
187
184
|
}
|
|
188
185
|
function amend(result, columns, color) {
|
|
189
186
|
const lines = titleLines("✓", "amended", result.contractId, columns);
|
|
190
|
-
if (result.changedSections === undefined &&
|
|
187
|
+
if (result.changedSections === undefined &&
|
|
188
|
+
result.gatesChanged === undefined &&
|
|
189
|
+
result.afterChanged === undefined &&
|
|
190
|
+
result.target === undefined)
|
|
191
191
|
receiptRow(lines, " ", "terms", [{ text: "unchanged" }], columns);
|
|
192
192
|
if (result.changedSections !== undefined)
|
|
193
193
|
receiptRow(lines, " ", "changed sections", [{ text: result.changedSections.join(" · ") }], columns);
|
|
@@ -195,6 +195,8 @@ function amend(result, columns, color) {
|
|
|
195
195
|
receiptRow(lines, " ", "gates", [{ text: "changed" }], columns);
|
|
196
196
|
if (result.afterChanged === true)
|
|
197
197
|
receiptRow(lines, " ", "after", [{ text: "changed" }], columns);
|
|
198
|
+
if (result.target !== undefined)
|
|
199
|
+
receiptRow(lines, " ", "target", [{ text: result.target }], columns);
|
|
198
200
|
lines.push(...deviations(result, columns, color), ...contractIssueLines(result, columns, { mode: "receipt" }), ...recoverySnapshotLines(result.recoverySnapshots, columns, result.contractId));
|
|
199
201
|
return lines.join("\n");
|
|
200
202
|
}
|
|
@@ -274,7 +276,8 @@ function review(result, columns, input, surface) {
|
|
|
274
276
|
}
|
|
275
277
|
function verify(result, columns, surface) {
|
|
276
278
|
const lines = titleLines("✓", "verify", result.contractId, columns);
|
|
277
|
-
lines
|
|
279
|
+
receiptRow(lines, " ", "snapshot", [{ text: displayGitId(result.snapshot, abbreviateGitIds([result.snapshot])) }], columns);
|
|
280
|
+
lines.push(...verificationCheckLines(result.checks, columns, result.contractId, surface), ...trailingPlacementLines(result, columns, surface));
|
|
278
281
|
return lines.join("\n");
|
|
279
282
|
}
|
|
280
283
|
/** The operation and supplied input stay renderer context, never fields manufactured on the native result. */
|
|
@@ -312,7 +315,7 @@ export function renderAccepted(operation, result, context, input = {}) {
|
|
|
312
315
|
export function renderRetry(operation, result, context) {
|
|
313
316
|
const columns = context?.columns ?? DEFAULT_CLI_COLUMNS;
|
|
314
317
|
const lines = outcomeLines("?", operation, "retry", "contractId" in result ? result.contractId : undefined, columns);
|
|
315
|
-
lines.push(...renderOpaqueBlock(
|
|
318
|
+
lines.push(...renderOpaqueBlock(kindWords(result.reason), " ", columns));
|
|
316
319
|
if (result.reason === "publication-failed")
|
|
317
320
|
receiptPayload(lines, "reason", result.diagnostic);
|
|
318
321
|
return lines.join("\n");
|
|
@@ -44,9 +44,8 @@ export function renderDebtList(result, context = DEFAULT_CONTEXT) {
|
|
|
44
44
|
if ("absent" in page)
|
|
45
45
|
return "debt world absent";
|
|
46
46
|
const rows = page.rows ?? [];
|
|
47
|
-
const view = "debts";
|
|
48
47
|
if (rows.length === 0)
|
|
49
|
-
return emptyCatalogue(
|
|
48
|
+
return emptyCatalogue("debts");
|
|
50
49
|
return [
|
|
51
50
|
"DEBTS // world",
|
|
52
51
|
...rows.flatMap((row) => entityLines({ ...row, mark: debtMark(row.disposition), word: row.disposition }, columns)),
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { shortGitId } from "./contract-observation.js";
|
|
2
1
|
import { StatusLine } from "./status-line.js";
|
|
3
2
|
import { renderOpaqueBlock, safeText } from "./terminal.js";
|
|
4
3
|
const LIVE_OUTPUT_BYTES = 4 * 1024;
|
|
@@ -19,10 +18,9 @@ function elapsed(ms) {
|
|
|
19
18
|
return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m${seconds % 60}s`;
|
|
20
19
|
}
|
|
21
20
|
function phaseDetail(observation) {
|
|
22
|
-
|
|
21
|
+
return observation.phase === "declaration"
|
|
23
22
|
? `declaration ${observation.index}/${observation.total}`
|
|
24
23
|
: `${observation.phase} · check ${observation.index}/${observation.total}${observation.name === undefined ? "" : ` · ${safeText(observation.name)}`}`;
|
|
25
|
-
return `${detail} · snapshot ${shortGitId(observation.snapshot)} · ${safeText(observation.requirement)}`;
|
|
26
24
|
}
|
|
27
25
|
function phaseMark(outcome) {
|
|
28
26
|
if (outcome === undefined)
|
|
@@ -103,8 +103,7 @@ function renderAkumaBoard(section, observedAt, context, emptyRows = [emptyCatalo
|
|
|
103
103
|
if (section.kind === "absent")
|
|
104
104
|
return ["AKUMA // absent"];
|
|
105
105
|
if (section.kind === "failed") {
|
|
106
|
-
|
|
107
|
-
return failure;
|
|
106
|
+
return ["AKUMA // unavailable", "", tone(`! ${safeText(section.diagnostic)}`, "alert", context.color)];
|
|
108
107
|
}
|
|
109
108
|
const board = section;
|
|
110
109
|
const rows = board.rows ?? [];
|
|
@@ -62,8 +62,7 @@ function renderContractBoard(section, observedAt, context) {
|
|
|
62
62
|
if (section.kind === "absent")
|
|
63
63
|
return ["CONTRACTS // absent"];
|
|
64
64
|
if (section.kind === "failed") {
|
|
65
|
-
|
|
66
|
-
return failure;
|
|
65
|
+
return ["CONTRACTS // unavailable", "", tone(`! ${safeText(section.diagnostic)}`, "alert", context.color)];
|
|
67
66
|
}
|
|
68
67
|
if ((section.rows ?? []).length === 0)
|
|
69
68
|
return [];
|
|
@@ -79,7 +78,7 @@ function detailHasError(row) {
|
|
|
79
78
|
row.workspace.kind === "unavailable" ||
|
|
80
79
|
row.issue !== undefined);
|
|
81
80
|
}
|
|
82
|
-
function semanticBlock(
|
|
81
|
+
function semanticBlock(facts) {
|
|
83
82
|
if (facts.length === 0)
|
|
84
83
|
return [];
|
|
85
84
|
return facts.map((fact) => ` ${safeText(fact)}`);
|
|
@@ -192,29 +191,29 @@ function renderSelectedContractRow(id, row, context) {
|
|
|
192
191
|
const outcome = terminalFacts(row, context, abbreviations);
|
|
193
192
|
lines.push(...outcome.map((fact) => (fact.startsWith(" ") ? fact : ` ${safeText(fact)}`)));
|
|
194
193
|
// A terminal Contract still carries a physical retention issue; its worktree is expected to be gone.
|
|
195
|
-
lines.push(...semanticBlock(
|
|
194
|
+
lines.push(...semanticBlock(row.issue === undefined ? [] : [`! ${issueAlarm(row.issue, row.target)}`]));
|
|
196
195
|
lines.push(...linkedAkumaRows(row));
|
|
197
196
|
return lines;
|
|
198
197
|
}
|
|
199
198
|
const deniedReview = (row.gates ?? [])
|
|
200
199
|
.find((gate) => gate.gate === "reviewed")
|
|
201
200
|
?.requirements.find((requirement) => requirement.current.kind === "attested" && requirement.current.verdict === "unsatisfied");
|
|
202
|
-
lines.push(...semanticBlock(
|
|
203
|
-
lines.push(...semanticBlock(
|
|
204
|
-
lines.push(...semanticBlock(
|
|
201
|
+
lines.push(...semanticBlock([detailProgressStrip(row)]));
|
|
202
|
+
lines.push(...semanticBlock((row.gates ?? []).flatMap(gateRequirementFacts)));
|
|
203
|
+
lines.push(...semanticBlock((row.after ?? []).map(afterWording)));
|
|
205
204
|
if (row.delivery !== undefined) {
|
|
206
205
|
const moved = targetMoved(row);
|
|
207
|
-
lines.push(...semanticBlock(
|
|
206
|
+
lines.push(...semanticBlock([
|
|
208
207
|
`candidate ${displayGitId(row.delivery.candidate, abbreviations)}`,
|
|
209
208
|
`integration result ${displayGitId(row.delivery.integration, abbreviations)}${moved ? " · target moved since" : ""}`,
|
|
210
209
|
...(moved ? targetMovementFacts(row, abbreviations) : []),
|
|
211
|
-
]
|
|
210
|
+
]));
|
|
212
211
|
}
|
|
213
212
|
if (deniedReview?.current.kind === "attested" && deniedReview.current.summary !== undefined)
|
|
214
213
|
lines.push(...payload("review ×", deniedReview.current.summary, context));
|
|
215
214
|
lines.push(...linkedAkumaRows(row));
|
|
216
|
-
lines.push(...semanticBlock(
|
|
217
|
-
lines.push(...semanticBlock(
|
|
215
|
+
lines.push(...semanticBlock(worktreeFacts(row)));
|
|
216
|
+
lines.push(...semanticBlock(liveAlarms(row)));
|
|
218
217
|
return lines;
|
|
219
218
|
}
|
|
220
219
|
function debtFailureFact(failure) {
|
|
@@ -241,12 +240,7 @@ function renderDebts(report, context) {
|
|
|
241
240
|
if (section.kind === "absent")
|
|
242
241
|
return ["DEBTS // absent"];
|
|
243
242
|
if (section.kind === "failed") {
|
|
244
|
-
|
|
245
|
-
"DEBTS // unavailable",
|
|
246
|
-
"",
|
|
247
|
-
tone(`! ${safeText(debtFailureFact(section))}`, "alert", context.color),
|
|
248
|
-
];
|
|
249
|
-
return failure;
|
|
243
|
+
return ["DEBTS // unavailable", "", tone(`! ${safeText(debtFailureFact(section))}`, "alert", context.color)];
|
|
250
244
|
}
|
|
251
245
|
return (section.rows ?? []).length === 0 ? [] : debtBoardRows(section, context);
|
|
252
246
|
}
|
|
@@ -39,7 +39,7 @@ export declare function targetMovementRows(lines: string[], placement: Readonly<
|
|
|
39
39
|
}>, columns: number): void;
|
|
40
40
|
export declare function gatesAwaitLines(placement: PlacementStop | undefined): readonly string[];
|
|
41
41
|
/** The performed work and its admission conclusion, with no aggregate gate testimony. */
|
|
42
|
-
export declare function verificationCheckLines(checks: readonly VerificationCheck[],
|
|
42
|
+
export declare function verificationCheckLines(checks: readonly VerificationCheck[], columns: number, addressed: string, surface?: TextRenderContext["surface"]): readonly string[];
|
|
43
43
|
type RecoverySnapshot = string | Readonly<{
|
|
44
44
|
snapshot: string;
|
|
45
45
|
contractId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { contractOperationName, requirementDisplayName } from "./contract-observation.js";
|
|
1
|
+
import { contractOperationName, requirementDisplayName, staleReasonFact } from "./contract-observation.js";
|
|
2
2
|
import { renderRefusalFacts } from "./refusal.js";
|
|
3
|
-
import { DEFAULT_CLI_COLUMNS, displayColumns, orderRefusalFacts, quotedText, renderOpaqueBlock, safeText, } from "./terminal.js";
|
|
3
|
+
import { DEFAULT_CLI_COLUMNS, displayColumns, kindWords, orderRefusalFacts, quotedText, renderOpaqueBlock, safeText, } from "./terminal.js";
|
|
4
4
|
import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
|
|
5
5
|
export function receiptRow(lines, mark, label, segments, columns) {
|
|
6
6
|
const prefix = mark.trim().length === 0 ? " " : `${mark} `;
|
|
@@ -44,9 +44,6 @@ export function titleLines(mark, title, contract, columns = DEFAULT_CLI_COLUMNS)
|
|
|
44
44
|
const inline = `${base} ${contract}`;
|
|
45
45
|
return displayColumns(inline) <= columns ? [inline] : [base, ` contract ${safeText(contract)}`];
|
|
46
46
|
}
|
|
47
|
-
function words(kind) {
|
|
48
|
-
return kind.replaceAll("-", " ");
|
|
49
|
-
}
|
|
50
47
|
function unmetRequirementLines(unmet, columns) {
|
|
51
48
|
const lines = [];
|
|
52
49
|
const ids = abbreviateGitIds(unmet.flatMap((problem) => problem.state === "stale" ? [problem.previousContentId ?? "", problem.currentContentId ?? ""] : []));
|
|
@@ -55,6 +52,7 @@ function unmetRequirementLines(unmet, columns) {
|
|
|
55
52
|
const detail = problem.state === "stale"
|
|
56
53
|
? [
|
|
57
54
|
{ text: "stale" },
|
|
55
|
+
...(problem.reason === undefined ? [] : [{ text: staleReasonFact(problem.reason) }]),
|
|
58
56
|
...(problem.previousContentId === undefined || problem.currentContentId === undefined
|
|
59
57
|
? []
|
|
60
58
|
: [
|
|
@@ -75,7 +73,7 @@ export { unmetRequirementLines };
|
|
|
75
73
|
function retryRows(reason, columns, dependent) {
|
|
76
74
|
const lines = [];
|
|
77
75
|
receiptRow(lines, "?", "retry", [
|
|
78
|
-
{ text:
|
|
76
|
+
{ text: kindWords(reason.reason) },
|
|
79
77
|
...(dependent === undefined ? [] : [{ text: "·" }, { text: dependent, opaque: true }]),
|
|
80
78
|
], columns);
|
|
81
79
|
if (reason.reason === "publication-failed")
|
|
@@ -99,7 +97,7 @@ function runtimeStopLines(stop, columns, dependent) {
|
|
|
99
97
|
const segments = dependent === undefined ? [] : [{ text: "·" }, { text: dependent, opaque: true }];
|
|
100
98
|
if (stop.kind === "environment-hook-failure")
|
|
101
99
|
segments.push({ text: `name ${quotedText(stop.name)}` });
|
|
102
|
-
receiptRow(lines, "!", dependent ??
|
|
100
|
+
receiptRow(lines, "!", dependent ?? kindWords(stop.kind), segments, columns);
|
|
103
101
|
const diagnostic = "diagnostic" in stop ? stop.diagnostic : undefined;
|
|
104
102
|
if (diagnostic !== undefined && diagnostic.length > 0)
|
|
105
103
|
receiptPayload(lines, "reason", diagnostic);
|
|
@@ -127,10 +125,10 @@ function requirementStopRows(stop, columns, dependent) {
|
|
|
127
125
|
function availabilityStopRows(stop, columns, dependent) {
|
|
128
126
|
const lines = [];
|
|
129
127
|
if (stop.kind !== "target-workspace-unavailable") {
|
|
130
|
-
dependentRow(lines, dependent,
|
|
128
|
+
dependentRow(lines, dependent, kindWords(stop.kind), columns);
|
|
131
129
|
return lines;
|
|
132
130
|
}
|
|
133
|
-
receiptRow(lines, "!", "target workspace unavailable", [{ text: stop.targetContractId, opaque: true }, { text:
|
|
131
|
+
receiptRow(lines, "!", "target workspace unavailable", [{ text: stop.targetContractId, opaque: true }, { text: kindWords(stop.reason) }], columns);
|
|
134
132
|
return lines;
|
|
135
133
|
}
|
|
136
134
|
function outcomeStopRows(stop, columns, addressed, dependent, surface) {
|
|
@@ -251,29 +249,27 @@ export function gatesAwaitLines(placement) {
|
|
|
251
249
|
return events.length === 0 ? [] : [`⧗ awaiting ${events.join(", ")}`];
|
|
252
250
|
}
|
|
253
251
|
/** The performed work and its admission conclusion, with no aggregate gate testimony. */
|
|
254
|
-
export function verificationCheckLines(checks,
|
|
255
|
-
const ids = abbreviateGitIds([snapshot]);
|
|
252
|
+
export function verificationCheckLines(checks, columns, addressed, surface) {
|
|
256
253
|
const lines = [];
|
|
257
254
|
for (const check of checks) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
{ text: check.requirement, opaque: true },
|
|
261
|
-
{ text: `· snapshot ${displayGitId(snapshot, ids)}` },
|
|
262
|
-
], columns);
|
|
263
|
-
if (check.kind !== "terminal") {
|
|
255
|
+
if (check.kind === "stopped") {
|
|
256
|
+
receiptRow(lines, "!", `check ${check.index}`, [{ text: "execution stopped" }], columns);
|
|
264
257
|
lines.push(...stopLines(check.stop, columns, addressed, undefined, surface));
|
|
265
258
|
}
|
|
266
259
|
else {
|
|
267
|
-
|
|
260
|
+
const admission = check.admission;
|
|
261
|
+
const recording = typeof admission !== "string"
|
|
262
|
+
? "admission stopped"
|
|
263
|
+
: admission === "unrecorded"
|
|
264
|
+
? "not recorded"
|
|
265
|
+
: admission === "admitted"
|
|
266
|
+
? "recorded"
|
|
267
|
+
: "reused";
|
|
268
|
+
receiptRow(lines, check.verdict === "satisfied" ? "✓" : "×", `check ${check.index}`, [{ text: `${check.verdict} · ${recording}` }], columns);
|
|
268
269
|
if (check.verdict === "unsatisfied")
|
|
269
270
|
receiptPayload(lines, "summary", check.summary);
|
|
270
|
-
|
|
271
|
-
if (typeof admission === "string")
|
|
272
|
-
receiptRow(lines, " ", "attestation", [{ text: admission === "unrecorded" ? "not recorded" : admission }], columns);
|
|
273
|
-
else {
|
|
274
|
-
receiptRow(lines, "!", "admission", [{ text: "stopped" }], columns);
|
|
271
|
+
if (typeof admission !== "string")
|
|
275
272
|
lines.push(...stopLines(admission, columns, addressed, undefined, surface));
|
|
276
|
-
}
|
|
277
273
|
}
|
|
278
274
|
if (check.retainedPath !== undefined)
|
|
279
275
|
receiptRow(lines, " ", "scratch retained", [{ text: check.retainedPath, opaque: true }], columns);
|
|
@@ -369,7 +365,7 @@ function effectLines(effect, columns, primary) {
|
|
|
369
365
|
return lines;
|
|
370
366
|
case "worktree-created":
|
|
371
367
|
case "worktree-removed":
|
|
372
|
-
receiptRow(lines, " ",
|
|
368
|
+
receiptRow(lines, " ", kindWords(effect.kind), [{ text: effect.path, opaque: true }], columns);
|
|
373
369
|
return lines;
|
|
374
370
|
}
|
|
375
371
|
}
|
|
@@ -385,8 +381,17 @@ function placementEvidenceLines(placement, columns, addressed, surface) {
|
|
|
385
381
|
/** Confirmed admissions and irreversible movement survive a trailing failure without a journal reread. */
|
|
386
382
|
export function executionEvidenceLines(receipt, columns, surface) {
|
|
387
383
|
const lines = [];
|
|
388
|
-
|
|
389
|
-
lines
|
|
384
|
+
if (receipt.snapshot !== undefined)
|
|
385
|
+
receiptRow(lines, " ", "snapshot", [{ text: displayGitId(receipt.snapshot, abbreviateGitIds([receipt.snapshot])) }], columns);
|
|
386
|
+
if (receipt.checks !== undefined)
|
|
387
|
+
lines.push(...verificationCheckLines(receipt.checks, columns, receipt.contractId ?? "", surface));
|
|
388
|
+
for (const admission of receipt.admitted ?? []) {
|
|
389
|
+
const shownByCheck = admission.kind === "attestation" &&
|
|
390
|
+
(admission.contractId === undefined || admission.contractId === receipt.contractId) &&
|
|
391
|
+
receipt.checks?.some((check) => check.kind === "terminal" && check.admission === "admitted" && check.requirement === admission.requirement);
|
|
392
|
+
if (!shownByCheck)
|
|
393
|
+
lines.push(...admittedLines(admission, columns, receipt.contractId));
|
|
394
|
+
}
|
|
390
395
|
if (receipt.placement !== undefined)
|
|
391
396
|
lines.push(...placementEvidenceLines(receipt.placement, columns, receipt.contractId ?? "", surface));
|
|
392
397
|
for (const effect of receipt.effects ?? [])
|
|
@@ -406,7 +411,7 @@ export function executionFailureLines(operation, receipt, failure, columns, surf
|
|
|
406
411
|
for (const [owner, count] of Object.entries(receipt.removed ?? {}))
|
|
407
412
|
receiptRow(lines, " ", `${owner} removed`, [{ text: String(count) }], columns);
|
|
408
413
|
for (const issue of receipt.issues ?? []) {
|
|
409
|
-
receiptRow(lines, "!",
|
|
414
|
+
receiptRow(lines, "!", kindWords(issue.kind), issue.kind === "reset-owner-stopped" ? [{ text: issue.owner }] : [], columns);
|
|
410
415
|
receiptPayload(lines, "reason", issue.diagnostic);
|
|
411
416
|
}
|
|
412
417
|
}
|
|
@@ -2,10 +2,7 @@ import { invocationIssueIsFailure } from "../../library/outcome.js";
|
|
|
2
2
|
import { contractIssueLines } from "./contract.js";
|
|
3
3
|
import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
|
|
4
4
|
import { receiptRow } from "./receipt.js";
|
|
5
|
-
import { DEFAULT_CLI_COLUMNS, safeText } from "./terminal.js";
|
|
6
|
-
function words(kind) {
|
|
7
|
-
return kind.replaceAll("-", " ");
|
|
8
|
-
}
|
|
5
|
+
import { DEFAULT_CLI_COLUMNS, kindWords, safeText } from "./terminal.js";
|
|
9
6
|
function effectSegments(effect) {
|
|
10
7
|
switch (effect.kind) {
|
|
11
8
|
case "ref": {
|
|
@@ -29,7 +26,7 @@ function effectSegments(effect) {
|
|
|
29
26
|
return [{ text: "debt settled" }, { text: effect.debtId, opaque: true }];
|
|
30
27
|
case "worktree-created":
|
|
31
28
|
case "worktree-removed":
|
|
32
|
-
return [{ text:
|
|
29
|
+
return [{ text: kindWords(effect.kind) }, { text: effect.path, opaque: true }];
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
function nativeDisposition(report) {
|