All contracts

Workspace Intelligence / JSON Schema

Workspai Workspace Model Diff

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

Schema version
workspace-model-diff.v1
Contract path
contracts/workspace-intelligence/workspace-model-diff.v1.json
Publication
embedded-type
Defined fields
30
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-diff-last-run.jsonworkspace-model-diff.v1
workspai workspace diff --from .workspai/reports/workspace-model-snapshot.json --json

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
changesarrayYesDefines the changes value at this contract boundary.
changes[].messagestringYesDefines the message value at this contract boundary.
changes[].severityenumYesDefines the severity value at this contract boundary.enum: info, warning, critical
changes[].targetstringYesDefines the target value at this contract boundary.
changes[].typeenumYesDefines the type value at this contract boundary.enum: project.added, project.removed, project.changed, workspace.changed, validation.changed, git.file.changed, git.untracked, git.deleted
currentModelobjectYesDefines the currentmodel value at this contract boundary.additionalProperties: true
currentModel.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-model.v1"
fromHashstringYesDefines the fromhash value at this contract boundary.
fromRefstringYesDefines the fromref value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
gitobjectNoDefines the git value at this contract boundary.additionalProperties: false
git.availablebooleanYesDefines the available value at this contract boundary.
git.branchstringNoDefines the branch value at this contract boundary.
git.changedFilesintegerYesDefines the changedfiles value at this contract boundary.minimum: 0
git.commitstringNoDefines the commit value at this contract boundary.
git.deletedFilesintegerYesDefines the deletedfiles value at this contract boundary.minimum: 0
git.dirtybooleanYesDefines the dirty value at this contract boundary.
git.refstringNoDefines the ref value at this contract boundary.
git.untrackedFilesintegerYesDefines the untrackedfiles value at this contract boundary.minimum: 0
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-model-diff.v1"
summaryobjectYesDefines the summary value at this contract boundary.additionalProperties: false
summary.addedProjectsintegerYesDefines the addedprojects value at this contract boundary.minimum: 0
summary.changedbooleanYesDefines the changed value at this contract boundary.
summary.changedProjectsintegerYesDefines the changedprojects value at this contract boundary.minimum: 0
summary.gitChangedFilesintegerYesDefines the gitchangedfiles value at this contract boundary.minimum: 0
summary.removedProjectsintegerYesDefines the removedprojects value at this contract boundary.minimum: 0
summary.validationChangesintegerYesDefines the validationchanges value at this contract boundary.minimum: 0
summary.workspaceChangesintegerYesDefines the workspacechanges value at this contract boundary.minimum: 0
toHashstringYesDefines the tohash value at this contract boundary.
toRefstringYesDefines the toref 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-diff.v1.json",
  "title": "Workspai Workspace Model Diff",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "fromRef",
    "toRef",
    "fromHash",
    "toHash",
    "summary",
    "changes",
    "currentModel"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-model-diff.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "fromRef": {
      "type": "string"
    },
    "toRef": {
      "type": "string"
    },
    "fromHash": {
      "type": "string"
    },
    "toHash": {
      "type": "string"
    },
    "summary": {
      "type": "object",
      "required": [
        "changed",
        "addedProjects",
        "removedProjects",
        "changedProjects",
        "workspaceChanges",
        "validationChanges",
        "gitChangedFiles"
      ],
      "properties": {
        "changed": {
          "type": "boolean"
        },
        "addedProjects": {
          "type": "integer",
          "minimum": 0
        },
        "removedProjects": {
          "type": "integer",
          "minimum": 0
        },
        "changedProjects": {
          "type": "integer",
          "minimum": 0
        },
        "workspaceChanges": {
          "type": "integer",
          "minimum": 0
        },
        "validationChanges": {
          "type": "integer",
          "minimum": 0
        },
        "gitChangedFiles": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "git": {
      "type": "object",
      "required": [
        "available",
        "dirty",
        "changedFiles",
        "untrackedFiles",
        "deletedFiles"
      ],
      "properties": {
        "available": {
          "type": "boolean"
        },
        "ref": {
          "type": "string"
        },
        "branch": {
          "type": "string"
        },
        "commit": {
          "type": "string"
        },
        "dirty": {
          "type": "boolean"
        },
        "changedFiles": {
          "type": "integer",
          "minimum": 0
        },
        "untrackedFiles": {
          "type": "integer",
          "minimum": 0
        },
        "deletedFiles": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "changes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "severity",
          "target",
          "message"
        ],
        "properties": {
          "type": {
            "enum": [
              "project.added",
              "project.removed",
              "project.changed",
              "workspace.changed",
              "validation.changed",
              "git.file.changed",
              "git.untracked",
              "git.deleted"
            ]
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          },
          "target": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    },
    "currentModel": {
      "type": "object",
      "required": [
        "schemaVersion"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspace-model.v1"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}