workspai 0.48.0 → 0.49.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.
Files changed (39) hide show
  1. package/README.md +70 -54
  2. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
  3. package/contracts/extension-cli-compatibility.v1.json +2 -1
  4. package/contracts/published-contract-catalog.v1.json +5 -0
  5. package/contracts/runtime-command-surface.v1.json +18 -2
  6. package/contracts/workspace-intelligence/workspace-graph-stream.v1.json +262 -0
  7. package/dist/autopilot-release-R4XRTWEM.js +1 -0
  8. package/dist/{chunk-I46XEIPL.js → chunk-EKZLUMCS.js} +2 -2
  9. package/dist/{chunk-5S3DJQEP.js → chunk-K4X3DM7R.js} +1 -1
  10. package/dist/{chunk-Y5UJLPS4.js → chunk-TIE2XMGH.js} +2 -2
  11. package/dist/{create-DBQNAMKP.js → create-S64IWHAP.js} +1 -1
  12. package/dist/index.d.ts +3 -0
  13. package/dist/index.js +108 -108
  14. package/dist/{pipeline-TQM43A3K.js → pipeline-LHTPE3DR.js} +1 -1
  15. package/dist/{workspace-NCWRINEF.js → workspace-PJPRBUMQ.js} +1 -1
  16. package/dist/{workspace-foundation-WXJ6I7ES.js → workspace-foundation-WPLD7OEO.js} +1 -1
  17. package/dist/workspace-graph-stream-KAGGQPJT.js +1 -0
  18. package/dist/{workspace-intelligence-runner-THYLHHMF.js → workspace-intelligence-runner-OTYTHV6B.js} +1 -1
  19. package/dist/workspace-run-QND2SIYA.js +1 -0
  20. package/dist/workspace-watch-7HWGA5TF.js +1 -0
  21. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +11 -8
  22. package/docs/README.md +45 -13
  23. package/docs/README_CONTENT_CONTRACT.md +1 -1
  24. package/docs/ci-workflows.md +3 -3
  25. package/docs/commands-reference.md +2 -2
  26. package/docs/contracts/ARTIFACT_CATALOG.md +7 -1
  27. package/docs/creating-workspaces-and-projects.md +16 -12
  28. package/docs/doctor-command.md +30 -28
  29. package/docs/examples/ci-agent-grounding.yml +1 -1
  30. package/docs/from-code-to-shared-understanding.md +2 -2
  31. package/docs/workspace-intelligence-evaluation.md +8 -6
  32. package/docs/workspace-intelligence-runner.md +17 -6
  33. package/docs/workspace-operations.md +13 -5
  34. package/package.json +9 -4
  35. package/templates/kits/fastapi-ddd/README.md.j2 +1 -1
  36. package/dist/autopilot-release-XGVXPOZI.js +0 -1
  37. package/dist/workspace-run-RLIYSOTN.js +0 -1
  38. package/dist/workspace-watch-3BPGLFLB.js +0 -1
  39. /package/dist/{chunk-QNONOO4F.js → chunk-E2KJ5QWY.js} +0 -0
package/README.md CHANGED
@@ -9,17 +9,17 @@
9
9
 
10
10
  > One workspace. One truth. Humans and AI aligned.
11
11
 
12
- Workspai is an open-source CLI that turns one or many software projects into an
13
- organized, evidence-backed view of the whole system. Developers, CI, IDEs,
14
- MCP-compatible tools, and AI agents can use the same current model instead of
15
- rebuilding a different picture from scattered files.
12
+ Workspai is an open-source CLI that connects one or many software projects and
13
+ keeps a current, checkable view of the whole system. Developers, CI, IDEs,
14
+ MCP-compatible tools, and AI agents can use that same view instead of rebuilding
15
+ different context from scattered files.
16
16
 
17
17
  - **See the system:** projects, runtimes, APIs, dependencies, infrastructure,
18
18
  documentation, policies, and release state in one model.
19
- - **Ask with proof:** bounded graph answers linked to the files and facts that
20
- support them.
21
- - **Act with confidence:** change impact, health, verification, readiness, and
22
- agent context from one defined and versioned intelligence chain.
19
+ - **Ask with proof:** get focused answers that link back to the supporting files
20
+ and facts.
21
+ - **Change with confidence:** see what may be affected, run the right checks,
22
+ and prepare useful context for AI tools.
23
23
 
