Workspai CLI Contracts
August 30, 2026 · View on GitHub
Contract documentation for JSON payloads, support matrices, and cross-repo parity.
Complete contract discovery
The complete machine-readable inventory is
../../contracts/published-contract-catalog.v1.json.
It is the source of truth for every published schema/capability path; the lists
below are grouped entry points, not a substitute for that catalog.
Installed consumers can discover the active package version and contract map without scraping Markdown:
npx workspai --version --json
Resolve contract files from the installed workspai/contracts/ directory and
validate payloads against the exact catalog revision shipped with that CLI.
Do not copy a schema from main and assume it matches an older installed CLI.
Monorepo workflow
Canonical JSON lives in ../../contracts/ (CLI package root, published in the tarball).
| Script | Purpose |
|---|---|
npm run generate:contracts | Regenerate runtime surface, create planner, agent customization pack, import-stack parity, module-layout, infra-stack |
npm run check:generated-contracts | Verify committed JSON matches generators |
npm run sync:shared-contracts | Generate canonical JSON and sync root plus locally available consumer mirrors |
npm run sync:parity-snapshot | Compatibility alias for canonical and consumer mirror synchronization |
npm run check:parity-snapshot | Verify mirrors match canonical |
npm run contracts:prepush | Sync local consumers and require generated canonical CLI mirrors to be committed |
npm run validate:contracts | Shared-contract checks and focused contract tests |
npm run contracts:validate | Comprehensive generated/shared contract, parity, runtime-conformance, and adversarial gate |
npm run check:agent-customization-drift | Verify generated agent customization files are committed in a consumer workspace |
npm run test:real-world -- ... | Qualify explicitly selected linked repositories in isolated or cumulative workspaces |
npm run test:real-world:enterprise -- ... | Exercise the read-mostly, export, archive, agent dry-run, snapshot, and destructive dry-run command surface |
Workflow: change code → npm run sync:shared-contracts → review and commit
the CLI mirrors plus every locally available consumer mirror → push. When the
VS Code repository is available, pre-commit synchronizes and stages its mirrored
contracts. Pre-push refuses uncommitted canonical CLI outputs while consumer
drift remains visible without coupling release cadence.
The CLI does not require a cross-repository consumer workflow before npm publication. Workspai VS Code enforces hard parity in its own release CI against the CLI version it selects. Consumer-specific version floors remain owned by the consumer; schema synchronization never forces a redundant CLI release. Breaking schema changes are still blocked by versioned contract compatibility gates in the CLI.
Documents in this folder
| File | Purpose |
|---|---|
| ARTIFACT_CATALOG.md | On-disk artifact paths, schema versions, and consumer rules |
| COMMAND_OWNERSHIP_MATRIX.md | Which commands the npm wrapper owns vs Python Core |
| NAMING_AND_COEXISTENCE.md | Workspace Intelligence command naming and generated surface rules |
| RUNTIME_SUPPORT_MATRIX.md | Scaffold, import, lifecycle, and module support tiers |
| RUNTIME_ACCEPTANCE_MATRIX.md | Runtime acceptance matrix expectations |
| rapidkit-cli-contracts.json | Core CLI JSON schema fragments |
Workspace intelligence schemas
Published under ../../contracts/ (not duplicated in this folder):
published-contract-catalog.v1.json— complete machine-readable contract inventoryworkspace-contract.v1.json— canonical workspace project/relationship contractruntime-command-surface.v1.jsonandcli-runtime-command-inventory.v1.snapshot.json— supported command/capability discoveryworkspace-intelligence-architecture.v1.jsonandworkspace-intelligence-chain.v1.json— architecture boundaries and ordered loopworkspace-registry.v1.json— canonical project registry summary (see ARTIFACT_CATALOG.md)release-readiness.v1.json— release readiness gate evidenceworkspace-run-last.v1.json— multi-stage workspace run evidencedoctor-workspace-evidence.v1.json/doctor-project-evidence.v1.json— doctor evidenceworkspace-intelligence/doctor-diagnosis.v1.json— runtime-neutral causal findings, proof bindings, confidence, unknowns, contradictions, and repair disposition embedded in Doctor evidenceworkspace-intelligence/doctor-capabilities.v1.json— fail-closed runtime/framework ownership, six-domain support levels, platform boundaries, repair modes, and extraction-safe adapter inventoryworkspace-intelligence/doctor-validation.v1.json— versioned disease-corpus results across every registered adapter, with bounded synthetic precision/recall and explicit limitationsworkspace-intelligence/doctor-receipt.v1.json— compact Doctor verdict, unambiguous counts, freshness, affected projects, blockers, and next-action handoff; full evidence remains canonicalworkspace-intelligence/doctor-summary.v1.json— bounded stdout contract emitted bydoctor --json=summaryfor system, workspace, and project consumersdoctor-remediation-plan.v2.json— canonical persisted Doctor fix/plan Studio handoff contract (v1path is a deprecated compatibility alias)artifact-remediation-plan.v1.json— cross-artifact Studio handoff for Bootstrap, Analyze, Readiness, Pipeline, Workspace Run, Workspace Verify, and Doctor plan bridgingworkspace-intelligence/workspace-repair-proposal.v1.json— bounded, hash-pinned source changes and optional runtime-native validation proposed by an IDE model; proposals never execute themselvesworkspace-intelligence/workspace-repair-transaction.v1.json— durable CLI-owned repair state from immutable plan and approval through checkpoint, execution, canonical verification, rollback, or an explicit decisionworkspace-repair-capabilities.v1.json— canonical multi-runtime adapter inventory, conditional support boundaries, preflight policy, and fail-closed repair invariantsanalyze-last-run.v1.json— analyze evidencepipeline-last-run.v1.json— governance pipeline orchestrationproject-entry-capability.v1.json— open-ended adopt/import contract for readable projectsworkspace-intelligence/project-agent-entry.v1.json— portable host discovery, canonical read order, authority boundaries, and integrity for an adopted projectworkspace-intelligence/agent-bootstrap-receipt.v1.json— per-session proof of workspace membership, host coverage, schema validity, freshness, live inputs, active Goal bindings, and explicitly separated grounding/environment/release readinessadopt-effects.v1.json— dry-run disclosure of project metadata, conditional repository-control reconciliation, and workspace operations before adoptioncreate-planner-capabilities.v1.json— native, official, and existing capability lanesagent-customization-pack.v1.json— generated instructions, prompts, skills, agents, optional hooks, MCP-ready design metadata, target matrix, and drift state for AI agent surfacesworkspace-list.v1.json,workspace-sync.v1.json, andcompatibility-matrix.v1.json— workspace discovery, synchronization, and platform compatibilityproject-archive.v1.json,workspace-snapshot.v1.json, andworkspace-snapshot.v2.json— recoverable lifecycle recordsinfra-plan.v1.json,private-product-manifest.v1.json, andproduct-factory-plan.v1.json— infrastructure and product planning payloadsworkspace-model-cache.v1.json,workspace-watch-event.v1.json,doctor-project-scan.v2.json, anddoctor-workspace-cache.v2.json— cache/watch/diagnostic support contractsworkspace-activity-event.v1.json— local-first run/block/operation/touch stream consumed byworkspai live; observational only, never Evidence/Decision authorityworkspace-activity-monitor-snapshot.v1.jsonandworkspace-activity-monitor-fleet.v1.json— deterministic local and bounded fleet projectionsworkspace-activity-board.v1.json— renderer-neutral bounded Live projection for terminal, SVG, IDE and web consumers, with optional provenance-backed references to canonical artifacts and revision-bound Graph evidence
Workspace intelligence (../../contracts/workspace-intelligence/):
workspace-intelligence-run.v1.json— authoritative full-chain result, stage outcomes, verdict, exit code, and durable artifact pathworkspace-model.v1.jsonworkspace-context.v1.jsonworkspace-dependency-graph.v1.jsonworkspace-knowledge-graph.v1.json— proof-backed entities, relations, evidence, providers, and model bindingworkspace-knowledge-graph-change-overlay.v1.json— proposed/change-set facts and relations without mutating the base graphworkspace-knowledge-search.v1.json— bounded ranked retrieval for CLI, MCP, IDE, and agent consumersworkspace-graph-token-efficiency.v1.json— reproducible corpus-versus-retrieval payload measurementworkspace-intelligence-benchmark.v1.json— fixed multi-scenario retrieval benchmark with separately classified measured evaluation evidencemodel-usage-event.v1.json— privacy-bounded model, tool, milestone, and verified-outcome events with explicit measurement provenanceworkspace-intelligence-evaluation.v1.json— live/final token, cost, latency, activity, and verified-outcome evaluationworkspace-intelligence-evaluation-comparison.v1.json— task-aligned comparison of two completed evaluation strategiesworkspace-model-snapshot.v1.jsonworkspace-model-diff.v1.jsonworkspace-impact.v1.jsonworkspace-verify.v1.jsonworkspace-explain.v1.jsonworkspace-intelligence-history.v1.jsonworkspace-operational-skill.v1.jsonworkspace-skills-index.v1.jsonworkspace-contract-verify.v1.jsonagent-action-outcome.v1.jsonblocker-resolution.v1.jsondoctor-fix-result.v1.jsonstudio-blocker-handoff.v1.jsonmcp-design.v1.jsonandagent-hooks.v1.json— generated MCP/IDE integration surfaces
These schemas describe durable artifacts or bounded query results. A command's
stdout may wrap an artifact with operation metadata such as status,
outputPath, or a structured error; that envelope follows
cli-operation-result.v1.json and does not change the nested artifact contract.
status: "success" means the command completed and returned its contracted
artifact; it does not override a policy gate. For gated operations such as
workspace verify --strict, the envelope exitCode, process exit code, and
nested gate exit code are identical even when the artifact was produced
successfully and the gate blocked progression.
CLI commands: see commands-reference.md and the CLI README.
Core CLI JSON payloads
rapidkit-cli-contracts.json describes:
VersionResponse—workspai version --jsonCommandsResponse—workspai commands --jsonProjectDetectResponse—workspai project detect --jsonModulesListResponseV1—workspai modules list --json-schema 1
Versioning
- Payloads include
schema_versionwhere applicable. - Backward-compatible changes keep the same schema version.
- Breaking changes require a schema bump and updated tests in
src/__tests__/contracts/.