@tomflow/proflow-execution-runtime 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONFIGURATION.md +31 -0
- package/dist/deployment/adapter.d.ts +36 -112
- package/dist/deployment/adapter.js +54 -145
- package/dist/deployment/descriptor.d.ts +5 -2
- package/dist/deployment/descriptor.js +26 -6
- package/dist/src/cli.js +1 -24
- package/package.json +9 -15
- package/proflow.module.json +6 -2
- package/CHANGELOG.md +0 -25
package/CONFIGURATION.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# execution-runtime configuration
|
|
2
|
+
|
|
3
|
+
Canonical public config: `.proflow/config/execution-runtime.json`
|
|
4
|
+
|
|
5
|
+
This file is Workspace-owned data. `platform uninstall` does not delete it. Values are JSON strings. Raw secrets must not be stored here; `secretRef` fields contain opaque references only.
|
|
6
|
+
|
|
7
|
+
## Fields
|
|
8
|
+
|
|
9
|
+
| Key | Type | Required | Sensitive | Source | Meaning |
|
|
10
|
+
|---|---|---:|---:|---|---|
|
|
11
|
+
| `databasePath` | `path` | yes | no | User or owning Module supplies an absolute/local path that exists on this Workspace. | Execution SQLite database |
|
|
12
|
+
| `projectRoot` | `path` | yes | no | User or owning Module supplies an absolute/local path that exists on this Workspace. | Canonical project boundary consumed by the local executor |
|
|
13
|
+
| `artifactRoot` | `path` | yes | no | User or owning Module supplies an absolute/local path that exists on this Workspace. | Execution-owned Artifact/Evidence filesystem root |
|
|
14
|
+
| `browserExecutorConfigPath` | `path` | yes | no | User or owning Module supplies an absolute/local path that exists on this Workspace. | Absolute configuration path for the formal Browser Reality Bridge composition |
|
|
15
|
+
| `transportCredentialFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the Execution Runtime transport credential |
|
|
16
|
+
| `identity.endpoint` | `url` | yes | no | User or owning external/runtime Module supplies the reachable endpoint URL. | Loopback platform-host execution identity endpoint |
|
|
17
|
+
| `identity.tokenFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the Execution-to-platform-host identity transport credential |
|
|
18
|
+
| `modelDecision.endpoint` | `url` | yes | no | User or owning external/runtime Module supplies the reachable endpoint URL. | Loopback Model Runtime endpoint used by execution.command-risk.v1 |
|
|
19
|
+
| `modelDecision.credentialFile` | `path` | yes | yes | User or owning Module supplies an absolute/local path that exists on this Workspace. | File containing the Execution-to-Model transport credential |
|
|
20
|
+
|
|
21
|
+
## Materialize
|
|
22
|
+
|
|
23
|
+
Create or update the canonical JSON object at:
|
|
24
|
+
|
|
25
|
+
`.proflow/config/execution-runtime.json`
|
|
26
|
+
|
|
27
|
+
Use only declared keys and string values. Do not create a second Platform configuration database.
|
|
28
|
+
|
|
29
|
+
## Base completion check
|
|
30
|
+
|
|
31
|
+
Run `platform modules`. This Module should no longer report required keys in `missingConfig`. `platform start` performs the authoritative Module-owned validation before starting anything.
|
|
@@ -12,14 +12,14 @@ type ProcessService = {
|
|
|
12
12
|
readiness: "READY" | "NOT_READY";
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
15
|
+
export declare function createBehaviorAdapter(service?: ProcessService, config?: Record<string, string>, configValid?: boolean): {
|
|
16
16
|
describe: () => {
|
|
17
17
|
result: {
|
|
18
18
|
readonly contract: "deployment.result.v1";
|
|
19
19
|
readonly ok: true;
|
|
20
20
|
readonly status: "SUCCEEDED";
|
|
21
21
|
readonly moduleRef: "execution-runtime";
|
|
22
|
-
readonly moduleVersion: "0.1.
|
|
22
|
+
readonly moduleVersion: "0.1.6";
|
|
23
23
|
};
|
|
24
24
|
observedEffects: never[];
|
|
25
25
|
};
|
|
@@ -29,53 +29,22 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
29
29
|
readonly ok: true;
|
|
30
30
|
readonly status: "SUCCEEDED";
|
|
31
31
|
readonly moduleRef: "execution-runtime";
|
|
32
|
-
readonly moduleVersion: "0.1.
|
|
32
|
+
readonly moduleVersion: "0.1.6";
|
|
33
33
|
};
|
|
34
34
|
observedEffects: never[];
|
|
35
35
|
};
|
|
36
36
|
status: () => {
|
|
37
37
|
result: {
|
|
38
|
-
readonly contract: "deployment.result.v1";
|
|
39
|
-
readonly moduleRef: "execution-runtime";
|
|
40
|
-
readonly moduleVersion: "0.1.4";
|
|
41
|
-
readonly ok: false;
|
|
42
|
-
readonly status: "ACTION_REQUIRED";
|
|
43
|
-
readonly actionRequired: {
|
|
44
|
-
readonly action: "bind-runtime";
|
|
45
|
-
readonly description: "Bind a configured Execution Runtime service";
|
|
46
|
-
};
|
|
47
|
-
} | {
|
|
48
38
|
contract: "deployment.result.v1";
|
|
49
39
|
ok: true;
|
|
50
40
|
status: "SUCCEEDED";
|
|
51
41
|
moduleRef: "execution-runtime";
|
|
52
|
-
moduleVersion: "0.1.
|
|
42
|
+
moduleVersion: "0.1.6";
|
|
53
43
|
data: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
id: string;
|
|
58
|
-
status: "FAIL" | "PASS";
|
|
59
|
-
message: string;
|
|
60
|
-
}[];
|
|
61
|
-
} | {
|
|
62
|
-
contract: "deployment.result.v1";
|
|
63
|
-
moduleRef: "execution-runtime";
|
|
64
|
-
moduleVersion: "0.1.4";
|
|
65
|
-
ok: false;
|
|
66
|
-
status: "ACTION_REQUIRED";
|
|
67
|
-
actionRequired: {
|
|
68
|
-
action: string;
|
|
69
|
-
description: string;
|
|
44
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
45
|
+
missingConfig?: string[] | undefined;
|
|
46
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
70
47
|
};
|
|
71
|
-
data: {
|
|
72
|
-
readiness: "READY" | "NOT_READY";
|
|
73
|
-
} | undefined;
|
|
74
|
-
checks: {
|
|
75
|
-
id: string;
|
|
76
|
-
status: "FAIL" | "PASS";
|
|
77
|
-
message: string;
|
|
78
|
-
}[];
|
|
79
48
|
};
|
|
80
49
|
observedEffects: never[];
|
|
81
50
|
};
|
|
@@ -85,7 +54,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
85
54
|
ok: true;
|
|
86
55
|
status: "SUCCEEDED";
|
|
87
56
|
moduleRef: "execution-runtime";
|
|
88
|
-
moduleVersion: "0.1.
|
|
57
|
+
moduleVersion: "0.1.6";
|
|
89
58
|
checks: {
|
|
90
59
|
id: string;
|
|
91
60
|
status: "FAIL" | "PASS";
|
|
@@ -94,7 +63,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
94
63
|
} | {
|
|
95
64
|
contract: "deployment.result.v1";
|
|
96
65
|
moduleRef: "execution-runtime";
|
|
97
|
-
moduleVersion: "0.1.
|
|
66
|
+
moduleVersion: "0.1.6";
|
|
98
67
|
ok: false;
|
|
99
68
|
status: "ACTION_REQUIRED";
|
|
100
69
|
actionRequired: {
|
|
@@ -109,7 +78,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
109
78
|
} | {
|
|
110
79
|
contract: "deployment.result.v1";
|
|
111
80
|
moduleRef: "execution-runtime";
|
|
112
|
-
moduleVersion: "0.1.
|
|
81
|
+
moduleVersion: "0.1.6";
|
|
113
82
|
ok: false;
|
|
114
83
|
status: "ACTION_REQUIRED";
|
|
115
84
|
actionRequired: {
|
|
@@ -130,7 +99,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
130
99
|
readonly ok: true;
|
|
131
100
|
readonly status: "SUCCEEDED";
|
|
132
101
|
readonly moduleRef: "execution-runtime";
|
|
133
|
-
readonly moduleVersion: "0.1.
|
|
102
|
+
readonly moduleVersion: "0.1.6";
|
|
134
103
|
};
|
|
135
104
|
observedEffects: never[];
|
|
136
105
|
};
|
|
@@ -138,7 +107,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
138
107
|
result: {
|
|
139
108
|
readonly contract: "deployment.result.v1";
|
|
140
109
|
readonly moduleRef: "execution-runtime";
|
|
141
|
-
readonly moduleVersion: "0.1.
|
|
110
|
+
readonly moduleVersion: "0.1.6";
|
|
142
111
|
readonly ok: false;
|
|
143
112
|
readonly status: "ACTION_REQUIRED";
|
|
144
113
|
readonly actionRequired: {
|
|
@@ -150,7 +119,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
150
119
|
ok: true;
|
|
151
120
|
status: "SUCCEEDED";
|
|
152
121
|
moduleRef: "execution-runtime";
|
|
153
|
-
moduleVersion: "0.1.
|
|
122
|
+
moduleVersion: "0.1.6";
|
|
154
123
|
data: {
|
|
155
124
|
host: string;
|
|
156
125
|
port: number;
|
|
@@ -164,11 +133,11 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
164
133
|
readonly ok: true;
|
|
165
134
|
readonly status: "SUCCEEDED";
|
|
166
135
|
readonly moduleRef: "execution-runtime";
|
|
167
|
-
readonly moduleVersion: "0.1.
|
|
136
|
+
readonly moduleVersion: "0.1.6";
|
|
168
137
|
} | {
|
|
169
138
|
readonly contract: "deployment.result.v1";
|
|
170
139
|
readonly moduleRef: "execution-runtime";
|
|
171
|
-
readonly moduleVersion: "0.1.
|
|
140
|
+
readonly moduleVersion: "0.1.6";
|
|
172
141
|
readonly ok: false;
|
|
173
142
|
readonly status: "ACTION_REQUIRED";
|
|
174
143
|
readonly actionRequired: {
|
|
@@ -184,7 +153,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
184
153
|
readonly ok: true;
|
|
185
154
|
readonly status: "SUCCEEDED";
|
|
186
155
|
readonly moduleRef: "execution-runtime";
|
|
187
|
-
readonly moduleVersion: "0.1.
|
|
156
|
+
readonly moduleVersion: "0.1.6";
|
|
188
157
|
};
|
|
189
158
|
observedEffects: "Runs the single backend Execution Runtime service"[];
|
|
190
159
|
}>;
|
|
@@ -192,7 +161,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
192
161
|
result: {
|
|
193
162
|
readonly contract: "deployment.result.v1";
|
|
194
163
|
readonly moduleRef: "execution-runtime";
|
|
195
|
-
readonly moduleVersion: "0.1.
|
|
164
|
+
readonly moduleVersion: "0.1.6";
|
|
196
165
|
readonly ok: false;
|
|
197
166
|
readonly status: "ACTION_REQUIRED";
|
|
198
167
|
readonly actionRequired: {
|
|
@@ -204,7 +173,7 @@ export declare function createBehaviorAdapter(service?: ProcessService): {
|
|
|
204
173
|
ok: true;
|
|
205
174
|
status: "SUCCEEDED";
|
|
206
175
|
moduleRef: "execution-runtime";
|
|
207
|
-
moduleVersion: "0.1.
|
|
176
|
+
moduleVersion: "0.1.6";
|
|
208
177
|
data: {
|
|
209
178
|
host: string;
|
|
210
179
|
port: number;
|
|
@@ -220,7 +189,7 @@ export declare const behaviorAdapter: {
|
|
|
220
189
|
readonly ok: true;
|
|
221
190
|
readonly status: "SUCCEEDED";
|
|
222
191
|
readonly moduleRef: "execution-runtime";
|
|
223
|
-
readonly moduleVersion: "0.1.
|
|
192
|
+
readonly moduleVersion: "0.1.6";
|
|
224
193
|
};
|
|
225
194
|
observedEffects: never[];
|
|
226
195
|
};
|
|
@@ -230,53 +199,22 @@ export declare const behaviorAdapter: {
|
|
|
230
199
|
readonly ok: true;
|
|
231
200
|
readonly status: "SUCCEEDED";
|
|
232
201
|
readonly moduleRef: "execution-runtime";
|
|
233
|
-
readonly moduleVersion: "0.1.
|
|
202
|
+
readonly moduleVersion: "0.1.6";
|
|
234
203
|
};
|
|
235
204
|
observedEffects: never[];
|
|
236
205
|
};
|
|
237
206
|
status: () => {
|
|
238
207
|
result: {
|
|
239
|
-
readonly contract: "deployment.result.v1";
|
|
240
|
-
readonly moduleRef: "execution-runtime";
|
|
241
|
-
readonly moduleVersion: "0.1.4";
|
|
242
|
-
readonly ok: false;
|
|
243
|
-
readonly status: "ACTION_REQUIRED";
|
|
244
|
-
readonly actionRequired: {
|
|
245
|
-
readonly action: "bind-runtime";
|
|
246
|
-
readonly description: "Bind a configured Execution Runtime service";
|
|
247
|
-
};
|
|
248
|
-
} | {
|
|
249
208
|
contract: "deployment.result.v1";
|
|
250
209
|
ok: true;
|
|
251
210
|
status: "SUCCEEDED";
|
|
252
211
|
moduleRef: "execution-runtime";
|
|
253
|
-
moduleVersion: "0.1.
|
|
212
|
+
moduleVersion: "0.1.6";
|
|
254
213
|
data: {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
id: string;
|
|
259
|
-
status: "FAIL" | "PASS";
|
|
260
|
-
message: string;
|
|
261
|
-
}[];
|
|
262
|
-
} | {
|
|
263
|
-
contract: "deployment.result.v1";
|
|
264
|
-
moduleRef: "execution-runtime";
|
|
265
|
-
moduleVersion: "0.1.4";
|
|
266
|
-
ok: false;
|
|
267
|
-
status: "ACTION_REQUIRED";
|
|
268
|
-
actionRequired: {
|
|
269
|
-
action: string;
|
|
270
|
-
description: string;
|
|
214
|
+
configStatus: "INCOMPLETE" | "INVALID" | "READY";
|
|
215
|
+
missingConfig?: string[] | undefined;
|
|
216
|
+
runtimeStatus: "FAILED" | "RUNNING" | "STOPPED" | "UNKNOWN";
|
|
271
217
|
};
|
|
272
|
-
data: {
|
|
273
|
-
readiness: "READY" | "NOT_READY";
|
|
274
|
-
} | undefined;
|
|
275
|
-
checks: {
|
|
276
|
-
id: string;
|
|
277
|
-
status: "FAIL" | "PASS";
|
|
278
|
-
message: string;
|
|
279
|
-
}[];
|
|
280
218
|
};
|
|
281
219
|
observedEffects: never[];
|
|
282
220
|
};
|
|
@@ -286,7 +224,7 @@ export declare const behaviorAdapter: {
|
|
|
286
224
|
ok: true;
|
|
287
225
|
status: "SUCCEEDED";
|
|
288
226
|
moduleRef: "execution-runtime";
|
|
289
|
-
moduleVersion: "0.1.
|
|
227
|
+
moduleVersion: "0.1.6";
|
|
290
228
|
checks: {
|
|
291
229
|
id: string;
|
|
292
230
|
status: "FAIL" | "PASS";
|
|
@@ -295,7 +233,7 @@ export declare const behaviorAdapter: {
|
|
|
295
233
|
} | {
|
|
296
234
|
contract: "deployment.result.v1";
|
|
297
235
|
moduleRef: "execution-runtime";
|
|
298
|
-
moduleVersion: "0.1.
|
|
236
|
+
moduleVersion: "0.1.6";
|
|
299
237
|
ok: false;
|
|
300
238
|
status: "ACTION_REQUIRED";
|
|
301
239
|
actionRequired: {
|
|
@@ -310,7 +248,7 @@ export declare const behaviorAdapter: {
|
|
|
310
248
|
} | {
|
|
311
249
|
contract: "deployment.result.v1";
|
|
312
250
|
moduleRef: "execution-runtime";
|
|
313
|
-
moduleVersion: "0.1.
|
|
251
|
+
moduleVersion: "0.1.6";
|
|
314
252
|
ok: false;
|
|
315
253
|
status: "ACTION_REQUIRED";
|
|
316
254
|
actionRequired: {
|
|
@@ -331,7 +269,7 @@ export declare const behaviorAdapter: {
|
|
|
331
269
|
readonly ok: true;
|
|
332
270
|
readonly status: "SUCCEEDED";
|
|
333
271
|
readonly moduleRef: "execution-runtime";
|
|
334
|
-
readonly moduleVersion: "0.1.
|
|
272
|
+
readonly moduleVersion: "0.1.6";
|
|
335
273
|
};
|
|
336
274
|
observedEffects: never[];
|
|
337
275
|
};
|
|
@@ -339,7 +277,7 @@ export declare const behaviorAdapter: {
|
|
|
339
277
|
result: {
|
|
340
278
|
readonly contract: "deployment.result.v1";
|
|
341
279
|
readonly moduleRef: "execution-runtime";
|
|
342
|
-
readonly moduleVersion: "0.1.
|
|
280
|
+
readonly moduleVersion: "0.1.6";
|
|
343
281
|
readonly ok: false;
|
|
344
282
|
readonly status: "ACTION_REQUIRED";
|
|
345
283
|
readonly actionRequired: {
|
|
@@ -351,7 +289,7 @@ export declare const behaviorAdapter: {
|
|
|
351
289
|
ok: true;
|
|
352
290
|
status: "SUCCEEDED";
|
|
353
291
|
moduleRef: "execution-runtime";
|
|
354
|
-
moduleVersion: "0.1.
|
|
292
|
+
moduleVersion: "0.1.6";
|
|
355
293
|
data: {
|
|
356
294
|
host: string;
|
|
357
295
|
port: number;
|
|
@@ -365,11 +303,11 @@ export declare const behaviorAdapter: {
|
|
|
365
303
|
readonly ok: true;
|
|
366
304
|
readonly status: "SUCCEEDED";
|
|
367
305
|
readonly moduleRef: "execution-runtime";
|
|
368
|
-
readonly moduleVersion: "0.1.
|
|
306
|
+
readonly moduleVersion: "0.1.6";
|
|
369
307
|
} | {
|
|
370
308
|
readonly contract: "deployment.result.v1";
|
|
371
309
|
readonly moduleRef: "execution-runtime";
|
|
372
|
-
readonly moduleVersion: "0.1.
|
|
310
|
+
readonly moduleVersion: "0.1.6";
|
|
373
311
|
readonly ok: false;
|
|
374
312
|
readonly status: "ACTION_REQUIRED";
|
|
375
313
|
readonly actionRequired: {
|
|
@@ -385,7 +323,7 @@ export declare const behaviorAdapter: {
|
|
|
385
323
|
readonly ok: true;
|
|
386
324
|
readonly status: "SUCCEEDED";
|
|
387
325
|
readonly moduleRef: "execution-runtime";
|
|
388
|
-
readonly moduleVersion: "0.1.
|
|
326
|
+
readonly moduleVersion: "0.1.6";
|
|
389
327
|
};
|
|
390
328
|
observedEffects: "Runs the single backend Execution Runtime service"[];
|
|
391
329
|
}>;
|
|
@@ -393,7 +331,7 @@ export declare const behaviorAdapter: {
|
|
|
393
331
|
result: {
|
|
394
332
|
readonly contract: "deployment.result.v1";
|
|
395
333
|
readonly moduleRef: "execution-runtime";
|
|
396
|
-
readonly moduleVersion: "0.1.
|
|
334
|
+
readonly moduleVersion: "0.1.6";
|
|
397
335
|
readonly ok: false;
|
|
398
336
|
readonly status: "ACTION_REQUIRED";
|
|
399
337
|
readonly actionRequired: {
|
|
@@ -405,7 +343,7 @@ export declare const behaviorAdapter: {
|
|
|
405
343
|
ok: true;
|
|
406
344
|
status: "SUCCEEDED";
|
|
407
345
|
moduleRef: "execution-runtime";
|
|
408
|
-
moduleVersion: "0.1.
|
|
346
|
+
moduleVersion: "0.1.6";
|
|
409
347
|
data: {
|
|
410
348
|
host: string;
|
|
411
349
|
port: number;
|
|
@@ -414,25 +352,11 @@ export declare const behaviorAdapter: {
|
|
|
414
352
|
observedEffects: ("Persists execution state, output references and evidence in WAL SQLite" | "Runs the single backend Execution Runtime service")[];
|
|
415
353
|
}>;
|
|
416
354
|
};
|
|
417
|
-
export declare function createServiceProcessBinding(input: {
|
|
418
|
-
moduleRef: string;
|
|
419
|
-
config: Record<string, string>;
|
|
420
|
-
workspaceRoot: string;
|
|
421
|
-
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
422
|
-
}): Promise<{
|
|
423
|
-
serviceProcess: {
|
|
424
|
-
contract: "deployment.service-process.v1";
|
|
425
|
-
bin: "proflow-execution-runtime";
|
|
426
|
-
startCommand: "start";
|
|
427
|
-
config: Record<string, unknown>;
|
|
428
|
-
};
|
|
429
|
-
behaviorAdapter: Record<string, unknown>;
|
|
430
|
-
} | undefined>;
|
|
431
355
|
export declare function createProductionBinding(input: {
|
|
432
356
|
moduleRef: string;
|
|
433
357
|
config: Record<string, string>;
|
|
434
358
|
configByModuleRef: ReadonlyMap<string, Record<string, string>>;
|
|
435
359
|
}): Promise<{
|
|
436
360
|
behaviorAdapter: Record<string, unknown>;
|
|
437
|
-
}
|
|
361
|
+
}>;
|
|
438
362
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createServer } from "node:net";
|
|
2
|
+
import { observeDeclaredModuleStatus } from "@tomflow/proflow-module-contract";
|
|
2
3
|
import { descriptor } from "./descriptor.js";
|
|
3
4
|
const base = {
|
|
4
5
|
contract: "deployment.result.v1",
|
|
@@ -87,37 +88,16 @@ async function listenerPreflight(listener) {
|
|
|
87
88
|
observedEffects: [],
|
|
88
89
|
};
|
|
89
90
|
}
|
|
90
|
-
export function createBehaviorAdapter(service) {
|
|
91
|
+
export function createBehaviorAdapter(service, config, configValid = true) {
|
|
91
92
|
return {
|
|
92
93
|
describe: () => ({ result: base, observedEffects: [] }),
|
|
93
94
|
preflight: () => ({ result: base, observedEffects: [] }),
|
|
94
95
|
status: () => {
|
|
95
96
|
const status = service?.status();
|
|
96
97
|
const ready = status?.readiness === "READY";
|
|
98
|
+
const data = observeDeclaredModuleStatus(descriptor, config, ready ? "RUNNING" : service ? "FAILED" : "UNKNOWN", configValid);
|
|
97
99
|
return {
|
|
98
|
-
result:
|
|
99
|
-
? {
|
|
100
|
-
...(ready
|
|
101
|
-
? base
|
|
102
|
-
: {
|
|
103
|
-
...base,
|
|
104
|
-
ok: false,
|
|
105
|
-
status: "ACTION_REQUIRED",
|
|
106
|
-
actionRequired: {
|
|
107
|
-
action: "repair-execution-runtime",
|
|
108
|
-
description: "Execution Runtime is not READY",
|
|
109
|
-
},
|
|
110
|
-
}),
|
|
111
|
-
data: status,
|
|
112
|
-
checks: [
|
|
113
|
-
{
|
|
114
|
-
id: "execution-runtime-readiness",
|
|
115
|
-
status: ready ? "PASS" : "FAIL",
|
|
116
|
-
message: `Execution Runtime readiness is ${status?.readiness ?? "NOT_READY"}`,
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
}
|
|
120
|
-
: unbound,
|
|
100
|
+
result: { ...base, data },
|
|
121
101
|
observedEffects: [],
|
|
122
102
|
};
|
|
123
103
|
},
|
|
@@ -193,103 +173,10 @@ export function createBehaviorAdapter(service) {
|
|
|
193
173
|
};
|
|
194
174
|
}
|
|
195
175
|
export const behaviorAdapter = createBehaviorAdapter();
|
|
196
|
-
export async function createServiceProcessBinding(input) {
|
|
197
|
-
const required = [
|
|
198
|
-
"databasePath",
|
|
199
|
-
"projectRoot",
|
|
200
|
-
"artifactRoot",
|
|
201
|
-
"browserExecutorConfigPath",
|
|
202
|
-
"transportCredentialFile",
|
|
203
|
-
"identity.endpoint",
|
|
204
|
-
"identity.tokenFile",
|
|
205
|
-
"modelDecision.endpoint",
|
|
206
|
-
"modelDecision.credentialFile",
|
|
207
|
-
];
|
|
208
|
-
if (!required.every((key) => input.config[key]))
|
|
209
|
-
return undefined;
|
|
210
|
-
const platformHost = input.configByModuleRef.get("platform-host");
|
|
211
|
-
const advertised = platformHost?.executionBaseUrl;
|
|
212
|
-
if (!advertised)
|
|
213
|
-
return undefined;
|
|
214
|
-
const listener = new URL(advertised);
|
|
215
|
-
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
216
|
-
return undefined;
|
|
217
|
-
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
218
|
-
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
219
|
-
return undefined;
|
|
220
|
-
const { parseExecutionRuntimeProcessConfig } = await import("../src/service.js");
|
|
221
|
-
const processConfig = parseExecutionRuntimeProcessConfig({
|
|
222
|
-
host: listener.hostname,
|
|
223
|
-
port,
|
|
224
|
-
databasePath: input.config.databasePath,
|
|
225
|
-
projectRoot: input.config.projectRoot,
|
|
226
|
-
artifactRoot: input.config.artifactRoot,
|
|
227
|
-
browserExecutorConfigPath: input.config.browserExecutorConfigPath,
|
|
228
|
-
transportCredentialFile: input.config.transportCredentialFile,
|
|
229
|
-
identity: {
|
|
230
|
-
endpoint: input.config["identity.endpoint"],
|
|
231
|
-
tokenFile: input.config["identity.tokenFile"],
|
|
232
|
-
},
|
|
233
|
-
modelDecision: {
|
|
234
|
-
endpoint: input.config["modelDecision.endpoint"],
|
|
235
|
-
credentialFile: input.config["modelDecision.credentialFile"],
|
|
236
|
-
},
|
|
237
|
-
});
|
|
238
|
-
const probeAdapter = {
|
|
239
|
-
describe: behaviorAdapter.describe,
|
|
240
|
-
preflight: () => listenerPreflight(listener),
|
|
241
|
-
verify: async () => {
|
|
242
|
-
let ready = false;
|
|
243
|
-
try {
|
|
244
|
-
ready = (await fetch(new URL("/ready", listener))).ok;
|
|
245
|
-
}
|
|
246
|
-
catch {
|
|
247
|
-
ready = false;
|
|
248
|
-
}
|
|
249
|
-
return {
|
|
250
|
-
result: ready
|
|
251
|
-
? {
|
|
252
|
-
...base,
|
|
253
|
-
checks: [
|
|
254
|
-
{
|
|
255
|
-
id: "execution-runtime-critical-proofs",
|
|
256
|
-
status: "PASS",
|
|
257
|
-
message: "Managed Execution Runtime /ready probe passed",
|
|
258
|
-
},
|
|
259
|
-
],
|
|
260
|
-
}
|
|
261
|
-
: {
|
|
262
|
-
...base,
|
|
263
|
-
ok: false,
|
|
264
|
-
status: "ACTION_REQUIRED",
|
|
265
|
-
actionRequired: {
|
|
266
|
-
action: "repair-execution-runtime",
|
|
267
|
-
description: "Managed Execution Runtime /ready probe failed",
|
|
268
|
-
},
|
|
269
|
-
checks: [
|
|
270
|
-
{
|
|
271
|
-
id: "execution-runtime-critical-proofs",
|
|
272
|
-
status: "FAIL",
|
|
273
|
-
message: "Managed Execution Runtime /ready probe failed",
|
|
274
|
-
},
|
|
275
|
-
],
|
|
276
|
-
},
|
|
277
|
-
observedEffects: [],
|
|
278
|
-
};
|
|
279
|
-
},
|
|
280
|
-
doctor: behaviorAdapter.doctor,
|
|
281
|
-
};
|
|
282
|
-
return {
|
|
283
|
-
serviceProcess: {
|
|
284
|
-
contract: "deployment.service-process.v1",
|
|
285
|
-
bin: "proflow-execution-runtime",
|
|
286
|
-
startCommand: "start",
|
|
287
|
-
config: processConfig,
|
|
288
|
-
},
|
|
289
|
-
behaviorAdapter: probeAdapter,
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
176
|
export async function createProductionBinding(input) {
|
|
177
|
+
const unboundBinding = (configValid = true) => ({
|
|
178
|
+
behaviorAdapter: createBehaviorAdapter(undefined, input.config, configValid),
|
|
179
|
+
});
|
|
293
180
|
const required = [
|
|
294
181
|
"databasePath",
|
|
295
182
|
"projectRoot",
|
|
@@ -302,43 +189,65 @@ export async function createProductionBinding(input) {
|
|
|
302
189
|
"modelDecision.credentialFile",
|
|
303
190
|
];
|
|
304
191
|
if (!required.every((key) => input.config[key]))
|
|
305
|
-
return
|
|
192
|
+
return unboundBinding();
|
|
193
|
+
for (const key of ["identity.endpoint", "modelDecision.endpoint"]) {
|
|
194
|
+
try {
|
|
195
|
+
const endpoint = new URL(input.config[key] ?? "");
|
|
196
|
+
if (endpoint.protocol !== "http:")
|
|
197
|
+
return unboundBinding(false);
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
return unboundBinding(false);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
306
203
|
const platformHost = input.configByModuleRef.get("platform-host");
|
|
307
204
|
const advertised = platformHost?.executionBaseUrl;
|
|
308
205
|
if (!advertised)
|
|
309
|
-
return
|
|
310
|
-
|
|
206
|
+
return unboundBinding();
|
|
207
|
+
let listener;
|
|
208
|
+
try {
|
|
209
|
+
listener = new URL(advertised);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return unboundBinding();
|
|
213
|
+
}
|
|
311
214
|
if (listener.protocol !== "http:" || listener.pathname !== "/")
|
|
312
|
-
return
|
|
215
|
+
return unboundBinding();
|
|
313
216
|
const port = listener.port === "" ? 80 : Number(listener.port);
|
|
314
217
|
if (!Number.isInteger(port) || port <= 0 || port > 65_535)
|
|
315
|
-
return
|
|
218
|
+
return unboundBinding();
|
|
316
219
|
const [{ createFormalExecutionRuntimeLifecycle }, { parseExecutionRuntimeProcessConfig },] = await Promise.all([
|
|
317
220
|
import("../src/formal-process.js"),
|
|
318
221
|
import("../src/service.js"),
|
|
319
222
|
]);
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
223
|
+
let service;
|
|
224
|
+
try {
|
|
225
|
+
service = createFormalExecutionRuntimeLifecycle({
|
|
226
|
+
config: parseExecutionRuntimeProcessConfig({
|
|
227
|
+
host: listener.hostname,
|
|
228
|
+
port,
|
|
229
|
+
databasePath: input.config.databasePath,
|
|
230
|
+
projectRoot: input.config.projectRoot,
|
|
231
|
+
artifactRoot: input.config.artifactRoot,
|
|
232
|
+
browserExecutorConfigPath: input.config.browserExecutorConfigPath,
|
|
233
|
+
transportCredentialFile: input.config.transportCredentialFile,
|
|
234
|
+
identity: {
|
|
235
|
+
endpoint: input.config["identity.endpoint"],
|
|
236
|
+
tokenFile: input.config["identity.tokenFile"],
|
|
237
|
+
},
|
|
238
|
+
modelDecision: {
|
|
239
|
+
endpoint: input.config["modelDecision.endpoint"],
|
|
240
|
+
credentialFile: input.config["modelDecision.credentialFile"],
|
|
241
|
+
},
|
|
242
|
+
}),
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
return unboundBinding(false);
|
|
247
|
+
}
|
|
339
248
|
return {
|
|
340
249
|
behaviorAdapter: {
|
|
341
|
-
...createBehaviorAdapter(service),
|
|
250
|
+
...createBehaviorAdapter(service, input.config),
|
|
342
251
|
preflight: () => listenerPreflight(listener),
|
|
343
252
|
},
|
|
344
253
|
};
|
|
@@ -3,11 +3,10 @@ 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.
|
|
6
|
+
readonly moduleVersion: "0.1.6";
|
|
7
7
|
readonly kind: "service";
|
|
8
8
|
readonly templateVersion: "1.0.0";
|
|
9
9
|
readonly platformCompatibility: ">=1.0.0 <2.0.0";
|
|
10
|
-
readonly installClass: "core";
|
|
11
10
|
readonly identity: {
|
|
12
11
|
readonly domain: "execution";
|
|
13
12
|
readonly summary: "Durable, policy-controlled Execution Core orchestration over SQLite and controlled executor ports.";
|
|
@@ -101,5 +100,9 @@ export declare const descriptor: {
|
|
|
101
100
|
readonly id: "overview";
|
|
102
101
|
readonly path: "./README.md";
|
|
103
102
|
readonly description: "Execution Runtime package overview";
|
|
103
|
+
}, {
|
|
104
|
+
readonly id: "configuration";
|
|
105
|
+
readonly path: "./CONFIGURATION.md";
|
|
106
|
+
readonly description: "Module configuration fields, sources and materialization instructions";
|
|
104
107
|
}];
|
|
105
108
|
};
|
|
@@ -3,22 +3,37 @@ 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.
|
|
6
|
+
moduleVersion: "0.1.6",
|
|
7
7
|
kind: "service",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
|
10
|
-
installClass: "core",
|
|
11
10
|
identity: {
|
|
12
11
|
domain: "execution",
|
|
13
12
|
summary: "Durable, policy-controlled Execution Core orchestration over SQLite and controlled executor ports.",
|
|
14
13
|
},
|
|
15
|
-
provides: [
|
|
14
|
+
provides: [
|
|
15
|
+
{
|
|
16
|
+
contractRef: "execution",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
16
20
|
requires: [
|
|
17
|
-
{
|
|
21
|
+
{
|
|
22
|
+
contractRef: "execution-local",
|
|
23
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
24
|
+
},
|
|
18
25
|
],
|
|
19
26
|
requirements: [
|
|
20
|
-
{
|
|
21
|
-
|
|
27
|
+
{
|
|
28
|
+
kind: "runtime",
|
|
29
|
+
runtime: "node",
|
|
30
|
+
versionRange: ">=24.19.0",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
kind: "filesystem",
|
|
34
|
+
path: ".proflow",
|
|
35
|
+
access: "read-write",
|
|
36
|
+
},
|
|
22
37
|
],
|
|
23
38
|
configSlots: [
|
|
24
39
|
{
|
|
@@ -119,5 +134,10 @@ export const descriptor = {
|
|
|
119
134
|
path: "./README.md",
|
|
120
135
|
description: "Execution Runtime package overview",
|
|
121
136
|
},
|
|
137
|
+
{
|
|
138
|
+
id: "configuration",
|
|
139
|
+
path: "./CONFIGURATION.md",
|
|
140
|
+
description: "Module configuration fields, sources and materialization instructions",
|
|
141
|
+
},
|
|
122
142
|
],
|
|
123
143
|
};
|
package/dist/src/cli.js
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
2
|
import { createFormalExecutionRuntimeLifecycle } from "./formal-process.js";
|
|
4
3
|
import { loadExecutionRuntimeProcessConfig } from "./service.js";
|
|
5
|
-
function installSelf() {
|
|
6
|
-
const executable = process.platform === "win32" ? "platform.cmd" : "platform";
|
|
7
|
-
const result = spawnSync(executable, [
|
|
8
|
-
"install",
|
|
9
|
-
"@tomflow/proflow-execution-runtime",
|
|
10
|
-
"--workspace",
|
|
11
|
-
process.cwd(),
|
|
12
|
-
], { cwd: process.cwd(), env: process.env, stdio: "inherit" });
|
|
13
|
-
if (result.error) {
|
|
14
|
-
if (result.error.code === "ENOENT") {
|
|
15
|
-
process.stderr.write("GLOBAL_PLATFORM_CLI_REQUIRED: install @tomflow/proflow-platform-cli globally before package-owned install\n");
|
|
16
|
-
process.exit(127);
|
|
17
|
-
}
|
|
18
|
-
throw result.error;
|
|
19
|
-
}
|
|
20
|
-
process.exit(result.status ?? 1);
|
|
21
|
-
}
|
|
22
4
|
async function main() {
|
|
23
5
|
const [command, configPath] = process.argv.slice(2);
|
|
24
6
|
if (command === "--help" || command === "-h") {
|
|
25
|
-
process.stdout.write("Usage: proflow-execution-runtime
|
|
7
|
+
process.stdout.write("Usage: proflow-execution-runtime start /absolute/config.json\\n");
|
|
26
8
|
process.exit(0);
|
|
27
9
|
}
|
|
28
|
-
if (command === "install") {
|
|
29
|
-
if (configPath)
|
|
30
|
-
throw new Error("Usage: proflow-execution-runtime install");
|
|
31
|
-
installSelf();
|
|
32
|
-
}
|
|
33
10
|
if (command !== "start" || !configPath)
|
|
34
11
|
throw new Error("Usage: proflow-execution-runtime start /absolute/config.json");
|
|
35
12
|
const config = await loadExecutionRuntimeProcessConfig(configPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/proflow-execution-runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -19,16 +19,18 @@
|
|
|
19
19
|
"dist",
|
|
20
20
|
"proflow.module.json",
|
|
21
21
|
"conformance.json",
|
|
22
|
-
"README.md"
|
|
22
|
+
"README.md",
|
|
23
|
+
"CONFIGURATION.md"
|
|
23
24
|
],
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@tomflow/proflow-
|
|
26
|
-
"@tomflow/proflow-execution-
|
|
27
|
-
"@tomflow/proflow-execution-
|
|
28
|
-
"@tomflow/proflow-model-contracts": "^0.1.
|
|
26
|
+
"@tomflow/proflow-module-contract": "^0.1.3",
|
|
27
|
+
"@tomflow/proflow-execution-local": "^0.1.4",
|
|
28
|
+
"@tomflow/proflow-execution-browser-extension": "^0.1.4",
|
|
29
|
+
"@tomflow/proflow-model-contracts": "^0.1.3",
|
|
30
|
+
"@tomflow/proflow-execution-contracts": "^0.1.3"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@tomflow/proflow-deployment-conformance": "^0.1.
|
|
33
|
+
"@tomflow/proflow-deployment-conformance": "^0.1.3"
|
|
32
34
|
},
|
|
33
35
|
"description": "Durable, policy-controlled Execution Core orchestration over SQLite and controlled executor ports.",
|
|
34
36
|
"keywords": [
|
|
@@ -38,15 +40,7 @@
|
|
|
38
40
|
],
|
|
39
41
|
"proflow": {
|
|
40
42
|
"module": true,
|
|
41
|
-
"installClass": "core",
|
|
42
43
|
"descriptor": "./dist/deployment/descriptor.js",
|
|
43
|
-
"installRequires": [
|
|
44
|
-
"@tomflow/proflow-execution-browser-extension",
|
|
45
|
-
"@tomflow/proflow-execution-contracts",
|
|
46
|
-
"@tomflow/proflow-execution-local",
|
|
47
|
-
"@tomflow/proflow-model-contracts",
|
|
48
|
-
"@tomflow/proflow-platform-host"
|
|
49
|
-
],
|
|
50
44
|
"manifest": "./proflow.module.json"
|
|
51
45
|
},
|
|
52
46
|
"scripts": {
|
package/proflow.module.json
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
"contractVersion": "1.0.0",
|
|
4
4
|
"moduleRef": "execution-runtime",
|
|
5
5
|
"packageName": "@tomflow/proflow-execution-runtime",
|
|
6
|
-
"moduleVersion": "0.1.
|
|
6
|
+
"moduleVersion": "0.1.6",
|
|
7
7
|
"kind": "service",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|
|
10
|
-
"installClass": "core",
|
|
11
10
|
"identity": {
|
|
12
11
|
"domain": "execution",
|
|
13
12
|
"summary": "Durable, policy-controlled Execution Core orchestration over SQLite and controlled executor ports."
|
|
@@ -134,6 +133,11 @@
|
|
|
134
133
|
"id": "overview",
|
|
135
134
|
"path": "./README.md",
|
|
136
135
|
"description": "Execution Runtime package overview"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "configuration",
|
|
139
|
+
"path": "./CONFIGURATION.md",
|
|
140
|
+
"description": "Module configuration fields, sources and materialization instructions"
|
|
137
141
|
}
|
|
138
142
|
]
|
|
139
143
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# @tomflow/proflow-execution-runtime
|
|
2
|
-
|
|
3
|
-
## 0.1.4
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Detect an occupied Execution Runtime listener during deployment preflight before start.
|
|
8
|
-
|
|
9
|
-
## 0.1.3
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- Re-probe recoverable identity and model dependencies during Execution Runtime readiness so normal startup order converges without a second manual restart.
|
|
14
|
-
|
|
15
|
-
## 0.1.2
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- Real-1 final remediation and black-box release closure
|
|
20
|
-
|
|
21
|
-
## 0.1.1
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- Close the Real-1 global Platform control-plane contract across every published ProFlow package. Platform CLI now owns one durable global Workspace binding with canonical identity, cross-process operation locking, cwd/`--workspace` install targeting, cross-directory instance commands, whole-instance uninstall/rebind, and deterministic npm/yarn/pnpm Workspace package-manager selection. Every package-owned install entry, including newly generated Module Template packages, delegates to the Shell-global `platform` command and fails closed when that global CLI is unavailable; Deployment Conformance and the formal test plans mechanically enforce the same rule across all 24 packages.
|