@intentius/chant 0.124.25 → 0.124.26
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/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +4 -2
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +4 -2
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +39 -4
- package/dist/gate-decision.d.ts +1 -1
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +1 -1
- package/dist/lifecycle/gate-audit.d.ts +7 -1
- package/dist/lifecycle/gate-audit.d.ts.map +1 -1
- package/dist/lifecycle/gate-audit.js +40 -3
- package/dist/lifecycle/gate-checkpoint.d.ts +78 -0
- package/dist/lifecycle/gate-checkpoint.d.ts.map +1 -0
- package/dist/lifecycle/gate-checkpoint.js +103 -0
- package/dist/lifecycle/gate-ledger.d.ts +41 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +18 -0
- package/dist/lifecycle/run-ledger.d.ts +2 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +2 -0
- package/dist/lint/rules/op/index.d.ts +6 -2
- package/dist/lint/rules/op/index.d.ts.map +1 -1
- package/dist/lint/rules/op/index.js +7 -3
- package/dist/lint/rules/op/ops016-gate-resume.d.ts +14 -0
- package/dist/lint/rules/op/ops016-gate-resume.d.ts.map +1 -0
- package/dist/lint/rules/op/ops016-gate-resume.js +31 -0
- package/dist/lint/rules/op/ops017-gate-alias.d.ts +30 -0
- package/dist/lint/rules/op/ops017-gate-alias.d.ts.map +1 -0
- package/dist/lint/rules/op/ops017-gate-alias.js +67 -0
- package/dist/op/activity-contract.d.ts +14 -0
- package/dist/op/activity-contract.d.ts.map +1 -1
- package/dist/op/activity-contract.js +16 -0
- package/dist/op/builders.d.ts +7 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +13 -0
- package/dist/op/gate-alias.d.ts +57 -0
- package/dist/op/gate-alias.d.ts.map +1 -0
- package/dist/op/gate-alias.js +127 -0
- package/dist/op/gate-checkpoint.d.ts +123 -0
- package/dist/op/gate-checkpoint.d.ts.map +1 -0
- package/dist/op/gate-checkpoint.js +280 -0
- package/dist/op/gate.d.ts +54 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +142 -1
- package/dist/op/index.d.ts +4 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +2 -1
- package/dist/op/local-executor.d.ts +57 -2
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +136 -6
- package/dist/op/local-output.d.ts.map +1 -1
- package/dist/op/local-output.js +20 -2
- package/dist/op/op-ir.d.ts +4 -0
- package/dist/op/op-ir.d.ts.map +1 -1
- package/dist/op/op-ir.js +4 -0
- package/dist/op/runtime.d.ts +15 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/runtimes/local.js +5 -0
- package/dist/op/types.d.ts +31 -0
- package/dist/op/types.d.ts.map +1 -1
- package/dist/wave-runtime.mjs +214 -212
- package/dist/workspace/trust/gate-seal.d.ts +32 -1
- package/dist/workspace/trust/gate-seal.d.ts.map +1 -1
- package/dist/workspace/trust/gate-seal.js +41 -2
- package/dist/workspace/trust/seal.d.ts +1 -1
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/seal.js +1 -1
- package/package.json +1 -1
- package/src/cli/commands/build.ts +9 -2
- package/src/cli/commands/lint.ts +4 -2
- package/src/cli/handlers/approve.ts +46 -4
- package/src/cli/handlers/operator.test.ts +91 -0
- package/src/gate-decision.ts +2 -0
- package/src/lifecycle/gate-audit.ts +41 -4
- package/src/lifecycle/gate-checkpoint.test.ts +128 -0
- package/src/lifecycle/gate-checkpoint.ts +133 -0
- package/src/lifecycle/gate-ledger.ts +61 -0
- package/src/lifecycle/run-ledger.ts +4 -0
- package/src/lint/rules/op/index.ts +9 -3
- package/src/lint/rules/op/ops016-gate-resume.test.ts +53 -0
- package/src/lint/rules/op/ops016-gate-resume.ts +48 -0
- package/src/lint/rules/op/ops017-gate-alias.test.ts +85 -0
- package/src/lint/rules/op/ops017-gate-alias.ts +89 -0
- package/src/op/activity-contract.ts +22 -1
- package/src/op/builders.ts +21 -1
- package/src/op/gate-alias.e2e.test.ts +78 -0
- package/src/op/gate-alias.test.ts +350 -0
- package/src/op/gate-alias.ts +137 -0
- package/src/op/gate-checkpoint.test.ts +284 -0
- package/src/op/gate-checkpoint.ts +322 -0
- package/src/op/gate.ts +198 -4
- package/src/op/index.ts +4 -1
- package/src/op/local-executor.ts +180 -7
- package/src/op/local-output.ts +18 -2
- package/src/op/op-ir.test.ts +25 -0
- package/src/op/op-ir.ts +8 -0
- package/src/op/runtime.ts +8 -0
- package/src/op/runtimes/local.ts +5 -0
- package/src/op/types.ts +32 -0
- package/src/workspace/trust/gate-seal.test.ts +29 -2
- package/src/workspace/trust/gate-seal.ts +46 -2
- package/src/workspace/trust/seal.ts +1 -1
|
@@ -37,9 +37,42 @@ export interface SealedGateApproval {
|
|
|
37
37
|
/** Who relayed the approval for `resolvedBy` (#3402), when someone did. */
|
|
38
38
|
relayedBy?: string;
|
|
39
39
|
timestamp: string;
|
|
40
|
+
/** The checkpoint the approval lets a run resume from (#3947), when it carries one. */
|
|
41
|
+
checkpointDigest?: string;
|
|
42
|
+
/** The line a carried approval came from (#3949): the names and time its seal was made under. */
|
|
43
|
+
carriedFrom?: { op: string; gate: string; timestamp: string; checkpointDigest?: string };
|
|
40
44
|
seal?: unknown;
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
/**
|
|
48
|
+
* The approval as it was sealed (#3949). A carried approval is recorded
|
|
49
|
+
* under a gate's new name and the time it was carried, and its seal was
|
|
50
|
+
* made over the line it came from, so its op, gate, time and checkpoint
|
|
51
|
+
* digest are read off `carriedFrom`. Any other approval is returned as it is.
|
|
52
|
+
*/
|
|
53
|
+
export function sealedFieldsOf(a: SealedGateApproval): SealedGateApproval {
|
|
54
|
+
const from = a.carriedFrom;
|
|
55
|
+
if (from === undefined) return a;
|
|
56
|
+
const { carriedFrom: _from, checkpointDigest: _checkpoint, ...rest } = a;
|
|
57
|
+
return {
|
|
58
|
+
...rest,
|
|
59
|
+
op: from.op,
|
|
60
|
+
gate: from.gate,
|
|
61
|
+
timestamp: from.timestamp,
|
|
62
|
+
...(from.checkpointDigest !== undefined ? { checkpointDigest: from.checkpointDigest } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The version of a seal over `a` (#3947): 2 when the approval carries a
|
|
68
|
+
* checkpoint digest, which the payload signs, and 1 otherwise. `chant approve
|
|
69
|
+
* --sign` records 2 on the seal; a seal records no version for 1.
|
|
70
|
+
*/
|
|
71
|
+
export function gateSealVersion(a: Pick<SealedGateApproval, "checkpointDigest" | "carriedFrom">): 1 | 2 {
|
|
72
|
+
const checkpoint = a.carriedFrom !== undefined ? a.carriedFrom.checkpointDigest : a.checkpointDigest;
|
|
73
|
+
return checkpoint !== undefined ? 2 : 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
43
76
|
/**
|
|
44
77
|
* The bytes a gate approval's seal signs (#3163): the op (or component), the
|
|
45
78
|
* gate, the environment, the plan digest, the approver and the time, joined
|
|
@@ -48,10 +81,21 @@ export interface SealedGateApproval {
|
|
|
48
81
|
* `relayed-by <principal>`, so the relay can't be added, changed or removed
|
|
49
82
|
* after sealing; an approval nobody relayed signs the six lines it always did,
|
|
50
83
|
* so seals made before #3402 still verify.
|
|
84
|
+
*
|
|
85
|
+
* Seal version 2 (#3947) adds the checkpoint a resumed run carries its step
|
|
86
|
+
* outputs from: an approval with a `checkpointDigest` signs one more line,
|
|
87
|
+
* `checkpoint <digest>`, last. The values the steps after the gate read are
|
|
88
|
+
* then covered by the seal too, and removing or swapping the digest stops it
|
|
89
|
+
* verifying. An approval with none signs what a version 1 seal signed.
|
|
90
|
+
*
|
|
91
|
+
* A carried approval (#3949) signs what the line it came from signed: see
|
|
92
|
+
* {@link sealedFieldsOf}.
|
|
51
93
|
*/
|
|
52
|
-
export function gateSealPayload(
|
|
94
|
+
export function gateSealPayload(approval: SealedGateApproval): Buffer {
|
|
95
|
+
const a = sealedFieldsOf(approval);
|
|
53
96
|
const relay = a.relayedBy !== undefined ? `\nrelayed-by ${a.relayedBy}` : "";
|
|
54
|
-
|
|
97
|
+
const checkpoint = gateSealVersion(a) === 2 ? `\ncheckpoint ${a.checkpointDigest}` : "";
|
|
98
|
+
return Buffer.from(`${a.op}\n${a.gate}\n${a.environment ?? ""}\n${a.planDigest ?? ""}\n${a.resolvedBy}\n${a.timestamp}${relay}${checkpoint}`, "utf-8");
|
|
55
99
|
}
|
|
56
100
|
|
|
57
101
|
// ── SSHSIG ───────────────────────────────────────────────────────────────
|
|
@@ -32,7 +32,7 @@ import type { Signer } from "./trust-files";
|
|
|
32
32
|
import { sshKeygen, verifySshSignature } from "./ssh-commit";
|
|
33
33
|
import { GATE_SEAL_NAMESPACE, gateSealPayload, namespaceAllowed, sshSignatureKey, verifySshSignatureWith, type SealedGateApproval } from "./gate-seal";
|
|
34
34
|
|
|
35
|
-
export { GATE_SEAL_NAMESPACE, gateSealPayload, type SealedGateApproval } from "./gate-seal";
|
|
35
|
+
export { GATE_SEAL_NAMESPACE, gateSealPayload, gateSealVersion, sealedFieldsOf, type SealedGateApproval } from "./gate-seal";
|
|
36
36
|
|
|
37
37
|
/** The ssh signature namespace of a verdict seal. */
|
|
38
38
|
export const REVIEW_SEAL_NAMESPACE = "chant-review";
|