All contracts

Workspace operations / JSON Schema

Workspace Watch Event V1

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

Schema version
workspace-watch-event.v1
Contract path
contracts/workspace-watch-event.v1.json
Publication
json-schema
Defined fields
17
Artifact bindings
0

Why this contract exists

Architecture role

Defines a versioned interoperability boundary used by Workspai and contract-aware consumers.

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.

This is a supporting, capability, cache, compatibility, or consumer contract. It has no single direct producer command in the canonical Workspace Intelligence execution registry.

Produced artifacts

These durable files are emitted by registered commands and validated against this contract.

No canonical file artifact is registered for this contract. It may describe capabilities, embedded data, runtime exchange, or supporting state instead of a standalone report.

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
addedProjectsarrayYesDefines the addedprojects value at this contract boundary.
changedProjectsarrayYesDefines the changedprojects value at this contract boundary.
durationMsnumberYesDefines the durationms value at this contract boundary.minimum: 0
errorstringNoDefines the error value at this contract boundary.
graphobjectYesDefines the graph value at this contract boundary.additionalProperties: false
graph.edgeCountintegerYesDefines the edgecount value at this contract boundary.minimum: 0
graph.edgesAddedarrayYesDefines the edgesadded value at this contract boundary.
graph.edgesRemovedarrayYesDefines the edgesremoved value at this contract boundary.
graph.nodeCountintegerYesDefines the nodecount value at this contract boundary.minimum: 0
kindenumYesDefines the kind value at this contract boundary.enum: ready, changed, unchanged, error
modeenumYesDefines the mode value at this contract boundary.enum: initial, full, incremental, unchanged
modelHashstringYesDefines the modelhash value at this contract boundary.pattern: ^(?:[a-f0-9]{64})?$
modelHashChangedbooleanYesDefines the modelhashchanged value at this contract boundary.
removedProjectsarrayYesDefines the removedprojects value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-watch-event.v1"
sequenceintegerYesDefines the sequence value at this contract boundary.minimum: -1
timestampstringYesDefines the timestamp value at this contract boundary.format: date-time

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",
    "kind",
    "sequence",
    "timestamp",
    "mode",
    "modelHash",
    "modelHashChanged",
    "changedProjects",
    "addedProjects",
    "removedProjects",
    "graph",
    "durationMs"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-watch-event.v1"
    },
    "kind": {
      "enum": [
        "ready",
        "changed",
        "unchanged",
        "error"
      ]
    },
    "sequence": {
      "type": "integer",
      "minimum": -1
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "mode": {
      "enum": [
        "initial",
        "full",
        "incremental",
        "unchanged"
      ]
    },
    "modelHash": {
      "type": "string",
      "pattern": "^(?:[a-f0-9]{64})?$"
    },
    "modelHashChanged": {
      "type": "boolean"
    },
    "changedProjects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "addedProjects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "removedProjects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "graph": {
      "type": "object",
      "required": [
        "nodeCount",
        "edgeCount",
        "edgesAdded",
        "edgesRemoved"
      ],
      "properties": {
        "nodeCount": {
          "type": "integer",
          "minimum": 0
        },
        "edgeCount": {
          "type": "integer",
          "minimum": 0
        },
        "edgesAdded": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "edgesRemoved": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "additionalProperties": false
    },
    "durationMs": {
      "type": "number",
      "minimum": 0
    },
    "error": {
      "type": "string"
    }
  },
  "additionalProperties": true
}