Workspace Intelligence / JSON Schema
Workspai Workspace Agent Context
Defines the versioned workspace context v1 boundary used by Workspai and its consumers.
- Schema version
workspace-context.v1- Contract path
contracts/workspace-intelligence/workspace-context.v1.json- Publication
- embedded-type, json-schema
- Defined fields
- 51
- Artifact bindings
- 1
Why this contract exists
Architecture role
Projects workspace intelligence into stable grounding surfaces for agents and integrations.
Consumption boundary
- • Workspai CLI
- • AI agents
- • IDEs and MCP clients
Related commands
Commands are linked only when the runtime contract identifies a direct production relationship. Supporting contracts may be consumed without having a single producer command.
Produced artifacts
These durable files are emitted by registered commands and validated against this contract.
| Artifact path | Schema | Producer |
|---|---|---|
| .workspai/reports/workspace-context-agent.json | workspace-context.v1 | workspai workspace context --for-agent --json --write --no-agent-sync |
Field reference
Every declared schema property or published capability path is listed here. Required means the contract declares or publishes that field at the shown boundary.
| Field path | Type | Required | Meaning | Constraints |
|---|---|---|---|---|
| $defs.factFreshness.category | enum | Yes | Defines the category value at this contract boundary. | enum: structure, verification, state |
| $defs.factFreshness.expiresAt | string | No | Defines the expiresat value at this contract boundary. | format: date-time |
| $defs.factFreshness.generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| $defs.factFreshness.inputsHash | string | No | Defines the inputshash value at this contract boundary. | — |
| $defs.factFreshness.kind | enum | Yes | Defines the kind value at this contract boundary. | enum: durable, derived, evidence-backed, live, verify-before-use |
| $defs.factFreshness.reason | string | Yes | Defines the reason value at this contract boundary. | — |
| $defs.factFreshness.schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "rapidkit-fact-freshness-v1" |
| $defs.factFreshness.sourceArtifact | string | No | Defines the sourceartifact value at this contract boundary. | — |
| $defs.factFreshness.sourcePath | string | No | Defines the sourcepath value at this contract boundary. | — |
| $defs.factFreshness.status | enum | Yes | Defines the status value at this contract boundary. | enum: fresh, stale, unknown |
| $defs.factFreshness.ttlSeconds | integer | null | Yes | Defines the ttlseconds value at this contract boundary. | minimum: 0 |
| $defs.factFreshness.verifyBeforeUse | boolean | Yes | Defines the verifybeforeuse value at this contract boundary. | — |
| $defs.factFreshnessSummary.byCategory | object | Yes | Defines the bycategory value at this contract boundary. | — |
| $defs.factFreshnessSummary.byKind | object | Yes | Defines the bykind value at this contract boundary. | — |
| $defs.factFreshnessSummary.generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| $defs.factFreshnessSummary.liveFacts | integer | Yes | Defines the livefacts value at this contract boundary. | minimum: 0 |
| $defs.factFreshnessSummary.schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "rapidkit-fact-freshness-v1" |
| $defs.factFreshnessSummary.staleFacts | integer | Yes | Defines the stalefacts value at this contract boundary. | minimum: 0 |
| $defs.factFreshnessSummary.status | enum | Yes | Defines the status value at this contract boundary. | enum: fresh, stale, unknown |
| $defs.factFreshnessSummary.totalFacts | integer | Yes | Defines the totalfacts value at this contract boundary. | minimum: 0 |
| $defs.factFreshnessSummary.unknownFacts | integer | Yes | Defines the unknownfacts value at this contract boundary. | minimum: 0 |
| $defs.factFreshnessSummary.verifyBeforeUseFacts | integer | Yes | Defines the verifybeforeusefacts value at this contract boundary. | minimum: 0 |
| $defs.workspaceFact.freshness | reference | Yes | Defines the freshness value at this contract boundary. | ref: #/$defs/factFreshness |
| $defs.workspaceFact.id | string | Yes | Defines the id value at this contract boundary. | — |
| $defs.workspaceFact.label | string | Yes | Defines the label value at this contract boundary. | — |
| $defs.workspaceFact.project | string | No | Defines the project value at this contract boundary. | — |
| $defs.workspaceFact.scope | enum | Yes | Defines the scope value at this contract boundary. | enum: workspace, project, evidence, policy, contract, command, graph |
| agent | enum | Yes | Defines the agent value at this contract boundary. | enum: generic, codex, claude, cursor, orca |
| factFreshness | reference | No | Defines the factfreshness value at this contract boundary. | ref: #/$defs/factFreshnessSummary |
| facts | array | No | Defines the facts value at this contract boundary. | — |
| generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| intelligenceChain | object | Yes | Defines the intelligencechain value at this contract boundary. | additionalProperties: false |
| intelligenceChain.canonicalReadOrder | array | Yes | Defines the canonicalreadorder value at this contract boundary. | — |
| intelligenceChain.contractPath | string | Yes | Defines the contractpath value at this contract boundary. | const: "contracts/workspace-intelligence-chain.v1.json" |
| intelligenceChain.currentStep | string | Yes | Defines the currentstep value at this contract boundary. | const: "context" |
| intelligenceChain.schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "workspai-workspace-intelligence-chain-v1" |
| modelRef | string | Yes | Defines the modelref value at this contract boundary. | — |
| projects | array | Yes | Defines the projects value at this contract boundary. | — |
| safeCommands | array | Yes | Defines the safecommands value at this contract boundary. | — |
| schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "workspace-context.v1" |
| scope | object | Yes | Defines the scope value at this contract boundary. | additionalProperties: true |
| validation | object | Yes | Defines the validation value at this contract boundary. | additionalProperties: true |
| validation.errors | integer | Yes | Defines the errors value at this contract boundary. | minimum: 0 |
| validation.status | enum | Yes | Defines the status value at this contract boundary. | enum: passed, warning, failed |
| validation.warnings | integer | Yes | Defines the warnings value at this contract boundary. | minimum: 0 |
| workspace | object | Yes | Defines the workspace value at this contract boundary. | additionalProperties: false |
| workspace.name | string | Yes | Defines the name value at this contract boundary. | — |
| workspace.profile | string | No | Defines the profile value at this contract boundary. | — |
| workspace.root | string | Yes | Defines the root value at this contract boundary. | — |
| workspace.type | string | Yes | Defines the type value at this contract boundary. | — |
| workspaceSummary | string | Yes | Defines the workspacesummary value at this contract boundary. | — |
Canonical machine-readable definition
The raw synchronized contract remains authoritative. The educational sections above are projections of this definition.
Show raw JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://getrapidkit.com/schemas/workspace-context.v1.json",
"title": "Workspai Workspace Agent Context",
"type": "object",
"required": [
"schemaVersion",
"generatedAt",
"agent",
"workspaceSummary",
"modelRef",
"intelligenceChain",
"workspace",
"scope",
"projects",
"safeCommands",
"validation"
],
"properties": {
"schemaVersion": {
"const": "workspace-context.v1"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"agent": {
"enum": [
"generic",
"codex",
"claude",
"cursor",
"orca"
]
},
"workspaceSummary": {
"type": "string"
},
"modelRef": {
"type": "string"
},
"intelligenceChain": {
"type": "object",
"required": [
"schemaVersion",
"contractPath",
"currentStep",
"canonicalReadOrder"
],
"properties": {
"schemaVersion": {
"const": "workspai-workspace-intelligence-chain-v1"
},
"contractPath": {
"const": "contracts/workspace-intelligence-chain.v1.json"
},
"currentStep": {
"const": "context"
},
"canonicalReadOrder": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"workspace": {
"type": "object",
"required": [
"name",
"root",
"type"
],
"properties": {
"name": {
"type": "string"
},
"root": {
"type": "string"
},
"type": {
"type": "string"
},
"profile": {
"type": "string"
}
},
"additionalProperties": false
},
"scope": {
"type": "object",
"additionalProperties": true
},
"projects": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"safeCommands": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"factFreshness": {
"$ref": "#/$defs/factFreshnessSummary"
},
"facts": {
"type": "array",
"items": {
"$ref": "#/$defs/workspaceFact"
}
},
"validation": {
"type": "object",
"required": [
"status",
"errors",
"warnings"
],
"properties": {
"status": {
"enum": [
"passed",
"warning",
"failed"
]
},
"errors": {
"type": "integer",
"minimum": 0
},
"warnings": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": true
}
},
"$defs": {
"factFreshness": {
"type": "object",
"required": [
"schemaVersion",
"kind",
"category",
"generatedAt",
"ttlSeconds",
"status",
"verifyBeforeUse",
"reason"
],
"properties": {
"schemaVersion": {
"const": "rapidkit-fact-freshness-v1"
},
"kind": {
"enum": [
"durable",
"derived",
"evidence-backed",
"live",
"verify-before-use"
]
},
"category": {
"enum": [
"structure",
"verification",
"state"
]
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"ttlSeconds": {
"type": [
"integer",
"null"
],
"minimum": 0
},
"expiresAt": {
"type": "string",
"format": "date-time"
},
"status": {
"enum": [
"fresh",
"stale",
"unknown"
]
},
"verifyBeforeUse": {
"type": "boolean"
},
"sourceArtifact": {
"type": "string"
},
"sourcePath": {
"type": "string"
},
"inputsHash": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"additionalProperties": false
},
"workspaceFact": {
"type": "object",
"required": [
"id",
"label",
"scope",
"value",
"freshness"
],
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"scope": {
"enum": [
"workspace",
"project",
"evidence",
"policy",
"contract",
"command",
"graph"
]
},
"project": {
"type": "string"
},
"value": true,
"freshness": {
"$ref": "#/$defs/factFreshness"
}
},
"additionalProperties": false
},
"factFreshnessSummary": {
"type": "object",
"required": [
"schemaVersion",
"generatedAt",
"status",
"totalFacts",
"staleFacts",
"unknownFacts",
"liveFacts",
"verifyBeforeUseFacts",
"byKind",
"byCategory"
],
"properties": {
"schemaVersion": {
"const": "rapidkit-fact-freshness-v1"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"status": {
"enum": [
"fresh",
"stale",
"unknown"
]
},
"totalFacts": {
"type": "integer",
"minimum": 0
},
"staleFacts": {
"type": "integer",
"minimum": 0
},
"unknownFacts": {
"type": "integer",
"minimum": 0
},
"liveFacts": {
"type": "integer",
"minimum": 0
},
"verifyBeforeUseFacts": {
"type": "integer",
"minimum": 0
},
"byKind": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"byCategory": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": true
}