@tomflow/proflow-execution-runtime 0.1.17 → 0.1.18

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @tomflow/proflow-execution-runtime
2
+
3
+ ## 0.1.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Close Real-3 node generation identity fencing across Platform Host admission, durable Execution idempotency, and Observer/Approval resume provenance.
@@ -6,7 +6,7 @@ export declare const behaviorAdapter: {
6
6
  ok: true;
7
7
  status: "SUCCEEDED";
8
8
  moduleRef: "execution-runtime";
9
- moduleVersion: "0.1.17";
9
+ moduleVersion: "0.1.18";
10
10
  data: {
11
11
  endpoint: string;
12
12
  transportCredentialFile: string;
@@ -23,7 +23,7 @@ export declare const behaviorAdapter: {
23
23
  readonly ok: true;
24
24
  readonly status: "SUCCEEDED";
25
25
  readonly moduleRef: "execution-runtime";
26
- readonly moduleVersion: "0.1.17";
26
+ readonly moduleVersion: "0.1.18";
27
27
  };
28
28
  observedEffects: ("Persists execution state, output references and evidence in WAL SQLite" | "Runs the single backend Execution Runtime service")[];
29
29
  }>;
@@ -33,7 +33,7 @@ export declare const behaviorAdapter: {
33
33
  ok: true;
34
34
  status: "SUCCEEDED";
35
35
  moduleRef: "execution-runtime";
36
- moduleVersion: "0.1.17";
36
+ moduleVersion: "0.1.18";
37
37
  data: {
38
38
  setupStatus: "READY";
39
39
  runtimeStatus: "RUNNING" | "STOPPED";
@@ -54,7 +54,7 @@ export declare const behaviorAdapter: {
54
54
  ok: true;
55
55
  status: "SUCCEEDED";
56
56
  moduleRef: "execution-runtime";
57
- moduleVersion: "0.1.17";
57
+ moduleVersion: "0.1.18";
58
58
  data: {
59
59
  endpoint: string;
60
60
  transportCredentialFile: string;
@@ -71,7 +71,7 @@ export declare const behaviorAdapter: {
71
71
  ok: true;
72
72
  status: "SUCCEEDED";
73
73
  moduleRef: "execution-runtime";
74
- moduleVersion: "0.1.17";
74
+ moduleVersion: "0.1.18";
75
75
  data: {
76
76
  docs: string;
77
77
  };
@@ -84,7 +84,7 @@ export declare const behaviorAdapter: {
84
84
  ok: true;
85
85
  status: "SUCCEEDED";
86
86
  moduleRef: "execution-runtime";
87
- moduleVersion: "0.1.17";
87
+ moduleVersion: "0.1.18";
88
88
  data: unknown;
89
89
  };
90
90
  observedEffects: ("Persists execution state, output references and evidence in WAL SQLite" | "Runs the single backend Execution Runtime service")[];
@@ -92,7 +92,7 @@ export declare const behaviorAdapter: {
92
92
  result: {
93
93
  contract: "deployment.result.v1";
94
94
  moduleRef: "execution-runtime";
95
- moduleVersion: "0.1.17";
95
+ moduleVersion: "0.1.18";
96
96
  ok: false;
97
97
  status: "FAILED";
98
98
  error: {
@@ -109,7 +109,7 @@ export declare const behaviorAdapter: {
109
109
  readonly ok: true;
110
110
  readonly status: "SUCCEEDED";
111
111
  readonly moduleRef: "execution-runtime";
112
- readonly moduleVersion: "0.1.17";
112
+ readonly moduleVersion: "0.1.18";
113
113
  };
114
114
  observedEffects: ("Persists execution state, output references and evidence in WAL SQLite" | "Runs the single backend Execution Runtime service")[];
115
115
  } | {
@@ -118,11 +118,11 @@ export declare const behaviorAdapter: {
118
118
  readonly ok: true;
119
119
  readonly status: "SUCCEEDED";
120
120
  readonly moduleRef: "execution-runtime";
121
- readonly moduleVersion: "0.1.17";
121
+ readonly moduleVersion: "0.1.18";
122
122
  } | {
123
123
  contract: "deployment.result.v1";
124
124
  moduleRef: "execution-runtime";
125
- moduleVersion: "0.1.17";
125
+ moduleVersion: "0.1.18";
126
126
  ok: false;
127
127
  status: "FAILED";
128
128
  error: {
@@ -3,7 +3,7 @@ export declare const descriptor: {
3
3
  readonly contractVersion: "1.0.0";
4
4
  readonly moduleRef: "execution-runtime";
5
5
  readonly packageName: "@tomflow/proflow-execution-runtime";
6
- readonly moduleVersion: "0.1.17";
6
+ readonly moduleVersion: "0.1.18";
7
7
  readonly kind: "service";
8
8
  readonly templateVersion: "1.0.0";
9
9
  readonly platformCompatibility: ">=1.0.0 <2.0.0";
@@ -3,7 +3,7 @@ export const descriptor = {
3
3
  contractVersion: "1.0.0",
4
4
  moduleRef: "execution-runtime",
5
5
  packageName: "@tomflow/proflow-execution-runtime",
6
- moduleVersion: "0.1.17",
6
+ moduleVersion: "0.1.18",
7
7
  kind: "service",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
package/dist/src/index.js CHANGED
@@ -92,11 +92,42 @@ export function executionInputFingerprint(input) {
92
92
  callerRef: request.callerRef,
93
93
  taskId: request.taskId,
94
94
  nodeId: request.nodeId,
95
+ runNo: request.runNo,
95
96
  roleRef: request.roleRef,
96
97
  workerRef: request.workerRef,
97
98
  projectRoot: request.projectRoot,
98
99
  });
99
100
  }
101
+ function legacyExecutionInputFingerprint(input) {
102
+ const request = parseExecuteCapabilityRequest(input);
103
+ return sha({
104
+ capability: request.capability,
105
+ input: protectedValue(request.input),
106
+ callerRef: request.callerRef,
107
+ taskId: request.taskId,
108
+ nodeId: request.nodeId,
109
+ roleRef: request.roleRef,
110
+ workerRef: request.workerRef,
111
+ projectRoot: request.projectRoot,
112
+ });
113
+ }
114
+ function compatibleDurableInputFingerprint(row, request, currentFingerprint) {
115
+ const durableFingerprint = String(row.input_fingerprint);
116
+ if (durableFingerprint === currentFingerprint)
117
+ return durableFingerprint;
118
+ try {
119
+ const durableRequest = parseExecuteCapabilityRequest(JSON.parse(String(row.request_json)));
120
+ const durableRecord = parseExecutionRecord(JSON.parse(String(row.record_json)));
121
+ if (durableFingerprint === legacyExecutionInputFingerprint(request) &&
122
+ durableRequest.runNo === request.runNo &&
123
+ durableRecord.runNo === request.runNo)
124
+ return durableFingerprint;
125
+ }
126
+ catch {
127
+ return undefined;
128
+ }
129
+ return undefined;
130
+ }
100
131
  function materializeArtifactRefs(artifacts) {
101
132
  return artifacts.map((artifact) => ({
102
133
  ref: artifact.ref,
@@ -497,7 +528,7 @@ export async function createExecutionRuntime(options) {
497
528
  .get(request.callerRef, request.capability, request.idempotencyKey);
498
529
  if (!row)
499
530
  throw new ExecutionRuntimeError("INVALID_REQUEST", "execution intent was not found");
500
- if (String(row.input_fingerprint) !== executionInputFingerprint(request))
531
+ if (compatibleDurableInputFingerprint(row, request, executionInputFingerprint(request)) === undefined)
501
532
  throw new ExecutionRuntimeError("IDEMPOTENCY_CONFLICT", "execution intent lookup input does not match durable input");
502
533
  return fromRow(row);
503
534
  }
@@ -506,14 +537,16 @@ export async function createExecutionRuntime(options) {
506
537
  throw new ExecutionRuntimeError("EXECUTOR_UNAVAILABLE", "execution runtime is closed");
507
538
  const request = parseExecuteCapabilityRequest(input);
508
539
  assertPatchArtifactScope(request);
509
- const inputFingerprint = executionInputFingerprint(request);
540
+ let inputFingerprint = executionInputFingerprint(request);
510
541
  const existing = database
511
542
  .prepare("SELECT * FROM executions WHERE caller_ref=? AND capability=? AND idempotency_key=?")
512
543
  .get(request.callerRef, request.capability, request.idempotencyKey);
513
544
  let record;
514
545
  if (existing) {
515
- if (String(existing.input_fingerprint) !== inputFingerprint)
546
+ const durableFingerprint = compatibleDurableInputFingerprint(existing, request, inputFingerprint);
547
+ if (durableFingerprint === undefined)
516
548
  throw new ExecutionRuntimeError("IDEMPOTENCY_CONFLICT", "idempotency key was already used with different critical input");
549
+ inputFingerprint = durableFingerprint;
517
550
  const prior = fromRow(existing);
518
551
  const safelyResumable = (prior.status === "PENDING" &&
519
552
  prior.sideEffectState === "NOT_STARTED") ||
@@ -545,7 +578,8 @@ export async function createExecutionRuntime(options) {
545
578
  const raced = database
546
579
  .prepare("SELECT * FROM executions WHERE caller_ref=? AND capability=? AND idempotency_key=?")
547
580
  .get(request.callerRef, request.capability, request.idempotencyKey);
548
- if (!raced || String(raced.input_fingerprint) !== inputFingerprint)
581
+ if (!raced ||
582
+ compatibleDurableInputFingerprint(raced, request, inputFingerprint) === undefined)
549
583
  throw new ExecutionRuntimeError("IDEMPOTENCY_CONFLICT", "concurrent idempotency conflict");
550
584
  return fromRow(raced);
551
585
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-execution-runtime",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,11 +24,11 @@
24
24
  "SETUP.md"
25
25
  ],
26
26
  "dependencies": {
27
- "@tomflow/proflow-model-contracts": "^0.1.10",
27
+ "@tomflow/proflow-execution-browser-extension": "^0.1.42",
28
28
  "@tomflow/proflow-execution-contracts": "^0.1.10",
29
- "@tomflow/proflow-execution-browser-extension": "^0.1.37",
30
- "@tomflow/proflow-execution-local": "^0.1.15",
31
- "@tomflow/proflow-module-contract": "^0.1.13"
29
+ "@tomflow/proflow-model-contracts": "^0.1.10",
30
+ "@tomflow/proflow-module-contract": "^0.1.13",
31
+ "@tomflow/proflow-execution-local": "^0.1.15"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@tomflow/proflow-deployment-conformance": "^0.1.13"
@@ -3,7 +3,7 @@
3
3
  "contractVersion": "1.0.0",
4
4
  "moduleRef": "execution-runtime",
5
5
  "packageName": "@tomflow/proflow-execution-runtime",
6
- "moduleVersion": "0.1.17",
6
+ "moduleVersion": "0.1.18",
7
7
  "kind": "service",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",