All contracts

Workspace Intelligence / JSON Schema

Workspai Workspace Intelligence Model

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

Schema version
workspace-model.v1
Contract path
contracts/workspace-intelligence/workspace-model.v1.json
Publication
embedded-type, json-schema
Defined fields
45
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/reports/workspace-model.jsonworkspace-model.v1
workspai workspace model --json --write

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
contractsobjectYesDefines the contracts value at this contract boundary.additionalProperties: true
discoveryobjectYesDefines the discovery value at this contract boundary.additionalProperties: true
evidenceobjectYesDefines the evidence value at this contract boundary.additionalProperties: true
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
graphobjectNoFirst-class inferred dependency graph (workspace-dependency-graph.v1). Additive/optional.additionalProperties: true
identityobjectYesDefines the identity value at this contract boundary.additionalProperties: true
policiesobjectYesDefines the policies value at this contract boundary.additionalProperties: true
projectsarrayYesDefines the projects value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-model.v1"
summaryobjectYesDefines the summary value at this contract boundary.additionalProperties: true
validationobjectNoDefines the validation value at this contract boundary.additionalProperties: true
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: true
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.

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-model.v1.json",
  "title": "Workspai Workspace Intelligence Model",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "workspace",
    "identity",
    "summary",
    "projects",
    "contracts",
    "evidence",
    "discovery",
    "policies"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-model.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "workspace": {
      "type": "object",
      "required": [
        "name",
        "root",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "root": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "profile": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "identity": {
      "type": "object",
      "additionalProperties": true
    },
    "summary": {
      "type": "object",
      "additionalProperties": true
    },
    "factFreshness": {
      "$ref": "#/$defs/factFreshnessSummary"
    },
    "facts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/workspaceFact"
      }
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "contracts": {
      "type": "object",
      "additionalProperties": true
    },
    "graph": {
      "type": "object",
      "description": "First-class inferred dependency graph (workspace-dependency-graph.v1). Additive/optional.",
      "additionalProperties": true
    },
    "evidence": {
      "type": "object",
      "additionalProperties": true
    },
    "discovery": {
      "type": "object",
      "additionalProperties": true
    },
    "policies": {
      "type": "object",
      "additionalProperties": true
    },
    "validation": {
      "type": "object",
      "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
}