workspai 0.56.0 → 0.57.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 (88) hide show
  1. package/README.md +36 -8
  2. package/contracts/adopt-effects.v1.json +72 -0
  3. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
  4. package/contracts/doctor-project-evidence.v1.json +27 -0
  5. package/contracts/doctor-workspace-evidence.v1.json +29 -0
  6. package/contracts/extension-cli-compatibility.v1.json +1 -0
  7. package/contracts/published-contract-catalog.v1.json +5 -0
  8. package/contracts/workspace-intelligence/doctor-summary.v1.json +3 -1
  9. package/dist/autopilot-release-WIFFFQKW.js +1 -0
  10. package/dist/capabilities-command-44JVOE5S.js +1 -0
  11. package/dist/{chunk-XH7PDHBF.js → chunk-6OFGLNFS.js} +1 -1
  12. package/dist/{chunk-QTCZPS5I.js → chunk-75HOCFNH.js} +1 -1
  13. package/dist/{chunk-5RL254O2.js → chunk-7WUT5ZSO.js} +1 -1
  14. package/dist/{chunk-KR7CIEQR.js → chunk-AA4PNQKR.js} +1 -1
  15. package/dist/chunk-CNWUIXF3.js +1 -0
  16. package/dist/{chunk-6HCAGHCY.js → chunk-DF4NWPB7.js} +1 -1
  17. package/dist/chunk-DT4X7I5M.js +81 -0
  18. package/dist/chunk-GDKFN3CM.js +8 -0
  19. package/dist/{chunk-WLCBXCZV.js → chunk-GTJY55QK.js} +1 -1
  20. package/dist/{chunk-5ZA4JYOP.js → chunk-GXTCU4WF.js} +1 -1
  21. package/dist/{chunk-SV2SP22H.js → chunk-IUYZ3NHS.js} +3 -3
  22. package/dist/{chunk-KS4FB5W7.js → chunk-IXOLHPTN.js} +1 -1
  23. package/dist/{chunk-2L4PSZQB.js → chunk-L36ZASME.js} +1 -1
  24. package/dist/{chunk-7PNARN6S.js → chunk-N2BIIUDH.js} +1 -1
  25. package/dist/{chunk-QFCKHUEP.js → chunk-P475BOJW.js} +1 -1
  26. package/dist/{chunk-5BGPGNRQ.js → chunk-QHY6F4SS.js} +1 -1
  27. package/dist/chunk-QK5QOXOE.js +13 -0
  28. package/dist/{chunk-QAF26ZQX.js → chunk-RPHM7LQW.js} +1 -1
  29. package/dist/chunk-SNO3WG4V.js +2 -0
  30. package/dist/chunk-TTFQWH55.js +91 -0
  31. package/dist/{chunk-HASVV34S.js → chunk-VL3APTVB.js} +1 -1
  32. package/dist/{chunk-WOTTSPSF.js → chunk-VUR7H2FU.js} +1 -1
  33. package/dist/chunk-VZPWIILU.js +1 -0
  34. package/dist/chunk-WP3CXMVA.js +2 -0
  35. package/dist/{chunk-ESWFBSYM.js → chunk-Z57G62KE.js} +1 -1
  36. package/dist/{create-DLUWG46F.js → create-O2KLTN5H.js} +1 -1
  37. package/dist/{doctor-IZ4YOCYE.js → doctor-AL5YWO5X.js} +1 -1
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.js +166 -164
  40. package/dist/{pipeline-IBQYDLFF.js → pipeline-4ST4BQWY.js} +1 -1
  41. package/dist/{project-intelligence-lens-SIU7IXKG.js → project-intelligence-lens-JHYECYOK.js} +1 -1
  42. package/dist/{verified-goal-M4GPOXNL.js → verified-goal-KFNRGOKT.js} +1 -1
  43. package/dist/{workspace-3AAOUELG.js → workspace-O4E5CCGK.js} +1 -1
  44. package/dist/{workspace-agent-sync-QGYLY7HH.js → workspace-agent-sync-N5DPGU2E.js} +1 -1
  45. package/dist/{workspace-context-JCLPRYNC.js → workspace-context-ETZNEHOJ.js} +1 -1
  46. package/dist/{workspace-contract-IUUPBQXU.js → workspace-contract-OSI7NBXS.js} +1 -1
  47. package/dist/{workspace-explain-CZGBVDE6.js → workspace-explain-EM7IUV6L.js} +1 -1
  48. package/dist/{workspace-foundation-7IGMO4CW.js → workspace-foundation-QQHX66KE.js} +1 -1
  49. package/dist/{workspace-graph-stream-5YMLJXAJ.js → workspace-graph-stream-UZJQ75XZ.js} +1 -1
  50. package/dist/workspace-graph-token-efficiency-TF23UYEF.js +1 -0
  51. package/dist/{workspace-intelligence-XHSUFTAT.js → workspace-intelligence-A7O7MN6T.js} +1 -1
  52. package/dist/{workspace-intelligence-runner-EN5V4KSC.js → workspace-intelligence-runner-4EF66L66.js} +1 -1
  53. package/dist/{workspace-knowledge-graph-VWQTIEYK.js → workspace-knowledge-graph-BVN4NTJ6.js} +1 -1
  54. package/dist/{workspace-knowledge-graph-query-TXA3KVUV.js → workspace-knowledge-graph-query-6DAOXGGT.js} +1 -1
  55. package/dist/{workspace-knowledge-graph-snapshot-WB62AVDK.js → workspace-knowledge-graph-snapshot-XSQADCNR.js} +1 -1
  56. package/dist/{workspace-mcp-serve-NCAGGWQS.js → workspace-mcp-serve-TKX4J3SX.js} +1 -1
  57. package/dist/{workspace-model-NXFIKX26.js → workspace-model-7ESEP366.js} +1 -1
  58. package/dist/{workspace-onboarding-OP22NHQ4.js → workspace-onboarding-SY255V7L.js} +1 -1
  59. package/dist/{workspace-registry-summary-A5VDPRHU.js → workspace-registry-summary-7ISKYEPM.js} +1 -1
  60. package/dist/{workspace-repair-engine-N4KXNSVL.js → workspace-repair-engine-GMA2YTCF.js} +1 -1
  61. package/dist/workspace-run-ZZXVNFUS.js +1 -0
  62. package/dist/{workspace-verify-TUVLFPPN.js → workspace-verify-CNXZPWS5.js} +1 -1
  63. package/dist/{workspace-watch-2ZNOYSUQ.js → workspace-watch-HGFL2EU3.js} +1 -1
  64. package/docs/From Code to Shared Understanding-B.png +0 -0
  65. package/docs/From Code to Shared Understanding.png +0 -0
  66. package/docs/README_CONTENT_CONTRACT.md +25 -12
  67. package/docs/ci-workflows.md +9 -1
  68. package/docs/commands-reference.md +1 -1
  69. package/docs/contracts/README.md +16 -12
  70. package/docs/doctor-command.md +35 -11
  71. package/docs/from-code-to-shared-understanding.md +22 -17
  72. package/docs/real-world-qualification.md +73 -0
  73. package/docs/workspace-knowledge-graph.md +24 -3
  74. package/docs/workspace-operations.md +14 -2
  75. package/docs/workspace-run.md +16 -4
  76. package/package.json +5 -1
  77. package/dist/autopilot-release-CH57CGET.js +0 -1
  78. package/dist/capabilities-command-WEOGFCWF.js +0 -1
  79. package/dist/chunk-664GXRLD.js +0 -1
  80. package/dist/chunk-7Y3KVZJF.js +0 -8
  81. package/dist/chunk-BDN32Y2N.js +0 -81
  82. package/dist/chunk-DIZSHNZ5.js +0 -2
  83. package/dist/chunk-DOIZANFA.js +0 -2
  84. package/dist/chunk-OX53L237.js +0 -13
  85. package/dist/chunk-QRWWYL52.js +0 -88
  86. package/dist/chunk-VGJVIHHR.js +0 -1
  87. package/dist/workspace-graph-token-efficiency-HK4KNWWP.js +0 -1
  88. package/dist/workspace-run-PXKC3ELS.js +0 -1
