@tomflow/proflow-task-migration-runner 0.1.1 → 0.1.3
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 +23 -0
- package/dist/deployment/adapter.d.ts +313 -37
- package/dist/deployment/adapter.js +140 -24
- package/dist/deployment/descriptor.d.ts +5 -2
- package/dist/deployment/descriptor.js +11 -3
- package/dist/src/cli.js +2 -1
- package/package.json +5 -11
- package/proflow.module.json +6 -2
- package/CHANGELOG.md +0 -7
- package/self-install.mjs +0 -34
package/CONFIGURATION.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# task-migration-runner configuration
|
|
2
|
+
|
|
3
|
+
Canonical public config: `.proflow/config/task-migration-runner.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. | Task SQLite database path |
|
|
12
|
+
|
|
13
|
+
## Materialize
|
|
14
|
+
|
|
15
|
+
Create or update the canonical JSON object at:
|
|
16
|
+
|
|
17
|
+
`.proflow/config/task-migration-runner.json`
|
|
18
|
+
|
|
19
|
+
Use only declared keys and string values. Do not create a second Platform configuration database.
|
|
20
|
+
|
|
21
|
+
## Base completion check
|
|
22
|
+
|
|
23
|
+
Run `platform modules`. This Module should no longer report required keys in `missingConfig`. `platform start` performs the authoritative Module-owned validation before starting anything.
|
|
@@ -1,67 +1,343 @@
|
|
|
1
|
+
export declare function createBehaviorAdapter(config?: Record<string, string>): {
|
|
2
|
+
describe: () => {
|
|
3
|
+
result: {
|
|
4
|
+
contract: "deployment.result.v1";
|
|
5
|
+
moduleRef: "task-migration-runner";
|
|
6
|
+
moduleVersion: "0.1.3";
|
|
7
|
+
ok: boolean;
|
|
8
|
+
status: "SUCCEEDED";
|
|
9
|
+
data?: {} | null;
|
|
10
|
+
checks?: unknown[];
|
|
11
|
+
};
|
|
12
|
+
observedEffects: never[];
|
|
13
|
+
};
|
|
14
|
+
preflight: () => {
|
|
15
|
+
result: {
|
|
16
|
+
contract: "deployment.result.v1";
|
|
17
|
+
moduleRef: "task-migration-runner";
|
|
18
|
+
moduleVersion: "0.1.3";
|
|
19
|
+
ok: boolean;
|
|
20
|
+
status: "SUCCEEDED";
|
|
21
|
+
data?: {} | null;
|
|
22
|
+
checks?: unknown[];
|
|
23
|
+
} | {
|
|
24
|
+
contract: "deployment.result.v1";
|
|
25
|
+
moduleRef: "task-migration-runner";
|
|
26
|
+
moduleVersion: "0.1.3";
|
|
27
|
+
ok: boolean;
|
|
28
|
+
status: "ACTION_REQUIRED";
|
|
29
|
+
actionRequired: {
|
|
30
|
+
action: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
data?: {} | null;
|
|
34
|
+
checks?: unknown[];
|
|
35
|
+
};
|
|
36
|
+
observedEffects: never[];
|
|
37
|
+
};
|
|
38
|
+
status: () => {
|
|
39
|
+
result: {
|
|
40
|
+
contract: "deployment.result.v1";
|
|
41
|
+
moduleRef: "task-migration-runner";
|
|
42
|
+
moduleVersion: "0.1.3";
|
|
43
|
+
ok: boolean;
|
|
44
|
+
status: "SUCCEEDED";
|
|
45
|
+
data?: {} | null;
|
|
46
|
+
checks?: unknown[];
|
|
47
|
+
};
|
|
48
|
+
observedEffects: never[];
|
|
49
|
+
};
|
|
50
|
+
verify: () => {
|
|
51
|
+
result: {
|
|
52
|
+
contract: "deployment.result.v1";
|
|
53
|
+
moduleRef: "task-migration-runner";
|
|
54
|
+
moduleVersion: "0.1.3";
|
|
55
|
+
ok: boolean;
|
|
56
|
+
status: "ACTION_REQUIRED";
|
|
57
|
+
actionRequired: {
|
|
58
|
+
action: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
data?: {} | null;
|
|
62
|
+
checks?: unknown[];
|
|
63
|
+
};
|
|
64
|
+
observedEffects: never[];
|
|
65
|
+
} | {
|
|
66
|
+
result: {
|
|
67
|
+
contract: "deployment.result.v1";
|
|
68
|
+
moduleRef: "task-migration-runner";
|
|
69
|
+
moduleVersion: "0.1.3";
|
|
70
|
+
ok: boolean;
|
|
71
|
+
status: "SUCCEEDED";
|
|
72
|
+
data?: {} | null;
|
|
73
|
+
checks?: unknown[];
|
|
74
|
+
} | {
|
|
75
|
+
contract: "deployment.result.v1";
|
|
76
|
+
moduleRef: "task-migration-runner";
|
|
77
|
+
moduleVersion: "0.1.3";
|
|
78
|
+
ok: boolean;
|
|
79
|
+
status: "FAILED";
|
|
80
|
+
error: {
|
|
81
|
+
code: "APPLY_FAILED" | "VERIFY_FAILED";
|
|
82
|
+
message: string;
|
|
83
|
+
retryable: boolean;
|
|
84
|
+
};
|
|
85
|
+
data?: {} | null;
|
|
86
|
+
checks?: unknown[];
|
|
87
|
+
};
|
|
88
|
+
observedEffects: never[];
|
|
89
|
+
};
|
|
90
|
+
doctor: () => {
|
|
91
|
+
result: {
|
|
92
|
+
contract: "deployment.result.v1";
|
|
93
|
+
moduleRef: "task-migration-runner";
|
|
94
|
+
moduleVersion: "0.1.3";
|
|
95
|
+
ok: boolean;
|
|
96
|
+
status: "ACTION_REQUIRED";
|
|
97
|
+
actionRequired: {
|
|
98
|
+
action: string;
|
|
99
|
+
description: string;
|
|
100
|
+
};
|
|
101
|
+
data?: {} | null;
|
|
102
|
+
checks?: unknown[];
|
|
103
|
+
};
|
|
104
|
+
observedEffects: never[];
|
|
105
|
+
} | {
|
|
106
|
+
result: {
|
|
107
|
+
contract: "deployment.result.v1";
|
|
108
|
+
moduleRef: "task-migration-runner";
|
|
109
|
+
moduleVersion: "0.1.3";
|
|
110
|
+
ok: boolean;
|
|
111
|
+
status: "SUCCEEDED";
|
|
112
|
+
data?: {} | null;
|
|
113
|
+
checks?: unknown[];
|
|
114
|
+
} | {
|
|
115
|
+
contract: "deployment.result.v1";
|
|
116
|
+
moduleRef: "task-migration-runner";
|
|
117
|
+
moduleVersion: "0.1.3";
|
|
118
|
+
ok: boolean;
|
|
119
|
+
status: "BLOCKED";
|
|
120
|
+
error: {
|
|
121
|
+
code: "VERIFY_FAILED";
|
|
122
|
+
message: string;
|
|
123
|
+
retryable: boolean;
|
|
124
|
+
};
|
|
125
|
+
data?: {} | null;
|
|
126
|
+
};
|
|
127
|
+
observedEffects: never[];
|
|
128
|
+
};
|
|
129
|
+
migrate: () => {
|
|
130
|
+
result: {
|
|
131
|
+
contract: "deployment.result.v1";
|
|
132
|
+
moduleRef: "task-migration-runner";
|
|
133
|
+
moduleVersion: "0.1.3";
|
|
134
|
+
ok: boolean;
|
|
135
|
+
status: "ACTION_REQUIRED";
|
|
136
|
+
actionRequired: {
|
|
137
|
+
action: string;
|
|
138
|
+
description: string;
|
|
139
|
+
};
|
|
140
|
+
data?: {} | null;
|
|
141
|
+
checks?: unknown[];
|
|
142
|
+
};
|
|
143
|
+
observedEffects: never[];
|
|
144
|
+
} | {
|
|
145
|
+
result: {
|
|
146
|
+
contract: "deployment.result.v1";
|
|
147
|
+
moduleRef: "task-migration-runner";
|
|
148
|
+
moduleVersion: "0.1.3";
|
|
149
|
+
ok: boolean;
|
|
150
|
+
status: "SUCCEEDED";
|
|
151
|
+
data?: {} | null;
|
|
152
|
+
checks?: unknown[];
|
|
153
|
+
} | {
|
|
154
|
+
contract: "deployment.result.v1";
|
|
155
|
+
moduleRef: "task-migration-runner";
|
|
156
|
+
moduleVersion: "0.1.3";
|
|
157
|
+
ok: boolean;
|
|
158
|
+
status: "FAILED";
|
|
159
|
+
error: {
|
|
160
|
+
code: "APPLY_FAILED" | "VERIFY_FAILED";
|
|
161
|
+
message: string;
|
|
162
|
+
retryable: boolean;
|
|
163
|
+
};
|
|
164
|
+
data?: {} | null;
|
|
165
|
+
checks?: unknown[];
|
|
166
|
+
};
|
|
167
|
+
observedEffects: string[];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
1
170
|
export declare const behaviorAdapter: {
|
|
2
|
-
|
|
171
|
+
describe: () => {
|
|
3
172
|
result: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
173
|
+
contract: "deployment.result.v1";
|
|
174
|
+
moduleRef: "task-migration-runner";
|
|
175
|
+
moduleVersion: "0.1.3";
|
|
176
|
+
ok: boolean;
|
|
177
|
+
status: "SUCCEEDED";
|
|
178
|
+
data?: {} | null;
|
|
179
|
+
checks?: unknown[];
|
|
9
180
|
};
|
|
10
181
|
observedEffects: never[];
|
|
11
182
|
};
|
|
12
|
-
|
|
183
|
+
preflight: () => {
|
|
13
184
|
result: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
185
|
+
contract: "deployment.result.v1";
|
|
186
|
+
moduleRef: "task-migration-runner";
|
|
187
|
+
moduleVersion: "0.1.3";
|
|
188
|
+
ok: boolean;
|
|
189
|
+
status: "SUCCEEDED";
|
|
190
|
+
data?: {} | null;
|
|
191
|
+
checks?: unknown[];
|
|
192
|
+
} | {
|
|
193
|
+
contract: "deployment.result.v1";
|
|
194
|
+
moduleRef: "task-migration-runner";
|
|
195
|
+
moduleVersion: "0.1.3";
|
|
196
|
+
ok: boolean;
|
|
197
|
+
status: "ACTION_REQUIRED";
|
|
198
|
+
actionRequired: {
|
|
199
|
+
action: string;
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
data?: {} | null;
|
|
203
|
+
checks?: unknown[];
|
|
19
204
|
};
|
|
20
205
|
observedEffects: never[];
|
|
21
206
|
};
|
|
22
|
-
|
|
207
|
+
status: () => {
|
|
23
208
|
result: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
209
|
+
contract: "deployment.result.v1";
|
|
210
|
+
moduleRef: "task-migration-runner";
|
|
211
|
+
moduleVersion: "0.1.3";
|
|
212
|
+
ok: boolean;
|
|
213
|
+
status: "SUCCEEDED";
|
|
214
|
+
data?: {} | null;
|
|
215
|
+
checks?: unknown[];
|
|
29
216
|
};
|
|
30
217
|
observedEffects: never[];
|
|
31
218
|
};
|
|
32
|
-
|
|
219
|
+
verify: () => {
|
|
33
220
|
result: {
|
|
34
221
|
contract: "deployment.result.v1";
|
|
35
|
-
|
|
222
|
+
moduleRef: "task-migration-runner";
|
|
223
|
+
moduleVersion: "0.1.3";
|
|
224
|
+
ok: boolean;
|
|
225
|
+
status: "ACTION_REQUIRED";
|
|
226
|
+
actionRequired: {
|
|
227
|
+
action: string;
|
|
228
|
+
description: string;
|
|
229
|
+
};
|
|
230
|
+
data?: {} | null;
|
|
231
|
+
checks?: unknown[];
|
|
232
|
+
};
|
|
233
|
+
observedEffects: never[];
|
|
234
|
+
} | {
|
|
235
|
+
result: {
|
|
236
|
+
contract: "deployment.result.v1";
|
|
237
|
+
moduleRef: "task-migration-runner";
|
|
238
|
+
moduleVersion: "0.1.3";
|
|
239
|
+
ok: boolean;
|
|
36
240
|
status: "SUCCEEDED";
|
|
241
|
+
data?: {} | null;
|
|
242
|
+
checks?: unknown[];
|
|
243
|
+
} | {
|
|
244
|
+
contract: "deployment.result.v1";
|
|
37
245
|
moduleRef: "task-migration-runner";
|
|
38
|
-
moduleVersion: "0.1.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
246
|
+
moduleVersion: "0.1.3";
|
|
247
|
+
ok: boolean;
|
|
248
|
+
status: "FAILED";
|
|
249
|
+
error: {
|
|
250
|
+
code: "APPLY_FAILED" | "VERIFY_FAILED";
|
|
42
251
|
message: string;
|
|
43
|
-
|
|
252
|
+
retryable: boolean;
|
|
253
|
+
};
|
|
254
|
+
data?: {} | null;
|
|
255
|
+
checks?: unknown[];
|
|
44
256
|
};
|
|
45
257
|
observedEffects: never[];
|
|
46
258
|
};
|
|
47
|
-
|
|
259
|
+
doctor: () => {
|
|
48
260
|
result: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
261
|
+
contract: "deployment.result.v1";
|
|
262
|
+
moduleRef: "task-migration-runner";
|
|
263
|
+
moduleVersion: "0.1.3";
|
|
264
|
+
ok: boolean;
|
|
265
|
+
status: "ACTION_REQUIRED";
|
|
266
|
+
actionRequired: {
|
|
267
|
+
action: string;
|
|
268
|
+
description: string;
|
|
269
|
+
};
|
|
270
|
+
data?: {} | null;
|
|
271
|
+
checks?: unknown[];
|
|
272
|
+
};
|
|
273
|
+
observedEffects: never[];
|
|
274
|
+
} | {
|
|
275
|
+
result: {
|
|
276
|
+
contract: "deployment.result.v1";
|
|
277
|
+
moduleRef: "task-migration-runner";
|
|
278
|
+
moduleVersion: "0.1.3";
|
|
279
|
+
ok: boolean;
|
|
280
|
+
status: "SUCCEEDED";
|
|
281
|
+
data?: {} | null;
|
|
282
|
+
checks?: unknown[];
|
|
283
|
+
} | {
|
|
284
|
+
contract: "deployment.result.v1";
|
|
285
|
+
moduleRef: "task-migration-runner";
|
|
286
|
+
moduleVersion: "0.1.3";
|
|
287
|
+
ok: boolean;
|
|
288
|
+
status: "BLOCKED";
|
|
289
|
+
error: {
|
|
290
|
+
code: "VERIFY_FAILED";
|
|
291
|
+
message: string;
|
|
292
|
+
retryable: boolean;
|
|
293
|
+
};
|
|
294
|
+
data?: {} | null;
|
|
54
295
|
};
|
|
55
296
|
observedEffects: never[];
|
|
56
297
|
};
|
|
57
|
-
|
|
298
|
+
migrate: () => {
|
|
58
299
|
result: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
300
|
+
contract: "deployment.result.v1";
|
|
301
|
+
moduleRef: "task-migration-runner";
|
|
302
|
+
moduleVersion: "0.1.3";
|
|
303
|
+
ok: boolean;
|
|
304
|
+
status: "ACTION_REQUIRED";
|
|
305
|
+
actionRequired: {
|
|
306
|
+
action: string;
|
|
307
|
+
description: string;
|
|
308
|
+
};
|
|
309
|
+
data?: {} | null;
|
|
310
|
+
checks?: unknown[];
|
|
311
|
+
};
|
|
312
|
+
observedEffects: never[];
|
|
313
|
+
} | {
|
|
314
|
+
result: {
|
|
315
|
+
contract: "deployment.result.v1";
|
|
316
|
+
moduleRef: "task-migration-runner";
|
|
317
|
+
moduleVersion: "0.1.3";
|
|
318
|
+
ok: boolean;
|
|
319
|
+
status: "SUCCEEDED";
|
|
320
|
+
data?: {} | null;
|
|
321
|
+
checks?: unknown[];
|
|
322
|
+
} | {
|
|
323
|
+
contract: "deployment.result.v1";
|
|
324
|
+
moduleRef: "task-migration-runner";
|
|
325
|
+
moduleVersion: "0.1.3";
|
|
326
|
+
ok: boolean;
|
|
327
|
+
status: "FAILED";
|
|
328
|
+
error: {
|
|
329
|
+
code: "APPLY_FAILED" | "VERIFY_FAILED";
|
|
330
|
+
message: string;
|
|
331
|
+
retryable: boolean;
|
|
332
|
+
};
|
|
333
|
+
data?: {} | null;
|
|
334
|
+
checks?: unknown[];
|
|
64
335
|
};
|
|
65
336
|
observedEffects: string[];
|
|
66
337
|
};
|
|
67
338
|
};
|
|
339
|
+
export declare function createProductionBinding(input: {
|
|
340
|
+
config: Record<string, string>;
|
|
341
|
+
}): {
|
|
342
|
+
behaviorAdapter: Record<string, unknown>;
|
|
343
|
+
};
|
|
@@ -1,31 +1,147 @@
|
|
|
1
|
+
import { observeDeclaredModuleStatus } from "@tomflow/proflow-module-contract";
|
|
2
|
+
import { taskMigrations } from "@tomflow/proflow-task-store-sqlite/migrations";
|
|
3
|
+
import { applyMigrations, getMigrationStatus, verifyMigrations, } from "../src/index.js";
|
|
1
4
|
import { descriptor } from "./descriptor.js";
|
|
2
|
-
const
|
|
5
|
+
const base = {
|
|
3
6
|
contract: "deployment.result.v1",
|
|
4
|
-
ok: true,
|
|
5
|
-
status: "SUCCEEDED",
|
|
6
7
|
moduleRef: descriptor.moduleRef,
|
|
7
8
|
moduleVersion: descriptor.moduleVersion,
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
status:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const success = (data, checks) => ({
|
|
11
|
+
...base,
|
|
12
|
+
ok: true,
|
|
13
|
+
status: "SUCCEEDED",
|
|
14
|
+
...(data === undefined ? {} : { data }),
|
|
15
|
+
...(checks === undefined ? {} : { checks }),
|
|
16
|
+
});
|
|
17
|
+
const actionRequired = (description, data, checks) => ({
|
|
18
|
+
...base,
|
|
19
|
+
ok: false,
|
|
20
|
+
status: "ACTION_REQUIRED",
|
|
21
|
+
actionRequired: { action: "configure-task-migrations", description },
|
|
22
|
+
...(data === undefined ? {} : { data }),
|
|
23
|
+
...(checks === undefined ? {} : { checks }),
|
|
24
|
+
});
|
|
25
|
+
const failed = (message, data, checks, code = "APPLY_FAILED") => ({
|
|
26
|
+
...base,
|
|
27
|
+
ok: false,
|
|
28
|
+
status: "FAILED",
|
|
29
|
+
error: { code, message, retryable: false },
|
|
30
|
+
...(data === undefined ? {} : { data }),
|
|
31
|
+
...(checks === undefined ? {} : { checks }),
|
|
32
|
+
});
|
|
33
|
+
const blocked = (message, data) => ({
|
|
34
|
+
...base,
|
|
35
|
+
ok: false,
|
|
36
|
+
status: "BLOCKED",
|
|
37
|
+
error: { code: "VERIFY_FAILED", message, retryable: true },
|
|
38
|
+
...(data === undefined ? {} : { data }),
|
|
39
|
+
});
|
|
40
|
+
function migrationInput(config) {
|
|
41
|
+
const databasePath = config.databasePath;
|
|
42
|
+
if (!databasePath)
|
|
43
|
+
return undefined;
|
|
44
|
+
return { databasePath, migrations: taskMigrations };
|
|
45
|
+
}
|
|
46
|
+
function statusData(config) {
|
|
47
|
+
const input = migrationInput(config);
|
|
48
|
+
if (input === undefined)
|
|
49
|
+
return undefined;
|
|
50
|
+
const status = getMigrationStatus(input);
|
|
51
|
+
const verification = verifyMigrations(input);
|
|
52
|
+
return {
|
|
53
|
+
migrated: verification.ok,
|
|
54
|
+
appliedVersions: status.appliedVersions,
|
|
55
|
+
pendingVersions: status.pendingVersions,
|
|
56
|
+
metadataDrift: status.metadataDrift,
|
|
57
|
+
checksumDrift: status.checksumDrift,
|
|
58
|
+
legacyMetadataVersions: status.legacyMetadataVersions,
|
|
59
|
+
missingTables: status.missingTables,
|
|
60
|
+
schemaDrift: status.schemaDrift,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function createBehaviorAdapter(config = {}) {
|
|
64
|
+
return {
|
|
65
|
+
describe: () => ({ result: success(), observedEffects: [] }),
|
|
66
|
+
preflight: () => ({
|
|
67
|
+
result: migrationInput(config) === undefined
|
|
68
|
+
? actionRequired("databasePath is required for Task migrations")
|
|
69
|
+
: success(),
|
|
70
|
+
observedEffects: [],
|
|
71
|
+
}),
|
|
72
|
+
status: () => ({
|
|
73
|
+
result: success(observeDeclaredModuleStatus(descriptor, config, "STOPPED")),
|
|
74
|
+
observedEffects: [],
|
|
75
|
+
}),
|
|
76
|
+
verify: () => {
|
|
77
|
+
const input = migrationInput(config);
|
|
78
|
+
if (input === undefined) {
|
|
79
|
+
const check = {
|
|
18
80
|
id: "migration-state-pass",
|
|
19
|
-
status: "
|
|
20
|
-
message: "
|
|
21
|
-
}
|
|
22
|
-
|
|
81
|
+
status: "FAIL",
|
|
82
|
+
message: "databasePath is required for Task migration verification",
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
result: actionRequired(check.message, undefined, [check]),
|
|
86
|
+
observedEffects: [],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const verification = verifyMigrations(input);
|
|
90
|
+
const data = statusData(config);
|
|
91
|
+
const check = {
|
|
92
|
+
id: "migration-state-pass",
|
|
93
|
+
status: verification.ok ? "PASS" : "FAIL",
|
|
94
|
+
message: verification.ok
|
|
95
|
+
? "Task migration state and SQLite integrity match the current schema"
|
|
96
|
+
: (verification.error?.message ??
|
|
97
|
+
"Task migration verification failed"),
|
|
98
|
+
};
|
|
99
|
+
return {
|
|
100
|
+
result: verification.ok
|
|
101
|
+
? success(data, [check])
|
|
102
|
+
: failed(check.message, data, [check], "VERIFY_FAILED"),
|
|
103
|
+
observedEffects: [],
|
|
104
|
+
};
|
|
23
105
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
106
|
+
doctor: () => {
|
|
107
|
+
const data = statusData(config);
|
|
108
|
+
if (data === undefined) {
|
|
109
|
+
return {
|
|
110
|
+
result: actionRequired("databasePath is required for Task migration diagnostics"),
|
|
111
|
+
observedEffects: [],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
result: data.migrated
|
|
116
|
+
? success(data)
|
|
117
|
+
: blocked("Task migration state requires a repair/migration plan before readiness", data),
|
|
118
|
+
observedEffects: [],
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
migrate: () => {
|
|
122
|
+
const input = migrationInput(config);
|
|
123
|
+
if (input === undefined) {
|
|
124
|
+
return {
|
|
125
|
+
result: actionRequired("databasePath is required before Task migrations can run"),
|
|
126
|
+
observedEffects: [],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
const migration = applyMigrations(input);
|
|
130
|
+
return {
|
|
131
|
+
result: migration.ok
|
|
132
|
+
? success({ applied: migration.applied, pending: migration.pending })
|
|
133
|
+
: failed(migration.error?.message ?? "Task migration failed", {
|
|
134
|
+
applied: migration.applied,
|
|
135
|
+
pending: migration.pending,
|
|
136
|
+
}),
|
|
137
|
+
observedEffects: migration.ok
|
|
138
|
+
? ["Applies Task Store migration SQL to SQLite"]
|
|
139
|
+
: [],
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export const behaviorAdapter = createBehaviorAdapter();
|
|
145
|
+
export function createProductionBinding(input) {
|
|
146
|
+
return { behaviorAdapter: createBehaviorAdapter(input.config) };
|
|
147
|
+
}
|
|
@@ -3,11 +3,10 @@ export declare const descriptor: {
|
|
|
3
3
|
readonly contractVersion: "1.0.0";
|
|
4
4
|
readonly moduleRef: "task-migration-runner";
|
|
5
5
|
readonly packageName: "@tomflow/proflow-task-migration-runner";
|
|
6
|
-
readonly moduleVersion: "0.1.
|
|
6
|
+
readonly moduleVersion: "0.1.3";
|
|
7
7
|
readonly kind: "cli";
|
|
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: "task-orchestration";
|
|
13
12
|
readonly summary: "Deterministically discovers, applies and verifies Task Store SQLite schema migrations.";
|
|
@@ -44,5 +43,9 @@ export declare const descriptor: {
|
|
|
44
43
|
readonly id: "overview";
|
|
45
44
|
readonly path: "./README.md";
|
|
46
45
|
readonly description: "Package-owned module overview";
|
|
46
|
+
}, {
|
|
47
|
+
readonly id: "configuration";
|
|
48
|
+
readonly path: "./CONFIGURATION.md";
|
|
49
|
+
readonly description: "Module configuration fields, sources and materialization instructions";
|
|
47
50
|
}];
|
|
48
51
|
};
|
|
@@ -3,11 +3,10 @@ export const descriptor = {
|
|
|
3
3
|
contractVersion: "1.0.0",
|
|
4
4
|
moduleRef: "task-migration-runner",
|
|
5
5
|
packageName: "@tomflow/proflow-task-migration-runner",
|
|
6
|
-
moduleVersion: "0.1.
|
|
6
|
+
moduleVersion: "0.1.3",
|
|
7
7
|
kind: "cli",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
|
10
|
-
installClass: "core",
|
|
11
10
|
identity: {
|
|
12
11
|
domain: "task-orchestration",
|
|
13
12
|
summary: "Deterministically discovers, applies and verifies Task Store SQLite schema migrations.",
|
|
@@ -15,7 +14,11 @@ export const descriptor = {
|
|
|
15
14
|
provides: [],
|
|
16
15
|
requires: [],
|
|
17
16
|
requirements: [
|
|
18
|
-
{
|
|
17
|
+
{
|
|
18
|
+
kind: "runtime",
|
|
19
|
+
runtime: "node",
|
|
20
|
+
versionRange: ">=24.19.0",
|
|
21
|
+
},
|
|
19
22
|
],
|
|
20
23
|
configSlots: [
|
|
21
24
|
{
|
|
@@ -57,5 +60,10 @@ export const descriptor = {
|
|
|
57
60
|
path: "./README.md",
|
|
58
61
|
description: "Package-owned module overview",
|
|
59
62
|
},
|
|
63
|
+
{
|
|
64
|
+
id: "configuration",
|
|
65
|
+
path: "./CONFIGURATION.md",
|
|
66
|
+
description: "Module configuration fields, sources and materialization instructions",
|
|
67
|
+
},
|
|
60
68
|
],
|
|
61
69
|
};
|
package/dist/src/cli.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
2
3
|
import { pathToFileURL } from "node:url";
|
|
3
4
|
import { runCli } from "./index.js";
|
|
4
5
|
export { runCli } from "./index.js";
|
|
5
6
|
if (process.argv[1] !== undefined &&
|
|
6
|
-
import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
7
|
+
import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
|
|
7
8
|
const output = await runCli(process.argv.slice(2));
|
|
8
9
|
process.stdout.write(`${output}\n`);
|
|
9
10
|
if (JSON.parse(output).ok !== true)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/proflow-task-migration-runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,19 +12,18 @@
|
|
|
12
12
|
"./deployment/descriptor": "./dist/deployment/descriptor.js"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"proflow-task-migrate": "./dist/src/cli.js"
|
|
16
|
-
"proflow-task-migration-runner": "./self-install.mjs"
|
|
15
|
+
"proflow-task-migrate": "./dist/src/cli.js"
|
|
17
16
|
},
|
|
18
17
|
"files": [
|
|
19
18
|
"dist",
|
|
20
19
|
"proflow.module.json",
|
|
21
20
|
"conformance.json",
|
|
22
21
|
"README.md",
|
|
23
|
-
"
|
|
22
|
+
"CONFIGURATION.md"
|
|
24
23
|
],
|
|
25
24
|
"dependencies": {
|
|
26
|
-
"@tomflow/proflow-task-store-sqlite": "^0.1.
|
|
27
|
-
"@tomflow/proflow-module-contract": "^0.1.
|
|
25
|
+
"@tomflow/proflow-task-store-sqlite": "^0.1.3",
|
|
26
|
+
"@tomflow/proflow-module-contract": "^0.1.2"
|
|
28
27
|
},
|
|
29
28
|
"description": "Deterministically discovers, applies and verifies Task Store SQLite schema migrations.",
|
|
30
29
|
"keywords": [
|
|
@@ -34,11 +33,6 @@
|
|
|
34
33
|
],
|
|
35
34
|
"proflow": {
|
|
36
35
|
"module": true,
|
|
37
|
-
"installClass": "core",
|
|
38
|
-
"installRequires": [
|
|
39
|
-
"@tomflow/proflow-module-contract",
|
|
40
|
-
"@tomflow/proflow-task-store-sqlite"
|
|
41
|
-
],
|
|
42
36
|
"descriptor": "./dist/deployment/descriptor.js",
|
|
43
37
|
"manifest": "./proflow.module.json"
|
|
44
38
|
},
|
package/proflow.module.json
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
"contractVersion": "1.0.0",
|
|
4
4
|
"moduleRef": "task-migration-runner",
|
|
5
5
|
"packageName": "@tomflow/proflow-task-migration-runner",
|
|
6
|
-
"moduleVersion": "0.1.
|
|
6
|
+
"moduleVersion": "0.1.3",
|
|
7
7
|
"kind": "cli",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|
|
10
|
-
"installClass": "core",
|
|
11
10
|
"identity": {
|
|
12
11
|
"domain": "task-orchestration",
|
|
13
12
|
"summary": "Deterministically discovers, applies and verifies Task Store SQLite schema migrations."
|
|
@@ -60,6 +59,11 @@
|
|
|
60
59
|
"id": "overview",
|
|
61
60
|
"path": "./README.md",
|
|
62
61
|
"description": "Package-owned module overview"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "configuration",
|
|
65
|
+
"path": "./CONFIGURATION.md",
|
|
66
|
+
"description": "Module configuration fields, sources and materialization instructions"
|
|
63
67
|
}
|
|
64
68
|
]
|
|
65
69
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# @tomflow/proflow-task-migration-runner
|
|
2
|
-
|
|
3
|
-
## 0.1.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 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.
|
package/self-install.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
|
|
4
|
-
const [command, ...rest] = process.argv.slice(2);
|
|
5
|
-
const usage = "Usage: npx @tomflow/proflow-task-migration-runner install\n";
|
|
6
|
-
if (command === "--help" || command === "-h") {
|
|
7
|
-
process.stdout.write(usage);
|
|
8
|
-
process.exit(0);
|
|
9
|
-
}
|
|
10
|
-
if (command !== "install" || rest.length > 0) {
|
|
11
|
-
process.stderr.write(usage);
|
|
12
|
-
process.exit(2);
|
|
13
|
-
}
|
|
14
|
-
const executable = process.platform === "win32" ? "platform.cmd" : "platform";
|
|
15
|
-
const result = spawnSync(
|
|
16
|
-
executable,
|
|
17
|
-
[
|
|
18
|
-
"install",
|
|
19
|
-
"@tomflow/proflow-task-migration-runner",
|
|
20
|
-
"--workspace",
|
|
21
|
-
process.cwd(),
|
|
22
|
-
],
|
|
23
|
-
{ cwd: process.cwd(), env: process.env, stdio: "inherit" },
|
|
24
|
-
);
|
|
25
|
-
if (result.error) {
|
|
26
|
-
if (result.error.code === "ENOENT") {
|
|
27
|
-
process.stderr.write(
|
|
28
|
-
"GLOBAL_PLATFORM_CLI_REQUIRED: install @tomflow/proflow-platform-cli globally before package-owned install\n",
|
|
29
|
-
);
|
|
30
|
-
process.exit(127);
|
|
31
|
-
}
|
|
32
|
-
throw result.error;
|
|
33
|
-
}
|
|
34
|
-
process.exit(result.status ?? 1);
|