@intentius/chant 0.124.24 → 0.124.25
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/main.d.ts.map +1 -1
- package/dist/cli/main.js +21 -7
- package/dist/cli/mcp/workspace-tools.d.ts +3 -3
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.js +27 -4
- package/dist/effect-receipt.d.ts +13 -0
- package/dist/effect-receipt.d.ts.map +1 -1
- package/dist/effect-receipt.js +19 -0
- package/dist/lexicon-module.d.ts +7 -1
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +7 -2
- package/dist/lifecycle/receipt-plan.d.ts.map +1 -1
- package/dist/lifecycle/receipt-plan.js +4 -2
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +64 -5
- package/dist/op/receipt-store.d.ts +5 -0
- package/dist/op/receipt-store.d.ts.map +1 -1
- package/dist/op/receipt-store.js +4 -3
- package/dist/op/step-output-ref.d.ts +26 -18
- package/dist/op/step-output-ref.d.ts.map +1 -1
- package/dist/op/step-output-ref.js +86 -63
- package/dist/wave-runtime.mjs +213 -213
- package/dist/workspace/agent-cli.d.ts.map +1 -1
- package/dist/workspace/agent-cli.js +3 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
- package/dist/workspace/conformance/writer.js +1 -1
- package/dist/workspace/decide.d.ts +51 -9
- package/dist/workspace/decide.d.ts.map +1 -1
- package/dist/workspace/decide.js +125 -14
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.js +20 -11
- package/dist/workspace/point-answer.schema.json +16 -1
- package/dist/workspace/points-cli.d.ts +5 -3
- package/dist/workspace/points-cli.d.ts.map +1 -1
- package/dist/workspace/points-cli.js +16 -7
- package/dist/workspace/points-write.schema.json +39 -4
- package/dist/workspace/points.schema.json +42 -3
- package/dist/workspace/reason-codes.d.ts +2 -1
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +2 -1
- package/dist/workspace/records-cli.d.ts +12 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +27 -7
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records-write.js +2 -3
- package/dist/workspace/records.d.ts +10 -4
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +16 -3
- package/dist/workspace/records.schema.json +2 -1
- package/dist/workspace/trust/verify-cli.d.ts.map +1 -1
- package/dist/workspace/trust/verify-cli.js +2 -1
- package/dist/workspace/trust/verify.d.ts +22 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -1
- package/dist/workspace/trust/verify.js +94 -14
- package/dist/workspace/write-scope.d.ts +3 -1
- package/dist/workspace/write-scope.d.ts.map +1 -1
- package/dist/workspace/write-scope.js +11 -4
- package/package.json +1 -1
- package/src/cli/compiled-cli.e2e.test.ts +45 -1
- package/src/cli/main.test.ts +10 -0
- package/src/cli/main.ts +21 -7
- package/src/cli/mcp/workspace-tools.e2e.test.ts +1 -1
- package/src/cli/mcp/workspace-tools.ts +27 -4
- package/src/effect-receipt.ts +22 -0
- package/src/lexicon-module.ts +9 -2
- package/src/lifecycle/receipt-plan.test.ts +9 -0
- package/src/lifecycle/receipt-plan.ts +4 -1
- package/src/op/effect-step.test.ts +95 -1
- package/src/op/local-executor.test.ts +65 -0
- package/src/op/local-executor.ts +68 -5
- package/src/op/receipt-store.ts +13 -3
- package/src/op/step-output-ref.test.ts +68 -24
- package/src/op/step-output-ref.ts +85 -65
- package/src/workspace/agent-cli.ts +2 -0
- package/src/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
- package/src/workspace/conformance/writer.ts +1 -1
- package/src/workspace/decide.test.ts +87 -3
- package/src/workspace/decide.ts +142 -17
- package/src/workspace/lineage-upgrade.test.ts +21 -0
- package/src/workspace/lineage-upgrade.ts +19 -11
- package/src/workspace/point-answer.schema.json +16 -1
- package/src/workspace/points-cli.ts +16 -8
- package/src/workspace/points-write.schema.json +39 -4
- package/src/workspace/points.schema.json +42 -3
- package/src/workspace/reason-codes.ts +2 -1
- package/src/workspace/record-assets.test.ts +14 -0
- package/src/workspace/records-cli.ts +28 -7
- package/src/workspace/records-write-commands.e2e.test.ts +32 -0
- package/src/workspace/records-write.ts +2 -3
- package/src/workspace/records.schema.json +2 -1
- package/src/workspace/records.ts +17 -4
- package/src/workspace/trust/trust.test.ts +105 -0
- package/src/workspace/trust/verify-cli.ts +2 -1
- package/src/workspace/trust/verify.ts +106 -13
- package/src/workspace/write-scope.test.ts +18 -0
- package/src/workspace/write-scope.ts +16 -5
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAKA,OAAO,EAAkB,KAAK,UAAU,EAAmB,MAAM,YAAY,CAAC;AAa9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAKA,OAAO,EAAkB,KAAK,UAAU,EAAmB,MAAM,YAAY,CAAC;AAa9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;AAwkCzC;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBzE;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,EA6KvC,CAAC"}
|
package/dist/cli/main.js
CHANGED
|
@@ -154,7 +154,12 @@ Commands:
|
|
|
154
154
|
okf emits an OKF v0.2 knowledge bundle — one markdown
|
|
155
155
|
concept per entity + index.md; -o <dir> writes the
|
|
156
156
|
bundle tree, otherwise JSON path→content on stdout)
|
|
157
|
-
|
|
157
|
+
search "<query>" Answer an estate question with a few matching rows
|
|
158
|
+
instead of a graph dump (kind:, tag:, attr:, ->/<- edge
|
|
159
|
+
terms; --live or --at <ref> with --env <name> reads the
|
|
160
|
+
estate or a recorded snapshot; --show <attr>,
|
|
161
|
+
--check-live, --check-snapshot, --fail-on-drift)
|
|
162
|
+
generate Generate typed code from sources chant.config declares
|
|
158
163
|
(k8s.crds, helm.charts) into src/generated/<lexicon>/
|
|
159
164
|
(codegen.outDir); --check exits 1 when the committed
|
|
160
165
|
output no longer matches its sources, as build does
|
|
@@ -389,9 +394,11 @@ Workspace (level 1, #2524):
|
|
|
389
394
|
state transitions, new verdicts, new supersessions
|
|
390
395
|
and changed pins. A session id compares the commits
|
|
391
396
|
the session opened and closed at
|
|
392
|
-
workspace records pin <path>
|
|
397
|
+
workspace records pin <path> [--kind <kind file>]
|
|
393
398
|
Print the path from the workspace root and the
|
|
394
|
-
sha256 of a file, for a decision's evidence pin
|
|
399
|
+
sha256 of a file, for a decision's evidence pin. The
|
|
400
|
+
root is the kind file's workspace with --kind, else
|
|
401
|
+
the workspace above the current directory
|
|
395
402
|
workspace records new [<kind file>] --from <file|-> [--prefix <prefix>] [--sign [<key file>]] [--dry-run]
|
|
396
403
|
Write one new record in the kind's directory from
|
|
397
404
|
the JSON fields given, after validating them as
|
|
@@ -546,6 +553,11 @@ Workspace (level 1, #2524):
|
|
|
546
553
|
workspace points retract <id> --by <name>... [--note <text>] [--kind <kind file>] [--dry-run]
|
|
547
554
|
Take an answer back: the question is open for people
|
|
548
555
|
again, and the answer stays in its retractions
|
|
556
|
+
workspace points withdraw <id> --by <name>... [--note <text>] [--kind <kind file>] [--dry-run]
|
|
557
|
+
Close an open question that no longer applies, such as
|
|
558
|
+
one about a work item its author changed: points --open
|
|
559
|
+
leaves it out, nobody answers it, and asking it again
|
|
560
|
+
opens it again (#2888)
|
|
549
561
|
workspace pin <path> [--json]
|
|
550
562
|
Print the integrity value that pins the plugin at
|
|
551
563
|
<path>, to put in a path pin of chant.workspace.json.
|
|
@@ -1204,16 +1216,18 @@ export const commandRegistry = [
|
|
|
1204
1216
|
{ name: "generate", requiresPlugins: true, handler: async (ctx) => (await import("./handlers/generate.js")).runGenerate(ctx) },
|
|
1205
1217
|
// Workspace reads (#2524). Imported on first use, so a level-0 command never
|
|
1206
1218
|
// loads anything under workspace/ (#2525 rule 5, pinned by #2526's goldens).
|
|
1207
|
-
|
|
1219
|
+
// #3276 — records, points, ls and status read the declaration and never the
|
|
1220
|
+
// config of the member they run in, so they skip its load (and tsx with it).
|
|
1221
|
+
{ name: "workspace records", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/records-cli.js")).runWorkspaceRecords(ctx) },
|
|
1208
1222
|
// ws-058 (#2739) — decision points and the questions asked of them; never calls a model.
|
|
1209
|
-
{ name: "workspace points", handler: async (ctx) => (await import("../workspace/points-cli.js")).runWorkspacePoints(ctx) },
|
|
1223
|
+
{ name: "workspace points", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/points-cli.js")).runWorkspacePoints(ctx) },
|
|
1210
1224
|
{ name: "workspace init", handler: async (ctx) => (await import("../workspace/init.js")).runWorkspaceInit(ctx) },
|
|
1211
|
-
{ name: "workspace ls", handler: async (ctx) => (await import("../workspace/ls.js")).runWorkspaceLs(ctx) },
|
|
1225
|
+
{ name: "workspace ls", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/ls.js")).runWorkspaceLs(ctx) },
|
|
1212
1226
|
// #2732 — the work lease: claim, renew and release a work item.
|
|
1213
1227
|
{ name: "workspace work", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/work-cli.js")).runWorkspaceWork(ctx) },
|
|
1214
1228
|
// #3033 — the agent run record: what each run cost and which commits it made. chant records runs and never starts one.
|
|
1215
1229
|
{ name: "workspace runs", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/runs-cli.js")).runWorkspaceRuns(ctx) },
|
|
1216
|
-
{ name: "workspace status", handler: async (ctx) => (await import("../workspace/status.js")).runWorkspaceStatus(ctx) },
|
|
1230
|
+
{ name: "workspace status", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/status.js")).runWorkspaceStatus(ctx) },
|
|
1217
1231
|
{ name: "workspace lineage", handler: async (ctx) => (await import("../workspace/lineage-cli.js")).runWorkspaceLineage(ctx) },
|
|
1218
1232
|
{ name: "workspace upgrade", handler: async (ctx) => (await import("../workspace/lineage-upgrade-cli.js")).runWorkspaceUpgrade(ctx) },
|
|
1219
1233
|
// #2551 — adopt a lineage, the hash index it matches against, and the versions of a family of workspaces.
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* read to the workspace root's pinned chant included (ws-021), and keeps
|
|
16
16
|
* anything a command prints away from the protocol on stdout.
|
|
17
17
|
* - The writes (`records-new`, `records-amend`, `records-review`,
|
|
18
|
-
* `records-close`, `points-answer`, `points-retract`)
|
|
19
|
-
* `chant workspace records new|amend|review|close` and
|
|
20
|
-
* answer|retract` call, and return the
|
|
18
|
+
* `records-close`, `points-answer`, `points-retract`, `points-withdraw`)
|
|
19
|
+
* call the functions `chant workspace records new|amend|review|close` and
|
|
20
|
+
* `points answer|retract|withdraw` call, and return the
|
|
21
21
|
* same JSON result. They keep every rule
|
|
22
22
|
* the CLI keeps: the kind's schema, a closed record never changing, an
|
|
23
23
|
* approved one changing only as its approval rule allows, a dissent needing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-tools.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/workspace-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,KAAK,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AC5B,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,aAAa,EAAE,CA+GpF"}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* read to the workspace root's pinned chant included (ws-021), and keeps
|
|
16
16
|
* anything a command prints away from the protocol on stdout.
|
|
17
17
|
* - The writes (`records-new`, `records-amend`, `records-review`,
|
|
18
|
-
* `records-close`, `points-answer`, `points-retract`)
|
|
19
|
-
* `chant workspace records new|amend|review|close` and
|
|
20
|
-
* answer|retract` call, and return the
|
|
18
|
+
* `records-close`, `points-answer`, `points-retract`, `points-withdraw`)
|
|
19
|
+
* call the functions `chant workspace records new|amend|review|close` and
|
|
20
|
+
* `points answer|retract|withdraw` call, and return the
|
|
21
21
|
* same JSON result. They keep every rule
|
|
22
22
|
* the CLI keeps: the kind's schema, a closed record never changing, an
|
|
23
23
|
* approved one changing only as its approval rule allows, a dissent needing
|
|
@@ -137,7 +137,7 @@ export const workspaceReadTools = [
|
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
name: "workspace-points",
|
|
140
|
-
description: "The workspace's decision points and the questions asked of them: chant workspace points --json (points.schema.json, ws-058). A question is open while it is escalated to people, or proposed by a model and not yet confirmed; each lists any model's answer with its confidence and threshold. Returns the document unchanged. chant calls no model to answer this.",
|
|
140
|
+
description: "The workspace's decision points and the questions asked of them: chant workspace points --json (points.schema.json, ws-058). A question is open while it is escalated to people, or proposed by a model and not yet confirmed, and not withdrawn; each lists any model's answer with its confidence and threshold. Returns the document unchanged. chant calls no model to answer this.",
|
|
141
141
|
inputSchema: {
|
|
142
142
|
type: "object",
|
|
143
143
|
properties: {
|
|
@@ -288,6 +288,22 @@ export const workspaceWriteTools = [
|
|
|
288
288
|
required: ["id", "by"],
|
|
289
289
|
},
|
|
290
290
|
},
|
|
291
|
+
{
|
|
292
|
+
name: "points-withdraw",
|
|
293
|
+
description: "Close an open decision point question that no longer applies, such as one about a work item its author changed, which a run asks about anew: chant workspace points withdraw (#2888). The question keeps its state, with who withdrew it, when and why; workspace-points open leaves it out, and points-answer refuses it. Asking it again opens it again. Withdrawing answers nothing, so it needs no quorum. An answered question is not withdrawn: points-retract takes the answer back. " +
|
|
294
|
+
PROTOCOL,
|
|
295
|
+
inputSchema: {
|
|
296
|
+
type: "object",
|
|
297
|
+
properties: {
|
|
298
|
+
id: { type: "string", description: "The question's id, as workspace-points lists it." },
|
|
299
|
+
by: { type: "array", items: { type: "string" }, description: "Who withdraws the question (--by)." },
|
|
300
|
+
note: { type: "string", description: "Why, such as the question that asks about the subject now (--note)." },
|
|
301
|
+
kind: { type: "string", description: "The answer kind file. Without it, the declared answer kinds." },
|
|
302
|
+
dryRun: dryRunProp,
|
|
303
|
+
},
|
|
304
|
+
required: ["id", "by"],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
291
307
|
];
|
|
292
308
|
/** A tool call that can't be made as given: the client gets it as an error result, and nothing runs. */
|
|
293
309
|
class ToolInputError extends Error {
|
|
@@ -548,6 +564,13 @@ export function createWorkspaceTools(options) {
|
|
|
548
564
|
throw new ToolInputError("by must list each person who takes the answer back");
|
|
549
565
|
return retractAnswer({ cwd, id: str(params, "id", true), by: by, note: str(params, "note"), kind: str(params, "kind"), dryRun: bool(params, "dryRun") });
|
|
550
566
|
},
|
|
567
|
+
"points-withdraw": async (params) => {
|
|
568
|
+
const { withdrawQuestion } = await import("../../workspace/decide.js");
|
|
569
|
+
const by = params.by;
|
|
570
|
+
if (!Array.isArray(by) || by.length === 0 || !by.every((b) => typeof b === "string" && b.trim() !== ""))
|
|
571
|
+
throw new ToolInputError("by must name who withdraws the question");
|
|
572
|
+
return withdrawQuestion({ cwd, id: str(params, "id", true), by: by, note: str(params, "note"), kind: str(params, "kind"), dryRun: bool(params, "dryRun") });
|
|
573
|
+
},
|
|
551
574
|
"records-close": async (params) => {
|
|
552
575
|
const w = await write();
|
|
553
576
|
const { closeRecord, RECORDS_CLOSE_SCHEMA_ID } = await import("../../workspace/records-close.js");
|
package/dist/effect-receipt.d.ts
CHANGED
|
@@ -58,6 +58,19 @@ export declare const EFFECT_RECEIPT_ENTITY_TYPE = "Chant::EffectReceipt";
|
|
|
58
58
|
* effect has run; anything else renders an effect-will-fire row (#1832).
|
|
59
59
|
*/
|
|
60
60
|
export declare const EXISTENCE_EXPECTATION = "chant.effect-receipt:exists";
|
|
61
|
+
/**
|
|
62
|
+
* A receipt expectation with the digest of the step outputs its effect read
|
|
63
|
+
* appended (#3948). The effect step writes this value, so the next run fires
|
|
64
|
+
* again when one of those outputs changed, though the declared inputs did not.
|
|
65
|
+
*/
|
|
66
|
+
export declare function withStepOutputs(expectation: string, outputs: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* The part of a stored receipt value that the declared inputs determine: the
|
|
69
|
+
* value without any step-output digest {@link withStepOutputs} appended. The
|
|
70
|
+
* plan and `receiptStaleness` compare this part, since step outputs exist only
|
|
71
|
+
* while the Op runs.
|
|
72
|
+
*/
|
|
73
|
+
export declare function declaredExpectation(value: string): string;
|
|
61
74
|
/**
|
|
62
75
|
* An effect receipt declaration — a Declarable, so discovery collects it,
|
|
63
76
|
* `chant list` shows it, and (unlike a secret declaration) serialization
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect-receipt.d.ts","sourceRoot":"","sources":["../src/effect-receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1D,2CAA2C;AAC3C,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,MAAM,CAAC;AAEvD,uDAAuD;AACvD,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAA0B,CAAC;AAE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I/E;AAmBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAW5E;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,oBAAoB,GAC7B,MAAM,CAIR"}
|
package/dist/effect-receipt.js
CHANGED
|
@@ -57,6 +57,25 @@ export const EFFECT_RECEIPT_ENTITY_TYPE = "Chant::EffectReceipt";
|
|
|
57
57
|
* effect has run; anything else renders an effect-will-fire row (#1832).
|
|
58
58
|
*/
|
|
59
59
|
export const EXISTENCE_EXPECTATION = "chant.effect-receipt:exists";
|
|
60
|
+
const OUTPUTS_SEPARATOR = "+outputs=";
|
|
61
|
+
/**
|
|
62
|
+
* A receipt expectation with the digest of the step outputs its effect read
|
|
63
|
+
* appended (#3948). The effect step writes this value, so the next run fires
|
|
64
|
+
* again when one of those outputs changed, though the declared inputs did not.
|
|
65
|
+
*/
|
|
66
|
+
export function withStepOutputs(expectation, outputs) {
|
|
67
|
+
return `${expectation}${OUTPUTS_SEPARATOR}${outputs}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The part of a stored receipt value that the declared inputs determine: the
|
|
71
|
+
* value without any step-output digest {@link withStepOutputs} appended. The
|
|
72
|
+
* plan and `receiptStaleness` compare this part, since step outputs exist only
|
|
73
|
+
* while the Op runs.
|
|
74
|
+
*/
|
|
75
|
+
export function declaredExpectation(value) {
|
|
76
|
+
const at = value.indexOf(OUTPUTS_SEPARATOR);
|
|
77
|
+
return at < 0 ? value : value.slice(0, at);
|
|
78
|
+
}
|
|
60
79
|
/**
|
|
61
80
|
* Declare an effect receipt. The returned object is a locked Declarable:
|
|
62
81
|
* declared fields are immutable, plain-data input structures are frozen
|
package/dist/lexicon-module.d.ts
CHANGED
|
@@ -93,8 +93,14 @@ export declare function resetLexiconModules(): void;
|
|
|
93
93
|
* Import the module a path-declared lexicon names. Returns `undefined` when
|
|
94
94
|
* `name` is package-backed, so a caller falls through to its package import.
|
|
95
95
|
* An import failure is thrown with the declared path in the message.
|
|
96
|
+
*
|
|
97
|
+
* `typeScript: false` imports it with plain node, without registering tsx
|
|
98
|
+
* (#3276): tsx's ESM hooks run on a thread of their own, which costs the
|
|
99
|
+
* compiled CLI about 200 MB, so a caller whose module is JavaScript says so.
|
|
96
100
|
*/
|
|
97
|
-
export declare function importLexiconModule(name: string
|
|
101
|
+
export declare function importLexiconModule(name: string, options?: {
|
|
102
|
+
typeScript?: boolean;
|
|
103
|
+
}): Promise<Record<string, unknown> | undefined>;
|
|
98
104
|
/**
|
|
99
105
|
* chant#2578 — how a message should name a lexicon. A package-backed name is
|
|
100
106
|
* its npm package; a lexicon declared by path is that path, relative to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon-module.d.ts","sourceRoot":"","sources":["../src/lexicon-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,mEAAmE;AACnE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAExE;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/E,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;AAiBvG;;;;;;;;;;;;;;GAcG;AACH,w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B,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAY9C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAsB,EAC/B,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAe,GAC/C,MAAM,CAKR;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAe,GAC/C,MAAM,EAAE,CAEV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9D;AAUD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,GAAG,SAAS,CAMpG;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAW1H"}
|
package/dist/lexicon-module.js
CHANGED
|
@@ -150,13 +150,18 @@ export function resetLexiconModules() {
|
|
|
150
150
|
* Import the module a path-declared lexicon names. Returns `undefined` when
|
|
151
151
|
* `name` is package-backed, so a caller falls through to its package import.
|
|
152
152
|
* An import failure is thrown with the declared path in the message.
|
|
153
|
+
*
|
|
154
|
+
* `typeScript: false` imports it with plain node, without registering tsx
|
|
155
|
+
* (#3276): tsx's ESM hooks run on a thread of their own, which costs the
|
|
156
|
+
* compiled CLI about 200 MB, so a caller whose module is JavaScript says so.
|
|
153
157
|
*/
|
|
154
|
-
export async function importLexiconModule(name) {
|
|
158
|
+
export async function importLexiconModule(name, options = {}) {
|
|
155
159
|
const path = modulePaths.get(name);
|
|
156
160
|
if (path === undefined)
|
|
157
161
|
return undefined;
|
|
158
162
|
try {
|
|
159
|
-
|
|
163
|
+
if (options.typeScript !== false)
|
|
164
|
+
ensureTypeScriptLoader();
|
|
160
165
|
return esModuleNamespace((await import(path)));
|
|
161
166
|
}
|
|
162
167
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt-plan.d.ts","sourceRoot":"","sources":["../../src/lifecycle/receipt-plan.ts"],"names":[],"mappings":"AAkCA,OAAO,
|
|
1
|
+
{"version":3,"file":"receipt-plan.d.ts","sourceRoot":"","sources":["../../src/lifecycle/receipt-plan.ts"],"names":[],"mappings":"AAkCA,OAAO,EAIL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAE/C,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,OAAO,CAIzF;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;IACjB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,GACpD,oBAAoB,CAiBtB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,wBAAwB,CAAC,EACvD,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,EAC7C,QAAQ,EAAE,oBAAoB,GAC7B,cAAc,EAAE,CAsGlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,SAAS,EACb,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,wBAAwB,CAAC,EACvD,cAAc,EAAE,cAAc,EAAE,GAC/B,SAAS,CAMX"}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* plan's merged observed values).
|
|
33
33
|
*/
|
|
34
34
|
import { AttrRef } from "../attrref.js";
|
|
35
|
-
import { EXISTENCE_EXPECTATION, resolveReceiptExpectation, } from "../effect-receipt.js";
|
|
35
|
+
import { EXISTENCE_EXPECTATION, declaredExpectation, resolveReceiptExpectation, } from "../effect-receipt.js";
|
|
36
36
|
/**
|
|
37
37
|
* The attribute a materialized receipt's live value is read from. A lexicon
|
|
38
38
|
* receipt row's observation (#1835) maps the stored value onto
|
|
@@ -148,7 +148,9 @@ export function planReceipts(receipts, readings, resolver) {
|
|
|
148
148
|
});
|
|
149
149
|
continue;
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
// A value an effect step wrote with the digest of the step outputs it read
|
|
152
|
+
// (#3948) is compared on its declared part: outputs exist only at run.
|
|
153
|
+
if (typeof reading.value === "string" && declaredExpectation(reading.value) === expectation) {
|
|
152
154
|
entries.push({ ...base, action: "noop", evidence });
|
|
153
155
|
continue;
|
|
154
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/op/local-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAmB,YAAY,EAAwC,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/op/local-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAmB,YAAY,EAAwC,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAQ7F,OAAO,EAAuF,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGlI,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAInG,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAsE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK/H,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,SA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;;;;OAKG;IACH,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,iGAAiG;IACjG,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,iGAAiG;IACjG,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACzC,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,CA4CtB"}
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { outcomeAttributesOf } from "./types.js";
|
|
22
22
|
import { resolveActivity } from "./activity-registry.js";
|
|
23
|
-
import { isStepOutputRef } from "./step-output-ref.js";
|
|
23
|
+
import { collectStepOutputRefs, isStepOutputRef } from "./step-output-ref.js";
|
|
24
|
+
import { canonicalJson } from "../effect-receipt.js";
|
|
25
|
+
import { contentDigest } from "../content-digest.js";
|
|
24
26
|
import { parseDuration } from "./duration.js";
|
|
25
27
|
import { stepLabel, withRunConsole, withStepConsole } from "./step-console.js";
|
|
26
28
|
import { stepTimeoutProblem } from "./activity-profiles.js";
|
|
@@ -150,6 +152,45 @@ function resolveStepOutputRefs(value, resultsById) {
|
|
|
150
152
|
}
|
|
151
153
|
return value;
|
|
152
154
|
}
|
|
155
|
+
/** The activity steps a step runs: itself, or an effect's nested ones. */
|
|
156
|
+
function activitiesOf(step) {
|
|
157
|
+
return isEffect(step) ? step.steps.filter(isActivity) : [step];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The first step a compensation step references that has not completed in
|
|
161
|
+
* this run (#3948 decision A6), or `undefined` when every one did. A failure
|
|
162
|
+
* can stop the run before the step that a rollback reads, and calling the
|
|
163
|
+
* rollback with `undefined` in place of that value would undo the wrong
|
|
164
|
+
* thing, or nothing, while reporting `ok`.
|
|
165
|
+
*/
|
|
166
|
+
function unfinishedSource(step, resultsById) {
|
|
167
|
+
for (const activity of activitiesOf(step)) {
|
|
168
|
+
const missing = collectStepOutputRefs(activity.args).find((ref) => !resultsById.has(ref.step));
|
|
169
|
+
if (missing)
|
|
170
|
+
return missing.step;
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
/** The skipped record of a compensation step whose source did not complete. */
|
|
175
|
+
function unfinishedSourceRecord(step, phaseName, source) {
|
|
176
|
+
const record = isEffect(step) ? skippedRecord(phaseName, `effect:${step.receipt.name}`) : skippedRecord(phaseName, step.fn, step.args);
|
|
177
|
+
return { ...record, refusal: `step "${source}" did not complete in this run, so this compensation step, which reads its output, was skipped` };
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The digest of the step outputs an effect's nested steps read (#3948), or
|
|
181
|
+
* `undefined` when they read none. The receipt store folds it into the
|
|
182
|
+
* expectation, so a changed value re-fires the effect instead of the receipt
|
|
183
|
+
* matching on the declared inputs alone. An existence receipt says only that
|
|
184
|
+
* the effect ran once, so it takes none.
|
|
185
|
+
*/
|
|
186
|
+
function effectOutputsDigest(step, resultsById) {
|
|
187
|
+
if (step.receipt.flavor === "existence")
|
|
188
|
+
return undefined;
|
|
189
|
+
const read = activitiesOf(step).flatMap((a) => collectStepOutputRefs(a.args).map((ref) => ({ step: ref.step, path: ref.path ?? "", value: resolveStepOutputRefs(ref, resultsById) })));
|
|
190
|
+
if (read.length === 0)
|
|
191
|
+
return undefined;
|
|
192
|
+
return contentDigest(canonicalJson(read));
|
|
193
|
+
}
|
|
153
194
|
/**
|
|
154
195
|
* Find the first `policyGate` step anywhere in the Op (phases + `onFailure`,
|
|
155
196
|
* including steps nested inside effect steps), if any.
|
|
@@ -312,13 +353,14 @@ async function runStep(step, phaseName, activities, profiles, resultsById, signa
|
|
|
312
353
|
/** The step data the executor synthesizes to read a receipt through the store
|
|
313
354
|
* activities (`receiptRead`/`receiptWrite` — provided by the receipt row's
|
|
314
355
|
* lexicon, #1835, or a mock store in tests via `receiptActivities`). */
|
|
315
|
-
function receiptReadStep(step) {
|
|
356
|
+
function receiptReadStep(step, outputs) {
|
|
316
357
|
return {
|
|
317
358
|
kind: "activity",
|
|
318
359
|
fn: "receiptRead",
|
|
319
360
|
args: {
|
|
320
361
|
receipt: step.receipt,
|
|
321
362
|
...(step.expectation !== undefined ? { expectation: step.expectation } : {}),
|
|
363
|
+
...(outputs !== undefined ? { outputs } : {}),
|
|
322
364
|
},
|
|
323
365
|
profile: "fastIdempotent",
|
|
324
366
|
outcomeAttribute: { name: "EffectApplied", from: "applied" },
|
|
@@ -584,7 +626,16 @@ async function runPointGateStep(step, phaseName, gates, resultsById) {
|
|
|
584
626
|
*/
|
|
585
627
|
async function runEffectStep(step, phaseName, activities, profiles, resultsById, gates, signal) {
|
|
586
628
|
const records = [];
|
|
587
|
-
|
|
629
|
+
let outputs;
|
|
630
|
+
try {
|
|
631
|
+
outputs = effectOutputsDigest(step, resultsById);
|
|
632
|
+
}
|
|
633
|
+
catch (err) {
|
|
634
|
+
// A resolved value JSON cannot hold (canonicalJson refuses it) would be a wrong expectation.
|
|
635
|
+
pushRecord(records, gates, { phase: phaseName, fn: `effect:${step.receipt.name}`, args: {}, status: "fail", durationMs: 0, error: errMessage(err) });
|
|
636
|
+
return { records, failed: true };
|
|
637
|
+
}
|
|
638
|
+
const read = await runStep(receiptReadStep(step, outputs), phaseName, activities, profiles, resultsById, signal);
|
|
588
639
|
pushRecord(records, gates, read.record);
|
|
589
640
|
if (read.record.status === "fail")
|
|
590
641
|
return { records, failed: true };
|
|
@@ -719,7 +770,10 @@ async function runPhase(phase, activities, profiles, resultsById, gates, signal)
|
|
|
719
770
|
}
|
|
720
771
|
}
|
|
721
772
|
const steps = phase.steps.filter(isActivity);
|
|
722
|
-
const settled = await Promise.all(steps.map((s) =>
|
|
773
|
+
const settled = await Promise.all(steps.map((s) => {
|
|
774
|
+
const source = gates.compensating ? unfinishedSource(s, resultsById) : undefined;
|
|
775
|
+
return source ? { record: unfinishedSourceRecord(s, phase.name, source) } : runStep(s, phase.name, activities, profiles, resultsById, signal);
|
|
776
|
+
}));
|
|
723
777
|
const ran = settled.map((r) => r.record);
|
|
724
778
|
for (const r of ran)
|
|
725
779
|
gates.onRecord?.(r);
|
|
@@ -783,6 +837,11 @@ async function runPhase(phase, activities, profiles, resultsById, gates, signal)
|
|
|
783
837
|
}
|
|
784
838
|
continue;
|
|
785
839
|
}
|
|
840
|
+
const source = gates.compensating ? unfinishedSource(step, resultsById) : undefined;
|
|
841
|
+
if (source) {
|
|
842
|
+
pushRecord(records, gates, unfinishedSourceRecord(step, phase.name, source));
|
|
843
|
+
continue;
|
|
844
|
+
}
|
|
786
845
|
if (isEffect(step)) {
|
|
787
846
|
const { records: effRecords, failed, pending, pushed, pushWarning, point } = await runEffectStep(step, phase.name, activities, profiles, resultsById, gates, signal);
|
|
788
847
|
records.push(...effRecords); // already emitted by runEffectStep
|
|
@@ -1109,7 +1168,7 @@ async function runOpInTurn(config, activities, profiles, signal, options, run) {
|
|
|
1109
1168
|
// Compensation: run onFailure phases in reverse order (best-effort). Skipped
|
|
1110
1169
|
// on abort (Ctrl-C) — the user asked to stop, so don't start new work.
|
|
1111
1170
|
// It runs whatever the work lease did, so it takes no work boundary.
|
|
1112
|
-
const compensation = { ...gates, work: undefined };
|
|
1171
|
+
const compensation = { ...gates, work: undefined, compensating: true };
|
|
1113
1172
|
if (!signal?.aborted) {
|
|
1114
1173
|
for (const phase of [...(config.onFailure ?? [])].reverse()) {
|
|
1115
1174
|
try {
|
|
@@ -71,6 +71,11 @@ export interface ReceiptCheckInput {
|
|
|
71
71
|
export declare function receiptCheckInput(receipt: EffectReceiptDeclaration): ReceiptCheckInput;
|
|
72
72
|
/** Args of the `receiptRead` activity, as the effect step's codegen emits them. */
|
|
73
73
|
export interface ReceiptReadArgs extends ReceiptCheckInput {
|
|
74
|
+
/**
|
|
75
|
+
* The digest of the step outputs the effect's nested steps read (#3948),
|
|
76
|
+
* when they read any. Folded into the expectation by {@link withStepOutputs}.
|
|
77
|
+
*/
|
|
78
|
+
outputs?: string;
|
|
74
79
|
}
|
|
75
80
|
/** Result of the `receiptRead` activity. `current` is `null` (not `undefined`)
|
|
76
81
|
* for an absent receipt so the value survives JSON transport. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receipt-store.d.ts","sourceRoot":"","sources":["../../src/op/receipt-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"receipt-store.d.ts","sourceRoot":"","sources":["../../src/op/receipt-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EAGzB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,MAAM,EAAE,mBAAmB,CAAC;IAC5B,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM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AAmB,EAAE,CAAC;CACjC;AAED,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC9E;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzF,YAAY,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5G,gBAAgB,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACzG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,iBAAiB,CAwCvG"}
|
package/dist/op/receipt-store.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* {@link ReceiptActivityOptions.resolveExpectation} hook — never by hashing
|
|
27
27
|
* placeholders.
|
|
28
28
|
*/
|
|
29
|
-
import { EXISTENCE_EXPECTATION, isEffectReceipt, receiptExpectation, referenceInputPaths, } from "../effect-receipt.js";
|
|
29
|
+
import { EXISTENCE_EXPECTATION, isEffectReceipt, receiptExpectation, referenceInputPaths, declaredExpectation, withStepOutputs, } from "../effect-receipt.js";
|
|
30
30
|
/**
|
|
31
31
|
* Snapshot a typed receipt declaration into check-input data: the
|
|
32
32
|
* {@link EffectReceiptRef} plus the synthesis-time expectation when the
|
|
@@ -67,7 +67,8 @@ export function receiptActivities(store, opts) {
|
|
|
67
67
|
};
|
|
68
68
|
return {
|
|
69
69
|
async receiptRead(args) {
|
|
70
|
-
const
|
|
70
|
+
const declared = await expectationOf(args);
|
|
71
|
+
const expectation = args.outputs !== undefined ? withStepOutputs(declared, args.outputs) : declared;
|
|
71
72
|
const current = await store.read(args.receipt);
|
|
72
73
|
return { current: current ?? null, expectation, applied: current === expectation };
|
|
73
74
|
},
|
|
@@ -84,7 +85,7 @@ export function receiptActivities(store, opts) {
|
|
|
84
85
|
if (current === undefined) {
|
|
85
86
|
findings.push({ receipt: input.receipt.name, effect: input.receipt.effect, kind: "absent", expected });
|
|
86
87
|
}
|
|
87
|
-
else if (current !== expected) {
|
|
88
|
+
else if (declaredExpectation(current) !== expected) {
|
|
88
89
|
findings.push({ receipt: input.receipt.name, effect: input.receipt.effect, kind: "differs", expected, current });
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -23,15 +23,20 @@
|
|
|
23
23
|
* Scope, kept deliberately tight (see the issue's "Open questions"):
|
|
24
24
|
* - same-Op only — no cross-Op plumbing (that needs a durable place to put
|
|
25
25
|
* the value, which #1290 explicitly defers).
|
|
26
|
-
* -
|
|
27
|
-
* `
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
26
|
+
* - producers are the top-level activity steps of the main `phases`. A step
|
|
27
|
+
* in `onFailure` or nested inside an `EffectStep` produces nothing another
|
|
28
|
+
* step may reference: an effect's nested steps run only when the receipt
|
|
29
|
+
* comparison mismatches, so a value one of them returns isn't reliably
|
|
30
|
+
* there for anything else (#3948 decision A7, "for now").
|
|
31
|
+
* - consumers are those producers, plus (#3948) every activity step in
|
|
32
|
+
* `onFailure` and every activity step nested inside an effect. An
|
|
33
|
+
* `onFailure` step may reference any main-phase producer. Compensation
|
|
34
|
+
* runs after a failure, so its producer may never have completed; the
|
|
35
|
+
* executor then skips the compensation step and records why (decision
|
|
36
|
+
* A6), rather than calling it with an `undefined` in place of the value.
|
|
37
|
+
* A step nested inside an effect may reference a producer that runs
|
|
38
|
+
* before the effect, and the executor folds the resolved values into the
|
|
39
|
+
* effect's expectation, so a changed value re-fires the effect.
|
|
35
40
|
* - producer must run to completion before the consumer starts: an earlier
|
|
36
41
|
* phase, or an earlier step within the same non-parallel phase. Two
|
|
37
42
|
* steps in the same parallel phase run concurrently (`Promise.all`) with
|
|
@@ -176,22 +181,25 @@ export declare function collectStepOutputRefs(value: unknown): StepOutputRef[];
|
|
|
176
181
|
* a public export a caller can invoke directly, bypassing that lint pass —
|
|
177
182
|
* this is its own defense-in-depth.
|
|
178
183
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* explicitly here rather than left to fall
|
|
184
|
+
* Consumers are the main-phase activity steps, the steps nested inside an
|
|
185
|
+
* effect, and every `onFailure` activity step (#3948). Flags:
|
|
186
|
+
* - a reference to a step nested inside an effect step, from anywhere
|
|
187
|
+
* (#3948 decision A7) — flagged explicitly here rather than left to fall
|
|
188
|
+
* through as "unknown producer",
|
|
183
189
|
* - a reference to an unregistered step id (no step in scope declares it),
|
|
184
190
|
* - a duplicate step id (ambiguous producer),
|
|
185
191
|
* - a reference to a step that does not precede the referencing step
|
|
186
192
|
* (a later phase, a later step in the same phase, itself, or a step in
|
|
187
|
-
* the same parallel phase).
|
|
193
|
+
* the same parallel phase). A step nested inside an effect takes the
|
|
194
|
+
* effect's position, so it may reference only a step that runs before
|
|
195
|
+
* the effect. An `onFailure` step comes after every main phase.
|
|
188
196
|
*/
|
|
189
197
|
export declare function validateStepOutputRefScope(config: Pick<OpConfig, "name" | "phases" | "onFailure"> & Partial<Pick<OpConfig, "workLease">>): ActivityContractIssue[];
|
|
190
198
|
/**
|
|
191
|
-
* Validate every step-output reference in an Op
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
199
|
+
* Validate every step-output reference in an Op against a contract map and
|
|
200
|
+
* the Op's own step ordering, over the consumers {@link
|
|
201
|
+
* validateStepOutputRefScope} covers (see the module doc). Layers
|
|
202
|
+
* contract-based checks on top of {@link
|
|
195
203
|
* validateStepOutputRefScope}'s scope/ordering checks.
|
|
196
204
|
*
|
|
197
205
|
* Flags everything {@link validateStepOutputRefScope} does, plus:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-output-ref.d.ts","sourceRoot":"","sources":["../../src/op/step-output-ref.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"step-output-ref.d.ts","sourceRoot":"","sources":["../../src/op/step-output-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,SAAS,CAAC;AAEvE,OAAO,EAAqD,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE3I,QAAA,MAAM,qBAAqB,eAAuC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,KAAK,SAAS,CAAC,CAAC,IACZ,aAAa,GACb,CAAC,CAAC,SAAS,QAAQ,GAAG,CAAC,GACrB,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,SAAS,CAAC,CAAC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