@@ -39,6 +39,10 @@ Checks:
39
39
 
40
40
  > Compatibility note: `npx workspai doctor --workspace` still works, but `doctor workspace` is the canonical form.
41
41
 
42
+ Both workspace forms use the canonical project-to-workspace resolver. After a
43
+ project is adopted, imported, or relinked, they can be launched from that
44
+ project directory and resolve its validated machine-local workspace binding.
45
+
42
46
  ### 3) Project Check (Canonical)
43
47
 
44
48
  ```bash
@@ -111,6 +115,9 @@ npx workspai doctor
111
115
  # Full check inside a workspace
112
116
  npx workspai doctor workspace
113
117
 
118
+ # Expand every probe and lifecycle capability (default output is summary-first)
119
+ npx workspai doctor workspace --verbose
120
+
114
121
  # Focus only on current project
115
122
  npx workspai doctor project
116
123
 
@@ -120,6 +127,9 @@ npx workspai doctor workspace --json
120
127
  # Compact agent/CI projection; full evidence is still written
121
128
  npx workspai doctor workspace --fresh --json=summary
122
129
 
130
+ # Review the governed plan before mutation
131
+ npx workspai doctor workspace --plan
132
+
123
133
  # Attempt safe fixes (interactive)
124
134
  npx workspai doctor workspace --fix
125
135
 
@@ -145,7 +155,7 @@ CI, and agents: it distinguishes blocking causes, advisory findings, unknowns, d
145
155
  subjects, vulnerability findings, not-applicable checks, and the next safe action. The complete
146
156
  probe and diagnosis evidence remains in `doctor-last-run.json` or `doctor-project-last-run.json`.
147
157
 
148
- ## One verdict, backed by every probe
158
+ ## One verdict, multi-axis accounting
149
159
 
150
160
  Doctor calculates one verdict from the host and every project probe:
151
161
 
@@ -153,12 +163,26 @@ Doctor calculates one verdict from the host and every project probe:
153
163
  - **Needs attention** means the current profile found advisory work.
154
164
  - **Blocked** means at least one error-level probe failed.
155
165
 
156
- The score and verdict use the same counts. A failed security, coverage, or
157
- runtime probe cannot be hidden behind a high percentage or a healthy host. New
158
- evidence includes the host/project score components and per-project probe
159
- summary; semantic validation rejects contradictory artifacts before they are
160
- written. Older v1 evidence remains readable so existing workspaces and IDEs do
161
- not break during migration.
166
+ The verdict is authoritative. Human output presents blocking, advisory,
167
+ unknown, contradictory, and not-applicable counts separately; it never calls a
168
+ single percentage “health.” The additive `healthScore.presentation` contract
169
+ labels its percentage as a diagnostic pass rate for accounting only. A failed
170
+ security, coverage, or runtime probe therefore cannot be hidden behind a high
171
+ percentage or a healthy host. Existing score fields remain readable for older
172
+ IDEs, while updated consumers prefer the multi-axis projection.
173
+
174
+ Doctor also publishes `projectArchetype` independently from `projectKind`.
175
+ `projectKind` describes the technical surface (backend, frontend, extension,
176
+ and so on); the archetype describes the product role (service, application,
177
+ library, SDK, platform, plugin, or monorepo). Service-only checks such as a
178
+ runtime health endpoint, database migrations, or an executable boot entrypoint
179
+ are retained as explicit `not-applicable` evidence for non-deployable
180
+ archetypes instead of becoming false warnings.
181
+
182
+ The default terminal view is summary-first and uses portable boundaries such
183
+ as `$WORKSPACE`, `$PROJECT`, and `external/<project>`. `--verbose` expands all
184
+ probes and lifecycle capabilities. JSON continues to retain canonical absolute
185
+ paths because local machine consumers need them for governed operations.
162
186
 
163
187
  ## Universal diagnosis core
164
188
 
@@ -192,10 +216,10 @@ The same diagnosis contract is used for Node, Python, Go, JVM, Rust, .NET, PHP,
192
216
  Clojure, Deno, Bun, Scala, Kotlin, C, C++, and unknown/custom projects. Runtime adapters gather
193
217
  different evidence; the diagnosis, causality, safety, and verification vocabulary stays the same.
194
218
  Composite projects publish every detected family under `project.runtimeFamilies`; Doctor keeps a
195
- primary runtime for compatibility and explicitly warns when secondary runtimes need their own
196
- project boundary or custom adapter instead of silently claiming full coverage. Every unevaluated
197
- secondary runtime is also published as a diagnosis unknown and proportionally lowers diagnosis
198
- completeness; a primary-only polyglot scan can never report 100%.
219
+ primary runtime for compatibility. A detected cross-language platform is evaluated through primary
220
+ and portable evidence, and asks for explicit custom adapters only for runtime-specific checks the
221
+ portable contract cannot represent. Every unevaluated secondary runtime remains a diagnosis unknown
222
+ and proportionally lowers completeness; a primary-only polyglot scan can never report 100%.
199
223
 
200
224
  Workspace project boundaries come from the canonical workspace contract/registry when available.
201
225
  A nested solution, test project, or manifest inside a registered project is treated as evidence for
@@ -5,26 +5,28 @@ you to replace your frameworks or move existing source code.
5
5
 
6
6
  ```mermaid