24
24
  [Quickstart](#start-in-two-minutes) ·
25
25
  [Architecture](#from-code-to-shared-understanding) ·
@@ -30,22 +30,24 @@ rebuilding a different picture from scattered files.
30
30
  ## Understand Workspai in one minute
31
31
 
32
32
  Your software system is more than a repository. It may include several
33
- applications and services, shared packages, API contracts, deployment files,
34
- documentation, tests, ownership, and CI evidence. Workspai connects those
35
- surfaces without making AI the source of truth.
33
+ applications and services, shared packages, API definitions, deployment files,
34
+ documentation, tests, owners, and CI results. Workspai connects those parts
35
+ without asking an AI model to decide what is true.
36
36
 
37
37
  | Term | Plain-language meaning |
38
38
  | ------------------- | ------------------------------------------------------------------------------------ |
39
- | **Workspace** | The managed boundary containing registered projects, policy, contracts, and evidence |
40
- | **Project** | An application, service, library, or existing source tree connected to the workspace |
41
- | **Workspace Model** | The authoritative structured record used to generate the other views and artifacts |
42
- | **Knowledge Graph** | A queryable representation derived from the model, with typed relations and proofs |
43
- | **Evidence** | The source, observation, hash, or report that justifies a fact or decision |
44
- | **Artifact** | A durable file under `.workspai/` that another tool can safely consume |
45
-
46
- The Workspace Model is the canonical source of truth. The Knowledge Graph is a
47
- derived, revision-bound representation—not a competing truth and not an
48
- LLM-generated guess.
39
+ | **Workspace** | A home for related projects, shared rules, and saved results |
40
+ | **Project** | An application, service, library, or existing source folder connected to a workspace |
41
+ | **Workspace Model** | The main saved record of what Workspai knows about the system |
42
+ | **Knowledge Graph** | A searchable map built from the model, with links back to supporting files |
43
+ | **Evidence** | The file, observation, hash, or report that supports an answer |
44
+ | **Artifact** | A file under `.workspai/` that people and other tools can read |
45
+
46
+ The Workspace Model is the canonical source of truth. This means it is the main
47
+ saved record. The Knowledge Graph is built from that record to make
48
+ relationships easy to search; it is not a second truth and it is not an AI
49
+ guess. In the technical contract, the graph is a derived, revision-bound
50
+ representation of the model.
49
51
 
50
52
  The deterministic model, graph, contracts, and verification chain do not
51
53
  require an AI API key. Optional AI-backed features declare that dependency
@@ -67,35 +69,37 @@ Global installation is optional. Every example below also works with
67
69
  npx wspai --help
68
70
  ```
69
71
 
70
- `workspai` is the canonical npm package and command. `wspai` is an optional
71
- short alias for `npx` workflows. This package is the active CLI boundary in the
72
+ `workspai` is the main npm package and command. `wspai` is an optional shorter
73
+ name for interactive use. This package is the active CLI in the
72
74
  [Workspai monorepo](../../README.md).
73
75
 
74
- ### 2. Create a lightweight workspace and connect existing source
76
+ ### 2. Connect an existing project
75
77
 
76
78
  ```bash
77
- npx workspai create workspace platform --profile minimal --yes
78
- npx workspai adopt /absolute/path/to/project \
79
- --workspace ~/.workspai/workspaces/platform \
80
- --json
81
- cd ~/.workspai/workspaces/platform
79
+ cd /absolute/path/to/project
80
+ npx workspai adopt .
82
81
  ```
83
82
 
84
- `adopt` registers the project without moving or copying it. To create new
85
- software instead, start with `npx workspai create` or read
86
- [Creating Workspaces and Projects](docs/creating-workspaces-and-projects.md).
83
+ `adopt` registers the project without moving or copying it. When run outside a
84
+ workspace, it creates or reuses the minimal default workspace and prints the
85
+ exact `Next shell step`.
87
86
 
88
- ### 3. Run the complete Workspace Intelligence chain
87
+ ### 3. Continue from the workspace root
88
+
89
+ Without the VS Code extension, copy the printed `Next shell step` and continue
90
+ in that workspace terminal:
89
91
 
90
92
  ```bash
91
- npx workspai workspace intelligence run --for-agent codex --strict --json
93
+ cd ~/.workspai/workspaces/workspai
94
+ npx workspai workspace intelligence run --for-agent generic --strict --json
92
95
  ```
93
96
 
94
- `codex` selects the generated agent-facing surface; use another supported agent
95
- identifier when needed. The underlying intelligence chain and evidence remain
96
- the same.
97
+ `generic` creates vendor-neutral context. Use `codex`, `claude`, `cursor`, or
98
+ `orca` when you want context shaped for that agent. Agent Sync also writes the
99
+ shared files used by GitHub Copilot, VS Code, and `AGENTS.md` consumers without
100
+ changing the system information or the checks Workspai runs.
97
101
 
98
- The run creates durable, discoverable output:
102
+ The run saves its results so people and tools can inspect and reuse them:
99
103
 
100
104
  ```text
101
105
  .workspai/
@@ -113,20 +117,32 @@ The run creates durable, discoverable output:
113
117
  AGENTS.md
114
118
  ```
115
119
 
116
- Exit code `0` means passed, `1` means execution failed, and `2` means the run
117
- completed but current evidence blocks the requested decision. A blocked result
120
+ For automation details, including exit codes and blocked results, see the
121
+ [Unified runner guide](docs/workspace-intelligence-runner.md). A blocked result
118
122
  is useful evidence, not a crashed command.
119
123
 
120
- The broader governance and release pipeline is a separate gate when you are
121
- ready; it is not a substitute for the canonical chain:
124
+ When you are ready for the broader release workflow, run:
122
125
 
123
126
  ```bash
124
127
  npx workspai pipeline --json --strict
125
128
  ```
126
129
 
130
+ Starting new software instead?
131
+
132
+ ```bash
133
+ npx workspai create workspace my-workspace --profile minimal --yes
134
+ cd ~/.workspai/workspaces/my-workspace
135
+ npx workspai create project nextjs web --yes
136
+ ```
137
+
138
+ From the `my-workspace` terminal, create a project, use `adopt` to link one in
139
+ place, or use `import` to copy or clone one into the workspace. See
140
+ [Creating Workspaces and Projects](docs/creating-workspaces-and-projects.md)
141
+ for supported starters.
142
+
127
143
  ## From Code to Shared Understanding
128
144
 
129
- ![From Code to Shared Understanding](https://raw.githubusercontent.com/rapidkitlabs/workspai/main/packages/cli/docs/From%20Code%20to%20Shared%20Understanding.png)
145
+ ![From Code to Shared Understanding](https://raw.githubusercontent.com/chistiq/workspai/main/packages/cli/docs/From%20Code%20to%20Shared%20Understanding.png)
130
146
 
131
147
  [View the Mermaid source and explanation](docs/from-code-to-shared-understanding.md).
132
148
 
@@ -266,11 +282,11 @@ reruns.
266
282
 
267
283
  ### Governance and operations
268
284
 
269
- | What you need | Command |
270
- | ------------------------------------ | --------------------------------------------------------------------------- |
271
- | Run affected project tests | `npx workspai workspace run test --affected --blast-radius --json` |
272
- | Run the release/governance gate | `npx workspai pipeline --json --strict` |
273
- | Run the canonical intelligence chain | `npx workspai workspace intelligence run --for-agent codex --strict --json` |
285
+ | What you need | Command |
286
+ | ------------------------------------ | ----------------------------------------------------------------------------- |
287
+ | Run affected project tests | `npx workspai workspace run test --affected --blast-radius --json` |
288
+ | Run the release/governance gate | `npx workspai pipeline --json --strict` |
289
+ | Run the canonical intelligence chain | `npx workspai workspace intelligence run --for-agent generic --strict --json` |
274
290
 
275
291
  `workspace verify` consumes current impact, doctor, contract, analysis, and
276
292
  readiness evidence. Use `workspace intelligence run` for the canonical chain,
@@ -388,7 +404,7 @@ All onboarding routes feed the same Workspace Intelligence model.
388
404
  | Adopt | Existing source should stay in place | `npx workspai adopt /path/to/project --json` |
389
405
  | Import local | Existing source should be copied into a workspace | `npx workspai import ../orders-api --workspace /path/to/workspace --json` |
390
406
  | Import Git | A repository should be cloned into a workspace | `npx workspai import https://github.com/acme/orders-api.git --git --workspace /path/to/workspace --json` |
391
- | Create workspace | You need a new governed boundary | `npx workspai create workspace platform --profile polyglot --yes` |
407
+ | Create workspace | You need a new governed boundary | `npx workspai create workspace my-workspace --profile polyglot --yes` |
392
408
  | Create project | You need a supported new scaffold | `npx workspai create project nextjs web --yes` |
393
409
  | Interactive | You want Workspai to guide the choice | `npx workspai create` |
394
410
 
@@ -483,7 +499,7 @@ For command-specific behavior, use the
483
499
 
484
500
  Workspai is MIT-licensed and developed in the open. Contributions to runtime
485
501
  support, contracts, documentation, tests, and Workspace Intelligence workflows
486
- are welcome.
502
+ are welcome. Workspai is built by [Chistiq](https://chistiq.com/).
487
503
 
488
504
  From a source checkout:
489
505
 
@@ -499,12 +515,12 @@ Go, Java, and .NET are required only for workflows that exercise those runtimes.
499
515
  To validate only this package, run `npm --workspace workspai run validate` from
500
516
  the monorepo root.
501
517
 
502
- - Read [CONTRIBUTING.md](https://github.com/rapidkitlabs/workspai/blob/main/packages/cli/CONTRIBUTING.md) before submitting changes.
503
- - Use [GitHub Issues](https://github.com/rapidkitlabs/workspai/issues) for reproducible bugs and feature requests.
504
- - Use [GitHub Discussions](https://github.com/rapidkitlabs/workspai/discussions) for questions and design conversations.
518
+ - Read [CONTRIBUTING.md](https://github.com/chistiq/workspai/blob/main/packages/cli/CONTRIBUTING.md) before submitting changes.
519
+ - Use [GitHub Issues](https://github.com/chistiq/workspai/issues) for reproducible bugs and feature requests.
520
+ - Use [GitHub Discussions](https://github.com/chistiq/workspai/discussions) for questions and design conversations.
505
521
  - Read the [Development Guide](docs/DEVELOPMENT.md) for local workflows.
506
522
  - Report vulnerabilities through the [Security Policy](docs/SECURITY.md), not a public issue.
507
- - Review the [Changelog](https://github.com/rapidkitlabs/workspai/blob/main/packages/cli/CHANGELOG.md) before upgrading.
523
+ - Review the [Changelog](https://github.com/chistiq/workspai/blob/main/packages/cli/CHANGELOG.md) before upgrading.
508
524
 
509
525
  ## License
510
526
 
@@ -1216,6 +1216,10 @@
1216
1216
  "flags": "--once",
1217
1217
  "attributeName": "once"
1218
1218
  },
1219
+ {
1220
+ "flags": "--graph-stream",
1221
+ "attributeName": "graphStream"
1222
+ },
1219
1223
  {
1220
1224
  "flags": "--for-agent [agent]",
1221
1225
  "attributeName": "forAgent"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "rapidkit-extension-cli-compatibility.v1",
3
3
  "cli": "workspai",
4
- "minimumVerifiedCliVersion": "0.48.0",
4
+ "minimumVerifiedCliVersion": "0.49.0",
5
5
  "publishedContractSchemas": {
6
6
  "workspaceContract": 1,
7
7
  "runtimeCommandSurface": "rapidkit-runtime-command-surface-v1",
@@ -46,6 +46,7 @@
46
46
  "workspaceContext": "workspace-context.v1",
47
47
  "workspaceDependencyGraph": "workspace-dependency-graph.v1",
48
48
  "workspaceKnowledgeGraph": "workspace-knowledge-graph.v1",
49
+ "workspaceGraphStream": "workspace-graph-stream.v1",
49
50
  "workspaceKnowledgeGraphChangeOverlay": "workspace-knowledge-graph-change-overlay.v1",
50
51
  "workspaceKnowledgeSearch": "workspace-knowledge-search.v1",
51
52
  "workspaceGraphTokenEfficiency": "workspace-graph-token-efficiency.v1",
@@ -234,6 +234,11 @@
234
234
  "contractPath": "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json",
235
235
  "publication": "json-schema"
236
236
  },
237
+ "workspaceGraphStream": {
238
+ "schemaVersion": "workspace-graph-stream.v1",
239
+ "contractPath": "contracts/workspace-intelligence/workspace-graph-stream.v1.json",
240
+ "publication": "json-schema"
241
+ },
237
242
  "workspaceKnowledgeGraphChangeOverlay": {
238
243
  "schemaVersion": "workspace-knowledge-graph-change-overlay.v1",
239
244
  "contractPath": "contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json",
@@ -1266,8 +1266,24 @@
1266
1266
  "summary": "Observe relevant workspace changes and publish versioned watch events.",
1267
1267
  "canonicalArgv": [
1268
1268
  "workspace",
1269
- "watch"
1270
- ]
1269
+ "watch",
1270
+ "--json"
1271
+ ],
1272
+ "output": {
1273
+ "defaultFormat": "human-or-json",
1274
+ "modes": [
1275
+ {
1276
+ "selector": "--json",
1277
+ "format": "json",
1278
+ "mediaType": "application/x-ndjson"
1279
+ },
1280
+ {
1281
+ "selector": "--graph-stream --json",
1282
+ "format": "json",
1283
+ "mediaType": "application/x-ndjson"
1284
+ }
1285
+ ]
1286
+ }
1271
1287
  },
1272
1288
  {
1273
1289
  "invocation": "workspace why",
@@ -0,0 +1,262 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://getrapidkit.com/schemas/workspace-graph-stream.v1.json",
4
+ "title": "Workspai Workspace Graph Stream",
5
+ "description": "Transport-neutral, revision-safe events for hydrating and incrementally updating a Workspace Knowledge Graph consumer.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "type",
10
+ "workspaceId",
11
+ "sessionId",
12
+ "generation",
13
+ "revision",
14
+ "modelHash",
15
+ "graphHash",
16
+ "generatedAt",
17
+ "causationId",
18
+ "correlationId",
19
+ "payload"
20
+ ],
21
+ "properties": {
22
+ "schemaVersion": { "const": "workspace-graph-stream.v1" },
23
+ "type": {
24
+ "enum": [
25
+ "graph.snapshot",
26
+ "graph.delta",
27
+ "graph.provider-progress",
28
+ "graph.quality-changed",
29
+ "graph.proof-invalidated",
30
+ "graph.resync-required",
31
+ "graph.paused",
32
+ "graph.complete",
33
+ "graph.heartbeat",
34
+ "graph.error"
35
+ ]
36
+ },
37
+ "workspaceId": { "type": "string", "minLength": 1 },
38
+ "sessionId": { "type": "string", "minLength": 1 },
39
+ "generation": { "type": "integer", "minimum": 0 },
40
+ "baseRevision": { "type": "integer", "minimum": 0 },
41
+ "baseModelHash": { "$ref": "#/$defs/hash" },
42
+ "baseGraphHash": { "$ref": "#/$defs/hash" },
43
+ "revision": { "type": "integer", "minimum": 0 },
44
+ "modelHash": { "$ref": "#/$defs/hash" },
45
+ "graphHash": { "$ref": "#/$defs/hash" },
46
+ "generatedAt": { "type": "string", "format": "date-time" },
47
+ "causationId": { "type": "string", "minLength": 1 },
48
+ "correlationId": { "type": "string", "minLength": 1 },
49
+ "payload": { "type": "object" }
50
+ },
51
+ "allOf": [
52
+ {
53
+ "if": { "properties": { "type": { "const": "graph.snapshot" } } },
54
+ "then": {
55
+ "properties": {
56
+ "payload": { "$ref": "#/$defs/snapshotPayload" },
57
+ "baseRevision": false,
58
+ "baseModelHash": false,
59
+ "baseGraphHash": false
60
+ }
61
+ }
62
+ },
63
+ {
64
+ "if": { "properties": { "type": { "const": "graph.delta" } } },
65
+ "then": {
66
+ "required": ["baseRevision", "baseModelHash", "baseGraphHash"],
67
+ "properties": { "payload": { "$ref": "#/$defs/deltaPayload" } }
68
+ }
69
+ },
70
+ {
71
+ "if": { "properties": { "type": { "const": "graph.provider-progress" } } },
72
+ "then": { "properties": { "payload": { "$ref": "#/$defs/providerProgressPayload" } } }
73
+ },
74
+ {
75
+ "if": { "properties": { "type": { "const": "graph.quality-changed" } } },
76
+ "then": { "properties": { "payload": { "$ref": "#/$defs/qualityPayload" } } }
77
+ },
78
+ {
79
+ "if": { "properties": { "type": { "const": "graph.proof-invalidated" } } },
80
+ "then": { "properties": { "payload": { "$ref": "#/$defs/proofInvalidatedPayload" } } }
81
+ },
82
+ {
83
+ "if": { "properties": { "type": { "const": "graph.resync-required" } } },
84
+ "then": { "properties": { "payload": { "$ref": "#/$defs/resyncPayload" } } }
85
+ },
86
+ {
87
+ "if": {
88
+ "properties": {
89
+ "type": { "enum": ["graph.paused", "graph.complete", "graph.heartbeat"] }
90
+ }
91
+ },
92
+ "then": { "properties": { "payload": { "$ref": "#/$defs/controlPayload" } } }
93
+ },
94
+ {
95
+ "if": { "properties": { "type": { "const": "graph.error" } } },
96
+ "then": { "properties": { "payload": { "$ref": "#/$defs/errorPayload" } } }
97
+ }
98
+ ],
99
+ "$defs": {
100
+ "hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
101
+ "id": { "type": "string", "minLength": 1 },
102
+ "snapshotPayload": {
103
+ "type": "object",
104
+ "required": ["graph"],
105
+ "properties": {
106
+ "graph": { "$ref": "workspace-knowledge-graph.v1.json" },
107
+ "reason": { "enum": ["initial", "refresh", "recovery", "schema-transition"] }
108
+ },
109
+ "additionalProperties": false
110
+ },
111
+ "deltaPayload": {
112
+ "type": "object",
113
+ "required": [
114
+ "entitiesAdded",
115
+ "entitiesUpdated",
116
+ "entitiesRemoved",
117
+ "relationsAdded",
118
+ "relationsUpdated",
119
+ "relationsRemoved",
120
+ "proofsAdded",
121
+ "proofsUpdated",
122
+ "proofsRemoved",
123
+ "providersUpdated",
124
+ "diagnostics"
125
+ ],
126
+ "properties": {
127
+ "entitiesAdded": {
128
+ "type": "array",
129
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items" }
130
+ },
131
+ "entitiesUpdated": {
132
+ "type": "array",
133
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items" }
134
+ },
135
+ "entitiesRemoved": {
136
+ "type": "array",
137
+ "items": { "$ref": "#/$defs/id" },
138
+ "uniqueItems": true
139
+ },
140
+ "relationsAdded": {
141
+ "type": "array",
142
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/relations/items" }
143
+ },
144
+ "relationsUpdated": {
145
+ "type": "array",
146
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/relations/items" }
147
+ },
148
+ "relationsRemoved": {
149
+ "type": "array",
150
+ "items": { "$ref": "#/$defs/id" },
151
+ "uniqueItems": true
152
+ },
153
+ "proofsAdded": {
154
+ "type": "array",
155
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/proofs/items" }
156
+ },
157
+ "proofsUpdated": {
158
+ "type": "array",
159
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/proofs/items" }
160
+ },
161
+ "proofsRemoved": {
162
+ "type": "array",
163
+ "items": { "$ref": "#/$defs/id" },
164
+ "uniqueItems": true
165
+ },
166
+ "providersUpdated": {
167
+ "type": "array",
168
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/providers/items" }
169
+ },
170
+ "quality": {
171
+ "oneOf": [
172
+ { "type": "null" },
173
+ { "$ref": "workspace-knowledge-graph.v1.json#/properties/quality" }
174
+ ]
175
+ },
176
+ "diagnostics": {
177
+ "type": "array",
178
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/diagnostics/items" }
179
+ }
180
+ },
181
+ "additionalProperties": false
182
+ },
183
+ "providerProgressPayload": {
184
+ "type": "object",
185
+ "required": ["providerId", "status"],
186
+ "properties": {
187
+ "providerId": { "$ref": "#/$defs/id" },
188
+ "status": { "enum": ["queued", "running", "passed", "partial", "skipped", "failed"] },
189
+ "completed": { "type": "integer", "minimum": 0 },
190
+ "total": { "type": "integer", "minimum": 0 },
191
+ "message": { "type": "string" }
192
+ },
193
+ "additionalProperties": false
194
+ },
195
+ "qualityPayload": {
196
+ "type": "object",
197
+ "required": ["quality"],
198
+ "properties": {
199
+ "quality": { "$ref": "workspace-knowledge-graph.v1.json#/properties/quality" },
200
+ "diagnostics": {
201
+ "type": "array",
202
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/diagnostics/items" }
203
+ }
204
+ },
205
+ "additionalProperties": false
206
+ },
207
+ "proofInvalidatedPayload": {
208
+ "type": "object",
209
+ "required": ["proofIds", "reason"],
210
+ "properties": {
211
+ "proofIds": {
212
+ "type": "array",
213
+ "items": { "$ref": "#/$defs/id" },
214
+ "minItems": 1,
215
+ "uniqueItems": true
216
+ },
217
+ "reason": { "type": "string", "minLength": 1 },
218
+ "entityIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "uniqueItems": true },
219
+ "relationIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "uniqueItems": true }
220
+ },
221
+ "additionalProperties": false
222
+ },
223
+ "resyncPayload": {
224
+ "type": "object",
225
+ "required": ["reason"],
226
+ "properties": {
227
+ "reason": {
228
+ "enum": [
229
+ "revision-gap",
230
+ "identity-mismatch",
231
+ "generation-regression",
232
+ "schema-unsupported",
233
+ "hash-discontinuity",
234
+ "validation-failed",
235
+ "queue-overflow"
236
+ ]
237
+ },
238
+ "expectedRevision": { "type": "integer", "minimum": 0 },
239
+ "receivedBaseRevision": { "type": "integer", "minimum": 0 },
240
+ "message": { "type": "string" }
241
+ },
242
+ "additionalProperties": false
243
+ },
244
+ "controlPayload": {
245
+ "type": "object",
246
+ "properties": { "reason": { "type": "string" }, "message": { "type": "string" } },
247
+ "additionalProperties": false
248
+ },
249
+ "errorPayload": {
250
+ "type": "object",
251
+ "required": ["code", "message", "recoverable"],
252
+ "properties": {
253
+ "code": { "type": "string", "minLength": 1 },
254
+ "message": { "type": "string", "minLength": 1 },
255
+ "recoverable": { "type": "boolean" },
256
+ "providerId": { "type": "string" }
257
+ },
258
+ "additionalProperties": false
259
+ }
260
+ },
261
+ "additionalProperties": false
262
+ }
@@ -0,0 +1 @@
1
+ export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-K4X3DM7R.js';
@@ -1,4 +1,4 @@
1
- import {f as f$1,e as e$2}from'./chunk-P3D5YQB2.js';import {b as b$3}from'./chunk-NHN4QXPP.js';import {b as b$6,a as a$3}from'./chunk-THIOE2PB.js';import {e,g,f as f$2,b as b$5,c as c$3,d as d$2}from'./chunk-MER6ZBN2.js';import {a as a$2}from'./chunk-RHQW3DTP.js';import {d as d$3}from'./chunk-T4YR4RAI.js';import {d,b as b$2}from'./chunk-GSWPGELT.js';import {c}from'./chunk-Y45WZR5N.js';import {f,c as c$2,e as e$3}from'./chunk-7YHK5NM3.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {b as b$1,a,c as c$1,d as d$1}from'./chunk-5XATWNME.js';import {b as b$4,j,i,l,h,s,r,p as p$1}from'./chunk-EYJ2CQSK.js';import {promises}from'fs';import*as b from'fs-extra';import p from'path';import e$1 from'chalk';import {execa}from'execa';async function G(t,o={}){let n=p.resolve(t),s=o.workspaceName??p.basename(n),{registerWorkspaceStrict:a}=await import('./workspace-NCWRINEF.js');await a(n,s);let{syncWorkspaceContract:l}=await import('./workspace-contract-TU2I7GC2.js'),d=await l({workspacePath:n,strict:true});o.silent||console.log(e$1.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${d.contract.projects.length} project(s)).`));}function N(){return h()}var st="transactions";function lt(){return p.join(p$1(),st)}async function Fe(){let t=lt();return await b$6(t),a$3({journalDirectory:t})}async function Le(t){for(let o of r())await t.captureFile(o);}async function ie(t){let o=await Fe();try{return await Le(o),await o.captureOwnedTree(t),o}catch(n){return F(o,n)}}async function ct(t){let o=await Fe();try{await Le(o),await o.captureOwnedTree(p.join(t,a)),await o.captureOwnedTree(p.join(t,".venv"));let n=[c$1,".gitignore",p.join(a,"workspace.json"),p.join(a,"toolchain.lock"),p.join(a,"policies.yml"),p.join(a,"cache-config.yml"),d$3,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let s of n)await o.captureFile(p.join(t,s));return o}catch(n){return F(o,n)}}async function B(t){await t.commit(),t.journalPath&&await promises.rm(p.dirname(t.journalPath),{recursive:true,force:true}).catch(o=>f.debug(`Could not remove committed lifecycle journal: ${o}`));}async function F(t,o){try{await t.rollback();}catch(n){throw new AggregateError([o,n],"Workspace lifecycle failed and rollback was incomplete.")}throw o}async function J(t,o,n,s,a){let l=d(o,c(),n,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...s?{pythonVersion:s}:{}}:void 0);s&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:s}),await b$2(t,l);}async function U(t){await b.outputFile(p.join(t,".gitignore"),`.venv/
1
+ import {f as f$1,e as e$2}from'./chunk-P3D5YQB2.js';import {b as b$3}from'./chunk-NHN4QXPP.js';import {b as b$6,a as a$3}from'./chunk-THIOE2PB.js';import {e,g,f as f$2,b as b$5,c as c$3,d as d$2}from'./chunk-MER6ZBN2.js';import {a as a$2}from'./chunk-RHQW3DTP.js';import {d as d$3}from'./chunk-T4YR4RAI.js';import {d,b as b$2}from'./chunk-GSWPGELT.js';import {c}from'./chunk-Y45WZR5N.js';import {f,c as c$2,e as e$3}from'./chunk-7YHK5NM3.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {b as b$1,a,c as c$1,d as d$1}from'./chunk-5XATWNME.js';import {b as b$4,j,i,l,h,s,r,p as p$1}from'./chunk-EYJ2CQSK.js';import {promises}from'fs';import*as b from'fs-extra';import p from'path';import e$1 from'chalk';import {execa}from'execa';async function G(t,o={}){let n=p.resolve(t),s=o.workspaceName??p.basename(n),{registerWorkspaceStrict:a}=await import('./workspace-PJPRBUMQ.js');await a(n,s);let{syncWorkspaceContract:l}=await import('./workspace-contract-TU2I7GC2.js'),d=await l({workspacePath:n,strict:true});o.silent||console.log(e$1.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${d.contract.projects.length} project(s)).`));}function N(){return h()}var st="transactions";function lt(){return p.join(p$1(),st)}async function Fe(){let t=lt();return await b$6(t),a$3({journalDirectory:t})}async function Le(t){for(let o of r())await t.captureFile(o);}async function ie(t){let o=await Fe();try{return await Le(o),await o.captureOwnedTree(t),o}catch(n){return F(o,n)}}async function ct(t){let o=await Fe();try{await Le(o),await o.captureOwnedTree(p.join(t,a)),await o.captureOwnedTree(p.join(t,".venv"));let n=[c$1,".gitignore",p.join(a,"workspace.json"),p.join(a,"toolchain.lock"),p.join(a,"policies.yml"),p.join(a,"cache-config.yml"),d$3,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let s of n)await o.captureFile(p.join(t,s));return o}catch(n){return F(o,n)}}async function B(t){await t.commit(),t.journalPath&&await promises.rm(p.dirname(t.journalPath),{recursive:true,force:true}).catch(o=>f.debug(`Could not remove committed lifecycle journal: ${o}`));}async function F(t,o){try{await t.rollback();}catch(n){throw new AggregateError([o,n],"Workspace lifecycle failed and rollback was incomplete.")}throw o}async function J(t,o,n,s,a){let l=d(o,c(),n,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...s?{pythonVersion:s}:{}}:void 0);s&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:s}),await b$2(t,l);}async function U(t){await b.outputFile(p.join(t,".gitignore"),`.venv/
2
2
  __pycache__/
3
3
  *.pyc
4
4
  .env
@@ -903,7 +903,7 @@ ${o}/
903
903
 
904
904
  ---
905
905
 
906
- **Generated with Workspai** | [GitHub](https://github.com/rapidkitlabs/workspai)
906
+ **Generated with Workspai** | [GitHub](https://github.com/chistiq/workspai)
907
907
  `;if(await promises.writeFile(p.join(t,"README.md"),d,"utf-8"),s.succeed("Demo workspace setup complete"),!n)if(await Ve(t))s.warn("Git initialization skipped because target is already inside a git worktree");else {s.start("Initializing git repository");try{await execa("git",["init"],{cwd:t,env:a$1()}),await b.outputFile(p.join(t,".gitignore"),`# Dependencies
908
908
  node_modules/
909
909
 
@@ -1,4 +1,4 @@
1
- import {a as a$2}from'./chunk-QNONOO4F.js';import {a as a$5}from'./chunk-22DT744Z.js';import {a as a$3,e}from'./chunk-HDXNIN4N.js';import {d,a as a$1,e as e$1}from'./chunk-32OJDBIG.js';import {a}from'./chunk-BMWFQXGW.js';import a$4 from'chalk';import se from'fs';import b from'path';import {execa}from'execa';var G="autopilot-release-last-run.json",V="autopilot-release.json";function j(r){try{return JSON.parse(r)}catch{return null}}function Re(r){let e=b.resolve(r),n=a$5(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 re(r){let e=r.toLowerCase();return e==="pass"?"pass":e==="warn"?"warn":e==="fail"?"fail":"warn"}function oe(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 Se(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 be(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 se.promises.mkdir(b.dirname(r),{recursive:true}),await se.promises.writeFile(r,`${JSON.stringify(e,null,2)}
1
+ import {a as a$2}from'./chunk-E2KJ5QWY.js';import {a as a$5}from'./chunk-22DT744Z.js';import {a as a$3,e}from'./chunk-HDXNIN4N.js';import {d,a as a$1,e as e$1}from'./chunk-32OJDBIG.js';import {a}from'./chunk-BMWFQXGW.js';import a$4 from'chalk';import se from'fs';import b from'path';import {execa}from'execa';var G="autopilot-release-last-run.json",V="autopilot-release.json";function j(r){try{return JSON.parse(r)}catch{return null}}function Re(r){let e=b.resolve(r),n=a$5(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 re(r){let e=r.toLowerCase();return e==="pass"?"pass":e==="warn"?"warn":e==="fail"?"fail":"warn"}function oe(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 Se(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 be(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 se.promises.mkdir(b.dirname(r),{recursive:true}),await se.promises.writeFile(r,`${JSON.stringify(e,null,2)}
2
2
  `,"utf-8");}async function Me(r){let e$2=Re(r.workspacePath),n=r.mode,o=[],t=[],F,H,D,q,Q,X=0,f=false,T=0,L=0,N=-1,W=-1,c="skipped",d$1="skipped",ae=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([...ae],e$2),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=j(l.stdout),E=p&&p.healthScore&&typeof p.healthScore=="object"?p.healthScore:{},k=Number(E.errors??0),$=Number(E.warnings??0);Number.isFinite(k)&&k>0?(c="fail",t.push(`doctor workspace reports ${k} error(s)`)):Number.isFinite($)&&$>0&&(c="warn");}N=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=Date.now(),w=await S(["analyze","--json"],e$2),v=Date.now()-g;H=await d(e$2,a.analyze)??a$1(e$2,a.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=j(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:v,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 P=Date.now(),h=await S(["readiness","--json"],e$2),y=Date.now()-P;if(d$1="fail",h.crashed)d$1="fail",f=true,t.push(`readiness execution error: ${h.stderr||"unknown error"}`);else if(h.exitCode!==0)d$1="fail",t.push("readiness command failed");else {let p=j(h.stdout),E=String(p?.overallStatus??"fail");if(d$1=re(E),typeof p?.evidencePath=="string"&&p.evidencePath.trim().length>0&&(F=p.evidencePath),d$1==="fail"){let k=Array.isArray(p?.blockingReasons)?p?.blockingReasons.filter($=>typeof $=="string"):[];k.length>0?t.push(...k.map($=>`readiness: ${$}`)):t.push("readiness overall status is fail");}}W=o.push({name:"readiness",status:d$1,durationMs:y,summary:`readiness overall status is ${d$1}`})-1,n==="enforce"&&d$1==="warn"&&t.push("readiness reported warnings under enforce mode");}let ne=Date.now(),z=await S(["doctor","workspace","--plan","--json"],e$2),ie=Date.now()-ne,R="warn";if(z.crashed)R="fail",f=true,t.push(`doctor remediation plan execution error: ${z.stderr||"unknown error"}`);else if(z.exitCode!==0)R="fail",t.push("doctor remediation plan command failed");else {let s=j(z.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&&(T=m),Number.isFinite(g)&&g>0&&(L=g),Number.isFinite(m)&&m===0?R="pass":R="warn";}if(o.push({name:"remediation-plan",status:R,durationMs:ie,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$2),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=L>0?L:T>0?T:1;let w=await S(["doctor","workspace","--json"],e$2);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=j(w.stdout),P=i&&i.healthScore&&typeof i.healthScore=="object"?i.healthScore:{},h=Number(P.errors??0),y=Number(P.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";}N>=0&&(o[N].status=c,o[N].summary=`doctor workspace post-apply status is ${c}`);let v=await S(["readiness","--json"],e$2);if(v.crashed)d$1="fail",f=true,t.push(`post-apply readiness execution error: ${v.stderr||"unknown error"}`);else if(v.exitCode!==0)d$1="fail",t.push("post-apply readiness command failed");else {let i=j(v.stdout),P=String(i?.overallStatus??"fail");if(d$1=re(P),typeof i?.evidencePath=="string"&&i.evidencePath.trim().length>0&&(F=i.evidencePath),d$1==="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");}}W>=0&&(o[W].status=d$1,o[W].summary=`readiness post-apply overall status is ${d$1}`);}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 le=Date.now(),x="pass",A="workspace test/build completed for selected projects";try{let s=await a$2({workspacePath:e$2,stage:"test",affected:true,since:r.since,parallel:r.parallel,maxWorkers:r.maxWorkers,strict:true,json:true,enforceGates:false});D=a$1(e$2,b.join(".workspai","reports",a$3)),await e(e$2,s),q=D;let l=oe(s);if(l==="fail")x="fail",A="workspace test stage failed for selected projects",t.push("workspace run test failed for selected projects");else {l==="warn"&&(x="warn",A="workspace test stage completed with warnings",n==="enforce"&&t.push("workspace run test reported warnings under enforce mode"));let m=await a$2({workspacePath:e$2,stage:"build",affected:true,since:r.since,parallel:r.parallel,maxWorkers:r.maxWorkers,strict:true,json:true,enforceGates:false});await e(e$2,m),Q=D;let g=oe(m);g==="fail"?(x="fail",A="workspace build stage failed for selected projects",t.push("workspace run build failed for selected projects")):g==="warn"&&(x="warn",A="workspace test/build completed with warnings",n==="enforce"&&t.push("workspace run test/build reported warnings under enforce mode"));}}catch(s){x="fail",A="workspace test/build orchestration failed",f=true,t.push(`workspace run orchestration error: ${s instanceof Error?s.message:String(s)}`);}let ce=Date.now()-le;o.push({name:"workspace-run-test-build",status:x,durationMs:ce,summary:A});let M=o.filter(s=>s.status==="warn").length,pe=o.filter(s=>s.status==="fail").length,_=n==="enforce"?o.some(s=>s.status==="warn"||s.status==="fail"):pe>0,C=[...new Set(t)],O=f||_?Math.max(1,C.length):0,ue=O>0?C:[],de=O===0?C:[],fe=Se(o),me=f||_?"blocked":M>0?"partial":"approved",ge=f?3:_?1:M>0?2:0,we=be({mode:n,executionError:f,blockers:C,hasWarnings:M>0}),Y=a$1(e$2,".workspai/reports"),he=b.join(Y,G),ke=b.join(Y,V),u={schemaVersion:"autopilot-release-v1",generatedAt:new Date().toISOString(),workspacePath:e$2,mode:n,summary:{releaseScore:fe,verdict:me,blockers:O,warnings:M,safeFixesApplied:X,manualActions:C.length,exitCode:ge},stages:o,blockingReasons:ue,warningReasons:de,nextActions:we,artifacts:{reportPath:he,aliasEvidencePath:ke,analyzeEvidencePath:H,readinessEvidencePath:F,workspaceRunEvidencePath:D,workspaceRunTestPath:q,workspaceRunBuildPath:Q},enterpriseControls:{jsonReady:true,evidencePath:`.workspai/reports/${G}`,aliasEvidencePath:`.workspai/reports/${V}`}};if(await e$1(e$2,`.workspai/reports/${G}`,u),await e$1(e$2,`.workspai/reports/${V}`,u),r.output&&await xe(b.resolve(r.output),u),!r.json){console.log(a$4.bold.cyan(`
3
3
  \u{1F680} Workspai Autopilot Release
4
4
  `)),console.log(a$4.bold(`Workspace: ${a$4.cyan(b.basename(e$2))}`)),console.log(a$4.gray(`Path: ${e$2}`)),console.log(a$4.white(`Mode: ${n}`)),console.log(a$4.white(`Verdict: ${u.summary.verdict==="approved"?a$4.green("approved"):u.summary.verdict==="partial"?a$4.yellow("partial"):a$4.red("blocked")}`)),console.log(a$4.white(`Release score: ${u.summary.releaseScore}`));for(let s of u.stages){let l=s.status==="pass"?a$4.green("PASS"):s.status==="warn"?a$4.yellow("WARN"):s.status==="skipped"?a$4.gray("SKIP"):a$4.red("FAIL");console.log(` - ${s.name}: ${l} ${s.summary} (${s.durationMs}ms)`);}if(u.blockingReasons.length>0){console.log(a$4.bold.red(`