All contracts

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 pathSchemaProducer
.workspai/reports/workspace-context-agent.jsonworkspace-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 pathTypeRequiredMeaningConstraints
$defs.factFreshness.categoryenumYesDefines the category value at this contract boundary.enum: structure, verification, state
$defs.factFreshness.expiresAtstringNoDefines the expiresat value at this contract boundary.format: date-time
$defs.factFreshness.generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
$defs.factFreshness.inputsHashstringNoDefines the inputshash value at this contract boundary.
$defs.factFreshness.kindenumYesDefines the kind value at this contract boundary.enum: durable, derived, evidence-backed, live, verify-before-use
$defs.factFreshness.reasonstringYesDefines the reason value at this contract boundary.
$defs.factFreshness.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "rapidkit-fact-freshness-v1"
$defs.factFreshness.sourceArtifactstringNoDefines the sourceartifact value at this contract boundary.
$defs.factFreshness.sourcePathstringNoDefines the sourcepath value at this contract boundary.
$defs.factFreshness.statusenumYesDefines the status value at this contract boundary.enum: fresh, stale, unknown
$defs.factFreshness.ttlSecondsinteger | nullYesDefines the ttlseconds value at this contract boundary.minimum: 0
$defs.factFreshness.verifyBeforeUsebooleanYesDefines the verifybeforeuse value at this contract boundary.
$defs.factFreshnessSummary.byCategoryobjectYesDefines the bycategory value at this contract boundary.
$defs.factFreshnessSummary.byKindobjectYesDefines the bykind value at this contract boundary.
$defs.factFreshnessSummary.generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
$defs.factFreshnessSummary.liveFactsintegerYesDefines the livefacts value at this contract boundary.minimum: 0
$defs.factFreshnessSummary.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "rapidkit-fact-freshness-v1"
$defs.factFreshnessSummary.staleFactsintegerYesDefines the stalefacts value at this contract boundary.minimum: 0
$defs.factFreshnessSummary.statusenumYesDefines the status value at this contract boundary.enum: fresh, stale, unknown
$defs.factFreshnessSummary.totalFactsintegerYesDefines the totalfacts value at this contract boundary.minimum: 0
$defs.factFreshnessSummary.unknownFactsintegerYesDefines the unknownfacts value at this contract boundary.minimum: 0
$defs.factFreshnessSummary.verifyBeforeUseFactsintegerYesDefines the verifybeforeusefacts value at this contract boundary.minimum: 0
$defs.workspaceFact.freshnessreferenceYesDefines the freshness value at this contract boundary.ref: #/$defs/factFreshness
$defs.workspaceFact.idstringYesDefines the id value at this contract boundary.
$defs.workspaceFact.labelstringYesDefines the label value at this contract boundary.
$defs.workspaceFact.projectstringNoDefines the project value at this contract boundary.
$defs.workspaceFact.scopeenumYesDefines the scope value at this contract boundary.enum: workspace, project, evidence, policy, contract, command, graph
agentenumYesDefines the agent value at this contract boundary.enum: generic, codex, claude, cursor, orca
factFreshnessreferenceNoDefines the factfreshness value at this contract boundary.ref: #/$defs/factFreshnessSummary
factsarrayNoDefines the facts value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
intelligenceChainobjectYesDefines the intelligencechain value at this contract boundary.additionalProperties: false
intelligenceChain.canonicalReadOrderarrayYesDefines the canonicalreadorder value at this contract boundary.
intelligenceChain.contractPathstringYesDefines the contractpath value at this contract boundary.const: "contracts/workspace-intelligence-chain.v1.json"
intelligenceChain.currentStepstringYesDefines the currentstep value at this contract boundary.const: "context"
intelligenceChain.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai-workspace-intelligence-chain-v1"
modelRefstringYesDefines the modelref value at this contract boundary.
projectsarrayYesDefines the projects value at this contract boundary.
safeCommandsarrayYesDefines the safecommands value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-context.v1"
scopeobjectYesDefines the scope value at this contract boundary.additionalProperties: true
validationobjectYesDefines the validation value at this contract boundary.additionalProperties: true
validation.errorsintegerYesDefines the errors value at this contract boundary.minimum: 0
validation.statusenumYesDefines the status value at this contract boundary.enum: passed, warning, failed
validation.warningsintegerYesDefines the warnings value at this contract boundary.minimum: 0
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: false
workspace.namestringYesDefines the name value at this contract boundary.
workspace.profilestringNoDefines the profile value at this contract boundary.
workspace.rootstringYesDefines the root value at this contract boundary.
workspace.typestringYesDefines the type value at this contract boundary.
workspaceSummarystringYesDefines 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
}