7
7
  flowchart TB
8
- Code["Your projects and repositories"]
8
+ Sources["Projects · APIs · packages<br/>infrastructure · docs · CI"]
9
9
 
10
- Routes["Create a project<br/>Adopt it in place<br/>or Import a repository"]
10
+ Connect["Create · Adopt in place · Import"]
11
11
 
12
- Workspace["Workspai builds one model of<br/>projects, dependencies, rules, and commands"]
12
+ Model["Canonical Workspace Model<br/>identity · inventory · boundaries"]
13
13
 
14
- Change["What changed?<br/>What is affected?<br/>Is the evidence ready?"]
14
+ Graph["Derived Knowledge Graph<br/>relationships · facts · canonical proof"]
15
15
 
16
- Outputs["Context, impact, verification,<br/>explanations, and release evidence"]
16
+ Decide["Diff · Impact · Evidence gates<br/>Readiness · Verify"]
17
17
 
18
- Code --> Routes
19
- Routes --> Workspace
20
- Workspace --> Change
21
- Change --> Outputs
18
+ Ground["Reports · bounded context<br/>Agent sync · Explain"]
22
19
 
23
- Outputs --> Developers["Developers"]
24
- Outputs --> CI["CI and releases"]
25
- Outputs --> IDEs["IDEs"]
26
- Outputs --> Agents["AI agents"]
27
- Outputs --> MCP["MCP clients"]
20
+ Sources --> Connect
21
+ Connect --> Model
22
+ Model -->|derives, revision-bound| Graph
23
+ Model --> Decide
24
+ Graph --> Decide
25
+ Decide --> Ground
26
+
27
+ Ground --> Humans["Developers"]
28
+ Ground --> Automation["CI · releases"]
29
+ Ground --> Tools["IDEs · MCP · AI agents"]
28
30
  ```
29
31
 
30
32
  ## What This Means
@@ -40,8 +42,8 @@ flowchart TB
40
42
  the evidence needed for a safe decision.
41
43
  4. **Share the result.** Developers, CI, IDEs, AI agents, and MCP clients consume
42
44
  the same workspace truth instead of building separate assumptions. The
43
- current CLI exposes a read-mostly `workspace mcp serve` bridge; a dedicated
44
- `packages/mcp` boundary is planned.
45
+ current CLI exposes the governed evidence through its reports, agent context,
46
+ graph queries, and read-mostly `workspace mcp serve` bridge.
45
47
 
46
48
  This is the user-facing view. The implementation uses a versioned chain of
47
49
  model, change, evidence, verification, context, grounding, and explanation
@@ -57,7 +59,10 @@ baseline lifecycle, exit codes, and failure propagation are specified in
57
59
  [Unified Workspace Intelligence Runner](./workspace-intelligence-runner.md).
58
60
 
59
61
  The npm README uses a PNG rendering because npm package pages do not reliably
60
- render Mermaid. When this source changes, regenerate
62
+ render Mermaid. npm also does not provide a dependable embedded-video player
63
+ for package READMEs. Keep the full MP4 outside the published package. For inline
64
+ motion, use a bounded, silent GIF hosted as a public asset; retain a linked MP4
65
+ for full-resolution playback and audio. When this source changes, regenerate
61
66
  `From Code to Shared Understanding.png` before publishing.
62
67
 
63
68
  ## Execute the Contract
@@ -0,0 +1,73 @@
1
+ # Real-world qualification
2
+
3
+ Workspai's deterministic unit, contract, integration, and adversarial suites
4
+ remain the release gates. Real-world qualification complements them by running
5
+ the installed CLI against explicitly selected, linked reference repositories
6
+ without installing dependencies or executing project lifecycle commands.
7
+
8
+ ## Isolated and cumulative layouts
9
+
10
+ Use one isolated workspace per repository when diagnosing detection, adoption,
11
+ Doctor, model, graph, context, contract, and readiness behavior:
12
+
13
+ ```bash
14
+ REFERENCE_ROOT=/path/to/reference-repositories
15
+ QUALIFICATION_ROOT=/path/to/qualification-output
16
+ npm run test:real-world -- \
17
+ --reference-root "$REFERENCE_ROOT" \
18
+ --run-root "$QUALIFICATION_ROOT" \
19
+ --projects vscode,grpc,deno \
20
+ --report "$QUALIFICATION_ROOT/isolated.json"
21
+ ```
22
+
23
+ Use `--shared-workspace` to adopt the repositories cumulatively into one fresh
24
+ workspace. Every addition reruns the canonical chain, so transition and scale
25
+ failures are observable rather than hidden behind the final state:
26
+
27
+ ```bash
28
+ REFERENCE_ROOT=/path/to/reference-repositories
29
+ QUALIFICATION_ROOT=/path/to/qualification-output
30
+ npm run test:real-world -- \
31
+ --reference-root "$REFERENCE_ROOT" \
32
+ --run-root "$QUALIFICATION_ROOT" \
33
+ --shared-workspace enterprise-polyglot \
34
+ --projects vscode,grpc,deno,copilot-sdk \
35
+ --report "$QUALIFICATION_ROOT/shared.json"
36
+ ```
37
+
38
+ After the shared workspace qualifies, exercise bounded queries, full graph
39
+ exports, diff/impact/verify/trace, agent dry runs, portable archives, snapshots,
40
+ and destructive-operation dry runs:
41
+
42
+ ```bash
43
+ QUALIFICATION_ROOT=/path/to/qualification-output
44
+ npm run test:real-world:enterprise -- \
45
+ --workspace "$QUALIFICATION_ROOT/enterprise-polyglot" \
46
+ --report "$QUALIFICATION_ROOT/enterprise-command-surface.json"
47
+ ```
48
+
49
+ ## Safety and interpretation
50
+
51
+ - Reference repositories are linked; source is never moved or copied.
52
+ - `--reference-root` is mandatory. The harness has no developer-machine default.
53
+ - Qualification reports are publication-safe by construction: project names are
54
+ anonymized, absolute paths and command arguments are omitted, and raw command
55
+ output is never retained. Report writing fails closed if a local path or a
56
+ forbidden raw-output field reaches the payload.
57
+ - Enterprise command artifacts (graphs, archives, exports, and snapshots) are
58
+ operational test material and remain local-only. Publish only the sanitized
59
+ qualification JSON report, never its adjacent artifact directory.
60
+ - Dependency installation, project build/test/start/init, infrastructure
61
+ mutation, publication, and model network calls are not permitted.
62
+ - Agent customization and destructive project operations are dry-run only.
63
+ - Exit codes `1` and `2` may be valid domain outcomes when their documented JSON
64
+ contracts parse successfully; unexpected process, timeout, buffer, or schema
65
+ failures fail qualification.
66
+ - A real repository warning remains evidence, not a CLI defect. Fix the CLI only
67
+ when detection, classification, contract, portability, or command semantics
68
+ are wrong.
69
+ - Full graphs belong in `--output` artifacts. Agents and IDEs consume bounded
70
+ `search`, `entities`, `evidence`, and `path` results.
71
+
72
+ These suites are explicit and opt-in because they require local reference
73
+ repositories. They do not replace cross-platform CI fixtures or release gates.
@@ -102,6 +102,20 @@ they are in the current graph. Exact labels and identities still win. This keeps
102
102
  a common word such as `check` from outranking a rarer term such as `user` merely
103
103
  because it appears in more files. No embedding service or model call is involved.
104
104
 
105
+ For multi-term questions, a generic kind intent such as `service` or `api`
106
+ cannot qualify an otherwise unrelated entity by itself. The result must cover
107
+ the query's meaningful terms, except for deliberate broad architecture queries
108
+ whose purpose is to return a diversified set of languages, bindings,
109
+ dependencies, ownership, CI, deployment, documentation, and contracts.
110
+
111
+ Source-structure extraction is also deliberately sampled. Local import
112
+ resolution uses the larger bounded fingerprint inventory, so a sampled source
113
+ file can still link to a valid target outside the extraction window. A target
114
+ outside the sample receives a lightweight proof-backed file entity; its full
115
+ symbols are not implied to have been extracted. The graph diagnostic reports
116
+ the sampled and indexed candidate counts and must not be read as exhaustive
117
+ symbol coverage.
118
+
105
119
  ### Fast reads without stale answers
106
120
 
107
121
  The read-oriented `search`, `entities`, `evidence`, `path`, and `benchmark`
@@ -142,11 +156,18 @@ files beyond that declared limit.
142
156
  | Why does Workspai believe an item exists? | `workspace graph evidence <entity-or-relation> --json` |
143
157
  | How are two things connected? | `workspace graph path <from> <to> --json` |
144
158
  | What changed between graph revisions? | `workspace graph overlay --from <graph.json> --json` |
145
- | What is the full portable graph? | `workspace graph emit --json` |
146
- | How do I render the project topology? | `workspace graph dot\|mermaid [--output <file>]` |
159
+ | What is the full portable graph? | `workspace graph emit --output graph.json --json` |
160
+ | How do I render the project topology? | `workspace graph dot\|mermaid [--output <file>]` |
147
161
  | How do I export to semantic or graph-analysis tools? | `workspace graph jsonld\|graphml\|gexf --output <file>` |
148
162
  | How much retrieval payload did one query avoid? | `workspace graph benchmark <query> --limit <n> --json` |
149
- | How should an MCP-compatible agent retrieve context? | `workspace mcp serve` → `searchWorkspaceGraph` |
163
+
164
+ `graph emit --json` writes the complete dependency and Knowledge Graph to
165
+ stdout and can be very large. Automation, IDEs, and agents should pass
166
+ `--output`; stdout then contains only a bounded
167
+ `workspai-cli-operation-result-v1` receipt. Use `search`, `entities`,
168
+ `evidence`, or `path` for bounded retrieval rather than loading the full
169
+ export.
170
+ | How should an MCP-compatible agent retrieve context? | `workspace mcp serve` → `searchWorkspaceGraph` |
150
171
 
151
172
  ## What it models
152
173
 
@@ -55,8 +55,12 @@ npx workspai workspace import team.workspai-archive.zip --output ./team --json
55
55
  - Registry and contract sync include adopted projects for `workspace model`, `workspace context`, Dashboard, and agents.
56
56
  - Managed grounding writes a portable project lens, project grounding, and a
57
57
  bounded managed section in `AGENTS.md`. User-authored `AGENTS.md` content is
58
- preserved.
59
- - `--dry-run --json` previews detection without writing metadata.
58
+ preserved, and an authored tracked deletion of that file is never resurrected.
59
+ - `--dry-run --json` previews detection without writing metadata. Its versioned
60
+ `adoptedProject.effects` record also declares project metadata files,
61
+ conditional `.gitignore`/`AGENTS.md` reconciliation, and the registration,
62
+ contract, model, graph, and agent-grounding operations that a real run would
63
+ perform.
60
64
 
61
65
  ### Existing workspace behavior
62
66
 
@@ -103,6 +107,7 @@ entry point into its canonical workspace:
103
107
  ```bash
