workspai 0.45.0 → 0.46.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 +242 -516
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
- package/contracts/extension-cli-compatibility.v1.json +3 -2
- package/contracts/published-contract-catalog.v1.json +7 -1
- package/contracts/runtime-command-surface.v1.json +41 -6
- package/contracts/workspace-archive-capabilities.v1.json +17 -6
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +4 -0
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +207 -0
- package/contracts/workspace-intelligence-architecture.v1.json +1 -1
- package/contracts/workspace-intelligence-chain.v1.json +37 -1
- package/dist/analyze-BEBEZSZK.js +1 -0
- package/dist/{artifact-remediation-plan-WLZGROUU.js → artifact-remediation-plan-FFQSESAM.js} +1 -1
- package/dist/autopilot-release-WUR4CQIT.js +1 -0
- package/dist/chunk-2G7FASAO.js +2 -0
- package/dist/{chunk-5GNT4RJI.js → chunk-4EPHWD27.js} +1 -1
- package/dist/{chunk-J4AICQFB.js → chunk-4LGXSBCN.js} +1 -1
- package/dist/chunk-52PBRX7F.js +1 -0
- package/dist/{chunk-2QOWRBQD.js → chunk-6IIZJQLV.js} +1 -1
- package/dist/{chunk-HYJK7W3B.js → chunk-CVHMUSRX.js} +1 -1
- package/dist/{chunk-7UZVOYF5.js → chunk-DIPD72H4.js} +1 -1
- package/dist/chunk-EFYHGCGX.js +2 -0
- package/dist/chunk-EYJ2CQSK.js +1 -0
- package/dist/chunk-FPJNWPKU.js +1 -0
- package/dist/{chunk-JP25YL3J.js → chunk-FTY7GGXJ.js} +2 -2
- package/dist/chunk-FWRXA435.js +2 -0
- package/dist/chunk-FXQJX34Z.js +1 -0
- package/dist/chunk-HDURFXW5.js +2 -0
- package/dist/chunk-HMUKBW2S.js +4 -0
- package/dist/{chunk-DXPU4DDV.js → chunk-J5PIZCAU.js} +92 -78
- package/dist/{chunk-6ZENXBMG.js → chunk-K4WNYXKK.js} +7 -7
- package/dist/chunk-MER6ZBN2.js +13 -0
- package/dist/chunk-N7DV5L7C.js +1 -0
- package/dist/{chunk-P424XYHP.js → chunk-PRBVYW3T.js} +1 -1
- package/dist/{chunk-WANW4QA4.js → chunk-QA5BGEQW.js} +1 -1
- package/dist/chunk-QZLIURER.js +13 -0
- package/dist/{chunk-P7SCWJFG.js → chunk-RIEF2DDX.js} +1 -1
- package/dist/{chunk-V2H2KRMZ.js → chunk-SXMTSV5M.js} +1 -1
- package/dist/chunk-SXPY523X.js +1 -0
- package/dist/{chunk-XIVFLY6G.js → chunk-UQWOVV6V.js} +1 -1
- package/dist/chunk-V3LRQZ36.js +1 -0
- package/dist/chunk-VFDM65IE.js +80 -0
- package/dist/{chunk-KU4S7RCM.js → chunk-WPEEC5BX.js} +1 -1
- package/dist/chunk-WYFPXTTS.js +2 -0
- package/dist/{chunk-K63BSU56.js → chunk-YUATNVOT.js} +62 -51
- package/dist/{chunk-OOOPYUL2.js → chunk-ZKAI3PJE.js} +1 -1
- package/dist/{create-KFR6FLRT.js → create-WCV3L6XH.js} +1 -1
- package/dist/doctor-5BWM2EMJ.js +1 -0
- package/dist/{dotnet-webapi-clean-BYUUHX5Y.js → dotnet-webapi-clean-6TVFBTVI.js} +20 -20
- package/dist/{gofiber-standard-B6UK5GR7.js → gofiber-standard-2BL7GWZB.js} +1 -1
- package/dist/{gogin-standard-BXU44VEM.js → gogin-standard-XGP3KBXA.js} +1 -1
- package/dist/index.d.ts +88 -13
- package/dist/index.js +327 -324
- package/dist/pipeline-ORIWVVYM.js +5 -0
- package/dist/{platform-capabilities-YICBF4FA.js → platform-capabilities-2B4QMZXE.js} +1 -1
- package/dist/{pythonRapidkitExec-UJYIB6FL.js → pythonRapidkitExec-CVCIK225.js} +1 -1
- package/dist/{springboot-standard-PEHDKH2L.js → springboot-standard-JJNUID6M.js} +6 -6
- package/dist/workspace-7OXW5YTJ.js +1 -0
- package/dist/{workspace-agent-sync-G5YVI3BJ.js → workspace-agent-sync-O4IA6VOA.js} +1 -1
- package/dist/workspace-archive-H74NBBNW.js +10 -0
- package/dist/{workspace-context-E3UFWL5X.js → workspace-context-R7IPUBPG.js} +1 -1
- package/dist/workspace-contract-HKCMOMFE.js +1 -0
- package/dist/workspace-explain-GOPQYTPQ.js +1 -0
- package/dist/workspace-explain-contract-SVFJAAEI.js +1 -0
- package/dist/{workspace-feedback-YY6WQPWQ.js → workspace-feedback-REOS36ZZ.js} +1 -1
- package/dist/{workspace-foundation-3C2DLCVI.js → workspace-foundation-KXT4QI5O.js} +1 -1
- package/dist/{workspace-history-VF3CHDYQ.js → workspace-history-OGOVSKZG.js} +1 -1
- package/dist/{workspace-intelligence-3GG7GEDQ.js → workspace-intelligence-7IESQSXY.js} +1 -1
- package/dist/workspace-intelligence-runner-6GJ5M4HB.js +1 -0
- package/dist/{workspace-mcp-serve-MJMUV4RY.js → workspace-mcp-serve-FRVWBO36.js} +1 -1
- package/dist/{workspace-model-NG45SRM5.js → workspace-model-PPYX7B4S.js} +1 -1
- package/dist/workspace-python-engine-state-2MLKJYQG.js +2 -0
- package/dist/workspace-registry-summary-SZ46R5PD.js +1 -0
- package/dist/workspace-run-V3KKHTVF.js +1 -0
- package/dist/{workspace-verify-ZNT6JX7D.js → workspace-verify-MFQ7IXGD.js} +1 -1
- package/dist/{workspace-watch-W47T4RX2.js → workspace-watch-SOPZHRWA.js} +1 -1
- package/docs/AI_DYNAMIC_INTEGRATION.md +29 -33
- package/docs/AI_FEATURES.md +18 -27
- package/docs/AI_QUICKSTART.md +7 -4
- package/docs/DEVELOPMENT.md +5 -5
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +23 -2
- package/docs/OPTIMIZATION_GUIDE.md +19 -51
- package/docs/PACKAGE_MANAGER_POLICY.md +4 -1
- package/docs/README.md +30 -3
- package/docs/SECURITY.md +13 -6
- package/docs/SETUP.md +6 -3
- package/docs/UTILITIES.md +8 -20
- package/docs/WORKSPACE_MARKER_SPEC.md +27 -20
- package/docs/ci-workflows.md +19 -5
- package/docs/commands-reference.md +37 -9
- package/docs/config-file-guide.md +64 -247
- package/docs/contracts/ARTIFACT_CATALOG.md +14 -2
- package/docs/contracts/CLI_LOG_EVENT_STREAM.md +1 -1
- package/docs/contracts/README.md +5 -2
- package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +4 -4
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +14 -10
- package/docs/creating-workspaces-and-projects.md +649 -0
- package/docs/doctor-command.md +5 -4
- package/docs/examples/ci-agent-grounding.yml +16 -10
- package/docs/from-code-to-shared-understanding.md +69 -38
- package/docs/workspace-intelligence-runner.md +186 -0
- package/docs/workspace-operations.md +29 -11
- package/docs/workspace-run.md +4 -1
- package/package.json +9 -8
- package/rapidkit.config.example.cjs +5 -5
- package/scripts/enforce-package-manager.cjs +1 -1
- package/scripts/prepack-enterprise.mjs +4 -0
- package/workspai.config.example.cjs +12 -47
- package/dist/analyze-YLV7NVLF.js +0 -1
- package/dist/autopilot-release-YBN3SWAA.js +0 -1
- package/dist/chunk-2K3GYCPS.js +0 -1
- package/dist/chunk-42G2OK64.js +0 -1
- package/dist/chunk-5AKYMAIL.js +0 -1
- package/dist/chunk-5PVEQ6CZ.js +0 -13
- package/dist/chunk-6AA3WWQZ.js +0 -2
- package/dist/chunk-7RIWU5TZ.js +0 -1
- package/dist/chunk-BJLE5CH7.js +0 -4
- package/dist/chunk-G3H5R3RR.js +0 -1
- package/dist/chunk-IMUU5Q2V.js +0 -13
- package/dist/chunk-KPPGZCUW.js +0 -78
- package/dist/chunk-LCRROMRR.js +0 -2
- package/dist/chunk-QWU2CZBG.js +0 -2
- package/dist/chunk-XZGVNGRB.js +0 -1
- package/dist/chunk-ZWO6K24C.js +0 -2
- package/dist/doctor-YJDM5XBH.js +0 -1
- package/dist/imported-projects-registry-FOIE27WT.js +0 -1
- package/dist/pipeline-FEDYO3IA.js +0 -5
- package/dist/workspace-PLXOO6ST.js +0 -1
- package/dist/workspace-archive-EEGLHZDW.js +0 -10
- package/dist/workspace-contract-LQJDZV36.js +0 -1
- package/dist/workspace-explain-G74ZIF23.js +0 -1
- package/dist/workspace-explain-contract-KT757JGQ.js +0 -1
- package/dist/workspace-python-engine-state-MTWIIZPY.js +0 -2
- package/dist/workspace-registry-summary-JM2XY52C.js +0 -1
- package/dist/workspace-run-WEQYIERE.js +0 -1
|
@@ -10,6 +10,7 @@ name: Workspai Agent Grounding
|
|
|
10
10
|
on:
|
|
11
11
|
pull_request:
|
|
12
12
|
paths:
|
|
13
|
+
- '.workspai/**'
|
|
13
14
|
- '.rapidkit/**'
|
|
14
15
|
- 'AGENTS.md'
|
|
15
16
|
- 'CLAUDE.md'
|
|
@@ -34,17 +35,21 @@ jobs:
|
|
|
34
35
|
- name: Install Workspai CLI
|
|
35
36
|
run: npm install --no-save workspai
|
|
36
37
|
|
|
37
|
-
- name: Run
|
|
38
|
-
|
|
38
|
+
- name: Run canonical Workspace Intelligence chain
|
|
39
|
+
# Exit 1 = hard execution failure; exit 2 = completed but evidence-blocked.
|
|
40
|
+
# Continue here only so the durable run report and blocker evidence can
|
|
41
|
+
# always be uploaded; the final step below still fails either outcome.
|
|
42
|
+
run: npx workspai workspace intelligence run --for-agent codex --strict --json
|
|
43
|
+
continue-on-error: true
|
|
44
|
+
id: intelligence
|
|
45
|
+
|
|
46
|
+
- name: Run separate governance pipeline
|
|
47
|
+
run: npx workspai pipeline --json --strict --no-agent-sync
|
|
39
48
|
continue-on-error: true
|
|
40
49
|
id: pipeline
|
|
41
50
|
|
|
42
|
-
- name:
|
|
43
|
-
run:
|
|
44
|
-
npx workspai workspace agent-sync --write --refresh-context --strict --json --preset enterprise
|
|
45
|
-
node ./node_modules/workspai/scripts/check-agent-customization-drift.mjs --workspace .
|
|
46
|
-
env:
|
|
47
|
-
RAPIDKIT_NO_AGENT_SYNC: '0'
|
|
51
|
+
- name: Verify agent grounding drift
|
|
52
|
+
run: node ./node_modules/workspai/scripts/check-agent-customization-drift.mjs --workspace .
|
|
48
53
|
|
|
49
54
|
- name: Upload agent grounding artifacts
|
|
50
55
|
if: always()
|
|
@@ -54,12 +59,13 @@ jobs:
|
|
|
54
59
|
path: |
|
|
55
60
|
.workspai/reports/INDEX.json
|
|
56
61
|
.workspai/reports/workspace-context-agent.json
|
|
62
|
+
.workspai/reports/workspace-intelligence-run-last-run.json
|
|
57
63
|
.workspai/reports/agent-customization-pack.json
|
|
58
64
|
.workspai/reports/workspai-mcp-design.json
|
|
59
65
|
.workspai/reports/pipeline-last-run.json
|
|
60
66
|
AGENTS.md
|
|
61
67
|
if-no-files-found: ignore
|
|
62
68
|
|
|
63
|
-
- name: Fail if pipeline blocked
|
|
64
|
-
if: steps.pipeline.outcome == 'failure'
|
|
69
|
+
- name: Fail if canonical chain or pipeline blocked
|
|
70
|
+
if: steps.intelligence.outcome == 'failure' || steps.pipeline.outcome == 'failure'
|
|
65
71
|
run: exit 1
|
|
@@ -1,45 +1,76 @@
|
|
|
1
1
|
# From Code to Shared Understanding
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This Mermaid diagram is kept in the internal documentation because GitHub renders it correctly. The main npm README uses a PNG version of the same diagram so it remains visible on npm package pages.
|
|
3
|
+
Workspai gives everyone the same understanding of your software, without asking
|
|
4
|
+
you to replace your frameworks or move existing source code.
|
|
6
5
|
|
|
7
6
|
```mermaid
|
|
8
7
|
flowchart TB
|
|
8
|
+
Code["Your projects and repositories"]
|
|
9
|
+
|
|
10
|
+
Routes["Create a project<br/>Adopt it in place<br/>or Import a repository"]
|
|
11
|
+
|
|
12
|
+
Workspace["Workspai builds one model of<br/>projects, dependencies, rules, and commands"]
|
|
13
|
+
|
|
14
|
+
Change["What changed?<br/>What is affected?<br/>Is the evidence ready?"]
|
|
15
|
+
|
|
16
|
+
Outputs["Context, impact, verification,<br/>explanations, and release evidence"]
|
|
17
|
+
|
|
18
|
+
Code --> Routes
|
|
19
|
+
Routes --> Workspace
|
|
20
|
+
Workspace --> Change
|
|
21
|
+
Change --> Outputs
|
|
22
|
+
|
|
23
|
+
Outputs --> Developers["Developers"]
|
|
24
|
+
Outputs --> CI["CI and releases"]
|
|
25
|
+
Outputs --> IDEs["IDEs"]
|
|
26
|
+
Outputs --> Agents["AI agents"]
|
|
27
|
+
Outputs --> MCP["MCP clients"]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## What This Means
|
|
31
|
+
|
|
32
|
+
1. **Connect your software.** Create something new, adopt an existing project
|
|
33
|
+
without moving it, or import a repository.
|
|
34
|
+
2. **Understand the workspace.** Workspai builds one model of the projects and
|
|
35
|
+
how they relate.
|
|
36
|
+
3. **Understand change and verify it.** Workspai shows affected areas and checks
|
|
37
|
+
the evidence needed for a safe decision.
|
|
38
|
+
4. **Share the result.** Developers, CI, IDEs, AI agents, and MCP clients consume
|
|
39
|
+
the same workspace truth instead of building separate assumptions. The
|
|
40
|
+
current CLI exposes a read-mostly `workspace mcp serve` bridge; a dedicated
|
|
41
|
+
`packages/mcp` boundary is planned.
|
|
9
42
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Model --> Agents["AI Agents"]
|
|
34
|
-
|
|
35
|
-
Context --> Agents
|
|
36
|
-
|
|
37
|
-
Impact --> Dev
|
|
38
|
-
Impact --> CI
|
|
39
|
-
|
|
40
|
-
Verify --> CI
|
|
41
|
-
Verify --> Agents
|
|
42
|
-
Evidence --> Dev
|
|
43
|
-
Evidence --> CI
|
|
44
|
-
Evidence --> Agents
|
|
43
|
+
This is the user-facing view. The implementation uses a versioned chain of
|
|
44
|
+
model, change, evidence, verification, context, grounding, and explanation
|
|
45
|
+
steps. Contributors and integrations can inspect the complete contracts:
|
|
46
|
+
|
|
47
|
+
- [`workspace-intelligence-chain.v1.json`](../contracts/workspace-intelligence-chain.v1.json)
|
|
48
|
+
- [`workspace-intelligence-architecture.v1.json`](../contracts/workspace-intelligence-architecture.v1.json)
|
|
49
|
+
|
|
50
|
+
The unified runner also has a deterministic execution envelope: `sync` runs
|
|
51
|
+
before Model and baseline resolution runs after Model/before Diff. These appear
|
|
52
|
+
as two `preflight` entries, not as extra chain stages. The 11 canonical stages,
|
|
53
|
+
baseline lifecycle, exit codes, and failure propagation are specified in
|
|
54
|
+
[Unified Workspace Intelligence Runner](./workspace-intelligence-runner.md).
|
|
55
|
+
|
|
56
|
+
The npm README uses a PNG rendering because npm package pages do not reliably
|
|
57
|
+
render Mermaid. When this source changes, regenerate
|
|
58
|
+
`From Code to Shared Understanding.png` before publishing.
|
|
59
|
+
|
|
60
|
+
## Execute the Contract
|
|
61
|
+
|
|
62
|
+
Run the complete canonical chain in its versioned order:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx workspai workspace intelligence run --for-agent codex --json
|
|
45
66
|
```
|
|
67
|
+
|
|
68
|
+
For enterprise CI and release enforcement, add `--strict`. A warning or
|
|
69
|
+
needs-attention verdict then produces a blocked report and exit code `2`:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx workspai workspace intelligence run --for-agent codex --strict --json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`pipeline` is the broader governance/release orchestrator. It does not replace
|
|
76
|
+
or reorder the canonical Workspace Intelligence chain.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Unified Workspace Intelligence Runner
|
|
2
|
+
|
|
3
|
+
`workspace intelligence run` is the canonical contract-backed entrypoint for
|
|
4
|
+
refreshing Workspace Intelligence evidence in one deterministic execution. Use
|
|
5
|
+
it from a Workspai workspace root:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx workspai workspace intelligence run --for-agent codex --strict --json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The authoritative result is written atomically to
|
|
12
|
+
`.workspai/reports/workspace-intelligence-run-last-run.json` with schema
|
|
13
|
+
`workspace-intelligence-run.v1`. JSON stdout returns the same report payload.
|
|
14
|
+
Consumers should read the persisted report when they need durable evidence and
|
|
15
|
+
use the process exit code for the immediate automation verdict.
|
|
16
|
+
|
|
17
|
+
## Execution envelope and canonical chain
|
|
18
|
+
|
|
19
|
+
The runner separates prerequisite operations from the versioned intelligence
|
|
20
|
+
chain. `sync` and baseline handling are reported in `preflight`; they are not
|
|
21
|
+
additional chain stages.
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
Execution order
|
|
25
|
+
|
|
26
|
+
sync
|
|
27
|
+
-> model
|
|
28
|
+
-> baseline resolution
|
|
29
|
+
-> diff
|
|
30
|
+
-> impact
|
|
31
|
+
-> doctor-evidence
|
|
32
|
+
-> contract-evidence
|
|
33
|
+
-> analyze-evidence
|
|
34
|
+
-> readiness-evidence
|
|
35
|
+
-> verify
|
|
36
|
+
-> context
|
|
37
|
+
-> agent-sync
|
|
38
|
+
-> explain
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The report always contains exactly two ordered `preflight` entries:
|
|
42
|
+
|
|
43
|
+
| ID | Execution point | Successful result | Purpose |
|
|
44
|
+
| ---------- | ---------------------------- | --------------------- | -------------------------------------------------- |
|
|
45
|
+
| `sync` | Before `model` | `synchronized` | Reconcile workspace inventory and contract inputs. |
|
|
46
|
+
| `baseline` | After `model`, before `diff` | `created` or `reused` | Ensure Diff has an explicit structural baseline. |
|
|
47
|
+
|
|
48
|
+
The report always contains exactly these 11 ordered `stages`:
|
|
49
|
+
|
|
50
|
+
| Order | Stage | Contract role |
|
|
51
|
+
| ----: | -------------------- | ------------------------------------------------------- |
|
|
52
|
+
| 1 | `model` | Build and persist the current workspace model. |
|
|
53
|
+
| 2 | `diff` | Compare the current model with the selected baseline. |
|
|
54
|
+
| 3 | `impact` | Calculate affected projects and transitive consequence. |
|
|
55
|
+
| 4 | `doctor-evidence` | Refresh workspace and project health evidence. |
|
|
56
|
+
| 5 | `contract-evidence` | Verify the workspace contract. |
|
|
57
|
+
| 6 | `analyze-evidence` | Refresh structural and operational analysis. |
|
|
58
|
+
| 7 | `readiness-evidence` | Refresh pre-verify release-readiness evidence. |
|
|
59
|
+
| 8 | `verify` | Produce the definitive evidence-backed gate. |
|
|
60
|
+
| 9 | `context` | Build agent context from the same current evidence. |
|
|
61
|
+
| 10 | `agent-sync` | Project canonical context into agent and IDE surfaces. |
|
|
62
|
+
| 11 | `explain` | Explain the resulting release posture and blockers. |
|
|
63
|
+
|
|
64
|
+
The machine-readable authority is
|
|
65
|
+
[`workspace-intelligence-chain.v1.json`](../contracts/workspace-intelligence-chain.v1.json).
|
|
66
|
+
Commands, websites, IDEs, CI jobs, and agent instructions must not define a
|
|
67
|
+
different order or insert `sync` or `snapshot-baseline` into `stages`.
|
|
68
|
+
|
|
69
|
+
## Baseline semantics
|
|
70
|
+
|
|
71
|
+
On the first run, the runner creates
|
|
72
|
+
`.workspai/reports/workspace-model-snapshot.json` and reports:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"id": "baseline",
|
|
77
|
+
"status": "passed",
|
|
78
|
+
"result": "created"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
On later runs, it reuses the existing snapshot and reports `result: "reused"`.
|
|
83
|
+
`baselineCreated` is `true` only when that run created the baseline.
|
|
84
|
+
|
|
85
|
+
The runner does not silently replace an existing baseline immediately before
|
|
86
|
+
Diff. Doing so would erase the change boundary and incorrectly report no
|
|
87
|
+
changes. Refresh or replace a baseline only through the explicit
|
|
88
|
+
`workspace snapshot` workflow after the intended structural state has been
|
|
89
|
+
accepted.
|
|
90
|
+
|
|
91
|
+
## Status and exit semantics
|
|
92
|
+
|
|
93
|
+
| Report status | Exit code | Meaning |
|
|
94
|
+
| ------------- | --------: | ---------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `passed` | `0` | Every operation executed and no gate blocked the run. |
|
|
96
|
+
| `failed` | `1` | A required operation threw or could not complete. Downstream stages are recorded as `skipped`. |
|
|
97
|
+
| `blocked` | `2` | Execution completed, but one or more evidence or verification gates rejected readiness. |
|
|
98
|
+
|
|
99
|
+
The canonical mapping is `passed` → `0`, `failed` → `1`, and `blocked` → `2`.
|
|
100
|
+
|
|
101
|
+
A `blocked` evidence stage does not stop the chain. Context, grounding, and
|
|
102
|
+
Explain must still be refreshed so humans and agents receive the current
|
|
103
|
+
blocker evidence. A hard `failed` stage stops execution work and every
|
|
104
|
+
downstream canonical stage is recorded with `status: "skipped"`, `exitCode: 0`,
|
|
105
|
+
and `durationMs: 0`.
|
|
106
|
+
|
|
107
|
+
Stage invariants:
|
|
108
|
+
|
|
109
|
+
- `passed` requires `exitCode: 0`;
|
|
110
|
+
- `blocked` requires a non-zero stage exit code;
|
|
111
|
+
- `failed` requires `exitCode: 1`;
|
|
112
|
+
- `skipped` requires `exitCode: 0` and `durationMs: 0`;
|
|
113
|
+
- report status and exit code are derived from all preflight and stage results;
|
|
114
|
+
- every stage artifact list must exactly match the runtime registry.
|
|
115
|
+
|
|
116
|
+
`--strict` promotes warning-grade readiness states such as Analyze
|
|
117
|
+
`needs-attention` and Readiness `warn` into blocked stage verdicts. It does not
|
|
118
|
+
turn evidence blockers into execution failures: the aggregate exit remains `2`,
|
|
119
|
+
not `1`.
|
|
120
|
+
|
|
121
|
+
## Report contract
|
|
122
|
+
|
|
123
|
+
The durable report contains:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"schemaVersion": "workspace-intelligence-run.v1",
|
|
128
|
+
"chainSchemaVersion": "workspai-workspace-intelligence-chain-v1",
|
|
129
|
+
"generatedAt": "2026-07-18T00:00:00.000Z",
|
|
130
|
+
"workspacePath": "/absolute/machine-local/path",
|
|
131
|
+
"baselineCreated": false,
|
|
132
|
+
"preflight": [],
|
|
133
|
+
"status": "blocked",
|
|
134
|
+
"exitCode": 2,
|
|
135
|
+
"stages": [],
|
|
136
|
+
"artifactPath": ".workspai/reports/workspace-intelligence-run-last-run.json"
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The abbreviated arrays above illustrate the envelope only; conforming reports
|
|
141
|
+
must contain exactly two preflight entries and 11 stages. The complete JSON
|
|
142
|
+
Schema is
|
|
143
|
+
[`workspace-intelligence-run.v1.json`](../contracts/workspace-intelligence/workspace-intelligence-run.v1.json).
|
|
144
|
+
Structural schema validation is necessary but not sufficient. Workspai also
|
|
145
|
+
enforces stage order, registered artifacts, baseline coherence, failure
|
|
146
|
+
propagation, and aggregate verdict semantics before writing the report.
|
|
147
|
+
|
|
148
|
+
`workspacePath` and some underlying evidence can contain machine-local absolute
|
|
149
|
+
paths. Do not treat the run report as a portable workspace identity contract or
|
|
150
|
+
publish it without applying the relevant redaction policy.
|
|
151
|
+
|
|
152
|
+
## CI consumption
|
|
153
|
+
|
|
154
|
+
The simplest hard gate is:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx workspai workspace intelligence run --for-agent codex --strict --json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Both exit `1` and exit `2` fail a normal CI step. If artifacts must be uploaded
|
|
161
|
+
after a blocked run, allow the runner step to continue, upload with `if: always()`,
|
|
162
|
+
then fail the job from the recorded step outcome. See
|
|
163
|
+
[`examples/ci-agent-grounding.yml`](./examples/ci-agent-grounding.yml).
|
|
164
|
+
|
|
165
|
+
Automation must distinguish:
|
|
166
|
+
|
|
167
|
+
- exit `1`: repair execution, environment, permissions, corruption, or another
|
|
168
|
+
hard runtime failure;
|
|
169
|
+
- exit `2`: inspect Analyze, Readiness, Verify, and Explain evidence and resolve
|
|
170
|
+
the reported blockers;
|
|
171
|
+
- exit `0`: consume the newly refreshed artifacts.
|
|
172
|
+
|
|
173
|
+
Do not parse terminal prose. Read `status`, `exitCode`, `preflight`, `stages`,
|
|
174
|
+
and their registered artifacts from the JSON report.
|
|
175
|
+
|
|
176
|
+
## Relationship to other commands
|
|
177
|
+
|
|
178
|
+
`workspace intelligence run` is the canonical Workspace Intelligence chain.
|
|
179
|
+
`pipeline` is a broader governance/release orchestrator and `autopilot release`
|
|
180
|
+
is a separate release surface. Neither command may replace, reorder, extend, or
|
|
181
|
+
silently partially execute the canonical intelligence chain.
|
|
182
|
+
|
|
183
|
+
Individual commands such as `workspace model`, `workspace diff`, and
|
|
184
|
+
`workspace verify` remain useful for inspection and targeted renewal. A partial
|
|
185
|
+
manual sequence must not be documented or treated as an equivalent replacement
|
|
186
|
+
for the unified runner.
|
|
@@ -7,7 +7,9 @@ Command syntax: [commands-reference.md](./commands-reference.md).
|
|
|
7
7
|
## Import and adoption
|
|
8
8
|
|
|
9
9
|
Use `import` to copy or clone an existing project into a Workspai workspace.
|
|
10
|
-
Use `adopt` when the project must stay where it already lives but should become
|
|
10
|
+
Use `adopt` when the project must stay where it already lives but should become
|
|
11
|
+
visible to Workspai Workspace Intelligence. Core module commands remain limited
|
|
12
|
+
to projects whose existing RapidKit metadata identifies a module-enabled kit.
|
|
11
13
|
|
|
12
14
|
```bash
|
|
13
15
|
npx workspai import ../orders-api
|
|
@@ -20,24 +22,24 @@ npx workspai adopt --json
|
|
|
20
22
|
### Import behavior
|
|
21
23
|
|
|
22
24
|
- Local folders are copied; git sources are cloned with shallow history.
|
|
23
|
-
- Outside any workspace (no `--workspace`), Workspai
|
|
24
|
-
- Existing workspaces under
|
|
25
|
+
- Outside any workspace (no `--workspace`), Workspai creates or reuses the managed `workspai` workspace. New defaults use `~/.workspai/workspaces/workspai`; valid legacy candidates under `~/rapidkit/workspaces/workspai` and `~/Workspai/rapidkits/workspai` can still be reused.
|
|
26
|
+
- Existing workspaces under legacy managed roots remain registered after upgrade.
|
|
25
27
|
- CLI prints a next-step `cd ...` hint (`suggestedCdCommand` in JSON mode).
|
|
26
28
|
- Failed workspace sync rolls back imported files and registry entries.
|
|
27
29
|
|
|
28
30
|
### Adopt behavior
|
|
29
31
|
|
|
30
32
|
- Source files are not moved or copied.
|
|
31
|
-
- Default workspace resolution matches import
|
|
33
|
+
- Default workspace resolution matches import, including canonical creation and valid legacy managed-default reuse.
|
|
32
34
|
- Writes `.workspai/project.json`, `.workspai/adopt.json`, and `.workspai/adopt-readiness.json`.
|
|
33
35
|
- Registry and contract sync include adopted projects for `workspace model`, `workspace context`, Dashboard, and agents.
|
|
34
36
|
- `--dry-run --json` previews detection without writing metadata.
|
|
35
37
|
|
|
36
38
|
### JSON output (`--json`)
|
|
37
39
|
|
|
38
|
-
- `workspacePath`, `workspaceResolution`
|
|
39
|
-
- `defaultWorkspaceCreated`, `
|
|
40
|
-
-
|
|
40
|
+
- Import returns `workspacePath`, `workspaceResolution`, `defaultWorkspaceCreated`, `suggestedCdCommand`, and `importedProject`. The imported project includes its `source`.
|
|
41
|
+
- Adopt returns `workspacePath`, `workspaceResolution`, `defaultWorkspaceCreated`, `wouldCreateDefaultWorkspace`, `dryRun`, and `adoptedProject`.
|
|
42
|
+
- Project results include detected `name`, `path`, `stack`, `runtime`, `framework`, `supportTier`, `moduleSupport`, and `confidence` where available.
|
|
41
43
|
|
|
42
44
|
Imported projects receive `.workspai/import-readiness.json`. Adopted projects add frontend-aware detection for Next.js, React, Vite, Vue, Angular, SvelteKit, Nuxt, Astro, Remix, and Solid.
|
|
43
45
|
|
|
@@ -115,16 +117,24 @@ Export excludes dependency folders, build output, git history, logs, `.env`, and
|
|
|
115
117
|
|
|
116
118
|
Archive export, verification, and hydrate stream file payloads instead of loading the workspace into memory. Exports use ZIP64, so multi-gigabyte workspaces and archives with more than 65,535 files are supported. Stored ZIP entries are the default; use `--archive-compression deflate` when transfer size matters more than export CPU time.
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
Remote archives are protected by secure defaults: 5 GB maximum download, 20 GB
|
|
121
|
+
maximum expanded payload, 200,000 entries, per-entry and compression-ratio
|
|
122
|
+
guards, and a five-minute timeout. Public HTTPS destinations are accepted;
|
|
123
|
+
loopback, private, link-local, and private redirect destinations are rejected.
|
|
124
|
+
Budgets can be lowered or explicitly raised for a controlled workflow:
|
|
119
125
|
|
|
120
126
|
```bash
|
|
121
127
|
npx workspai workspace hydrate https://example.test/team.zip \
|
|
122
128
|
--output ./team-workspace \
|
|
123
|
-
--max-download-size
|
|
124
|
-
--max-expanded-size
|
|
125
|
-
--download-timeout-ms
|
|
129
|
+
--max-download-size 2gb \
|
|
130
|
+
--max-expanded-size 8gb \
|
|
131
|
+
--download-timeout-ms 120000
|
|
126
132
|
```
|
|
127
133
|
|
|
134
|
+
For a reviewed archive served from a private development network, opt in with
|
|
135
|
+
`--allow-private-network`. Never use that flag for user-controlled URLs in CI
|
|
136
|
+
or agent services.
|
|
137
|
+
|
|
128
138
|
IDE, CI, and AI consumers can discover archive behavior from
|
|
129
139
|
`contracts/workspace-archive-capabilities.v1.json`. The embedded manifest and every successful
|
|
130
140
|
`--json` operation result are runtime-validated against
|
|
@@ -162,12 +172,20 @@ Artifacts:
|
|
|
162
172
|
| `import` | Workspace ingestion | Rollback-safe sync |
|
|
163
173
|
| `adopt` | Workspace adoption | In-place linking + registry sync |
|
|
164
174
|
| `workspace model/context/diff/impact/verify` | Workspace intelligence | Model, context packs, blast radius |
|
|
175
|
+
| `workspace intelligence run` | Workspace intelligence | Canonical contract-backed chain and strict gate |
|
|
165
176
|
| `snapshot` | Workspace recovery | Metadata or full snapshots |
|
|
166
177
|
| `project archive/restore/delete` | Project lifecycle | Safe delete with confirmation |
|
|
167
178
|
| `doctor` / `doctor workspace` / `doctor project` | Wrapper health | Host, workspace, and project scopes |
|
|
168
179
|
| `workspace run` | Workspace orchestrator | Fleet stage execution |
|
|
169
180
|
| `infra` | Workspace sidecar | Contract-driven local dependencies |
|
|
170
181
|
|
|
182
|
+
The unified intelligence runner keeps `sync` and baseline resolution in a
|
|
183
|
+
separate two-entry execution envelope and emits exactly 11 canonical stages.
|
|
184
|
+
Exit `2` means the evidence gate blocked readiness after successful execution;
|
|
185
|
+
exit `1` means a hard runtime failure. Read the complete
|
|
186
|
+
[Unified Workspace Intelligence Runner contract](./workspace-intelligence-runner.md)
|
|
187
|
+
before consuming its report from CI, IDE, or agent integrations.
|
|
188
|
+
|
|
171
189
|
## Verification evidence freshness
|
|
172
190
|
|
|
173
191
|
`workspace verify` treats evidence as release-gate material, not just as a file
|
package/docs/workspace-run.md
CHANGED
|
@@ -11,7 +11,10 @@ npx workspai workspace run test --affected --blast-radius
|
|
|
11
11
|
npx workspai workspace run build --json --max-workers 8
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
`--blast-radius`
|
|
14
|
+
`--blast-radius` resolves the canonical or legacy workspace contract first, then
|
|
15
|
+
`.workspai/workspace-dependency-graph.json`, and finally the legacy
|
|
16
|
+
`.rapidkit/workspace-dependency-graph.json` fallback. It expands direct
|
|
17
|
+
`dependsOn` and publish/consume event relationships.
|
|
15
18
|
|
|
16
19
|
## Supported runtimes
|
|
17
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workspai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.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": [
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"preinstall": "node scripts/enforce-package-manager.cjs",
|
|
68
67
|
"postinstall": "node scripts/check-cli-resolution.cjs",
|
|
68
|
+
"check:package-manager": "node scripts/enforce-package-manager.cjs",
|
|
69
69
|
"sync-kits": "bash scripts/sync-kits.sh",
|
|
70
70
|
"sync:kits": "corepack npm run sync-kits",
|
|
71
71
|
"build": "tsup",
|
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
"prepare": "node scripts/prepare-husky.mjs",
|
|
78
78
|
"test:e2e:first-install": "bash scripts/e2e-first-install.sh",
|
|
79
79
|
"test:e2e:user-first-install": "bash scripts/e2e-user-first-install.sh",
|
|
80
|
-
"test": "
|
|
80
|
+
"test:prebuild": "tsup",
|
|
81
|
+
"test": "corepack npm run test:prebuild && vitest run",
|
|
81
82
|
"test:drift": "node scripts/run-drift-guard.mjs",
|
|
82
83
|
"benchmark:intelligence": "vitest run src/__tests__/workspace-intelligence-benchmark.test.ts",
|
|
83
84
|
"sync:shared-contracts": "node scripts/sync-shared-contracts.mjs",
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"validate:contracts": "corepack npm run check:shared-contracts && vitest run src/__tests__/contracts/",
|
|
91
92
|
"test:parity-contract": "corepack npm run check:shared-contracts && vitest run src/__tests__/contracts/import-stack-parity.snapshot.test.ts",
|
|
92
93
|
"test:watch": "vitest",
|
|
93
|
-
"test:coverage": "vitest run --coverage",
|
|
94
|
+
"test:coverage": "vitest run --coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",
|
|
94
95
|
"test:prepare-embeddings": "node scripts/prepare-mock-embeddings.mjs",
|
|
95
96
|
"generate-embeddings": "npx tsx src/ai/generate-embeddings.ts",
|
|
96
97
|
"verify:package-cli": "node scripts/verify-package-cli.mjs",
|
|
@@ -111,10 +112,10 @@
|
|
|
111
112
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
112
113
|
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
113
114
|
"typecheck": "tsc --noEmit",
|
|
114
|
-
"validate": "corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm test",
|
|
115
|
+
"validate": "corepack npm run check:package-manager && corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm test",
|
|
115
116
|
"security": "corepack npm audit --audit-level=moderate",
|
|
116
117
|
"security:fix": "corepack npm audit fix",
|
|
117
|
-
"metrics": "
|
|
118
|
+
"metrics": "tsx scripts/metrics.ts",
|
|
118
119
|
"validate:docs-examples": "node scripts/validate-doc-examples.mjs",
|
|
119
120
|
"check:markdown-links": "node scripts/check-markdown-links.mjs",
|
|
120
121
|
"check:docs-drift": "node scripts/docs-drift-guard.mjs",
|
|
@@ -128,13 +129,13 @@
|
|
|
128
129
|
"analyze": "corepack npm run build && node scripts/analyze-dist.mjs",
|
|
129
130
|
"size-check": "corepack npm run build && size-limit",
|
|
130
131
|
"bench": "npx tsx scripts/benchmarks.ts",
|
|
131
|
-
"quality": "corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm test && corepack npm run size-check && corepack npm run check:workspace-intelligence-runtime && corepack npm run check:workspace-intelligence-adversarial && corepack npm run security && corepack npm run validate:docs && corepack npm run smoke:frontend-generators && corepack npm run check:contracts && corepack npm run check:shared-contracts && corepack npm run check:parity-snapshot && corepack npm run check:agent-customization-drift",
|
|
132
|
+
"quality": "corepack npm run check:package-manager && corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm test && corepack npm run size-check && corepack npm run check:workspace-intelligence-runtime && corepack npm run check:workspace-intelligence-adversarial && corepack npm run security && corepack npm run validate:docs && corepack npm run smoke:frontend-generators && corepack npm run check:contracts && corepack npm run check:shared-contracts && corepack npm run check:parity-snapshot && corepack npm run check:agent-customization-drift",
|
|
132
133
|
"act-matrix": "act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 -P macos-latest=ghcr.io/catthehacker/ubuntu:act-22.04 -P windows-latest=ghcr.io/catthehacker/ubuntu:act-22.04 --pull=false -j build-test-matrix",
|
|
133
134
|
"release:dry": "bash scripts/release.sh --no-publish --yes --allow-dirty",
|
|
134
135
|
"release:patch": "bash scripts/release.sh patch",
|
|
135
136
|
"release:minor": "bash scripts/release.sh minor",
|
|
136
137
|
"release:major": "bash scripts/release.sh major",
|
|
137
|
-
"check": "corepack npm run check:windows-registry && corepack npm run typecheck && corepack npm run lint && corepack npm run format:check",
|
|
138
|
+
"check": "corepack npm run check:package-manager && corepack npm run check:windows-registry && corepack npm run typecheck && corepack npm run lint && corepack npm run format:check && corepack npm run test:coverage && corepack npm run metrics",
|
|
138
139
|
"ci": "corepack npm run quality",
|
|
139
140
|
"contracts:sync": "corepack npm run sync:contracts && corepack npm run sync:shared-contracts",
|
|
140
141
|
"contracts:check": "corepack npm run check:contracts && corepack npm run check:shared-contracts && corepack npm run check:parity-snapshot && corepack npm run check:generated-contracts && corepack npm run check:agent-customization-drift",
|
|
@@ -19,9 +19,9 @@ module.exports = {
|
|
|
19
19
|
// Default author name for new workspaces
|
|
20
20
|
defaultAuthor: 'Your Name or Team',
|
|
21
21
|
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
pythonVersion: '3.10',
|
|
22
|
+
// Optional version pin. Python 3.10 is the minimum supported version.
|
|
23
|
+
// Omit this setting to let Workspai detect and select an installed version.
|
|
24
|
+
// pythonVersion: '3.10',
|
|
25
25
|
|
|
26
26
|
// Default installation method for RapidKit Core
|
|
27
27
|
// Options: 'poetry' | 'venv' | 'pipx'
|
|
@@ -53,10 +53,10 @@ module.exports = {
|
|
|
53
53
|
|
|
54
54
|
// Example usage:
|
|
55
55
|
// npx workspai my-workspace
|
|
56
|
-
// -> Uses config: author='Your Name or Team',
|
|
56
|
+
// -> Uses config: author='Your Name or Team', installMethod='poetry'; Python is auto-detected
|
|
57
57
|
//
|
|
58
58
|
// npx workspai my-workspace --author "Different Author"
|
|
59
|
-
// -> Overrides
|
|
59
|
+
// -> Overrides author; installMethod remains 'poetry' and Python is auto-detected
|
|
60
60
|
//
|
|
61
61
|
// npx workspai create project my-api
|
|
62
62
|
// -> Uses config: defaultKit='fastapi.standard', adds default modules
|
|
@@ -4,7 +4,7 @@ const userAgent = process.env.npm_config_user_agent || '';
|
|
|
4
4
|
const usingNpm = userAgent.startsWith('npm/');
|
|
5
5
|
|
|
6
6
|
if (!usingNpm) {
|
|
7
|
-
console.error('
|
|
7
|
+
console.error('Workspai uses npm as the only supported package manager for development.');
|
|
8
8
|
console.error('Please run: npm install');
|
|
9
9
|
process.exit(1);
|
|
10
10
|
}
|
|
@@ -33,6 +33,10 @@ if (!fs.existsSync(tsupCli)) {
|
|
|
33
33
|
fail(`missing tsup CLI at ${tsupCli}; run npm ci before packaging`);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
runNode(
|
|
37
|
+
['scripts/generate-shared-contracts.mjs', '--check'],
|
|
38
|
+
'checking generated contracts, including extension CLI compatibility'
|
|
39
|
+
);
|
|
36
40
|
runNode([tsupCli], 'building dist');
|
|
37
41
|
runNode(['scripts/prepare-mock-embeddings.mjs'], 'preparing packaged embeddings');
|
|
38
42
|
runNode(['scripts/verify-package-cli.mjs'], 'verifying bundled CLI command ownership');
|