workspai 0.69.0 → 0.71.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/README.md +43 -80
- package/contracts/workspace-intelligence/decision-event.v1.json +20 -0
- package/contracts/workspace-intelligence/goal-lifecycle-result.v1.json +19 -0
- package/contracts/workspace-intelligence/proof-carrying-change-capsule.v1.json +1 -0
- package/dist/analyze-4YQ67OCK.js +1 -0
- package/dist/{artifact-remediation-plan-JHHZ4L24.js → artifact-remediation-plan-URQL5MBN.js} +1 -1
- package/dist/autopilot-release-V3A3YCDD.js +1 -0
- package/dist/capabilities-command-NFGX42CH.js +1 -0
- package/dist/chunk-26VNCHVV.js +8 -0
- package/dist/{chunk-3G5FF2JZ.js → chunk-2KJNASF3.js} +1 -1
- package/dist/chunk-37SWTS2B.js +1 -0
- package/dist/{chunk-37ZLNFV5.js → chunk-4CE3GI4Y.js} +2 -2
- package/dist/chunk-554W2TXP.js +9 -0
- package/dist/{chunk-OU3BBWH5.js → chunk-5HURQABR.js} +5 -5
- package/dist/chunk-7V3YDKMG.js +4 -0
- package/dist/{chunk-MAWHHHU3.js → chunk-ACCWXKZW.js} +2 -2
- package/dist/{chunk-WZ5V5U2K.js → chunk-AUQLOQ2S.js} +1 -1
- package/dist/chunk-AUVWD3WV.js +2 -0
- package/dist/chunk-C563KVBD.js +1 -0
- package/dist/{chunk-N2Q4MSSP.js → chunk-CX6PAQTQ.js} +5 -5
- package/dist/chunk-FE5R6EUV.js +2 -0
- package/dist/{chunk-AD4ZY3RF.js → chunk-FFE2JZZJ.js} +8 -8
- package/dist/{chunk-EBEAJIBI.js → chunk-GL3KLNIG.js} +1 -1
- package/dist/{chunk-BM2F5C4J.js → chunk-H64KAPJJ.js} +1 -1
- package/dist/chunk-HMKDU7OU.js +2 -0
- package/dist/{chunk-IBJEQHJR.js → chunk-HV6EQMUJ.js} +24 -7
- package/dist/{chunk-EG6EZ7HW.js → chunk-IOKEF3DE.js} +1 -1
- package/dist/{chunk-A3MYO55A.js → chunk-IRLKWRLP.js} +2 -2
- package/dist/chunk-JK6XEF7K.js +6 -0
- package/dist/{chunk-ABMB6MJT.js → chunk-K2LKJBQ4.js} +1 -1
- package/dist/{chunk-V6TIT6M3.js → chunk-L5IV2SI4.js} +1 -1
- package/dist/{chunk-M37ALD4V.js → chunk-LOXR5QUX.js} +1 -1
- package/dist/{chunk-KFTJVVJR.js → chunk-M2R6UXJB.js} +1 -1
- package/dist/{chunk-XPGCFVGC.js → chunk-QHHSSIMZ.js} +1 -1
- package/dist/chunk-RMGSMDJW.js +5 -0
- package/dist/chunk-TD5TQZEG.js +2 -0
- package/dist/{chunk-YKY4JFCF.js → chunk-XVTN5DDV.js} +1 -1
- package/dist/chunk-XY537LCX.js +1 -0
- package/dist/chunk-YC676TPF.js +1 -0
- package/dist/chunk-YS34N35Y.js +2 -0
- package/dist/chunk-ZOE43SGQ.js +1 -0
- package/dist/{create-GWBQ74ZI.js → create-HSHAZYAK.js} +1 -1
- package/dist/{doctor-OQAXSMEM.js → doctor-VZ2MZ7EI.js} +1 -1
- package/dist/{dotnet-webapi-clean-XL4IBUQV.js → dotnet-webapi-clean-VJX6SGGP.js} +39 -33
- package/dist/{goal-lifecycle-YWBVQ2DF.js → goal-lifecycle-NKSCALES.js} +1 -1
- package/dist/{goal-pack-KUXPZVNO.js → goal-pack-MPKW4K6F.js} +1 -1
- package/dist/{gofiber-standard-OHHMCNMJ.js → gofiber-standard-I6ASLOEE.js} +77 -66
- package/dist/{gogin-standard-BAZXPOKL.js → gogin-standard-U2LSRLIP.js} +78 -67
- package/dist/index.js +102 -102
- package/dist/pipeline-RIA5UXUC.js +5 -0
- package/dist/{project-agent-entry-H3JAGNLS.js → project-agent-entry-GQAPCSOT.js} +1 -1
- package/dist/{project-intelligence-lens-7NMKHV5N.js → project-intelligence-lens-5I2GQBWC.js} +1 -1
- package/dist/{project-test-coverage-3DKZKLWY.js → project-test-coverage-4RRCHY5W.js} +1 -1
- package/dist/proof-carrying-change-T33C2SSD.js +1 -0
- package/dist/{rust-axum-CCJ6UCBW.js → rust-axum-JMV7UPO7.js} +25 -20
- package/dist/{springboot-standard-M5JQEJML.js → springboot-standard-OC2RS3KC.js} +41 -39
- package/dist/verified-goal-MK5MXGRY.js +1 -0
- package/dist/{workspace-TJHCETBV.js → workspace-AZKZPG45.js} +1 -1
- package/dist/{workspace-agent-sync-Z35NTXCB.js → workspace-agent-sync-CGK44F3O.js} +1 -1
- package/dist/{workspace-context-KNJQUJWC.js → workspace-context-S6ZWRUFZ.js} +1 -1
- package/dist/{workspace-contract-VIUQT5SZ.js → workspace-contract-Y7WRHLYR.js} +1 -1
- package/dist/{workspace-explain-HM6GMK26.js → workspace-explain-CSJL3GJR.js} +1 -1
- package/dist/{workspace-feedback-YSPEGCON.js → workspace-feedback-D6HJLKBQ.js} +1 -1
- package/dist/{workspace-foundation-PLXFPI3J.js → workspace-foundation-LLND2WIF.js} +1 -1
- package/dist/{workspace-graph-stream-FNRQ2FTB.js → workspace-graph-stream-PHFO2J2E.js} +1 -1
- package/dist/{workspace-history-HDDFG6LH.js → workspace-history-WWPS4U7H.js} +1 -1
- package/dist/{workspace-intelligence-QLSD5EEV.js → workspace-intelligence-ND2N3B2A.js} +1 -1
- package/dist/{workspace-intelligence-runner-4EW4T2OW.js → workspace-intelligence-runner-LHHJM2AT.js} +1 -1
- package/dist/{workspace-knowledge-graph-EEOW5VAJ.js → workspace-knowledge-graph-NOGGGENE.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-7XHZNRFK.js +1 -0
- package/dist/workspace-mcp-serve-6NVF7AS6.js +3 -0
- package/dist/{workspace-model-NCOOY5LC.js → workspace-model-VOQOEDVU.js} +1 -1
- package/dist/{workspace-onboarding-JNC7ZFMR.js → workspace-onboarding-ZRLUMBLE.js} +1 -1
- package/dist/{workspace-readme-OV2ADTLW.js → workspace-readme-HA6XLDME.js} +2 -2
- package/dist/{workspace-registry-summary-ONT4VOJX.js → workspace-registry-summary-NWZK5IKS.js} +1 -1
- package/dist/workspace-repair-engine-VUOCH66O.js +3 -0
- package/dist/workspace-run-3YZTVOU6.js +1 -0
- package/dist/{workspace-verify-MLABQUWK.js → workspace-verify-4EQI3MCW.js} +1 -1
- package/dist/{workspace-watch-MJOG5AZ3.js → workspace-watch-BPRU2X7K.js} +1 -1
- package/docs/README.md +39 -34
- package/docs/README_CONTENT_CONTRACT.md +14 -9
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +41 -33
- package/docs/contracts/PROOF_CARRYING_CHANGE_CONTRACT_PLAN.md +6 -3
- package/docs/native-kit-baselines.md +82 -0
- package/docs/proof-carrying-change.implementation.v1.json +3 -2
- package/docs/proof-carrying-change.md +42 -8
- package/docs/real-world-qualification.md +8 -3
- package/docs/workspace-knowledge-graph.md +6 -2
- package/docs/workspace-run.md +16 -0
- package/package.json +1 -1
- package/dist/analyze-GPYPXXRT.js +0 -1
- package/dist/autopilot-release-FL47VMF7.js +0 -1
- package/dist/capabilities-command-MYSLJIYS.js +0 -1
- package/dist/chunk-2LZWBUJD.js +0 -1
- package/dist/chunk-3HFFKW4Q.js +0 -2
- package/dist/chunk-ERVWW5HX.js +0 -1
- package/dist/chunk-GSSJJS5M.js +0 -6
- package/dist/chunk-I3UCODXU.js +0 -1
- package/dist/chunk-MBICKDYP.js +0 -1
- package/dist/chunk-MHQHRMKU.js +0 -5
- package/dist/chunk-OZXCNVGW.js +0 -2
- package/dist/chunk-RVOW3BHQ.js +0 -2
- package/dist/chunk-UW4SESKD.js +0 -2
- package/dist/chunk-VNKAISFE.js +0 -8
- package/dist/chunk-W6WRT77T.js +0 -1
- package/dist/chunk-WHR5SL33.js +0 -4
- package/dist/chunk-YWZBGSFE.js +0 -9
- package/dist/chunk-YZL7ZY7J.js +0 -2
- package/dist/pipeline-PGB5TEV3.js +0 -5
- package/dist/proof-carrying-change-QFH7WI2E.js +0 -1
- package/dist/verified-goal-7XHRWYSE.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-X347REDB.js +0 -1
- package/dist/workspace-mcp-serve-NQ42PE2I.js +0 -3
- package/dist/workspace-repair-engine-WMJCYWO4.js +0 -3
- package/dist/workspace-run-3S35MDX6.js +0 -1
package/README.md
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
## Workspace Intelligence for software systems
|
|
15
15
|
|
|
16
|
+
Workspai is an open-source CLI that gives people and AI tools one governed view
|
|
17
|
+
of the software system they are changing.
|
|
18
|
+
|
|
16
19
|
```bash
|
|
17
20
|
npx workspai adopt .
|
|
18
21
|
npx workspai workspace intelligence run --for-agent generic
|
|
@@ -47,36 +50,23 @@ for every supported host, without duplicating the Model or Graph.
|
|
|
47
50
|
|
|
48
51
|
### What the output looks like
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
The canonical workspace owns the Model, Graph, context, evidence index, and
|
|
54
|
+
Skills. Each linked project keeps only its portable entry, scoped context, and
|
|
55
|
+
workspace binding:
|
|
53
56
|
|
|
54
57
|
```text
|
|
55
|
-
your-workspace/
|
|
58
|
+
your-workspace/
|
|
56
59
|
├── .workspai/
|
|
57
|
-
│ ├──
|
|
58
|
-
│
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
│ └── skills/ # detected operational playbooks
|
|
64
|
-
├── AGENTS.md · CLAUDE.md · GEMINI.md · QWEN.md
|
|
65
|
-
├── .cursor/ · .claude/ · .github/ · .agents/ # host-native projections
|
|
66
|
-
├── nova-api/
|
|
67
|
-
│ ├── .agents/skills/workspai-*/SKILL.md # portable project Skill wrappers
|
|
68
|
-
│ └── .workspai/
|
|
69
|
-
│ ├── agent-entry.v1.json # canonical project entry
|
|
70
|
-
│ ├── workspace-link.local.json # machine-local binding
|
|
71
|
-
│ └── reports/
|
|
72
|
-
│ ├── project-context-agent.json
|
|
73
|
-
│ └── project-knowledge-graph-reference.json
|
|
74
|
-
└── summit-web/ # same project-level boundary
|
|
60
|
+
│ ├── reports/ # Model, Graph, verification, context
|
|
61
|
+
│ └── skills/ # evidence-derived playbooks
|
|
62
|
+
├── AGENTS.md · .codex/ · .cursor/ · .claude/ · .github/ · .agents/
|
|
63
|
+
└── project/.workspai/
|
|
64
|
+
├── agent-entry.v1.json # portable project entry
|
|
65
|
+
└── workspace-link.local.json # machine-local binding
|
|
75
66
|
```
|
|
76
67
|
|
|
77
|
-
Your agent starts with `agent-entry.v1.json`, compact workspace context, and the
|
|
78
|
-
index; it then retrieves
|
|
79
|
-
scan or complete Graph load is needed for ordinary work.
|
|
68
|
+
Your agent starts with `agent-entry.v1.json`, compact workspace context, and the
|
|
69
|
+
Skills index; it then retrieves task-scoped Graph evidence and targeted source.
|
|
80
70
|
|
|
81
71
|

|
|
82
72
|
|
|
@@ -85,18 +75,6 @@ scan or complete Graph load is needed for ordinary work.
|
|
|
85
75
|
[How it works](#how-workspace-intelligence-works) ·
|
|
86
76
|
[Documentation](docs/README.md)
|
|
87
77
|
|
|
88
|
-
## Why Workspai
|
|
89
|
-
|
|
90
|
-
Workspai is an open-source CLI that brings related software projects together,
|
|
91
|
-
so people and AI tools can understand and work with the same system.
|
|
92
|
-
|
|
93
|
-
- **See the whole system:** registered projects and proven relationships in one model.
|
|
94
|
-
- **Ask with proof:** trace answers back to their evidence record and source location.
|
|
95
|
-
- **Change safely:** know impact before you commit, verify after, and give AI agents
|
|
96
|
-
only the context they need.
|
|
97
|
-
|
|
98
|
-

|
|
99
|
-
|
|
100
78
|
## Start in two minutes
|
|
101
79
|
|
|
102
80
|
### Use an existing project
|
|
@@ -135,14 +113,8 @@ Choose whether to create a workspace, scaffold a project, or add existing
|
|
|
135
113
|
software. Project starters are grouped as Backend, Frontend, Desktop, and
|
|
136
114
|
Extension.
|
|
137
115
|
|
|
138
|
-
Global installation is optional:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
npm install -g workspai
|
|
142
|
-
workspai --help
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
`wspai` is an optional short alias for the same CLI.
|
|
116
|
+
Global installation is optional: `npm install -g workspai`. `wspai` is a short
|
|
117
|
+
alias for the same CLI.
|
|
146
118
|
|
|
147
119
|
## Give your agent a goal, not an open-ended prompt
|
|
148
120
|
|
|
@@ -150,10 +122,7 @@ Describe the outcome in plain language from the adopted project:
|
|
|
150
122
|
|
|
151
123
|
```bash
|
|
152
124
|
npx workspai goal "Raise test coverage to 85%" --for-agent generic
|
|
153
|
-
# In a polyglot scope, choose interactively or bind a canonical runtime:
|
|
154
125
|
npx workspai goal "Raise test coverage to 85%" --runtime cpp --for-agent generic
|
|
155
|
-
# Or pursue feature, defect, refactor, performance, documentation, or
|
|
156
|
-
# system-understanding outcomes in the same governed flow.
|
|
157
126
|
npx workspai goal "Add retry with exponential backoff" --for-agent generic
|
|
158
127
|
```
|
|
159
128
|
|
|
@@ -173,8 +142,6 @@ Multi-project scope and polyglot runtime choices are explicit. Interactive
|
|
|
173
142
|
users get bounded choices from the canonical Workspace Model; automation gets
|
|
174
143
|
a machine-readable decision and can use `--scope` and `--runtime`.
|
|
175
144
|
|
|
176
|
-

|
|
177
|
-
|
|
178
145
|
[Learn how Goal Packs work](docs/goal-packs.md)
|
|
179
146
|
|
|
180
147
|
## Make every agent change carry proof
|
|
@@ -183,9 +150,8 @@ For source-changing work, begin a Goal-bound change before mutation:
|
|
|
183
150
|
|
|
184
151
|
```bash
|
|
185
152
|
npx workspai change begin --json
|
|
186
|
-
npx workspai change list --json
|
|
187
153
|
npx workspai change authorize --change <change-id> --effects filesystem,command --json
|
|
188
|
-
|
|
154
|
+
npx workspai change effect record --change <change-id> --file effect-receipt.json --json
|
|
189
155
|
npx workspai change verify --change <change-id> --strict --json
|
|
190
156
|
npx workspai change capsule validate --change <change-id> --json
|
|
191
157
|
```
|
|
@@ -195,10 +161,11 @@ observed effects, predicted-versus-actual Graph changes, verification receipts,
|
|
|
195
161
|
and remaining uncertainty. Prediction can guide work but can never prove its
|
|
196
162
|
own result. [Learn how Proof-Carrying Change works](docs/proof-carrying-change.md).
|
|
197
163
|
|
|
164
|
+

|
|
165
|
+
|
|
198
166
|
## What happens after the first run
|
|
199
167
|
|
|
200
|
-
|
|
201
|
-
generated in one run. The key files for each audience:
|
|
168
|
+
The key outputs for each audience are:
|
|
202
169
|
|
|
203
170
|
| Audience | What to read |
|
|
204
171
|
| ------------------- | ---------------------------------------------------------------------------- |
|
|
@@ -280,25 +247,24 @@ explicitly unproven.
|
|
|
280
247
|
|
|
281
248
|
## Everyday workflows
|
|
282
249
|
|
|
283
|
-
| Goal | Command
|
|
284
|
-
| ------------------------------------------- |
|
|
285
|
-
| Use guided setup | `npx workspai create`
|
|
286
|
-
| Link a project without moving it | `npx workspai adopt .`
|
|
287
|
-
|
|
|
288
|
-
|
|
|
289
|
-
|
|
|
290
|
-
|
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
|
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
|
|
|
300
|
-
|
|
|
301
|
-
| Start MCP server for workspace queries | `npx workspai workspace mcp serve` |
|
|
250
|
+
| Goal | Command |
|
|
251
|
+
| ------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
252
|
+
| Use guided setup | `npx workspai create` |
|
|
253
|
+
| Link a project without moving it | `npx workspai adopt .` |
|
|
254
|
+
| Initialize workspace and project dependencies | `npx workspai init` |
|
|
255
|
+
| Refresh the complete system view | `npx workspai workspace intelligence run --for-agent generic --strict --json` |
|
|
256
|
+
| Turn an outcome into governed work | `npx workspai goal "Raise test coverage to 85%"` |
|
|
257
|
+
| Prove an agent change from intent to verify | `npx workspai change begin --json` |
|
|
258
|
+
| Ground an agent before source discovery | `npx workspai agent bootstrap --for-agent generic --strict --json` |
|
|
259
|
+
| Copy or clone a project into a workspace | `npx workspai import <path-or-git-url> --workspace <path>` |
|
|
260
|
+
| Diagnose project or workspace health | `npx workspai doctor project` / `npx workspai doctor workspace` |
|
|
261
|
+
| Observe CLI and Studio activity | `npx workspai live --once --json --projection board` |
|
|
262
|
+
| Ask a focused architecture question | `npx workspai workspace graph search "authentication service" --limit 12 --json` |
|
|
263
|
+
| Verify current evidence | `npx workspai workspace verify --strict --json` |
|
|
264
|
+
| Inspect a governed repair before execution | `npx workspai workspace repair capabilities --json` |
|
|
265
|
+
| Refresh agent and IDE context | `npx workspai workspace agent-sync --write --preset enterprise --json` |
|
|
266
|
+
| Run the broader release gate | `npx workspai pipeline --strict --json` |
|
|
267
|
+
| Start MCP server for workspace queries | `npx workspai workspace mcp serve` |
|
|
302
268
|
|
|
303
269
|
For every command and flag, use the
|
|
304
270
|
[Command Reference](docs/commands-reference.md).
|
|
@@ -312,7 +278,7 @@ Workspai exposes the same governed data through several stable surfaces:
|
|
|
312
278
|
- versioned artifacts under `.workspai/reports/`;
|
|
313
279
|
- focused context and instructions for AI agents;
|
|
314
280
|
- MCP server with versioned read-oriented workspace tools (`workspace mcp serve`);
|
|
315
|
-
-
|
|
281
|
+
- Live activity projections and reports for IDEs and dashboards;
|
|
316
282
|
- JSON, JSON-LD, Mermaid, DOT, GraphML, and GEXF graph exports.
|
|
317
283
|
|
|
318
284
|
The [Workspai VS Code extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode)
|
|
@@ -339,11 +305,14 @@ modules; Workspai remains the workspace-level CLI.
|
|
|
339
305
|
| Create, adopt, import, or connect software | [Creating workspaces and projects](docs/creating-workspaces-and-projects.md) |
|
|
340
306
|
| Query Graph and inspect proof | [Workspace Knowledge Graph](docs/workspace-knowledge-graph.md) |
|
|
341
307
|
| Understand the exact decision loop | [Workspace Intelligence runner](docs/workspace-intelligence-runner.md) |
|
|
308
|
+
| Run dependency, test, and build stages | [Workspace Run](docs/workspace-run.md) |
|
|
309
|
+
| Observe CLI and Studio activity | [Workspai Live](docs/workspace-live-activity.md) |
|
|
342
310
|
| Plan, approve, execute, or roll back a repair | [Workspace Repair Engine](docs/workspace-repair-engine.md) |
|
|
343
311
|
| Set a release, security, or coverage outcome | [Verified engineering goals](docs/workspace-intelligence-runner.md#verified-engineering-goals) |
|
|
344
312
|
| Compile plain language into a governed plan | [Goal Packs](docs/goal-packs.md) |
|
|
345
313
|
| Prove what an agent changed and why | [Proof-Carrying Change](docs/proof-carrying-change.md) |
|
|
346
314
|
| Ground an agent in canonical project evidence | [Canonical-first agent entry](docs/agent-entry.md) |
|
|
315
|
+
| Measure bounded retrieval and model usage | [Evaluation](docs/workspace-intelligence-evaluation.md) and [benchmark](docs/workspace-intelligence-benchmark.md) |
|
|
347
316
|
| Integrate CI | [CI workflows](docs/ci-workflows.md) |
|
|
348
317
|
| Find generated files and schemas | [Artifact Catalog](docs/contracts/ARTIFACT_CATALOG.md) |
|
|
349
318
|
| Browse all documentation | [Documentation index](docs/README.md) |
|
|
@@ -364,12 +333,6 @@ Workspai is developed in the open by
|
|
|
364
333
|
[Chistiq](https://chistiq.com/), the intelligence infrastructure company behind
|
|
365
334
|
RapidKit and Workspai.
|
|
366
335
|
|
|
367
|
-
```bash
|
|
368
|
-
npm ci
|
|
369
|
-
npm run build
|
|
370
|
-
npm test
|
|
371
|
-
```
|
|
372
|
-
|
|
373
336
|
Read [CONTRIBUTING.md](CONTRIBUTING.md), the
|
|
374
337
|
[Development Guide](docs/DEVELOPMENT.md), and the
|
|
375
338
|
[Security Policy](docs/SECURITY.md).
|
|
@@ -47,6 +47,25 @@
|
|
|
47
47
|
},
|
|
48
48
|
"additionalProperties": false
|
|
49
49
|
},
|
|
50
|
+
"deletedArtifactReference": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"required": ["artifact", "observedAt", "digest"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"artifact": { "type": "string", "minLength": 1 },
|
|
55
|
+
"observedAt": { "type": "string", "format": "date-time" },
|
|
56
|
+
"digest": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["algorithm", "semantics", "value"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"algorithm": { "const": "sha256" },
|
|
61
|
+
"semantics": { "const": "deletion-tombstone-v1" },
|
|
62
|
+
"value": { "$ref": "#/$defs/sha256" }
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
},
|
|
50
69
|
"scope": {
|
|
51
70
|
"type": "object",
|
|
52
71
|
"required": ["kind", "projects"],
|
|
@@ -76,6 +95,7 @@
|
|
|
76
95
|
"summary": { "type": "string", "minLength": 1 },
|
|
77
96
|
"command": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
|
|
78
97
|
"artifacts": { "type": "array", "items": { "$ref": "#/$defs/artifactReference" } },
|
|
98
|
+
"deletedArtifacts": { "type": "array", "items": { "$ref": "#/$defs/deletedArtifactReference" }, "uniqueItems": true },
|
|
79
99
|
"observedAt": { "type": "string", "format": "date-time" },
|
|
80
100
|
"idempotencyKey": { "type": "string", "minLength": 1 }
|
|
81
101
|
},
|
|
@@ -132,6 +132,25 @@
|
|
|
132
132
|
"agentHandoff": { "type": "string" },
|
|
133
133
|
"verifiedGoalId": { "type": "string" },
|
|
134
134
|
"repairTransactionId": { "type": "string" },
|
|
135
|
+
"repairTransactionIds": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"maxItems": 25,
|
|
138
|
+
"uniqueItems": true,
|
|
139
|
+
"items": { "type": "string", "minLength": 1 }
|
|
140
|
+
},
|
|
141
|
+
"changeTransactionId": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$"
|
|
144
|
+
},
|
|
145
|
+
"changeTransactionIds": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"maxItems": 25,
|
|
148
|
+
"uniqueItems": true,
|
|
149
|
+
"items": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
135
154
|
"verificationReceipt": {
|
|
136
155
|
"type": "object",
|
|
137
156
|
"required": [
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"actualOverlay": { "oneOf": [{ "$ref": "decision-event.v1.json#/$defs/artifactReference" }, { "type": "null" }] },
|
|
31
31
|
"surpriseReport": { "oneOf": [{ "$ref": "decision-event.v1.json#/$defs/artifactReference" }, { "type": "null" }] },
|
|
32
32
|
"effects": { "type": "array", "items": { "$ref": "decision-event.v1.json#/$defs/artifactReference" } },
|
|
33
|
+
"deletedArtifacts": { "type": "array", "items": { "$ref": "decision-event.v1.json#/$defs/deletedArtifactReference" }, "uniqueItems": true },
|
|
33
34
|
"verification": { "type": "array", "items": { "$ref": "decision-event.v1.json#/$defs/artifactReference" } },
|
|
34
35
|
"assurances": {
|
|
35
36
|
"type": "array",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-554W2TXP.js';
|
package/dist/{artifact-remediation-plan-JHHZ4L24.js → artifact-remediation-plan-URQL5MBN.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as buildArtifactRemediationPlan,b as writeArtifactRemediationPlan}from'./chunk-
|
|
1
|
+
export{a as buildArtifactRemediationPlan,b as writeArtifactRemediationPlan}from'./chunk-IRLKWRLP.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-26VNCHVV.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as runDoctorCapabilities}from'./chunk-JK6XEF7K.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {b}from'./chunk-RMGSMDJW.js';import {a as a$1,e}from'./chunk-37SWTS2B.js';import {a as a$3}from'./chunk-MGL6DBOR.js';import {g,a,h}from'./chunk-FE5R6EUV.js';import {p,s}from'./chunk-ODK4LCEL.js';import a$2 from'chalk';import re from'fs';import b$1 from'path';import {execa}from'execa';var V="autopilot-release-last-run.json",G="autopilot-release.json";function $(r){try{return JSON.parse(r)}catch{return null}}function Se(r){let e=b$1.resolve(r),n=a$3(e);if(!n)throw new Error("No Workspai workspace found in current directory or parents");return n}async function S(r,e){let n=process.argv[1];if(!n)return {exitCode:1,stdout:"",stderr:"RapidKit entrypoint is unavailable for autopilot execution.",crashed:true};try{let o=await execa(process.execPath,[n,...r],{cwd:e,reject:false,env:{...process.env,RAPIDKIT_AUTOPILOT_CHILD:"1"}});return {exitCode:Number(o.exitCode??1),stdout:o.stdout,stderr:o.stderr,crashed:false}}catch(o){return {exitCode:1,stdout:"",stderr:o instanceof Error?o.message:String(o),crashed:true}}}function oe(r){let e=r.toLowerCase();return e==="pass"?"pass":e==="warn"?"warn":e==="fail"?"fail":"warn"}function ae(r){return r.summary.failed>0||r.gates.results.some(e=>e.status==="fail")?"fail":r.gates.results.some(e=>e.status==="warn")?"warn":"pass"}function be(r){let e=r.filter(o=>o.status!=="skipped");if(e.length===0)return 100;let n=e.reduce((o,t)=>t.status==="pass"?o+1:t.status==="warn"?o+.6:o,0);return Math.round(n/e.length*100)}function Ae(r){return r.executionError?["Re-run: npx workspai autopilot release --mode audit --json","Inspect .workspai/reports/autopilot-release-last-run.json for execution failure details"]:r.blockers.length>0?["Run: npx workspai doctor workspace --plan","Run: npx workspai readiness --json --strict","Run: npx workspai workspace run test --affected --strict"]:r.hasWarnings&&r.mode!=="enforce"?["Review warning-level findings in autopilot report","Optionally run: npx workspai autopilot release --mode safe-fix"]:["Workspace is release-ready based on current autopilot policy"]}async function xe(r,e){await re.promises.mkdir(b$1.dirname(r),{recursive:true}),await re.promises.writeFile(r,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`,"utf-8");}async function ze(r){let e$1=Se(r.workspacePath),n=r.mode,o=[],t=[],L,H,N,q,Q,X=0,f=false,I=0,_=0,W=-1,T=-1,c="skipped",d="skipped",ne=n==="enforce"?["doctor","workspace","--json","--strict"]:["doctor","workspace","--json","--ci"];if(r.skipPipelineStages)o.push({name:"doctor-workspace",status:"skipped",durationMs:0,summary:"doctor stage skipped (pipeline already executed)"},{name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped (pipeline already executed)"},{name:"readiness",status:"skipped",durationMs:0,summary:"readiness stage skipped (pipeline already executed)"});else {let s=Date.now(),l=await S([...ne],e$1),m=Date.now()-s;if(c="pass",l.crashed)c="fail",f=true,t.push(`doctor workspace execution error: ${l.stderr||"unknown error"}`);else if(l.exitCode===1)c="fail",t.push("doctor workspace command failed or reported errors");else if(l.exitCode===2)c="warn",t.push("doctor workspace reported warnings");else if(l.exitCode!==0)c="fail",t.push("doctor workspace command failed");else {let p=$(l.stdout),E=p&&p.healthScore&&typeof p.healthScore=="object"?p.healthScore:{},k=Number(E.errors??0),C=Number(E.warnings??0);Number.isFinite(k)&&k>0?(c="fail",t.push(`doctor workspace reports ${k} error(s)`)):Number.isFinite(C)&&C>0&&(c="warn");}W=o.push({name:"doctor-workspace",status:c,durationMs:m,summary:c==="pass"?"doctor workspace passed":c==="warn"?"doctor workspace reported warnings":"doctor workspace reported errors"})-1,n==="enforce"&&c==="warn"&&t.push("doctor workspace reported warnings under enforce mode");let g$1=Date.now(),w=await S(["analyze","--json"],e$1),P=Date.now()-g$1;H=await g(e$1,p.analyze)??a(e$1,p.analyze);let i="pass";if(w.crashed)i="fail",f=true,t.push(`analyze execution error: ${w.stderr||"unknown error"}`);else if(w.exitCode!==0)i=w.exitCode===2?"warn":"fail",t.push(w.exitCode===2?"analyze reported needs-attention verdict":"analyze command failed or reported blocked verdict");else {let p=$(w.stdout),E=p&&p.summary&&typeof p.summary=="object"?p.summary:{},k=String(E.verdict??"ready");k==="blocked"?(i="fail",t.push("analyze reported blocked verdict")):k==="needs-attention"&&(i="warn");}o.push({name:"analyze",status:i,durationMs:P,summary:i==="pass"?"analyze passed":i==="warn"?"analyze reported needs-attention":"analyze reported blocked verdict"}),n==="enforce"&&i==="warn"&&t.push("analyze reported warnings under enforce mode");let v=Date.now(),h=await S(["readiness","--json"],e$1),y=Date.now()-v;if(d="fail",h.crashed)d="fail",f=true,t.push(`readiness execution error: ${h.stderr||"unknown error"}`);else if(h.exitCode!==0)d="fail",t.push("readiness command failed");else {let p=$(h.stdout),E=String(p?.overallStatus??"fail");if(d=oe(E),typeof p?.evidencePath=="string"&&p.evidencePath.trim().length>0&&(L=p.evidencePath),d==="fail"){let k=Array.isArray(p?.blockingReasons)?p?.blockingReasons.filter(C=>typeof C=="string"):[];k.length>0?t.push(...k.map(C=>`readiness: ${C}`)):t.push("readiness overall status is fail");}}T=o.push({name:"readiness",status:d,durationMs:y,summary:`readiness overall status is ${d}`})-1,n==="enforce"&&d==="warn"&&t.push("readiness reported warnings under enforce mode");}let ie=Date.now(),D=await S(["doctor","workspace","--plan","--json"],e$1),le=Date.now()-ie,R="warn";if(D.crashed)R="fail",f=true,t.push(`doctor remediation plan execution error: ${D.stderr||"unknown error"}`);else if(D.exitCode!==0)R="fail",t.push("doctor remediation plan command failed");else {let s=$(D.stdout),l=s&&s.remediationPlan&&typeof s.remediationPlan=="object"?s.remediationPlan:null,m=Number(l?.totalSteps??0),g=Number(l?.executableSteps??0);Number.isFinite(m)&&m>0&&(I=m),Number.isFinite(g)&&g>0&&(_=g),Number.isFinite(m)&&m===0?R="pass":R="warn";}if(o.push({name:"remediation-plan",status:R,durationMs:le,summary:R==="pass"?"no remediation steps required":"remediation steps available"}),n==="enforce"&&R==="warn"&&t.push("remediation plan has pending steps under enforce mode"),n==="safe-fix"){let s=Date.now(),l=await S(["doctor","workspace","--apply"],e$1),m=Date.now()-s,g=l.crashed||l.exitCode!==0?"fail":"pass";if(l.crashed)f=true,t.push(`doctor remediation apply execution error: ${l.stderr||"unknown error"}`);else if(g==="fail")t.push("doctor remediation apply failed");else {X=_>0?_:I>0?I:1;let w=await S(["doctor","workspace","--json"],e$1);if(w.crashed)c="fail",f=true,t.push(`post-apply doctor execution error: ${w.stderr||"unknown error"}`);else if(w.exitCode!==0)c="fail",t.push("post-apply doctor workspace command failed");else {let i=$(w.stdout),v=i&&i.healthScore&&typeof i.healthScore=="object"?i.healthScore:{},h=Number(v.errors??0),y=Number(v.warnings??0);Number.isFinite(h)&&h>0?(c="fail",t.push(`post-apply doctor reports ${h} error(s)`)):Number.isFinite(y)&&y>0?c="warn":c="pass";}W>=0&&(o[W].status=c,o[W].summary=`doctor workspace post-apply status is ${c}`);let P=await S(["readiness","--json"],e$1);if(P.crashed)d="fail",f=true,t.push(`post-apply readiness execution error: ${P.stderr||"unknown error"}`);else if(P.exitCode!==0)d="fail",t.push("post-apply readiness command failed");else {let i=$(P.stdout),v=String(i?.overallStatus??"fail");if(d=oe(v),typeof i?.evidencePath=="string"&&i.evidencePath.trim().length>0&&(L=i.evidencePath),d==="fail"){let h=Array.isArray(i?.blockingReasons)?i?.blockingReasons.filter(y=>typeof y=="string"):[];h.length>0?t.push(...h.map(y=>`post-apply readiness: ${y}`)):t.push("post-apply readiness overall status is fail");}}T>=0&&(o[T].status=d,o[T].summary=`readiness post-apply overall status is ${d}`);}o.push({name:"remediation-apply",status:g,durationMs:m,summary:g==="pass"?"safe remediation apply completed":"safe remediation apply failed"});}else o.push({name:"remediation-apply",status:"skipped",durationMs:0,summary:"remediation apply is skipped for this mode"});let ce=Date.now(),A="pass",x="workspace test/build completed for selected projects";try{let s=await b({workspacePath:e$1,stage:"test",affected:true,since:r.since,parallel:r.parallel,maxWorkers:r.maxWorkers,strict:true,json:true,enforceGates:false});N=a(e$1,b$1.join(".workspai","reports",a$1)),await e(e$1,s),q=N;let l=ae(s);if(l==="fail")A="fail",x="workspace test stage failed for selected projects",t.push("workspace run test failed for selected projects");else {l==="warn"&&(A="warn",x="workspace test stage completed with warnings",n==="enforce"&&t.push("workspace run test reported warnings under enforce mode"));let m=await b({workspacePath:e$1,stage:"build",affected:true,since:r.since,parallel:r.parallel,maxWorkers:r.maxWorkers,strict:true,json:true,enforceGates:false});await e(e$1,m),Q=N;let g=ae(m);g==="fail"?(A="fail",x="workspace build stage failed for selected projects",t.push("workspace run build failed for selected projects")):g==="warn"&&(A="warn",x="workspace test/build completed with warnings",n==="enforce"&&t.push("workspace run test/build reported warnings under enforce mode"));}}catch(s){A="fail",x="workspace test/build orchestration failed",f=true,t.push(`workspace run orchestration error: ${s instanceof Error?s.message:String(s)}`);}let pe=Date.now()-ce;o.push({name:"workspace-run-test-build",status:A,durationMs:pe,summary:x});let M=o.filter(s=>s.status==="warn").length,ue=o.filter(s=>s.status==="fail").length,F=n==="enforce"?o.some(s=>s.status==="warn"||s.status==="fail"):ue>0,j=[...new Set(t)],O=f||F?Math.max(1,j.length):0,de=O>0?j:[],fe=O===0?j:[],me=be(o),ge=f||F?"blocked":M>0?"partial":"approved",we=f?3:F?1:M>0?2:0,he=Ae({mode:n,executionError:f,blockers:j,hasWarnings:M>0}),Y=a(e$1,".workspai/reports"),ke=b$1.join(Y,V),ye=b$1.join(Y,G),u={schemaVersion:s.autopilotReleaseLastRun.schemaVersion,generatedAt:new Date().toISOString(),workspacePath:e$1,mode:n,summary:{releaseScore:me,verdict:ge,blockers:O,warnings:M,safeFixesApplied:X,manualActions:j.length,exitCode:we},stages:o,blockingReasons:de,warningReasons:fe,nextActions:he,artifacts:{reportPath:ke,aliasEvidencePath:ye,analyzeEvidencePath:H,readinessEvidencePath:L,workspaceRunEvidencePath:N,workspaceRunTestPath:q,workspaceRunBuildPath:Q},enterpriseControls:{jsonReady:true,evidencePath:`.workspai/reports/${V}`,aliasEvidencePath:`.workspai/reports/${G}`}};if(await h(e$1,`.workspai/reports/${V}`,u),await h(e$1,`.workspai/reports/${G}`,u),r.output&&await xe(b$1.resolve(r.output),u),!r.json){console.log(a$2.bold.cyan(`
|
|
3
|
+
\u{1F680} Workspai Autopilot Release
|
|
4
|
+
`)),console.log(a$2.bold(`Workspace: ${a$2.cyan(b$1.basename(e$1))}`)),console.log(a$2.gray(`Path: ${e$1}`)),console.log(a$2.white(`Mode: ${n}`)),console.log(a$2.white(`Verdict: ${u.summary.verdict==="approved"?a$2.green("approved"):u.summary.verdict==="partial"?a$2.yellow("partial"):a$2.red("blocked")}`)),console.log(a$2.white(`Release score: ${u.summary.releaseScore}`));for(let s of u.stages){let l=s.status==="pass"?a$2.green("PASS"):s.status==="warn"?a$2.yellow("WARN"):s.status==="skipped"?a$2.gray("SKIP"):a$2.red("FAIL");console.log(` - ${s.name}: ${l} ${s.summary} (${s.durationMs}ms)`);}if(u.blockingReasons.length>0){console.log(a$2.bold.red(`
|
|
5
|
+
Blocking reasons:`));for(let s of u.blockingReasons)console.log(a$2.red(` - ${s}`));}if(u.warningReasons.length>0){console.log(a$2.bold.yellow(`
|
|
6
|
+
Warning reasons:`));for(let s of u.warningReasons)console.log(a$2.yellow(` - ${s}`));}if(u.nextActions.length>0){console.log(a$2.bold(`
|
|
7
|
+
Next actions:`));for(let s of u.nextActions)console.log(a$2.gray(` - ${s}`));}console.log(a$2.gray(`
|
|
8
|
+
Report: ${u.artifacts.reportPath}`));}return u}export{V as a,G as b,ze as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,m}from'./chunk-
|
|
1
|
+
import {d,m}from'./chunk-ZOE43SGQ.js';import {a,b}from'./chunk-S5KTATOU.js';function u(r){let s=new Map;for(let n of r.projects)s.has(n.name)||s.set(n.name,d(n));return s}function w(r){let s=u(r),n=m(r)??{nodes:r.projects.map(t=>({id:t.name,path:t.path})),edges:[]},a$1=a(n),o=new Map;for(let t of n.nodes){let e=s.get(t.id)??d({missing:t.id}),l=[...b(a$1,[t.id],{direction:"dependencies"}).keys()].filter(c=>c!==t.id).sort((c,f)=>c.localeCompare(f)).map(c=>({id:c,hash:s.get(c)??"<unknown>"}));o.set(t.id,{id:t.id,ownHash:e,transitiveInputsHash:d({own:e,dependencies:l})});}return o}function y(r,s){if(!s||Object.keys(s).length===0)return {verdict:"unknown",baseline:"none",changed:[],added:[],removed:[]};let n=[],a=[];for(let[e,i]of r.entries())e in s?s[e]!==i.transitiveInputsHash&&n.push(e):a.push(e);let o=[];for(let e of Object.keys(s))r.has(e)||o.push(e);return n.sort((e,i)=>e.localeCompare(i)),a.sort((e,i)=>e.localeCompare(i)),o.sort((e,i)=>e.localeCompare(i)),{verdict:n.length>0||a.length>0||o.length>0?"stale":"fresh",baseline:"recorded",changed:n,added:a,removed:o}}function M(r){let s={};for(let[n,a]of [...r.entries()].sort((o,t)=>o[0].localeCompare(t[0])))s[n]=a.transitiveInputsHash;return s}export{u as a,w as b,y as c,M as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f,h as h$1}from'./chunk-FE5R6EUV.js';import {t,s}from'./chunk-ODK4LCEL.js';import {t as t$1}from'./chunk-VQZ5PI5J.js';import u from'fs';import A from'path';var a=s.workspaceRunLast.schemaVersion,W="workspace-run-last.json",o=t.workspaceRunLast;var P=new Set(["init","test","build","start"]);function _(e){return P.has(e)}async function d(e){try{return await u.promises.access(e,u.constants.F_OK),true}catch{return false}}async function w(e){try{let r=await u.promises.readFile(e,"utf-8");return JSON.parse(r)}catch{return null}}function m(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function h(e){let r=e.stage;return typeof r!="string"||r.trim().length===0||!Array.isArray(e.projects)?false:_(r)||/^[a-z][a-z0-9_-]*$/i.test(r)}function T(e){let r=m(e);return !r||r.schemaVersion===a?false:h(r)}function C(e){let r=m(e);return r?r.schemaVersion===a&&r.stages!=null:false}function p(e){if(C(e))return e;if(T(e)){let r=e.stage;return {schemaVersion:a,generatedAt:e.generatedAt,workspacePath:e.workspacePath,latestStage:r,stages:{[r]:e},enterpriseControls:e.enterpriseControls??{jsonReady:true,evidencePath:o}}}return null}function U(e,r){let n=p(e);if(!n)return null;let t=r??n.latestStage;return n.stages[t]??null}async function V(e){let r=(await Promise.all(t$1(A.resolve(e),"reports",W).map(async t=>await d(t)?t:null))).find(t=>typeof t=="string");if(!r)return null;let n=await w(r);return p(n)}async function j(e,r){let n=A.resolve(e);return f(n,o,async()=>{let t=(await Promise.all(t$1(n,"reports",W).map(async s=>await d(s)?s:null))).find(s=>typeof s=="string"),R=t?await w(t):null,i=p(R);if(t&&!i)throw new Error(`Workspace run evidence is unreadable or invalid; refusing to overwrite: ${t}`);let l=i?{...i.stages}:{};l[r.stage]=r;let g={schemaVersion:a,generatedAt:r.generatedAt,workspacePath:r.workspacePath,latestStage:r.stage,stages:l,enterpriseControls:{jsonReady:true,evidencePath:o}};return await h$1(n,o,g),g})}export{W as a,o as b,U as c,V as d,j as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-IVYPC36J.js';import {c,e,d}from'./chunk-QYEQVNBF.js';import {d as d$1,b}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-IVYPC36J.js';import {c,e,d}from'./chunk-QYEQVNBF.js';import {d as d$1,b}from'./chunk-C563KVBD.js';import {g}from'./chunk-TD5TQZEG.js';import {q as q$1,m}from'./chunk-ZOE43SGQ.js';import {p,d as d$2}from'./chunk-YS34N35Y.js';import {h}from'./chunk-FE5R6EUV.js';import {b as b$1}from'./chunk-K33JJVQZ.js';import {a as a$2}from'./chunk-AFIFZTOY.js';import j from'path';import W from'fs-extra';function X(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function q(e$1){switch(e$1){case "why":return d;case "trace":return e;default:return c}}async function P(e,n,o){try{if(!await W.pathExists(e))return null;let r=await W.readJson(e);return n?b$1(n,r,e):o&&a$2(r,o,e),r}catch(r){if((n||o)&&await W.pathExists(e))throw r;return null}}function Y(e,n){if(!e)return null;let o=n.trim().toLowerCase();return e.projects.find(r=>r.slug.toLowerCase()===o||r.relativePath.toLowerCase()===o)??null}function Q(e,n,o){let r=o.trim().toLowerCase(),t=(m(e)?.nodes.map(i=>i.id)??e.projects.map(i=>i.name)).find(i=>i.toLowerCase()===r);if(t)return t;let m$1=e.projects.find(i=>[i.name,i.path,j.basename(i.path)].filter(u=>u.trim().length>0).some(u=>u.toLowerCase()===r));if(m$1)return m$1.name;let p=Y(n,o);if(p){let i=e.projects.find(u=>u.path===p.relativePath||u.path.endsWith(`/${p.relativePath}`));if(i)return i.name}return o}function U(e,n){if(!e)return [];let o=n.trim().toLowerCase(),r=new Set;for(let d of e.projects){d.contracts.dependsOn?.some(t=>t.toLowerCase()===o)&&r.add(d.slug);for(let t of d.contracts.consumes??[])for(let m of e.projects)m.contracts.publishes?.includes(t)&&m.slug===o&&r.add(d.slug);}return [...r].sort()}function Z(e,n){if(!e)return [];let o=n.trim().toLowerCase();return e.steps.filter(r=>r.scope==="project"&&r.project?.toLowerCase()===o&&r.command?.display).map(r=>r.command.display).slice(0,8)}function l(e,n,o){return {id:e,title:n,body:o.trim()}}async function ke(e){let n=j.resolve(e.workspacePath),o=(e.now??new Date).toISOString(),r=e.model??await q$1({workspacePath:n,includeEvidence:true}),d=e.contract;if(d===void 0)try{d=(await p({workspacePath:n})).contract;}catch{d=null;}let t=e.verify;t===void 0&&(t=await P(j.join(n,d$1),d$1));let m$1=e.impact;if(m$1===void 0&&(m$1=await P(j.join(n,g),g)),e.target.kind==="release-blocked"){let s=t?.blockingReasons??[],c=(r.summary?.projectCount??r.projects.length)===0,g=[l("verdict",c?"Workspace scaffold posture":"Release verdict",t?c?`Scaffold posture: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Freshness: **${t.freshness.verdict}**. No registered projects yet \u2014 release gates apply after the first project is added.`:`Verdict: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Risk: **${t.impact.risk}**. Freshness: **${t.freshness.verdict}**.`:"No workspace verify report found. Run `npx workspai workspace verify --json --write` first."),l("blockers",c?"Pre-project signals":"Blocking reasons",s.length?s.map(h=>`- ${h}`).join(`
|
|
2
2
|
`):c?"No pre-project signals in the latest verify report.":"No blocking reasons in the latest verify report.")];return t?.resolutionHints?.length&&g.push(l("resolution","Resolution hints",t.resolutionHints.map(h=>`- **${h.blockerId}** (${h.resolutionClass}): ${h.commandRetryHint??h.fixHints[0]?.detail??"See fix hints"}`).join(`
|
|
3
3
|
`))),{schemaVersion:a,generatedAt:o,workspacePath:n,target:e.target,summary:t?c?b(s.length,t.summary.verdict):s.length>0||t.summary.verdict==="blocked"?`Release blocked: ${t.summary.verdict} with ${s.length} blocking reason(s).`:t.summary.verdict==="needs-attention"?"Release needs attention: advisory or incomplete verification evidence remains; no blocking reason was reported.":`Release posture: ${t.summary.verdict}; no blocking reason was reported.`:"Release posture unknown \u2014 verify report missing.",sections:g,releaseVerdict:t?.summary.verdict,evidenceFreshness:t?.freshness.verdict,blocking:!!(t&&(t.summary.verdict==="blocked"||s.length>0)),releaseRisk:t?.impact.risk,blockingReasons:s,resolutionHints:t?.resolutionHints}}if(e.target.kind==="blocker"){let s=e.target,f=t?.resolutionHints?.find(g=>g.blockerId===s.blockerId),c=t?.blockingReasons.find(g=>g.includes(s.blockerId))??t?.blockingReasons[0];return {schemaVersion:a,generatedAt:o,workspacePath:n,target:s,summary:f?`Blocker ${s.blockerId}: ${f.resolutionClass}`:`Blocker ${s.blockerId} (no structured hint)`,sections:[l("reason","Blocking signal",c??"No matching blocking reason in verify."),l("hint","Resolution class",f?`${f.resolutionClass}
|
|
4
4
|
|
|
@@ -10,4 +10,4 @@ ${f.fixHints.map(g=>`- ${g.detail}`).join(`
|
|
|
10
10
|
`):"No transitive impact report."),l("gate","Subgraph gate",y?`Directly changed: ${y.directlyChanged}; transitive dependents: ${y.transitiveDependents}; covered: ${y.covered}; uncovered: ${y.uncovered}; unverifiable: ${y.unverifiable}.`:"No verify subgraph coverage available.")],releaseRisk:m$1?.summary?.risk??t?.impact.risk,blockingReasons:t?.blockingReasons}}let p$1=e.target.project,i=Q(r,d,p$1),u=m(r),k=u?a$1(u,i):{found:false,centrality:null,directDependents:[],transitiveDependents:[]},w=Y(d,p$1),E=U(d,p$1),x=Z(t,p$1),v=r.projects.find(s=>s.name.toLowerCase()===p$1.toLowerCase()),A=[l("overview","Project overview",v?`${v.name} (${v.frameworkDisplayName}, ${v.runtime}) at \`${v.path}\`.`:`Project **${p$1}** ${k.found?"exists in graph":"not found in workspace model"}.`),l("consumers","Consumers / dependents",[`Direct dependents: ${k.directDependents.join(", ")||"none"}`,`Contract consumers: ${E.join(", ")||"none"}`,`Transitive dependents (blast radius): ${k.transitiveDependents.length}`].join(`
|
|
11
11
|
`)),l("contracts","Critical contracts",w?[`Owns: ${w.contracts?.owns?.join(", ")||"none"}`,`Publishes: ${w.contracts.publishes.join(", ")||"none"}`,`Consumes: ${w.contracts.consumes.join(", ")||"none"}`,`APIs: ${w.contracts.apis.map(s=>s.name).join(", ")||"none"}`].join(`
|
|
12
12
|
`):"No workspace.contract.json entry for this project."),l("verification","Required verification",x.length?x.map(s=>`- ${s}`).join(`
|
|
13
|
-
`):"- `npx workspai workspace verify --json`\n- Project test/build via `workspace run` when configured")];k.centrality&&A.push(l("centrality","Graph centrality",`fanIn ${k.centrality.fanIn}, fanOut ${k.centrality.fanOut}, reach ${k.centrality.reach}, hotspot ${k.centrality.isHotspot?"yes":"no"}.`));let I=p$1.trim().toLowerCase(),T=s=>s.project?.name?.toLowerCase()===I||s.target.toLowerCase()===I,S=m$1?.affectedProjects?.find(T)?.risk??m$1?.transitiveImpact?.find(T)?.risk??t?.impact.risk??"unknown";return {schemaVersion:a,generatedAt:o,workspacePath:n,target:e.target,summary:`${p$1}: ${E.length} consumer(s), release risk **${S}**.`,sections:A,releaseRisk:String(S)}}async function he(e,n,o="explain"){let r=q(o);return await
|
|
13
|
+
`):"- `npx workspai workspace verify --json`\n- Project test/build via `workspace run` when configured")];k.centrality&&A.push(l("centrality","Graph centrality",`fanIn ${k.centrality.fanIn}, fanOut ${k.centrality.fanOut}, reach ${k.centrality.reach}, hotspot ${k.centrality.isHotspot?"yes":"no"}.`));let I=p$1.trim().toLowerCase(),T=s=>s.project?.name?.toLowerCase()===I||s.target.toLowerCase()===I,S=m$1?.affectedProjects?.find(T)?.risk??m$1?.transitiveImpact?.find(T)?.risk??t?.impact.risk??"unknown";return {schemaVersion:a,generatedAt:o,workspacePath:n,target:e.target,summary:`${p$1}: ${E.length} consumer(s), release risk **${S}**.`,sections:A,releaseRisk:String(S)}}async function he(e,n,o="explain"){let r=q(o);return await h(n,r,d$2(e)),r}export{q as a,ke as b,he as c};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {f,e,g}from'./chunk-NSH7TTSV.js';import {a,b}from'./chunk-MGL6DBOR.js';import {b as b$1,c}from'./chunk-V52R2W2Q.js';import {a as a$1}from'./chunk-NMXGSVMD.js';import {p,a as a$2}from'./chunk-YS34N35Y.js';import {k as k$1,m,l}from'./chunk-U5ENEDJA.js';import {h as h$1}from'./chunk-FE5R6EUV.js';import {p as p$1,q}from'./chunk-ODK4LCEL.js';import {k,t,u}from'./chunk-VQZ5PI5J.js';import j from'fs';import i from'path';import s from'chalk';var ee=new Set([".git",".workspai",".rapidkit",".venv","node_modules","dist","build","target","coverage","htmlcov",".next"]);async function E(e){try{return await j.promises.access(e,j.constants.F_OK),true}catch{return false}}async function F(e){try{let n=JSON.parse(await j.promises.readFile(e,"utf-8"));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}async function v(e){try{return await j.promises.readFile(e,"utf-8")}catch{return ""}}function ne(e){return a(e)}async function te(e,n){return await Y([...u(e,"project.json"),...u(e,"context.json")])?true:b(e)?false:i.resolve(e)===i.resolve(n)?k$1(e).length>0:k$1(e).length>0}async function re(e){let n=await a$1(e,{skipDirs:ee,includeHiddenDirs:false,descendIntoMatchedProjects:false,isProjectDir:te}),o=(await a$2(e)).filter(a=>a.relationship==="adopted"||a.source==="adopted-local").map(a=>i.resolve(a.path)).filter(a=>j.existsSync(a)),r=[...new Set([...n.map(a=>i.resolve(a)),...o])];return r.length>0?r:b(e)?[]:k$1(e).length>0?[e]:[]}function oe(e,n){return i.relative(e,n).replace(/\\/g,"/")||"."}async function S(e,n){for(let t of n)if(await E(i.join(e,t)))return true;return false}async function Y(e){for(let n of e)if(await E(n))return true;return false}async function Z(e){for(let n of e){let t=await F(n);if(t)return t}return null}async function ae(e){if(await S(e,["health","health.ts","health.js","health.py","health.go","health.kt","health.rb","health.php","healthcheck","health-check","src/health.ts","src/health.js","src/health.py","src/health.go","src/health.kt","src/health.rb","src/health.php","src/healthcheck.ts","src/healthcheck.js","src/liveness.ts","src/readiness.ts","src/ping.ts","app/controllers/health_controller.rb","app/controllers/health_check_controller.rb","config/initializers/health_check.rb"]))return true;let t=await v(i.join(e,"config","routes.rb"));return /(?:health|readiness|liveness|readiness_check|health_check)/iu.test(t)}async function se(e,n){if(await S(e,[".env",".env.local"]))return true;let t=n?.contracts&&typeof n.contracts=="object"?n.contracts:null;if(Array.isArray(t?.env)&&t.env.length>0)return true;let o=await F(i.join(e,"package.json")),r={...o?.dependencies??{},...o?.devDependencies??{}};if(Object.keys(r).some(d=>/^(?:dotenv|dotenv-flow|env-cmd)$/iu.test(d)))return true;let a=await v(i.join(e,"pyproject.toml"));if(/\b(?:python-dotenv|pydantic-settings)\b/iu.test(a))return true;let l=[await v(i.join(e,"compose.yaml")),await v(i.join(e,"compose.yml")),await v(i.join(e,"docker-compose.yml")),await v(i.join(e,"docker-compose.yaml"))].join(`
|
|
2
|
+
`);return /^\s*(?:env_file|environment)\s*:/imu.test(l)}async function ie(e){return (await g(e)).detected}async function ce(e){let n=await F(i.join(e,"package.json")),t=n?.scripts&&typeof n.scripts=="object"?n.scripts:{};return Object.keys(t).sort()}function h(e,n,t,o,r,a,l){return {id:e,severity:n,target:t,title:o,detail:r,remediation:a,...l&&l.length>0?{files:[...l]}:{}}}function de(e){let n=e.reduce((t,o)=>o.severity==="fail"?t+28:o.severity==="warn"?t+12:t+3,0);return Math.max(0,100-n)}async function le(e,n,t){let o=await Z(u(n,"project.json")),r=m(n,o),a=l(n),l$1=r.runtime==="unknown"?a[0]||"unknown":r.runtime,d=[l$1,...a.filter(G=>G!==l$1)],p=r.key==="unknown"&&new Set(d.filter(G=>G!=="unknown")).size>1,A=await b$1(n,o,{runtime:l$1,framework:r.key}),f=["backend","service","worker"].includes(A),w=f&&/^(?:fastapi|django|flask|nestjs|express|fastify|springboot|gofiber|gogin|dotnet-webapi|laravel|rails|phoenix|axum|actix|rocket)$/u.test(r.key),k=oe(e,n),m$1=k,$=await ce(n),P=await Y([...u(n,"project.json"),...u(n,"context.json")]),x=await ie(n),R=await S(n,["Dockerfile","dockerfile"]),z=await S(n,[".env.example","env.example","config/env.example"]),y=await se(n,o),c$1=await c({projectPath:n,declaration:t?.governance}),u$1=c$1.ci.status==="repository",C=await ae(n),g=[];return r.key==="unknown"&&g.push(h(p?"project.stack.aggregate":"project.stack.unknown",p?"info":"fail",m$1,p?"Multi-runtime aggregate boundary detected":"Project stack is unknown",p?`Workspai detected multiple runtimes (${d.join(", ")}) and intentionally did not promote one nested framework as the aggregate project identity.`:"Workspai cannot confidently classify this backend project.",p?"Adopt independently operated nested projects when they need separate lifecycle, ownership, or release evidence.":"Add .workspai/project.json metadata or import the project with `workspai import`.")),P||g.push(h("project.marker.missing","warn",m$1,"Workspai marker is missing","The project can be detected by files, but it is not registered with Workspai metadata.","Run `workspai import <path>` from a workspace or create the project through Workspai.")),x||g.push(h("project.tests.missing","warn",m$1,"Test entrypoint is missing","No common test folder, config, or package test script was found.","Add a test command so `workspai workspace run test --affected` can gate changes.")),f&&y&&!z&&g.push(h("project.env.example.missing","info",m$1,"Environment example is missing","No .env.example or env.example file was found.","Add an env example for onboarding and CI secret documentation.",[".env.example"])),c$1.ci.status==="unknown"?g.push(h("project.ci.missing","warn",m$1,"CI governance is not proven","No repository CI surface or canonical external CI declaration was found for this project.","Add repository CI configuration or declare the external CI authority in the workspace contract.",[".github/workflows/ci.yml"])):c$1.ci.status==="external-observed"&&g.push(h("project.ci.external-observed","info",m$1,"Continuous integration appears externally managed",`Repository documentation references an external CI control plane (${c$1.ci.evidence.join(", ")}).`,"Declare the external CI provider in the canonical workspace contract when authoritative release gating depends on it.")),w&&!C&&g.push(h("project.health.missing","info",m$1,"Health or readiness probe is missing","The project has no obvious health or readiness endpoint to support automated deployment and runtime checks.","Add a simple health endpoint and document it for readiness gates and observability.")),f&&!R&&g.push(h("project.container.missing","info",m$1,"Container recipe is missing","No Dockerfile was found for this project.","Add a Dockerfile when the service is intended for containerized deployment.",["Dockerfile"])),{name:typeof o?.name=="string"&&o.name.trim()?o.name.trim():i.basename(n),path:n,relativePath:k,runtime:l$1,runtimeCandidates:d,framework:r.key,confidence:r.confidence,supportTier:r.supportTier,hasRapidKitMarker:P,hasTests:x,hasDockerfile:R,hasEnvExample:z,hasCiConfig:u$1,governance:c$1,hasHealthEndpoint:C,scripts:$,findings:g,score:de(g)}}function pe(e){return e.name.toLowerCase()}async function ue(e){let n=new Map(e.map(r=>[pe(r),r])),t=[];for(let r of e){let a=await F(i.join(r.path,"package.json")),l={...a?.dependencies??{},...a?.devDependencies??{},...a?.peerDependencies??{}};for(let p of Object.keys(l)){let A=p.replace(/^@[^/]+\//,"").toLowerCase(),f=n.get(A);f&&f.relativePath!==r.relativePath&&t.push({from:r.relativePath,to:f.relativePath,kind:"package"});}let d=await v(i.join(r.path,"pyproject.toml"));for(let p of e)p.relativePath!==r.relativePath&&d.includes(p.name)&&t.push({from:r.relativePath,to:p.relativePath,kind:"workspace-reference"});}let o=new Set;return t.filter(r=>{let a=`${r.from}\0${r.to}\0${r.kind}`;return o.has(a)?false:(o.add(a),true)})}function me(e,n){let t=new Map;for(let o of e)t.set(o.relativePath,{project:o.relativePath,directDependents:0,directDependencies:0});for(let o of n){let r=t.get(o.from),a=t.get(o.to);r&&(r.directDependencies+=1),a&&(a.directDependents+=1);}return Array.from(t.values()).sort((o,r)=>r.directDependents-o.directDependents||r.directDependencies-o.directDependencies)}async function fe(e){let n=await Z(t(e,"workspace.json"));return typeof n?.profile=="string"?n.profile:null}function ge(e){return {fail:e.filter(n=>n.severity==="fail").length,warn:e.filter(n=>n.severity==="warn").length,info:e.filter(n=>n.severity==="info").length}}function he(e){if(e.projectCount===0)return e.workspaceDetected?["Add your first project: npx workspai create project <name> --kit <kit>","Import an existing service: npx workspai import <path>"]:["Create a Workspai workspace: npx workspai create workspace my-workspace --profile polyglot","Import an existing service: npx workspai import ../service"];let n=[];return e.findings.some(t=>t.id==="workspace.marker.missing")&&n.push("Initialize workspace metadata with `workspai bootstrap --profile polyglot`."),e.findings.some(t=>t.id==="project.marker.missing")&&n.push("Register detected projects with `workspai import <path>` or recreate them via `workspai create project`."),e.findings.some(t=>t.id==="project.tests.missing")&&n.push("Add test entrypoints, then gate changes with `workspai workspace run test --affected --strict`."),e.findings.some(t=>t.id==="project.ci.missing")&&n.push("Add CI/CD configuration to catch regressions early and make workspace health checks actionable."),e.findings.some(t=>t.id==="project.health.missing")&&n.push("Add a health/readiness endpoint so runtime probes and deployment checks can verify service health."),e.hasCanonicalGraph||n.push("Generate canonical topology with `workspai workspace model --write --include-evidence`."),n.push("Run `workspai autopilot release --mode audit --json` before release."),Array.from(new Set(n))}async function $e(e$1={}){let n=i.resolve(e$1.workspacePath||process.cwd());if(!await E(n))throw new Error(`Workspace path does not exist: ${n}`);let t=ne(n)??n,o=k(t),r=await fe(t),a=await re(t),l;try{l=(await p({workspacePath:t})).contract;}catch{}let d=await Promise.all(a.map(c=>{let u=l?.projects.find(C=>{let g=C.externalPath??C.relativePath;return i.resolve(t,g)===i.resolve(c)});return le(t,c,u)})),p$2=await ue(d),A=me(d,p$2),f$1=[];o||f$1.push(h("workspace.marker.missing","warn",".","Workspace metadata is missing","The directory can be analyzed, but it is not a registered Workspai workspace.","Run `workspai create workspace` or `workspai bootstrap --profile polyglot` in a workspace root.")),d.length===0&&f$1.push(h("workspace.projects.missing","warn",".","No backend projects detected","Workspai did not find runtime markers or project metadata under this root.","Create a project with `workspai create project` or import one with `workspai import <path>`."));let w=[...f$1,...d.flatMap(c=>c.findings)],k$1=ge(w),m={};for(let c of d)for(let u of c.runtimeCandidates)m[u]=(m[u]||0)+1;let $=d.length>0?Math.round(d.reduce((c,u)=>c+u.score,0)/d.length):0,P=f$1.reduce((c,u)=>c+(u.severity==="fail"?20:u.severity==="warn"?8:2),0),x=Math.max(0,$-P),R=d.length===0&&k$1.fail===0&&w.length>0&&w.every(c=>c.id==="workspace.projects.missing"&&c.severity==="warn"),z=k$1.fail>0||e$1.strict&&k$1.warn>0&&!R?"blocked":k$1.warn>0?"needs-attention":"ready",y={schemaVersion:q.analyze,generatedAt:new Date().toISOString(),workspacePath:t,workspaceDetected:o,profile:r,summary:{statusScope:"source-structure",releaseReadiness:"not-evaluated",score:x,verdict:z,projectCount:d.length,runtimeCount:Object.keys(m).length,findings:k$1},runtimes:m,projects:d,dependencyGraph:{status:p$2.length>0?"generated":"empty",edges:p$2,topImpactedProjects:A.slice(0,5)},findings:w,nextActions:he({findings:w,projectCount:d.length,hasCanonicalGraph:await E(i.join(t,p$1.knowledgeGraph)),workspaceDetected:o}),enterpriseControls:{jsonReady:true,ciGateCommand:"workspai analyze --json --strict",releaseGateCommand:"workspai autopilot release --mode enforce --json",evidencePath:p$1.analyze}};if(e$1.output&&(await j.promises.mkdir(i.dirname(i.resolve(e$1.output)),{recursive:true}),await j.promises.writeFile(i.resolve(e$1.output),`${JSON.stringify(y,null,2)}
|
|
3
|
+
`)),!e$1.output&&o){let c=f(y,{commandId:"workspaceAnalyze",exitCode:y.summary.verdict==="blocked"?2:y.summary.verdict==="needs-attention"?1:0,generatedAt:y.generatedAt,blockers:y.findings.filter(u=>u.severity==="fail").map(u=>u.title).slice(0,12),runId:e()});await h$1(t,p$1.analyze,c);}return y}function Ge(e){let n=e.summary.verdict==="ready"?s.green:e.summary.verdict==="needs-attention"?s.yellow:s.red;if(console.log(s.bold(`
|
|
4
|
+
Workspai Workspace Analysis
|
|
5
|
+
`)),console.log(s.cyan("Workspace:"),e.workspacePath),console.log(s.cyan("Profile:"),e.profile||"not configured"),console.log(s.cyan("Source score:"),`${e.summary.score}/100`),console.log(s.cyan("Source verdict:"),n(e.summary.verdict)),console.log(s.cyan("Release readiness:"),e.summary.releaseReadiness),console.log(s.gray(`Projects: ${e.summary.projectCount}, runtimes: ${e.summary.runtimeCount}, findings: ${e.summary.findings.fail} fail / ${e.summary.findings.warn} warn / ${e.summary.findings.info} info`)),e.projects.length>0){console.log(s.bold(`
|
|
6
|
+
Projects`));for(let t of e.projects){let o=t.score>=85?s.green("pass"):t.score>=65?s.yellow("watch"):s.red("risk");console.log(` ${t.relativePath} ${s.gray(`${t.runtime}/${t.framework}`)} ${o} ${t.score}/100`);}}if(e.dependencyGraph.status==="generated"&&(console.log(s.bold(`
|
|
7
|
+
Dependency Graph`)),console.log(s.gray(` edges: ${e.dependencyGraph.edges.length}`)),e.dependencyGraph.topImpactedProjects.length>0)){console.log(s.gray(" Top impacted projects:"));for(let t of e.dependencyGraph.topImpactedProjects.slice(0,3))console.log(` ${t.project} (${t.directDependents} dependents, ${t.directDependencies} dependencies)`);}if(e.findings.length>0){console.log(s.bold(`
|
|
8
|
+
Top Findings`));for(let t of e.findings.slice(0,8)){let o=t.severity==="fail"?s.red:t.severity==="warn"?s.yellow:s.gray;console.log(` ${o(t.severity.toUpperCase())} ${t.target}: ${t.title}`),console.log(s.gray(` ${t.remediation}`));}}console.log(s.bold(`
|
|
9
|
+
Next Actions`));for(let t of e.nextActions.slice(0,5))console.log(s.gray(` - ${t}`));console.log();}export{$e as a,Ge as b};
|