All contracts

Workspace operations / JSON Schema

Workspace Model Cache V1

Defines the versioned workspace model cache v1 boundary used by Workspai and its consumers.

Schema version
workspace-model-cache.v1
Contract path
contracts/workspace-model-cache.v1.json
Publication
json-schema
Defined fields
8
Artifact bindings
1

Why this contract exists

Architecture role

Defines canonical workspace state or a versioned projection of that state.

Consumption boundary

  • Workspai CLI
  • Workspace Intelligence consumers
  • IDEs and agents

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/cache/workspace-model.v1.jsonworkspace-model-cache.v1
workspai workspace model

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
cliVersionstringYesDefines the cliversion value at this contract boundary.minLength: 1
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
inputsHashstringYesDefines the inputshash value at this contract boundary.pattern: ^[a-f0-9]{64}$
modelobjectYesDefines the model value at this contract boundary.additionalProperties: true
model.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-model.v1"
projectSignaturesobjectNoDefines the projectsignatures value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-model-cache.v1"
workspaceFileSignaturesobjectNoDefines the workspacefilesignatures 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",
  "type": "object",
  "required": [
    "schemaVersion",
    "cliVersion",
    "inputsHash",
    "generatedAt",
    "model"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-model-cache.v1"
    },
    "cliVersion": {
      "type": "string",
      "minLength": 1
    },
    "inputsHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "model": {
      "type": "object",
      "required": [
        "schemaVersion"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspace-model.v1"
        }
      },
      "additionalProperties": true
    },
    "projectSignatures": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      }
    },
    "workspaceFileSignatures": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      }
    }
  },
  "additionalProperties": true
}