104
108
  cd /absolute/path/to/project
105
109
  npx workspai project workspace status --json
110
+ npx workspai doctor workspace --json=summary
106
111
  npx workspai doctor project --json
107
112
  npx workspai workspace graph search "authentication endpoint" --limit 12 --json
108
113
  npx workspai workspace intelligence run --for-agent generic --strict --json
@@ -208,6 +213,7 @@ npx workspai workspace contract init
208
213
  npx workspai workspace contract inspect
209
214
  npx workspai workspace contract verify --strict
210
215
  npx workspai workspace contract graph
216
+ npx workspai workspace contract graph --output ./contract-graph.json --json
211
217
  ```
212
218
 
213
219
  Contract file: `.workspai/workspace.contract.json`. Verification checks schema, duplicate slugs, port collisions, and unknown dependencies.
@@ -222,6 +228,12 @@ public environment-template keys, command capabilities, key manifests,
222
228
  entrypoints, API specifications, infrastructure, documentation, and an
223
229
  operational verification profile. Environment values are never emitted.
224
230
 
231
+ The full contract graph can be large because it includes the Knowledge Graph.
232
+ For automation, IDEs, and agents, pass `--output`; the complete portable graph
233
+ is written to that file and stdout remains a bounded
234
+ `workspai-cli-operation-result-v1` receipt. Without `--output`, the existing
235
+ full JSON response remains backward compatible.
236
+
225
237
  The same response also exposes `knowledgeGraph` under the public
226
238
  `workspace-knowledge-graph.v1` contract. It is a provider-neutral,
227
239
  proof-carrying view spanning source structure, packages, service and API
@@ -35,6 +35,13 @@ family. Vendored trees, build outputs, fixtures, and nested test fixture package
35
35
  manifests are excluded from lifecycle discovery so orchestration does not turn
36
36
  sample inputs into install targets.
37
37
 
38
+ Planning and `init` do not require Doctor or release-readiness evidence. Real
39
+ `test`, `build`, and `start` runs enforce the `doctor-workspace` and `readiness`
40
+ gates by default. A failed gate prevents project commands from starting and is
41
+ recorded as `gates.blocked` in the result. `--strict` converts a failing or
42
+ warning gate into a non-zero process exit; without it, the structured gate
43
+ result remains available without turning advisory policy into a process error.
44
+
38
45
  The authoritative scaffold/import/lifecycle tiers are in
39
46
  [contracts/RUNTIME_SUPPORT_MATRIX.md](./contracts/RUNTIME_SUPPORT_MATRIX.md).
40
47
  Inspect one project's effective surface with
@@ -98,15 +105,20 @@ both command context and the final root cause without copying the full log.
98
105
  Consumers should render these fields rather than reconstructing a diagnosis
99
106
  from arbitrary stdout lines.
100
107
 
108
+ The canonical report is `.workspai/reports/workspace-run-last.json`. Workspace
109
+ verification binds a finding to its exact producer through `sourceCommand` and
110
+ `sourceArtifact`; consumers should run the cited producer and read that artifact
111
+ instead of guessing which command can refresh the evidence.
112
+
101
113
  ## Command semantics
102
114
 
103
115
  Workspai has two workspace-level execution surfaces and three equivalent full-init aliases at workspace root:
104
116
 
105
- | Command | Intent | Scope |
106
- | --- | --- | --- |
117
+ | Command | Intent | Scope |
118
+ | ------------------------------------------------------------------ | -------------------------------------------------- | ----------------- |
107
119
  | `init`, `workspace init`, `workspace run init` (at workspace root) | Mirrored full-init (workspace deps + project init) | Workspace + fleet |
108
- | `workspace run <test\|build\|start>` | Fleet stage execution | Selected projects |
109
- | `init`, `test`, `build`, `start`, `dev` (inside project dir) | Project primitive | Single project |
120
+ | `workspace run <test\|build\|start>` | Fleet stage execution | Selected projects |
121
+ | `init`, `test`, `build`, `start`, `dev` (inside project dir) | Project primitive | Single project |
110
122
 
111
123
  At workspace root, `npx workspai init`, `npx workspai workspace init`, and `npx workspai workspace run init` are equivalent aliases.
112
124
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workspai",
3
- "version": "0.56.0",
3
+ "version": "0.57.0",
4
4
  "type": "module",
5
5
  "description": "Open-source workspace intelligence CLI for software systems: create, adopt, govern, verify, and align polyglot workspaces for humans, CI, IDEs, and AI agents.",
6
6
  "keywords": [
@@ -53,6 +53,8 @@
53
53
  "dist",
54
54
  "contracts",
55
55
  "docs",
56
+ "!docs/*.mp4",
57
+ "!docs/*.gif",
56
58
  "templates",
57
59
  "workspai.config.example.cjs",
58
60
  "rapidkit.config.example.cjs",
@@ -115,6 +117,8 @@
115
117
  "test:runtime-matrix": "node scripts/runtime-acceptance-matrix.mjs",
116
118
  "test:runtime-contract": "node scripts/runtime-acceptance-matrix.mjs --contract-only",
117
119
  "test:runtime-matrix:full": "node scripts/runtime-acceptance-matrix.mjs --full",
120
+ "test:real-world": "node scripts/real-world-qualification.mjs",
121
+ "test:real-world:enterprise": "node scripts/enterprise-workspace-qualification.mjs",
118
122
  "lint": "eslint src --ext .ts",
119
123
  "lint:fix": "eslint src --ext .ts --fix",
120
124
  "format": "prettier --write \"src/**/*.ts\"",
@@ -1 +0,0 @@
1
- export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-6HCAGHCY.js';
@@ -1 +0,0 @@
1
- export{b as runDoctorCapabilities}from'./chunk-KS4FB5W7.js';
@@ -1 +0,0 @@
1
- import {b,c as c$2}from'./chunk-OX53L237.js';import {a as a$1}from'./chunk-YM77FQB3.js';import {r as r$1}from'./chunk-QRWWYL52.js';import {a as a$2}from'./chunk-7PNARN6S.js';import {g}from'./chunk-SV2SP22H.js';import {j as j$1,e as e$2}from'./chunk-GBMCHFOV.js';import {j,l as l$2}from'./chunk-QAF26ZQX.js';import {c as c$1,d}from'./chunk-WOTTSPSF.js';import {a}from'./chunk-UQEQ6CXU.js';import {f as f$1,g as g$1,h as h$2}from'./chunk-XH7PDHBF.js';import {k,l as l$1,h as h$1,m as m$1,n,p as p$2,q}from'./chunk-5BGPGNRQ.js';import {m,p as p$1,s}from'./chunk-5ZA4JYOP.js';import {l,o as o$1,p as p$3}from'./chunk-DOIZANFA.js';import {c,e as e$1}from'./chunk-ADL3CK44.js';import {b as b$1}from'./chunk-LYVDRRDO.js';import {e,f,o,p,n as n$1,m as m$2}from'./chunk-5EPPPMAS.js';import {d as d$1}from'./chunk-VRW6KXNK.js';import ue from'path';import de from'fs-extra';function r(t,s){if(!t)throw new Error(`Workspace Intelligence run semantic violation: ${s}`)}function ce(t,s){return t.length===s.length&&t.every((g,u)=>g===s[u])}function le(t){b$1(e.intelligenceRun,t,"Workspace Intelligence run report"),r(t.chainSchemaVersion===a,`chainSchemaVersion must be ${a}`),r(t.artifactPath===e.intelligenceRun,`artifactPath must be ${e.intelligenceRun}`),r(t.preflight.length===n$1.length,`preflight must contain exactly ${n$1.length} entries`);for(let[c,i]of n$1.entries()){let a=t.preflight[c];r(a?.id===i,`preflight[${c}].id must be ${i}`),r(ce(a.artifacts,o[i]),`${i} preflight artifacts must match the runtime registry`),i==="sync"?r(a.status==="passed"&&a.result==="synchronized"||a.status==="failed"&&a.result==="failed","sync preflight status and result are incoherent"):r(a.status==="passed"&&(a.result==="created"||a.result==="reused")||a.status==="failed"&&a.result==="failed"||a.status==="skipped"&&a.result==="skipped","baseline preflight status and result are incoherent");}let s=t.preflight[1];r(t.baselineCreated===(s?.result==="created"),"baselineCreated must match the baseline preflight result"),r(t.stages.length===m$2.length,`stages must contain exactly ${m$2.length} canonical steps`);let g=t.preflight[0],u=g?.status==="failed";for(let[c,i]of m$2.entries()){let a=t.stages[c];r(a?.id===i,`stages[${c}].id must be ${i}`),r(ce(a.artifacts,p[i].produces),`${i} artifacts must match the runtime registry`),u&&r(a.status==="skipped",`${i} must be skipped after a hard failure`),a.status==="passed"?r(a.exitCode===0,`${i} passed stage must have exitCode 0`):a.status==="blocked"?r(a.exitCode!==0,`${i} blocked stage must have a non-zero exitCode`):a.status==="failed"?(r(a.exitCode===1,`${i} failed stage must have exitCode 1`),u=true):(r(a.exitCode===0,`${i} skipped stage must have exitCode 0`),r(a.durationMs===0,`${i} skipped stage must have durationMs 0`)),c===0&&((g?.status==="failed"||a.status==="failed")&&r(s?.status==="skipped","baseline must be skipped when sync or model fails"),s?.status==="skipped"&&r(g?.status==="failed"||a.status==="failed"||a.status==="skipped","baseline may be skipped only after an upstream failure"),s?.status!=="passed"&&(u=true));}let m=t.preflight.some(c=>c.status==="failed")||t.stages.some(c=>c.status==="failed"),y=t.stages.some(c=>c.status==="blocked"),o$1=m?"failed":y?"blocked":"passed",f=o$1==="failed"?1:o$1==="blocked"?2:0;r(t.status===o$1,`status must be ${o$1}`),r(t.exitCode===f,`exitCode must be ${f}`);}var he=e.intelligenceRun,Ie=f.intelligenceRun,x=he;function h(t){d$1({action:"intelligence",status:t.status==="started"?"started":t.status==="passed"?"succeeded":t.status==="failed"?"failed":"warn",message:t.message,metadata:{phase:`workspace.intelligence.${t.kind}.${t.id}`,intelligenceMilestoneId:t.id,intelligenceMilestoneKind:t.kind,intelligenceMilestoneStatus:t.status}});}async function ze(t){let s=ue.resolve(t.workspacePath);return c(s,x,()=>Ee({...t,workspacePath:s}),{timeoutMs:15*6e4,staleAfterMs:3e4})}async function Ee(t){let s$1=t.workspacePath,g$2=[],u=[],m$2=false,y=async(e,n)=>{let d=[...o[e]];if(m$2){h({id:e,kind:"preflight",status:"skipped",message:`${e} prerequisite skipped after an upstream failure`}),g$2.push({id:e,status:"skipped",result:"skipped",durationMs:0,artifacts:d,message:"skipped because a required upstream operation failed"});return}let I=Date.now();h({id:e,kind:"preflight",status:"started",message:`${e} prerequisite started`});try{let l=await n();h({id:e,kind:"preflight",status:"passed",message:l.message}),g$2.push({id:e,status:"passed",result:l.result,durationMs:Date.now()-I,artifacts:d,message:l.message});}catch(l){m$2=true;let k=l instanceof Error?l.message:String(l);h({id:e,kind:"preflight",status:"failed",message:k}),g$2.push({id:e,status:"failed",result:"failed",durationMs:Date.now()-I,artifacts:d,message:k});}},o$2=async(e,n)=>{let d=[...p[e].produces];if(m$2){h({id:e,kind:"stage",status:"skipped",message:`${e} skipped after an upstream failure`}),u.push({id:e,status:"skipped",durationMs:0,artifacts:d,exitCode:0,message:"skipped because a required upstream stage failed"});return}let I=Date.now();h({id:e,kind:"stage",status:"started",message:`${e} started`});try{let l=await n(),k=l.exitCode??0,_=l.blocked||k!==0?"blocked":"passed";h({id:e,kind:"stage",status:_,message:l.message}),u.push({id:e,status:_,durationMs:Date.now()-I,artifacts:d,exitCode:k,message:l.message});}catch(l){m$2=true;let k=l instanceof Error?l.message:String(l);h({id:e,kind:"stage",status:"failed",message:k}),u.push({id:e,status:"failed",durationMs:Date.now()-I,artifacts:d,exitCode:1,message:k});}};await y("sync",async()=>{let e=await g(s$1,true),n=await l({workspacePath:s$1});return {result:"synchronized",message:`registry ${e.added.length} added/${e.skipped} existing; contract ${n.contract.projects.length} projects`}});let f,c=()=>{if(!f)throw new Error("canonical workspace model is unavailable");return f};await o$2("model",async()=>(f={...await p$1({workspacePath:s$1,includeEvidence:true}),build:m({mode:"full",engineStatus:"disabled"})},await s(f,s$1),{message:`${f.summary.projectCount} projects modeled`}));let i=ue.join(s$1,e.snapshot),a$3=false;await y("baseline",async()=>{if(!await de.pathExists(i)){let d=await k({workspacePath:s$1,model:c()});return await l$1(d,s$1),a$3=true,{result:"created",message:"initial structural baseline created"}}let e=await de.readJson(i),n=h$1(e);return n?(await l$1(n,s$1),{result:"reused",message:"legacy structural baseline migrated and reused"}):{result:"reused",message:"existing structural baseline reused"}}),await o$2("diff",async()=>{let e$1=await m$1({workspacePath:s$1,fromPath:e.snapshot,model:c()});return await n(e$1,s$1),{message:e$1.summary.changed?"workspace changes detected":"no workspace changes"}}),await o$2("impact",async()=>{let e$1=await p$2({workspacePath:s$1,fromPath:e.diff});return await q(e$1,s$1),{message:`${e$1.summary.risk} risk; ${e$1.summary.affectedProjects} affected`}}),await o$2("doctor-evidence",async()=>{let e=await r$1({workspace:s$1,json:true,quiet:true,profile:t.strict===true?"enterprise-strict":"local"});return {exitCode:e,blocked:e!==0,message:`doctor exit ${e}`}}),await o$2("contract-evidence",async()=>{let e=await o$1({workspacePath:s$1,strict:true});return await p$3({workspacePath:s$1,result:e}),{exitCode:e.status==="passed"?0:1,blocked:e.status!=="passed",message:`contract ${e.status}`}}),await o$2("analyze-evidence",async()=>{let e=await a$1({workspacePath:s$1,json:true,strict:t.strict===true});return {blocked:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention",exitCode:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention"?1:0,message:`analyze ${e.summary.verdict} (${e.summary.score}/100)`}}),await o$2("readiness-evidence",async()=>{let e=await a$2({startPath:s$1,writeReport:true,skipVerify:true});return {blocked:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn",exitCode:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn"?1:0,message:`pre-verify readiness ${e.overallStatus}`}}),await o$2("verify",async()=>{let e$1=await f$1({workspacePath:s$1,fromImpactPath:e.impact});await g$1(e$1,s$1);let n=h$2(e$1,{strict:t.strict===true});return await j$1(s$1,e$2(e$1,n.passed)),{blocked:!n.passed,exitCode:n.exitCode,message:`${e$1.summary.verdict}; gate ${n.passed?"passed":"blocked"}`}}),await o$2("context",async()=>{let e=await c$1({workspacePath:s$1,model:c(),agent:t.agent??"generic",includeEvidence:true});return await d(e,s$1),{message:`context grounded for ${e.agent}`}}),await o$2("agent-sync",async()=>{let e=await l$2({workspacePath:s$1,agent:t.agent??"generic",write:true,refreshContext:false,strict:t.strict===true,preset:"enterprise"}),n=e.strictViolations??[],d=t.strict===true&&n.length>0;return {blocked:d,exitCode:d?2:0,message:d?`${e.writtenFiles.length} grounding files written; ${n.length} strict grounding violation(s): ${n.join("; ")}`:`${e.writtenFiles.length} grounding files written`}}),await o$2("explain",async()=>{let e=await b({workspacePath:s$1,target:{kind:"release-blocked"}});return await c$2(e,s$1),{message:e.summary}});let pe=u.some(e=>e.status==="blocked"),A=m$2?"failed":pe?"blocked":"passed",ge=m$2?1:A==="blocked"?2:0,R={schemaVersion:Ie,chainSchemaVersion:a,generatedAt:new Date().toISOString(),workspacePath:s$1,baselineCreated:a$3,preflight:g$2,status:A,exitCode:ge,stages:u,artifactPath:x};le(R),await e$1(s$1,x,R);let me=await j({workspacePath:s$1});return await e$1(s$1,e.agentIndex,me),R}export{he as a,Ie as b,ze as c};