workspai 0.63.0 → 0.64.0
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/contracts/create-planner-capabilities.v1.json +251 -8
- package/dist/analyze-NUGNB256.js +1 -0
- package/dist/autopilot-release-TWJWSVVF.js +1 -0
- package/dist/capabilities-command-LHM3XIS6.js +1 -0
- package/dist/chunk-2VJUAKMS.js +2 -0
- package/dist/{chunk-O6R7SE6Y.js → chunk-3A23KJAQ.js} +1 -1
- package/dist/{chunk-QA62UOE4.js → chunk-5B2GAZAC.js} +1 -1
- package/dist/{chunk-PPQL5UTI.js → chunk-6DAQ7PYT.js} +1 -1
- package/dist/{chunk-HS3DJMU5.js → chunk-6TBTMWNA.js} +1 -1
- package/dist/{chunk-ODJAKGQF.js → chunk-CCAXADKP.js} +26 -26
- package/dist/chunk-CJHWKXDN.js +1 -0
- package/dist/{chunk-NBJ6AP7K.js → chunk-CT4IODPG.js} +1 -1
- package/dist/{chunk-Z5L2IK54.js → chunk-DK6JNE6K.js} +1 -1
- package/dist/{chunk-J5OMC4RZ.js → chunk-DOXNVBX6.js} +1 -1
- package/dist/{chunk-A4BK7C7M.js → chunk-DWB2RRF4.js} +1 -1
- package/dist/{chunk-QB3BLYUR.js → chunk-FQSBOLM7.js} +1 -1
- package/dist/chunk-GQSRNUCU.js +105 -0
- package/dist/chunk-ISOOENLW.js +8 -0
- package/dist/chunk-J7RU5WR5.js +2 -0
- package/dist/{chunk-DIJGQUEV.js → chunk-JQLJBK5N.js} +1 -1
- package/dist/chunk-KANAJH65.js +681 -0
- package/dist/{chunk-2LLMKTMO.js → chunk-KJXMLBSY.js} +1 -1
- package/dist/{chunk-VRQLHCE2.js → chunk-KV6PS54A.js} +1 -1
- package/dist/{chunk-GPOZILMY.js → chunk-L22EABIC.js} +1 -1
- package/dist/{chunk-GPGEJVVO.js → chunk-NHTDPXTW.js} +1 -1
- package/dist/{chunk-KG3TUTXU.js → chunk-Q2WF7D5U.js} +1 -1
- package/dist/chunk-RGNCL5OB.js +1 -0
- package/dist/{chunk-TVCJKE2U.js → chunk-RSG2GJXT.js} +1 -1
- package/dist/{chunk-KCJ3VS6R.js → chunk-SFO5GVRT.js} +1 -1
- package/dist/{chunk-GXPOT3A7.js → chunk-TOYN76K4.js} +1 -1
- package/dist/{chunk-W3HXTCSY.js → chunk-UXEO5QCF.js} +1 -1
- package/dist/{chunk-QQU536KA.js → chunk-VB6I52ZT.js} +3 -3
- package/dist/{chunk-QJCCZLOF.js → chunk-VRGEPPUB.js} +1 -1
- package/dist/{chunk-TTQVOCG6.js → chunk-WY4DOMEA.js} +1 -1
- package/dist/{chunk-ZCPT6KC3.js → chunk-XKDR5BGS.js} +6 -6
- package/dist/{chunk-E4LJ3PQD.js → chunk-ZGS5NKEO.js} +1 -1
- package/dist/{chunk-UIBBSKJ3.js → chunk-ZH7CXQH3.js} +32 -32
- package/dist/create-PWJDTKDN.js +1 -0
- package/dist/{doctor-LDZ7BIU3.js → doctor-CGXY4IDE.js} +1 -1
- package/dist/{goal-lifecycle-HAWBRYDF.js → goal-lifecycle-BRFFTIU2.js} +1 -1
- package/dist/{goal-pack-HNQHQFRW.js → goal-pack-FG3QDNQH.js} +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +194 -190
- package/dist/{pipeline-TWHWU6GP.js → pipeline-DF4UIHAD.js} +1 -1
- package/dist/{platform-capabilities-PR6YL4KC.js → platform-capabilities-DB4BZPTD.js} +1 -1
- package/dist/{project-agent-entry-YFRLKNOB.js → project-agent-entry-IWUCV72J.js} +1 -1
- package/dist/{project-intelligence-lens-VWBLAGQ7.js → project-intelligence-lens-PZPPSCUW.js} +1 -1
- package/dist/{project-test-coverage-E2Q4QL44.js → project-test-coverage-4S7MEQ6T.js} +1 -1
- package/dist/{pythonRapidkitExec-4YTAMLBD.js → pythonRapidkitExec-VAW5XE4Z.js} +1 -1
- package/dist/{verified-goal-Y4NTKSWH.js → verified-goal-BBHZRYYH.js} +1 -1
- package/dist/{workspace-XWKEBPS3.js → workspace-35Q2IXAR.js} +1 -1
- package/dist/{workspace-agent-sync-FQU6VIEU.js → workspace-agent-sync-FFNSW2PD.js} +1 -1
- package/dist/{workspace-context-DPDGFTWJ.js → workspace-context-IJ36ZP6G.js} +1 -1
- package/dist/{workspace-contract-3BWIRSVQ.js → workspace-contract-JS4LZZQZ.js} +1 -1
- package/dist/{workspace-explain-OU2PEVYO.js → workspace-explain-TITIT5XN.js} +1 -1
- package/dist/workspace-foundation-GMGDUMPR.js +1 -0
- package/dist/{workspace-graph-stream-XTSDKRLM.js → workspace-graph-stream-7UU2YVHC.js} +1 -1
- package/dist/{workspace-intelligence-625UN27X.js → workspace-intelligence-5NO4K5SC.js} +1 -1
- package/dist/{workspace-intelligence-runner-YQWX5VAM.js → workspace-intelligence-runner-FGEBFVVM.js} +1 -1
- package/dist/{workspace-knowledge-graph-3ZBPSAS7.js → workspace-knowledge-graph-RSDP2E36.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-3FJHH5IK.js +1 -0
- package/dist/{workspace-mcp-serve-PYKYJIE6.js → workspace-mcp-serve-WUIQ2AE6.js} +1 -1
- package/dist/{workspace-model-ETCLINRB.js → workspace-model-OKY4CQ3X.js} +1 -1
- package/dist/{workspace-onboarding-DRFJWRLH.js → workspace-onboarding-VS3YYNGK.js} +1 -1
- package/dist/{workspace-registry-summary-VSOBKAJG.js → workspace-registry-summary-MIDFG6EC.js} +1 -1
- package/dist/{workspace-repair-engine-XZLHR27V.js → workspace-repair-engine-VUBT77Y7.js} +1 -1
- package/dist/workspace-run-SSF6Z26G.js +1 -0
- package/dist/{workspace-verify-7ENGIY4S.js → workspace-verify-4R7QHUPO.js} +1 -1
- package/dist/{workspace-watch-2YFSB2WL.js → workspace-watch-IOPSHQS5.js} +1 -1
- package/docs/ci-workflows.md +1 -1
- package/docs/creating-workspaces-and-projects.md +49 -8
- package/docs/real-world-qualification.md +7 -0
- package/package.json +1 -1
- package/dist/analyze-K6JDMF5C.js +0 -1
- package/dist/autopilot-release-NUQKFKKK.js +0 -1
- package/dist/capabilities-command-VBLZXP2T.js +0 -1
- package/dist/chunk-NA2NXX5P.js +0 -1
- package/dist/chunk-NVQUBUTY.js +0 -2
- package/dist/chunk-PTNLVI62.js +0 -16
- package/dist/chunk-RJIYCDVC.js +0 -1
- package/dist/chunk-SCP5LJNO.js +0 -2
- package/dist/chunk-TFOOSYGO.js +0 -8
- package/dist/chunk-UDXFUASA.js +0 -691
- package/dist/create-2VELRQAX.js +0 -1
- package/dist/workspace-foundation-MHKSQDKT.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-ZI4W735H.js +0 -1
- package/dist/workspace-run-YXI5L466.js +0 -1
|
@@ -19,81 +19,97 @@
|
|
|
19
19
|
"id": "fastapi.standard",
|
|
20
20
|
"runtime": "python",
|
|
21
21
|
"framework": "fastapi",
|
|
22
|
+
"plannerFramework": "fastapi",
|
|
22
23
|
"category": "backend",
|
|
23
24
|
"owner": "core",
|
|
24
25
|
"stability": "stable",
|
|
25
26
|
"versionPolicy": "tested-baseline",
|
|
26
|
-
"moduleSupport": true
|
|
27
|
+
"moduleSupport": true,
|
|
28
|
+
"workspacePythonEngine": "required"
|
|
27
29
|
},
|
|
28
30
|
{
|
|
29
31
|
"id": "fastapi.ddd",
|
|
30
32
|
"runtime": "python",
|
|
31
33
|
"framework": "fastapi",
|
|
34
|
+
"plannerFramework": "fastapi",
|
|
32
35
|
"category": "backend",
|
|
33
36
|
"owner": "core",
|
|
34
37
|
"stability": "stable",
|
|
35
38
|
"versionPolicy": "tested-baseline",
|
|
36
|
-
"moduleSupport": true
|
|
39
|
+
"moduleSupport": true,
|
|
40
|
+
"workspacePythonEngine": "required"
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
43
|
"id": "nestjs.standard",
|
|
40
44
|
"runtime": "node",
|
|
41
45
|
"framework": "nestjs",
|
|
46
|
+
"plannerFramework": "nestjs",
|
|
42
47
|
"category": "backend",
|
|
43
48
|
"owner": "core",
|
|
44
49
|
"stability": "stable",
|
|
45
50
|
"versionPolicy": "tested-baseline",
|
|
46
|
-
"moduleSupport": true
|
|
51
|
+
"moduleSupport": true,
|
|
52
|
+
"workspacePythonEngine": "optional"
|
|
47
53
|
},
|
|
48
54
|
{
|
|
49
55
|
"id": "springboot.standard",
|
|
50
56
|
"runtime": "java",
|
|
51
57
|
"framework": "springboot",
|
|
58
|
+
"plannerFramework": "springboot",
|
|
52
59
|
"category": "backend",
|
|
53
60
|
"owner": "npm",
|
|
54
61
|
"stability": "stable",
|
|
55
62
|
"versionPolicy": "tested-baseline",
|
|
56
|
-
"moduleSupport": false
|
|
63
|
+
"moduleSupport": false,
|
|
64
|
+
"workspacePythonEngine": "none"
|
|
57
65
|
},
|
|
58
66
|
{
|
|
59
67
|
"id": "gofiber.standard",
|
|
60
68
|
"runtime": "go",
|
|
61
69
|
"framework": "gofiber",
|
|
70
|
+
"plannerFramework": "go",
|
|
62
71
|
"category": "backend",
|
|
63
72
|
"owner": "npm",
|
|
64
73
|
"stability": "stable",
|
|
65
74
|
"versionPolicy": "tested-baseline",
|
|
66
|
-
"moduleSupport": false
|
|
75
|
+
"moduleSupport": false,
|
|
76
|
+
"workspacePythonEngine": "none"
|
|
67
77
|
},
|
|
68
78
|
{
|
|
69
79
|
"id": "gogin.standard",
|
|
70
80
|
"runtime": "go",
|
|
71
81
|
"framework": "gogin",
|
|
82
|
+
"plannerFramework": "go",
|
|
72
83
|
"category": "backend",
|
|
73
84
|
"owner": "npm",
|
|
74
85
|
"stability": "stable",
|
|
75
86
|
"versionPolicy": "tested-baseline",
|
|
76
|
-
"moduleSupport": false
|
|
87
|
+
"moduleSupport": false,
|
|
88
|
+
"workspacePythonEngine": "none"
|
|
77
89
|
},
|
|
78
90
|
{
|
|
79
91
|
"id": "dotnet.webapi.clean",
|
|
80
92
|
"runtime": "dotnet",
|
|
81
93
|
"framework": "dotnet",
|
|
94
|
+
"plannerFramework": "dotnet",
|
|
82
95
|
"category": "backend",
|
|
83
96
|
"owner": "npm",
|
|
84
97
|
"stability": "preview",
|
|
85
98
|
"versionPolicy": "tested-baseline",
|
|
86
|
-
"moduleSupport": false
|
|
99
|
+
"moduleSupport": false,
|
|
100
|
+
"workspacePythonEngine": "none"
|
|
87
101
|
},
|
|
88
102
|
{
|
|
89
103
|
"id": "rust.axum",
|
|
90
104
|
"runtime": "rust",
|
|
91
105
|
"framework": "axum",
|
|
106
|
+
"plannerFramework": "rust",
|
|
92
107
|
"category": "backend",
|
|
93
108
|
"owner": "npm",
|
|
94
109
|
"stability": "preview",
|
|
95
110
|
"versionPolicy": "tested-baseline",
|
|
96
|
-
"moduleSupport": false
|
|
111
|
+
"moduleSupport": false,
|
|
112
|
+
"workspacePythonEngine": "none"
|
|
97
113
|
}
|
|
98
114
|
],
|
|
99
115
|
"officialCreate": [
|
|
@@ -106,6 +122,12 @@
|
|
|
106
122
|
"next.js"
|
|
107
123
|
],
|
|
108
124
|
"ecosystem": "nextjs",
|
|
125
|
+
"plannerFramework": "nextjs",
|
|
126
|
+
"runtime": "node",
|
|
127
|
+
"runtimeCandidates": [
|
|
128
|
+
"node"
|
|
129
|
+
],
|
|
130
|
+
"workspacePythonEngine": "none",
|
|
109
131
|
"status": "available",
|
|
110
132
|
"canExecuteCreate": true,
|
|
111
133
|
"versionPolicy": "latest-stable",
|
|
@@ -124,6 +146,12 @@
|
|
|
124
146
|
"react-router"
|
|
125
147
|
],
|
|
126
148
|
"ecosystem": "remix",
|
|
149
|
+
"plannerFramework": "remix",
|
|
150
|
+
"runtime": "node",
|
|
151
|
+
"runtimeCandidates": [
|
|
152
|
+
"node"
|
|
153
|
+
],
|
|
154
|
+
"workspacePythonEngine": "none",
|
|
127
155
|
"status": "available",
|
|
128
156
|
"canExecuteCreate": true,
|
|
129
157
|
"versionPolicy": "latest-stable",
|
|
@@ -145,6 +173,12 @@
|
|
|
145
173
|
"vite.react"
|
|
146
174
|
],
|
|
147
175
|
"ecosystem": "react",
|
|
176
|
+
"plannerFramework": "vite-react",
|
|
177
|
+
"runtime": "node",
|
|
178
|
+
"runtimeCandidates": [
|
|
179
|
+
"node"
|
|
180
|
+
],
|
|
181
|
+
"workspacePythonEngine": "none",
|
|
148
182
|
"status": "available",
|
|
149
183
|
"canExecuteCreate": true,
|
|
150
184
|
"versionPolicy": "latest-stable",
|
|
@@ -163,6 +197,12 @@
|
|
|
163
197
|
"vite.vue"
|
|
164
198
|
],
|
|
165
199
|
"ecosystem": "vue",
|
|
200
|
+
"plannerFramework": "vite-vue",
|
|
201
|
+
"runtime": "node",
|
|
202
|
+
"runtimeCandidates": [
|
|
203
|
+
"node"
|
|
204
|
+
],
|
|
205
|
+
"workspacePythonEngine": "none",
|
|
166
206
|
"status": "available",
|
|
167
207
|
"canExecuteCreate": true,
|
|
168
208
|
"versionPolicy": "latest-stable",
|
|
@@ -181,6 +221,12 @@
|
|
|
181
221
|
"vite.svelte"
|
|
182
222
|
],
|
|
183
223
|
"ecosystem": "svelte",
|
|
224
|
+
"plannerFramework": "vite-svelte",
|
|
225
|
+
"runtime": "node",
|
|
226
|
+
"runtimeCandidates": [
|
|
227
|
+
"node"
|
|
228
|
+
],
|
|
229
|
+
"workspacePythonEngine": "none",
|
|
184
230
|
"status": "available",
|
|
185
231
|
"canExecuteCreate": true,
|
|
186
232
|
"versionPolicy": "latest-stable",
|
|
@@ -200,6 +246,12 @@
|
|
|
200
246
|
"vite.solid"
|
|
201
247
|
],
|
|
202
248
|
"ecosystem": "solid",
|
|
249
|
+
"plannerFramework": "vite-solid",
|
|
250
|
+
"runtime": "node",
|
|
251
|
+
"runtimeCandidates": [
|
|
252
|
+
"node"
|
|
253
|
+
],
|
|
254
|
+
"workspacePythonEngine": "none",
|
|
203
255
|
"status": "available",
|
|
204
256
|
"canExecuteCreate": true,
|
|
205
257
|
"versionPolicy": "latest-stable",
|
|
@@ -218,6 +270,12 @@
|
|
|
218
270
|
"vite-vanilla"
|
|
219
271
|
],
|
|
220
272
|
"ecosystem": "vite",
|
|
273
|
+
"plannerFramework": "vite-vanilla",
|
|
274
|
+
"runtime": "node",
|
|
275
|
+
"runtimeCandidates": [
|
|
276
|
+
"node"
|
|
277
|
+
],
|
|
278
|
+
"workspacePythonEngine": "none",
|
|
221
279
|
"status": "available",
|
|
222
280
|
"canExecuteCreate": true,
|
|
223
281
|
"versionPolicy": "latest-stable",
|
|
@@ -236,6 +294,12 @@
|
|
|
236
294
|
"nuxt.js"
|
|
237
295
|
],
|
|
238
296
|
"ecosystem": "nuxt",
|
|
297
|
+
"plannerFramework": "nuxt",
|
|
298
|
+
"runtime": "node",
|
|
299
|
+
"runtimeCandidates": [
|
|
300
|
+
"node"
|
|
301
|
+
],
|
|
302
|
+
"workspacePythonEngine": "none",
|
|
239
303
|
"status": "available",
|
|
240
304
|
"canExecuteCreate": true,
|
|
241
305
|
"versionPolicy": "latest-stable",
|
|
@@ -253,6 +317,12 @@
|
|
|
253
317
|
"ng"
|
|
254
318
|
],
|
|
255
319
|
"ecosystem": "angular",
|
|
320
|
+
"plannerFramework": "angular",
|
|
321
|
+
"runtime": "node",
|
|
322
|
+
"runtimeCandidates": [
|
|
323
|
+
"node"
|
|
324
|
+
],
|
|
325
|
+
"workspacePythonEngine": "none",
|
|
256
326
|
"status": "available",
|
|
257
327
|
"canExecuteCreate": true,
|
|
258
328
|
"versionPolicy": "latest-stable",
|
|
@@ -272,6 +342,12 @@
|
|
|
272
342
|
"astro"
|
|
273
343
|
],
|
|
274
344
|
"ecosystem": "astro",
|
|
345
|
+
"plannerFramework": "astro",
|
|
346
|
+
"runtime": "node",
|
|
347
|
+
"runtimeCandidates": [
|
|
348
|
+
"node"
|
|
349
|
+
],
|
|
350
|
+
"workspacePythonEngine": "none",
|
|
275
351
|
"status": "available",
|
|
276
352
|
"canExecuteCreate": true,
|
|
277
353
|
"versionPolicy": "latest-stable",
|
|
@@ -289,6 +365,12 @@
|
|
|
289
365
|
"svelte-kit"
|
|
290
366
|
],
|
|
291
367
|
"ecosystem": "sveltekit",
|
|
368
|
+
"plannerFramework": "sveltekit",
|
|
369
|
+
"runtime": "node",
|
|
370
|
+
"runtimeCandidates": [
|
|
371
|
+
"node"
|
|
372
|
+
],
|
|
373
|
+
"workspacePythonEngine": "none",
|
|
292
374
|
"status": "available",
|
|
293
375
|
"canExecuteCreate": true,
|
|
294
376
|
"versionPolicy": "latest-stable",
|
|
@@ -306,6 +388,13 @@
|
|
|
306
388
|
"tauri-app"
|
|
307
389
|
],
|
|
308
390
|
"ecosystem": "tauri",
|
|
391
|
+
"plannerFramework": "tauri",
|
|
392
|
+
"runtime": "node",
|
|
393
|
+
"runtimeCandidates": [
|
|
394
|
+
"node",
|
|
395
|
+
"rust"
|
|
396
|
+
],
|
|
397
|
+
"workspacePythonEngine": "none",
|
|
309
398
|
"status": "available",
|
|
310
399
|
"canExecuteCreate": true,
|
|
311
400
|
"versionPolicy": "latest-stable",
|
|
@@ -323,6 +412,12 @@
|
|
|
323
412
|
"electron-forge"
|
|
324
413
|
],
|
|
325
414
|
"ecosystem": "electron",
|
|
415
|
+
"plannerFramework": "electron",
|
|
416
|
+
"runtime": "node",
|
|
417
|
+
"runtimeCandidates": [
|
|
418
|
+
"node"
|
|
419
|
+
],
|
|
420
|
+
"workspacePythonEngine": "none",
|
|
326
421
|
"status": "available",
|
|
327
422
|
"canExecuteCreate": true,
|
|
328
423
|
"versionPolicy": "latest-stable",
|
|
@@ -341,6 +436,12 @@
|
|
|
341
436
|
"visual-studio-code-extension"
|
|
342
437
|
],
|
|
343
438
|
"ecosystem": "vscode-extension",
|
|
439
|
+
"plannerFramework": "vscode-extension",
|
|
440
|
+
"runtime": "node",
|
|
441
|
+
"runtimeCandidates": [
|
|
442
|
+
"node"
|
|
443
|
+
],
|
|
444
|
+
"workspacePythonEngine": "none",
|
|
344
445
|
"status": "available",
|
|
345
446
|
"canExecuteCreate": true,
|
|
346
447
|
"versionPolicy": "latest-stable",
|
|
@@ -361,6 +462,13 @@
|
|
|
361
462
|
"php-laravel"
|
|
362
463
|
],
|
|
363
464
|
"ecosystem": "laravel",
|
|
465
|
+
"plannerFramework": "laravel",
|
|
466
|
+
"runtime": "php",
|
|
467
|
+
"runtimeCandidates": [
|
|
468
|
+
"php",
|
|
469
|
+
"node"
|
|
470
|
+
],
|
|
471
|
+
"workspacePythonEngine": "none",
|
|
364
472
|
"status": "available",
|
|
365
473
|
"canExecuteCreate": true,
|
|
366
474
|
"versionPolicy": "latest-stable",
|
|
@@ -379,6 +487,12 @@
|
|
|
379
487
|
"wp-site"
|
|
380
488
|
],
|
|
381
489
|
"ecosystem": "wordpress",
|
|
490
|
+
"plannerFramework": "wordpress",
|
|
491
|
+
"runtime": "php",
|
|
492
|
+
"runtimeCandidates": [
|
|
493
|
+
"php"
|
|
494
|
+
],
|
|
495
|
+
"workspacePythonEngine": "none",
|
|
382
496
|
"status": "planned",
|
|
383
497
|
"canExecuteCreate": false,
|
|
384
498
|
"versionPolicy": "planned",
|
|
@@ -399,6 +513,13 @@
|
|
|
399
513
|
"gutenberg-block"
|
|
400
514
|
],
|
|
401
515
|
"ecosystem": "wordpress",
|
|
516
|
+
"plannerFramework": "wordpress",
|
|
517
|
+
"runtime": "node",
|
|
518
|
+
"runtimeCandidates": [
|
|
519
|
+
"node",
|
|
520
|
+
"php"
|
|
521
|
+
],
|
|
522
|
+
"workspacePythonEngine": "none",
|
|
402
523
|
"status": "planned",
|
|
403
524
|
"canExecuteCreate": false,
|
|
404
525
|
"versionPolicy": "planned",
|
|
@@ -415,6 +536,12 @@
|
|
|
415
536
|
"php-symfony"
|
|
416
537
|
],
|
|
417
538
|
"ecosystem": "php",
|
|
539
|
+
"plannerFramework": "symfony",
|
|
540
|
+
"runtime": "php",
|
|
541
|
+
"runtimeCandidates": [
|
|
542
|
+
"php"
|
|
543
|
+
],
|
|
544
|
+
"workspacePythonEngine": "none",
|
|
418
545
|
"status": "planned",
|
|
419
546
|
"canExecuteCreate": false,
|
|
420
547
|
"versionPolicy": "planned",
|
|
@@ -432,6 +559,12 @@
|
|
|
432
559
|
"ruby-rails"
|
|
433
560
|
],
|
|
434
561
|
"ecosystem": "ruby",
|
|
562
|
+
"plannerFramework": "rails",
|
|
563
|
+
"runtime": "ruby",
|
|
564
|
+
"runtimeCandidates": [
|
|
565
|
+
"ruby"
|
|
566
|
+
],
|
|
567
|
+
"workspacePythonEngine": "none",
|
|
435
568
|
"status": "planned",
|
|
436
569
|
"canExecuteCreate": false,
|
|
437
570
|
"versionPolicy": "planned",
|
|
@@ -451,6 +584,116 @@
|
|
|
451
584
|
"scala",
|
|
452
585
|
"kotlin"
|
|
453
586
|
],
|
|
587
|
+
"workspaceProfiles": [
|
|
588
|
+
{
|
|
589
|
+
"id": "minimal",
|
|
590
|
+
"runtimePolicy": "single-detected",
|
|
591
|
+
"runtimeFamilies": [],
|
|
592
|
+
"setupRuntimeFamilies": [],
|
|
593
|
+
"pythonEngineAtCreate": "skipped",
|
|
594
|
+
"pythonEngineAtBootstrap": "on-demand"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"id": "python-only",
|
|
598
|
+
"runtimePolicy": "bounded",
|
|
599
|
+
"runtimeFamilies": [
|
|
600
|
+
"python"
|
|
601
|
+
],
|
|
602
|
+
"setupRuntimeFamilies": [
|
|
603
|
+
"python"
|
|
604
|
+
],
|
|
605
|
+
"pythonEngineAtCreate": "optional-default-install",
|
|
606
|
+
"pythonEngineAtBootstrap": "on-demand"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"id": "node-only",
|
|
610
|
+
"runtimePolicy": "bounded",
|
|
611
|
+
"runtimeFamilies": [
|
|
612
|
+
"node"
|
|
613
|
+
],
|
|
614
|
+
"setupRuntimeFamilies": [
|
|
615
|
+
"node"
|
|
616
|
+
],
|
|
617
|
+
"pythonEngineAtCreate": "skipped",
|
|
618
|
+
"pythonEngineAtBootstrap": "disabled"
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"id": "go-only",
|
|
622
|
+
"runtimePolicy": "bounded",
|
|
623
|
+
"runtimeFamilies": [
|
|
624
|
+
"go"
|
|
625
|
+
],
|
|
626
|
+
"setupRuntimeFamilies": [
|
|
627
|
+
"go"
|
|
628
|
+
],
|
|
629
|
+
"pythonEngineAtCreate": "skipped",
|
|
630
|
+
"pythonEngineAtBootstrap": "disabled"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"id": "java-only",
|
|
634
|
+
"runtimePolicy": "bounded",
|
|
635
|
+
"runtimeFamilies": [
|
|
636
|
+
"java"
|
|
637
|
+
],
|
|
638
|
+
"setupRuntimeFamilies": [
|
|
639
|
+
"java"
|
|
640
|
+
],
|
|
641
|
+
"pythonEngineAtCreate": "skipped",
|
|
642
|
+
"pythonEngineAtBootstrap": "disabled"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"id": "dotnet-only",
|
|
646
|
+
"runtimePolicy": "bounded",
|
|
647
|
+
"runtimeFamilies": [
|
|
648
|
+
"dotnet"
|
|
649
|
+
],
|
|
650
|
+
"setupRuntimeFamilies": [
|
|
651
|
+
"dotnet"
|
|
652
|
+
],
|
|
653
|
+
"pythonEngineAtCreate": "skipped",
|
|
654
|
+
"pythonEngineAtBootstrap": "disabled"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"id": "polyglot",
|
|
658
|
+
"runtimePolicy": "multi-runtime",
|
|
659
|
+
"runtimeFamilies": [],
|
|
660
|
+
"setupRuntimeFamilies": [
|
|
661
|
+
"python",
|
|
662
|
+
"node",
|
|
663
|
+
"go",
|
|
664
|
+
"java",
|
|
665
|
+
"dotnet"
|
|
666
|
+
],
|
|
667
|
+
"pythonEngineAtCreate": "optional-default-install",
|
|
668
|
+
"pythonEngineAtBootstrap": "on-demand"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"id": "enterprise",
|
|
672
|
+
"runtimePolicy": "multi-runtime",
|
|
673
|
+
"runtimeFamilies": [],
|
|
674
|
+
"setupRuntimeFamilies": [
|
|
675
|
+
"python",
|
|
676
|
+
"node",
|
|
677
|
+
"go",
|
|
678
|
+
"java",
|
|
679
|
+
"dotnet"
|
|
680
|
+
],
|
|
681
|
+
"pythonEngineAtCreate": "optional-default-install",
|
|
682
|
+
"pythonEngineAtBootstrap": "on-demand"
|
|
683
|
+
}
|
|
684
|
+
],
|
|
685
|
+
"lifecycle": {
|
|
686
|
+
"automatic": [
|
|
687
|
+
"Create the workspace foundation without installing an optional workspace Python engine unless the user explicitly selected that engine in CLI workspace creation.",
|
|
688
|
+
"Run the selected native or official project generator and let that generator own project dependency installation unless --skip-install is set.",
|
|
689
|
+
"Register every created project and refresh the canonical contract, model, proof-backed graph, diff, impact, agent context, grounding, and evidence index."
|
|
690
|
+
],
|
|
691
|
+
"explicit": [
|
|
692
|
+
"Run workspai bootstrap only when the user requests profile and project dependency initialization or a required kit reports a missing workspace engine.",
|
|
693
|
+
"Run workspai workspace intelligence run --for-agent <agent> --strict for a complete evidence and verification loop.",
|
|
694
|
+
"Run doctor, analyze, readiness, verify, run, Goal, and repair operations when requested by the user or the governed workflow; Create does not silently claim those gates passed."
|
|
695
|
+
]
|
|
696
|
+
},
|
|
454
697
|
"productRules": [
|
|
455
698
|
"Do not translate unsupported stack requests into unrelated native kits.",
|
|
456
699
|
"If native create is unavailable, explain the lane and guide to adopt/import.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-KV6PS54A.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-KJXMLBSY.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as runDoctorCapabilities}from'./chunk-6TBTMWNA.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-B6FJ6RG6.js';import {k,q}from'./chunk-GQSRNUCU.js';import {c,i}from'./chunk-J7RU5WR5.js';import {a}from'./chunk-T5YRFRJV.js';import {j as j$2}from'./chunk-XKDR5BGS.js';import {e,f as f$1}from'./chunk-X6TNBARH.js';import {b}from'./chunk-UJXE4UAX.js';import {l,s,j as j$1,t,k as k$2}from'./chunk-MOSXTVPU.js';import ce,{promises}from'fs';import c$1 from'path';import T,{homedir}from'os';import {pathToFileURL}from'url';import m from'process';import k$1 from'fs-extra';function z(o){let t=o.label.indexOf(" \u2014 ");return t>=0?o.label.slice(t+3).trim():o.label.trim()}function Q(){let o=c().map(n=>({value:n.id,label:`${K(n.category)} \xB7 ${z(n)}`,hint:`${n.runtime} \xB7 tested baseline`,name:n.label})),e=k().map(n=>({value:n.kitId,label:`Frontend \xB7 ${n.displayName}`,hint:"official \xB7 latest stable",name:`${n.displayName} \u2014 ${n.framework}`})),t=q().map(n=>({value:n.kitId,label:`${K(n.category)} \xB7 ${n.displayName}`,hint:`${n.runtimeCandidates.join(" + ")} \xB7 official latest stable`,name:`${n.displayName} \u2014 ${n.category}`})),i=[...o,...e,...t].sort((n,r)=>{let s=["Backend","Frontend","Desktop","Extension"],a=n.label?.split(" \xB7 ")[0]??"",l=r.label?.split(" \xB7 ")[0]??"";return s.indexOf(a)-s.indexOf(l)||(n.label??"").localeCompare(r.label??"")});return D(i),i}function K(o){return o.charAt(0).toUpperCase()+o.slice(1)}function D(o){let e=new Set,t=new Set;for(let i of o){let n=i.label??i.name??String(i.value),r=String(i.value);if(e.has(n))throw new Error(`Duplicate kit picker label: ${n}`);if(t.has(r))throw new Error(`Duplicate kit picker value: ${r}`);e.add(n),t.add(r);}}var Z=".workspairc.json",ee=".rapidkitrc.json",oe=["workspai.config.js","workspai.config.mjs","workspai.config.cjs","rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"],te=["workspai.config.json","rapidkit.config.json"];function U(o){return typeof o=="object"&&o!==null&&"code"in o&&o.code==="ENOENT"}function R(o,e){let t=e instanceof Error?e.message:String(e),i=o.endsWith(".js")&&/module is not defined in ES module scope/i.test(t)?' CommonJS syntax in a .js config is not valid when the project package uses "type": "module"; rename the file to .cjs or use export default.':"";return `Failed to load Workspai config at ${o}.${i} Cause: ${t}`}async function Qe(){for(let o of [c$1.join(T.homedir(),Z),c$1.join(T.homedir(),ee)])try{let e$1=await promises.readFile(o,"utf-8"),t=JSON.parse(e$1);return e.debug(`Loaded config from ${o}`),t}catch{}return e.debug("No user config found, using defaults"),{}}async function Xe(o=process.cwd(),e$1={}){let t=o,i=c$1.parse(t).root;for(;t!==i;){for(let n of te){let r=c$1.join(t,n);try{let s=await promises.readFile(r,"utf-8"),a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))throw new Error("configuration root must be a JSON object");return e.debug(`Loaded data-only Workspai config from ${n}`),a}catch(s){if(U(s))continue;throw new Error(R(r,s))}}for(let n of oe){let r=c$1.join(t,n);try{await promises.access(r);}catch(s){if(U(s))continue;throw new Error(R(r,s))}if(e.debug(`Found config file: ${r}`),!e$1.trustExecutableConfig)throw new Error(`Refusing to execute Workspai config at ${r} without explicit trust. Use a data-only workspai.config.json file, pass --trust-config, or set WORKSPAI_TRUST_CONFIG=1.`);try{let a=await import(pathToFileURL(r).href),l=a.default||a;return e.debug(`Loaded Workspai config from ${n}`),l}catch(s){throw new Error(R(r,s))}}t=c$1.dirname(t);}return e.debug("No Workspai config file found, using defaults"),{}}function Ze(o,e,t){return {author:t.author||e.workspace?.defaultAuthor||o.author,pythonVersion:t.pythonVersion||e.workspace?.pythonVersion||o.pythonVersion,defaultInstallMethod:t.defaultInstallMethod||e.workspace?.installMethod||o.defaultInstallMethod,defaultKit:t.defaultKit||e.projects?.defaultKit||o.defaultKit,skipGit:t.skipGit??e.projects?.skipGit??o.skipGit,license:t.license||o.license,testRapidKitPath:t.testRapidKitPath||o.testRapidKitPath}}function eo(o){return f$1("DEV_PATH")||o.testRapidKitPath||void 0}var x=class extends Error{constructor(t,i){super(["Workspai workspaces cannot be nested.",`Target: ${t}`,`Containing workspace: ${i}`,"Choose Managed home or pass --output <path> with a location outside the current workspace."].join(`
|
|
2
|
+
`));this.targetPath=t;this.containingWorkspacePath=i;this.name="NestedWorkspaceCreationError";}targetPath;containingWorkspacePath;code="WORKSPACE_NESTING_NOT_SUPPORTED"};async function ie(o){try{return !!await k$1.stat(o)}catch{return false}}function re(o,e){let t=o.indexOf(e);if(t>=0&&t+1<o.length)return o[t+1];let i=o.find(n=>n.startsWith(`${e}=`));if(i)return i.slice(e.length+1)}function se(o){return o.includes("--here")}async function G(o){let e=c$1.resolve(o);for(;;){let t=[c$1.join(e,".workspai-workspace"),c$1.join(e,".rapidkit-workspace"),c$1.join(e,".workspai","workspace.json"),c$1.join(e,".rapidkit","workspace.json")];if((await Promise.all(t.map(ie))).some(Boolean))return e;let i=c$1.dirname(e);if(i===e)return;e=i;}}async function po(o){let e=c$1.resolve(o),t=await G(c$1.dirname(e));if(t)throw new x(e,t)}async function ae(o,e=homedir()){let i=[{value:"managed",label:"Managed home",hint:k$2(e)}];return await G(o)||i.push({value:"here",label:"Current directory",hint:o}),i}function J(o,e=m.cwd()){if(se(o))return c$1.resolve(e);let t=re(o,"--output");if(t)return c$1.resolve(t)}function uo(o,e=m.cwd()){let t=c$1.resolve(o),i=c$1.resolve(e),n=c$1.relative(i,t);return n.length>0&&!n.startsWith("..")&&!c$1.isAbsolute(n)?`cd ${n}`:`cd ${t}`}function mo(o,e={}){let t=e.argv??[],i=e.outputParent??J(t,m.cwd());return l(o.trim(),{homeDir:e.homeDir,outputDir:i})}function fo(o,e,t={}){return o?c$1.resolve(o)===c$1.resolve(e)?true:t.outputParent===void 0:false}async function go(o,e={}){let t=e.cwd??m.cwd(),i=e.homeDir??homedir(),n=J(o,t);if(n!==void 0)return n;let r=e.hasYes??(o.includes("--yes")||o.includes("-y"));if(!(e.interactive??(!r&&!!m.stdin.isTTY&&!b())))return;let a=await ae(t,i);if(a.length===1)return;let{location:l}=await b$1([{type:"rawlist",name:"location",message:"Where should the workspace be created?",choices:a,default:0}]);if(l==="here")return c$1.resolve(t)}var pe=["minimal","python-only","node-only","go-only","java-only","dotnet-only","polyglot","enterprise"],de=new Set(["minimal","node-only","go-only","java-only","dotnet-only"]),xo=new Set(["python-only","polyglot","enterprise"]);function ue(o){return typeof o=="string"&&pe.includes(o)}function jo(o){return ue(o)&&de.has(o)}var Y={"python-only":"python","node-only":"node","go-only":"go","java-only":"java","dotnet-only":"dotnet"},me={python:"Python",node:"Node",go:"Go",java:"Java",dotnet:".NET",php:"PHP",ruby:"Ruby",rust:"Rust",elixir:"Elixir",clojure:"Clojure",scala:"Scala",kotlin:"Kotlin",deno:"Deno",bun:"Bun",c:"C",cpp:"C++",unknown:"Unknown"},fe={python:"python-only",node:"node-only",go:"go-only",java:"java-only",dotnet:"dotnet-only"},V=["node","deno","bun","python","go","java","kotlin","scala","dotnet","php","ruby","rust","elixir","clojure","c","cpp","unknown"];function j(o){return o==="bun"||o==="deno"?"node":o==="kotlin"||o==="scala"?"java":o}function E(o){return typeof o!="string"||o.trim().length===0?"minimal":o.trim().toLowerCase()}function f(o){if(typeof o!="string")return "unknown";let e=o.trim().toLowerCase();return e==="python"||e==="node"||e==="go"||e==="java"||e==="dotnet"||e==="php"||e==="ruby"||e==="rust"||e==="elixir"||e==="clojure"||e==="scala"||e==="kotlin"||e==="deno"||e==="bun"||e==="c"||e==="cpp"?e:e==="c++"||e==="cplusplus"||e==="cc"||e==="clang++"||e==="g++"?"cpp":e==="clang"||e==="gcc"?"c":"unknown"}function P(o){let e=new Set;for(let t of o)e.add(f(t));return [...e].sort((t,i)=>V.indexOf(t)-V.indexOf(i))}function ge(o){let e=P(o).filter(t=>t!=="unknown");if(e.length!==0)return e.length===1?fe[e[0]]:"polyglot"}function H(o,e={}){return `npx workspai bootstrap --profile ${o}${e.ci?" --ci --json":""}`}function ke(o,e){return o?"none":e==="strict"?"error":"warning"}function g(o){let e=o.ok?void 0:ge(o.runtimes)??"polyglot";return {ok:o.ok,checkId:o.checkId,status:o.ok?"passed":"failed",profile:o.profile,runtimes:o.runtimes,message:o.message,recommendedProfile:e,recommendedCommand:e?H(e):void 0,ciRecommendedCommand:e?H(e,{ci:true}):void 0,severity:ke(o.ok,o.mode)}}function Eo(o){let e=E(o.profile),t=P(o.runtimes),i=o.mode??"warn",n=Y[e];if(n){let r=t.length===0||t.every(s=>j(s)===n);return g({ok:r,checkId:`profile.${e}`,profile:e,runtimes:t,message:r?`${e} profile validated for discovered projects.`:`${e} profile mismatch: detected runtimes [${t.join(", ")}].`,mode:i})}if(e==="minimal"){let r=t.filter(l=>l!=="unknown"),a=new Set(r.map(l=>j(l))).size<=1;return g({ok:a,checkId:"profile.minimal",profile:e,runtimes:t,message:a?"minimal profile is compatible with detected runtime mix.":`minimal profile mismatch: multiple runtimes detected [${r.join(", ")}].`,mode:i})}return g({ok:true,checkId:`profile.${e}`,profile:e,runtimes:t,message:`${e} profile accepts the detected runtime mix.`,mode:i})}function vo(o){let e=E(o.profile),t=f(o.runtime),i=o.mode??"warn",n=Y[e];if(!n||t==="unknown")return g({ok:true,checkId:`profile.${e}`,profile:e,runtimes:[t],message:t==="unknown"?`Project "${o.subjectLabel}" runtime is unknown; profile compatibility will be checked by workspace doctor.`:`${e} profile accepts project "${o.subjectLabel}".`,mode:i});let r=j(t)===n;return g({ok:r,checkId:`profile.${e}`,profile:e,runtimes:r?[t]:P([n,t]),message:r?`Project "${o.subjectLabel}" is compatible with workspace profile "${e}".`:`Project "${o.subjectLabel}" is ${me[t]}, but workspace profile is "${e}".`,mode:i})}async function Fo(o){let e=(await Promise.all(s(o,"policies.yml").map(async t=>await k$1.pathExists(t)?t:null))).find(t=>typeof t=="string");if(!e)return "warn";try{return (await k$1.readFile(e,"utf-8")).match(/^\s*mode:\s*(warn|strict)\s*(?:#.*)?$/m)?.[1]==="strict"?"strict":"warn"}catch{return "warn"}}async function Io(o){let e=(await Promise.all(s(o,"workspace.json").map(async t=>await k$1.pathExists(t)?t:null))).find(t=>typeof t=="string");if(!e)return "minimal";try{let t=await k$1.readJson(e);return E(t.profile)}catch{return "minimal"}}async function $o(o,e={}){let t$1=new Set,i$1=[],n=new Set,r=[o];for(;r.length>0;){let s=r.pop();if(!s||n.has(s))continue;n.add(s);let a=[];try{a=await ce.promises.readdir(s,{withFileTypes:true});}catch{continue}for(let l of a){if(!l.isDirectory()||l.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(l.name))continue;let p=c$1.join(s,l.name);if(p!==o&&j$1(p))continue;if((await Promise.all([...t(p,"context.json"),...t(p,"project.json")].map(async q=>k$1.pathExists(q)))).some(Boolean)){i$1.push(p);continue}r.push(p);}}for(let s of i$1){let a=i(s);t$1.add(f(j$2(s,a).runtime));}for(let s of await a(o))t$1.add(f(s.runtime));for(let s of e.additionalRuntimes??[])t$1.add(f(s));return P(t$1)}function Ao(o,e={}){let t=e.ci?o.ciRecommendedCommand:o.recommendedCommand;return t?`Recommended: ${t}`:null}export{Q as a,Qe as b,Xe as c,Ze as d,eo as e,po as f,uo as g,mo as h,fo as i,go as j,xo as k,jo as l,Eo as m,vo as n,Fo as o,Io as p,$o as q,Ao as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,c,d as d$1}from'./chunk-E4LJ3PQD.js';import {c as c$2}from'./chunk-W6FHVXNL.js';import {a as a$4}from'./chunk-X7FYEKLI.js';import {c as c$1,d as d$4}from'./chunk-HCFWT42C.js';import {a as a$1,b as b$1}from'./chunk-PYCJWW4B.js';import {p as p$1,a,o,g,d as d$3,f as f$1}from'./chunk-NBJ6AP7K.js';import {p,l,f as f$2}from'./chunk-NA2NXX5P.js';import {d}from'./chunk-EWZZUQBR.js';import {a as a$2}from'./chunk-KG3TUTXU.js';import {d as d$2,e as e$1}from'./chunk-CCDGHPEJ.js';import {a as a$3}from'./chunk-AFIFZTOY.js';import {f,e,i,g as g$1,h}from'./chunk-NZ3WZYD5.js';import m from'path';import v from'fs-extra';var fe="rapidkit-blocker-resolution-v1";function pe(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return f$2({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function we(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function me(e){let t=we(e.reason),r=pe({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",...e.sourceCommand?{}:{studioActionId:"run-analyze"}}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:fe,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?e.sourceCommand?`Run the source command once: ${e.sourceCommand}, then verify.`:"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function Re(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function Ce(e){return e.length===0||e.every(t=>Re(t))}function ge(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&Ce(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function tt(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var ye=f.verify,G=e.verify;function Ae(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function ke(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f$1)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$3(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$3(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let o=s.transitiveImpact.reduce((u,d)=>Math.max(u,d.distance??0),0);s.summary.blastRadius.maxDistance!==o&&i.push("blastRadius.maxDistance does not match transitive impact distances");let k=l(s.diff.currentModel)?.edges.length??0;if(s.summary.blastRadius.graphEdges!==k&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==d(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function Ee(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function Se(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function We(e$1,t){if(e$1.id==="workspace.doctor")return m.join(t,e.doctor);if(e$1.id==="workspace.contract.verify")return m.join(t,e.contractVerify);if(e$1.id==="workspace.readiness")return m.join(t,e.readiness);if(e$1.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e$1.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e$1.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e$1.id.startsWith("project.")&&e$1.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function C(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function je(e){if(!c$1(e,"workspace"))return {status:"fail",message:"Doctor evidence contract is missing or unsupported."};try{d$4(e);}catch(s){return {status:"fail",message:`Doctor evidence semantic validation failed: ${s instanceof Error?s.message:String(s)}`}}let t=a$4(e);return t.hasSystemErrors||t.blockingFindings>0?{status:"fail",message:`Doctor evidence reports ${t.blockingFindings} canonical blocking finding(s).`}:t.advisoryFindings+t.unknownFindings+t.contradictionCount+t.missingDiagnosisProjects>0||t.staleEvidence||t.unknownFreshness||t.minimumDiagnosisCompleteness<100?{status:"warn",message:`Doctor evidence needs attention (${t.advisoryFindings} advisory, ${t.unknownFindings} unknown, ${t.contradictionCount} contradictory; ${t.minimumDiagnosisCompleteness}% complete).`}:{status:"pass",message:"Canonical Doctor evidence is complete, fresh, and healthy."}}function xe(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function Pe(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function Ie(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Analyze evidence reports blocking findings."}:r==="needs-attention"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is ready."}}function Ve(e){let t=e.schemaVersion===h.doctorFixResult.schemaVersion?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function Fe(e,t){let r=await d$2(e,i.doctorRemediationPlan);if(!r)return false;try{let s=C(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let o=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!o||!t)return true;let k=Date.parse(o),u=Date.parse(t);return !Number.isFinite(k)||!Number.isFinite(u)?true:k>=u}catch{return false}}function $e(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Oe(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function De(e,t,r){let s=$e(t),i=c$2(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let o=i.stage;if(s&&o!==s)return {status:"missing",message:`Workspace run evidence is for stage "${o}", expected "${s}".`};let k=Array.isArray(i.projects)?i.projects:[],u=t.project?.toLowerCase();if(!u)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let d=k.find(g=>{let c=C(g);if(!c)return false;let n=typeof c.projectName=="string"?c.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(f=>c[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return n===u||a.some(f=>f.endsWith(`/${u}`)||f===u)});if(d){let g=R(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(g)return {status:"fail",message:g};let c=C(d),n=typeof c?.status=="string"?c.status:"unknown";return n==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:n==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:n==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${n} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function R(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}function Be(e){if(e.id==="workspace.doctor")return g$1.doctor;if(e.id==="workspace.readiness")return g$1.readiness;if(e.id==="workspace.contract.verify")return g$1.contractVerify;if(e.id==="workspace.analyze")return g$1.analyze;if(e.id==="workspace.pipeline")return "contracts/pipeline-last-run.v1.json"}async function _e(e,t,r,s){let i=We(e,t),o=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let k=i?await d$2(t,o??""):null;if(!i||!k)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:o,message:o?`Missing evidence report: ${o}`:"No evidence mapping exists for this command."};let u;try{u=await v.readJson(k);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is unreadable JSON: ${n instanceof Error?n.message:String(n)}`}}let d=C(u);if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:"Evidence report is not a JSON object."};let g=Be(e);if(g)try{a$3(d,g,`${e.label} evidence`);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is invalid: ${n instanceof Error?n.message:String(n)}`}}let c;if(e.id==="workspace.doctor"){let n=R(d.generatedAt,s,"Doctor evidence");n?c={status:"fail",message:n}:c=je(d);}else if(e.id==="workspace.readiness"){let n=R(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=xe(d);}else if(e.id==="workspace.contract.verify"){let n=R(d.generatedAt,s,"Workspace contract verify evidence");n?c={status:"fail",message:n}:c=Pe(d);}else if(e.id==="workspace.analyze"){let n=R(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=Ie(d);}else if(e.id==="workspace.pipeline"){let n=R(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Oe(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion===h.doctorFixResult.schemaVersion?d:d.fixResult,a=C(n),f=typeof a?.generatedAt=="string"?a.generatedAt:void 0,y=R(f,s,"Doctor fix result");y?c={status:"fail",message:y}:await Fe(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=Ve(d);}else if(e.id.startsWith("project."))c=De(d,e,s);else {let n=R(d.generatedAt,s,"Evidence report");n?c={status:"fail",message:n}:c={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:c.status,required:e.required,evidencePath:o,message:c.message}}function Ne(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(n=>n.status==="pass").length,s=e.filter(n=>n.status==="warn").length,i=e.filter(n=>n.status==="fail").length,o=e.filter(n=>n.status==="missing").length,k=e.filter(n=>n.status==="skipped").length,u=e.filter(n=>n.required&&(n.status==="fail"||n.status==="missing")).map(n=>`${n.id}: ${n.message}`),d=e.filter(n=>n.required&&n.status==="missing").length,g="ready",c=0;return u.length>0||t.blockingReasons.length>0?(g="blocked",c=2):(s>0||e.some(n=>!n.required&&n.status==="fail")||d>0||t.needsAttention)&&(g="needs-attention",c=1),{verdict:g,exitCode:c,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:o,stepsSkipped:k}}function He(e,t){let r=x(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=x(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!s.has(a.toLowerCase()))),o=new Map;for(let a of t){if(a.scope!=="project"||!a.project)continue;let f=a.project.toLowerCase(),y=o.get(f)??[];y.push(a),o.set(f,y);}let k=[],u=[],d=[],g=[],c=false,n=(a,f)=>{let y=o.get(a.toLowerCase())??[];if(y.length===0){d.push(a);return}let P=y.filter(p=>p.status==="fail"),b=P.filter(p=>p.required),I=y.filter(p=>p.status==="missing"),E=I.filter(p=>p.required),V=y.some(p=>p.status==="pass"||p.status==="warn");if(b.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has failed verification evidence (${b.map(p=>p.id).join(", ")}).`);return}if(P.length>0){u.push(a),c=true;return}if(E.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has missing required verification evidence (${E.map(p=>p.id).join(", ")}).`);return}if(I.length>0){u.push(a),c=true;return}if(V){k.push(a);return}d.push(a);};for(let a of r)n(a,"directly-changed");for(let a of i)n(a,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:x(k),uncovered:x(u),unverifiable:x(d)},blockingReasons:g,needsAttention:c}}function x(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function Me(e$1){let t=m.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let o=Ae(t,e$1.fromImpactPath);return {impact:await ke(o),fromImpactRef:m.relative(t,o).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g);if(await v.pathExists(r))return {impact:await ke(r),fromImpactRef:g,impactFromDisk:true};let s=m.join(t,d$3);if(await v.pathExists(s))return {impact:await p$1({workspacePath:t,fromPath:d$3,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:d$3,impactFromDisk:false};let i=await p({workspacePath:t,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:f$1,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:e.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:l(i)?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:f.diff,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",toRef:e.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function Te(e,t){if(t)return e.generatedAt}async function bt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await Me(e),o$1=r.diff.currentModel,k=i?await p({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):o$1,u=[];if(i){let l=await p$1({workspacePath:t,fromPath:r.diff.fromRef,diff:r.diff,scope:e.scope,now:e.now}),W=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],A=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(W)!==JSON.stringify(A)&&u.push("workspace.impact: Persisted impact semantics do not match the impact re-derived from the embedded diff. Regenerate diff and impact.");}i&&d(k)!==r.diff.toHash&&u.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let d$2=r.diff.git;if(i&&d$2?.available){let l=a(t,{ref:d$2.ref}),W=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),A=[...l.changedFiles.map(h=>`git.file.changed:${h}`),...l.untrackedFiles.map(h=>`git.untracked:${h}`),...l.deletedFiles.map(h=>`git.deleted:${h}`)].sort();(!l.available||l.commit!==d$2.commit||JSON.stringify(A)!==JSON.stringify(W))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=Te(r,i),c$1=Ee([...o(),...r.verificationPlan]).filter(l=>Se(e.scope,l)),n=[];for(let l of c$1)n.push(await _e(l,t,o$1.contracts.exists===true,g));let a$2=He(r,n),f=a$1(l(o$1)??{nodes:[],edges:[]}),y=b(o$1),P=await Ke(t),b$2=c(y,P?.freshness?.projectHashes),I={verdict:b$2.verdict,baseline:b$2.baseline,changed:b$2.changed,added:b$2.added,removed:b$2.removed,projectHashes:d$1(y)},E=b$1(f),V=o$1.policies?.mode??"warn",p$2=await Le(o$1,t),B=qe(V,p$2),S=Ne(n,{blockingReasons:[...a$2.blockingReasons,...E,...B.blockingReasons,...u],needsAttention:a$2.needsAttention||B.needsAttention}),he=n.filter(l=>l.status==="missing"&&l.evidencePath).map(l=>l.evidencePath),_=[...n.filter(l=>l.required&&(l.status==="fail"||l.status==="missing")).map(l=>`${l.id}: ${l.message}`),...a$2.blockingReasons,...E,...B.blockingReasons,...u],ve=p$2.filter(l=>l.severity==="error").length,be=o$1.summary?.projectCount??o$1.projects.length,U=ge({projectCount:be,verdict:S.verdict,exitCode:S.exitCode,blockingReasons:_,policyErrorCount:ve});S.verdict=U.verdict,S.exitCode=U.exitCode;let Y=Array.from(new Set(_.map(l=>l.trim()).filter(Boolean))).slice(0,12).map((l,W)=>{let A=n.find(h=>l.startsWith(`${h.id}:`));return me({reason:l,blockerId:`blocker-${W+1}`,sourceCommand:A?.command.display,sourceArtifact:A?.evidencePath,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:G})});return {schemaVersion:ye,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:S,steps:n,missingEvidence:he,blockingReasons:_,...Y.length>0?{resolutionHints:Y}:{},verificationPlan:c$1,affectedSubgraph:a$2.subgraph,graphIntegrity:f,freshness:I,policyMode:V,policyViolations:p$2}}async function Le(e$1,t){let r=[];for(let i of e$1.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await d$2(t,e.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let o of i.violations)typeof o=="string"&&o.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:o});}}catch{}return r.sort((i,o)=>i.source!==o.source?i.source.localeCompare(o.source):i.code!==o.code?i.code.localeCompare(o.code):i.message.localeCompare(o.message))}function qe(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function Ke(e){let t=m.join(e,G);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===ye?r:null}catch{return null}}async function wt(e,t){return e$1(t,G,a$2(e))}function ze(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function Rt(e,t){return ze(e,t).exitCode}export{fe as a,tt as b,ye as c,G as d,He as e,bt as f,wt as g,ze as h,Rt as i};
|
|
1
|
+
import {b,c,d as d$1}from'./chunk-ZGS5NKEO.js';import {c as c$2}from'./chunk-W6FHVXNL.js';import {a as a$4}from'./chunk-X7FYEKLI.js';import {c as c$1,d as d$4}from'./chunk-HCFWT42C.js';import {a as a$1,b as b$1}from'./chunk-PYCJWW4B.js';import {p as p$1,a,o,g,d as d$3,f as f$1}from'./chunk-CT4IODPG.js';import {p,l,f as f$2}from'./chunk-CJHWKXDN.js';import {d}from'./chunk-EWZZUQBR.js';import {a as a$2}from'./chunk-Q2WF7D5U.js';import {d as d$2,e as e$1}from'./chunk-CCDGHPEJ.js';import {a as a$3}from'./chunk-AFIFZTOY.js';import {f,e,i,g as g$1,h}from'./chunk-NZ3WZYD5.js';import m from'path';import v from'fs-extra';var fe="rapidkit-blocker-resolution-v1";function pe(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return f$2({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function we(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function me(e){let t=we(e.reason),r=pe({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",...e.sourceCommand?{}:{studioActionId:"run-analyze"}}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:fe,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?e.sourceCommand?`Run the source command once: ${e.sourceCommand}, then verify.`:"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function Re(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function Ce(e){return e.length===0||e.every(t=>Re(t))}function ge(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&Ce(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function tt(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var ye=f.verify,G=e.verify;function Ae(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function ke(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f$1)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$3(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$3(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let o=s.transitiveImpact.reduce((u,d)=>Math.max(u,d.distance??0),0);s.summary.blastRadius.maxDistance!==o&&i.push("blastRadius.maxDistance does not match transitive impact distances");let k=l(s.diff.currentModel)?.edges.length??0;if(s.summary.blastRadius.graphEdges!==k&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==d(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function Ee(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function Se(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function We(e$1,t){if(e$1.id==="workspace.doctor")return m.join(t,e.doctor);if(e$1.id==="workspace.contract.verify")return m.join(t,e.contractVerify);if(e$1.id==="workspace.readiness")return m.join(t,e.readiness);if(e$1.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e$1.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e$1.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e$1.id.startsWith("project.")&&e$1.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function C(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function je(e){if(!c$1(e,"workspace"))return {status:"fail",message:"Doctor evidence contract is missing or unsupported."};try{d$4(e);}catch(s){return {status:"fail",message:`Doctor evidence semantic validation failed: ${s instanceof Error?s.message:String(s)}`}}let t=a$4(e);return t.hasSystemErrors||t.blockingFindings>0?{status:"fail",message:`Doctor evidence reports ${t.blockingFindings} canonical blocking finding(s).`}:t.advisoryFindings+t.unknownFindings+t.contradictionCount+t.missingDiagnosisProjects>0||t.staleEvidence||t.unknownFreshness||t.minimumDiagnosisCompleteness<100?{status:"warn",message:`Doctor evidence needs attention (${t.advisoryFindings} advisory, ${t.unknownFindings} unknown, ${t.contradictionCount} contradictory; ${t.minimumDiagnosisCompleteness}% complete).`}:{status:"pass",message:"Canonical Doctor evidence is complete, fresh, and healthy."}}function xe(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function Pe(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function Ie(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Analyze evidence reports blocking findings."}:r==="needs-attention"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is ready."}}function Ve(e){let t=e.schemaVersion===h.doctorFixResult.schemaVersion?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function Fe(e,t){let r=await d$2(e,i.doctorRemediationPlan);if(!r)return false;try{let s=C(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let o=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!o||!t)return true;let k=Date.parse(o),u=Date.parse(t);return !Number.isFinite(k)||!Number.isFinite(u)?true:k>=u}catch{return false}}function $e(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Oe(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function De(e,t,r){let s=$e(t),i=c$2(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let o=i.stage;if(s&&o!==s)return {status:"missing",message:`Workspace run evidence is for stage "${o}", expected "${s}".`};let k=Array.isArray(i.projects)?i.projects:[],u=t.project?.toLowerCase();if(!u)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let d=k.find(g=>{let c=C(g);if(!c)return false;let n=typeof c.projectName=="string"?c.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(f=>c[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return n===u||a.some(f=>f.endsWith(`/${u}`)||f===u)});if(d){let g=R(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(g)return {status:"fail",message:g};let c=C(d),n=typeof c?.status=="string"?c.status:"unknown";return n==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:n==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:n==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${n} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function R(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}function Be(e){if(e.id==="workspace.doctor")return g$1.doctor;if(e.id==="workspace.readiness")return g$1.readiness;if(e.id==="workspace.contract.verify")return g$1.contractVerify;if(e.id==="workspace.analyze")return g$1.analyze;if(e.id==="workspace.pipeline")return "contracts/pipeline-last-run.v1.json"}async function _e(e,t,r,s){let i=We(e,t),o=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let k=i?await d$2(t,o??""):null;if(!i||!k)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:o,message:o?`Missing evidence report: ${o}`:"No evidence mapping exists for this command."};let u;try{u=await v.readJson(k);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is unreadable JSON: ${n instanceof Error?n.message:String(n)}`}}let d=C(u);if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:"Evidence report is not a JSON object."};let g=Be(e);if(g)try{a$3(d,g,`${e.label} evidence`);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is invalid: ${n instanceof Error?n.message:String(n)}`}}let c;if(e.id==="workspace.doctor"){let n=R(d.generatedAt,s,"Doctor evidence");n?c={status:"fail",message:n}:c=je(d);}else if(e.id==="workspace.readiness"){let n=R(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=xe(d);}else if(e.id==="workspace.contract.verify"){let n=R(d.generatedAt,s,"Workspace contract verify evidence");n?c={status:"fail",message:n}:c=Pe(d);}else if(e.id==="workspace.analyze"){let n=R(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=Ie(d);}else if(e.id==="workspace.pipeline"){let n=R(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Oe(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion===h.doctorFixResult.schemaVersion?d:d.fixResult,a=C(n),f=typeof a?.generatedAt=="string"?a.generatedAt:void 0,y=R(f,s,"Doctor fix result");y?c={status:"fail",message:y}:await Fe(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=Ve(d);}else if(e.id.startsWith("project."))c=De(d,e,s);else {let n=R(d.generatedAt,s,"Evidence report");n?c={status:"fail",message:n}:c={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:c.status,required:e.required,evidencePath:o,message:c.message}}function Ne(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(n=>n.status==="pass").length,s=e.filter(n=>n.status==="warn").length,i=e.filter(n=>n.status==="fail").length,o=e.filter(n=>n.status==="missing").length,k=e.filter(n=>n.status==="skipped").length,u=e.filter(n=>n.required&&(n.status==="fail"||n.status==="missing")).map(n=>`${n.id}: ${n.message}`),d=e.filter(n=>n.required&&n.status==="missing").length,g="ready",c=0;return u.length>0||t.blockingReasons.length>0?(g="blocked",c=2):(s>0||e.some(n=>!n.required&&n.status==="fail")||d>0||t.needsAttention)&&(g="needs-attention",c=1),{verdict:g,exitCode:c,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:o,stepsSkipped:k}}function He(e,t){let r=x(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=x(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!s.has(a.toLowerCase()))),o=new Map;for(let a of t){if(a.scope!=="project"||!a.project)continue;let f=a.project.toLowerCase(),y=o.get(f)??[];y.push(a),o.set(f,y);}let k=[],u=[],d=[],g=[],c=false,n=(a,f)=>{let y=o.get(a.toLowerCase())??[];if(y.length===0){d.push(a);return}let P=y.filter(p=>p.status==="fail"),b=P.filter(p=>p.required),I=y.filter(p=>p.status==="missing"),E=I.filter(p=>p.required),V=y.some(p=>p.status==="pass"||p.status==="warn");if(b.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has failed verification evidence (${b.map(p=>p.id).join(", ")}).`);return}if(P.length>0){u.push(a),c=true;return}if(E.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has missing required verification evidence (${E.map(p=>p.id).join(", ")}).`);return}if(I.length>0){u.push(a),c=true;return}if(V){k.push(a);return}d.push(a);};for(let a of r)n(a,"directly-changed");for(let a of i)n(a,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:x(k),uncovered:x(u),unverifiable:x(d)},blockingReasons:g,needsAttention:c}}function x(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function Me(e$1){let t=m.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let o=Ae(t,e$1.fromImpactPath);return {impact:await ke(o),fromImpactRef:m.relative(t,o).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g);if(await v.pathExists(r))return {impact:await ke(r),fromImpactRef:g,impactFromDisk:true};let s=m.join(t,d$3);if(await v.pathExists(s))return {impact:await p$1({workspacePath:t,fromPath:d$3,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:d$3,impactFromDisk:false};let i=await p({workspacePath:t,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:f$1,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:e.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:l(i)?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:f.diff,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",toRef:e.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function Te(e,t){if(t)return e.generatedAt}async function bt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await Me(e),o$1=r.diff.currentModel,k=i?await p({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):o$1,u=[];if(i){let l=await p$1({workspacePath:t,fromPath:r.diff.fromRef,diff:r.diff,scope:e.scope,now:e.now}),W=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],A=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(W)!==JSON.stringify(A)&&u.push("workspace.impact: Persisted impact semantics do not match the impact re-derived from the embedded diff. Regenerate diff and impact.");}i&&d(k)!==r.diff.toHash&&u.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let d$2=r.diff.git;if(i&&d$2?.available){let l=a(t,{ref:d$2.ref}),W=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),A=[...l.changedFiles.map(h=>`git.file.changed:${h}`),...l.untrackedFiles.map(h=>`git.untracked:${h}`),...l.deletedFiles.map(h=>`git.deleted:${h}`)].sort();(!l.available||l.commit!==d$2.commit||JSON.stringify(A)!==JSON.stringify(W))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=Te(r,i),c$1=Ee([...o(),...r.verificationPlan]).filter(l=>Se(e.scope,l)),n=[];for(let l of c$1)n.push(await _e(l,t,o$1.contracts.exists===true,g));let a$2=He(r,n),f=a$1(l(o$1)??{nodes:[],edges:[]}),y=b(o$1),P=await Ke(t),b$2=c(y,P?.freshness?.projectHashes),I={verdict:b$2.verdict,baseline:b$2.baseline,changed:b$2.changed,added:b$2.added,removed:b$2.removed,projectHashes:d$1(y)},E=b$1(f),V=o$1.policies?.mode??"warn",p$2=await Le(o$1,t),B=qe(V,p$2),S=Ne(n,{blockingReasons:[...a$2.blockingReasons,...E,...B.blockingReasons,...u],needsAttention:a$2.needsAttention||B.needsAttention}),he=n.filter(l=>l.status==="missing"&&l.evidencePath).map(l=>l.evidencePath),_=[...n.filter(l=>l.required&&(l.status==="fail"||l.status==="missing")).map(l=>`${l.id}: ${l.message}`),...a$2.blockingReasons,...E,...B.blockingReasons,...u],ve=p$2.filter(l=>l.severity==="error").length,be=o$1.summary?.projectCount??o$1.projects.length,U=ge({projectCount:be,verdict:S.verdict,exitCode:S.exitCode,blockingReasons:_,policyErrorCount:ve});S.verdict=U.verdict,S.exitCode=U.exitCode;let Y=Array.from(new Set(_.map(l=>l.trim()).filter(Boolean))).slice(0,12).map((l,W)=>{let A=n.find(h=>l.startsWith(`${h.id}:`));return me({reason:l,blockerId:`blocker-${W+1}`,sourceCommand:A?.command.display,sourceArtifact:A?.evidencePath,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:G})});return {schemaVersion:ye,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:S,steps:n,missingEvidence:he,blockingReasons:_,...Y.length>0?{resolutionHints:Y}:{},verificationPlan:c$1,affectedSubgraph:a$2.subgraph,graphIntegrity:f,freshness:I,policyMode:V,policyViolations:p$2}}async function Le(e$1,t){let r=[];for(let i of e$1.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await d$2(t,e.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let o of i.violations)typeof o=="string"&&o.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:o});}}catch{}return r.sort((i,o)=>i.source!==o.source?i.source.localeCompare(o.source):i.code!==o.code?i.code.localeCompare(o.code):i.message.localeCompare(o.message))}function qe(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function Ke(e){let t=m.join(e,G);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===ye?r:null}catch{return null}}async function wt(e,t){return e$1(t,G,a$2(e))}function ze(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function Rt(e,t){return ze(e,t).exitCode}export{fe as a,tt as b,ye as c,G as d,He as e,bt as f,wt as g,ze as h,Rt as i};
|