All contracts

Workspace Intelligence / JSON Schema

Workspai Architecture Surprise Report

Defines the versioned architecture surprise report v1 boundary used by Workspai and its consumers.

Schema version
workspai.architecture-surprise-report.v1
Contract path
contracts/workspace-intelligence/architecture-surprise-report.v1.json
Publication
json-schema
Defined fields
15
Artifact bindings
1

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.

Produced artifacts

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

Artifact pathSchemaProducer
.workspai/changes/change-id/architecture-surprises.jsonworkspai.architecture-surprise-report.v1
workspai change verify

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
actualreferenceYesDefines the actual value at this contract boundary.ref: decision-event.v1.json#/$defs/artifactReference
changeIdstringYesDefines the changeid value at this contract boundary.pattern: ^change-[a-z0-9][a-z0-9-]{7,95}$
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
matchedreferenceYesDefines the matched value at this contract boundary.ref: #/$defs/operations
missingreferenceYesDefines the missing value at this contract boundary.ref: #/$defs/operations
predictionanyYesDefines the prediction value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai.architecture-surprise-report.v1"
summaryobjectYesDefines the summary value at this contract boundary.additionalProperties: false
summary.actualintegerYesDefines the actual value at this contract boundary.minimum: 0
summary.matchedintegerYesDefines the matched value at this contract boundary.minimum: 0
summary.missingintegerYesDefines the missing value at this contract boundary.minimum: 0
summary.predictedintegerYesDefines the predicted value at this contract boundary.minimum: 0
summary.unpredictedintegerYesDefines the unpredicted value at this contract boundary.minimum: 0
summary.verdictenumYesDefines the verdict value at this contract boundary.enum: exact, within-expectation, surprising, no-prediction
unpredictedreferenceYesDefines the unpredicted value at this contract boundary.ref: #/$defs/operations

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://workspai.dev/schemas/workspace-intelligence/architecture-surprise-report.v1.json",
  "title": "Workspai Architecture Surprise Report",
  "type": "object",
  "required": [
    "schemaVersion",
    "changeId",
    "generatedAt",
    "prediction",
    "actual",
    "matched",
    "unpredicted",
    "missing",
    "summary"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspai.architecture-surprise-report.v1"
    },
    "changeId": {
      "type": "string",
      "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "prediction": {
      "oneOf": [
        {
          "$ref": "decision-event.v1.json#/$defs/artifactReference"
        },
        {
          "type": "null"
        }
      ]
    },
    "actual": {
      "$ref": "decision-event.v1.json#/$defs/artifactReference"
    },
    "matched": {
      "$ref": "#/$defs/operations"
    },
    "unpredicted": {
      "$ref": "#/$defs/operations"
    },
    "missing": {
      "$ref": "#/$defs/operations"
    },
    "summary": {
      "type": "object",
      "required": [
        "predicted",
        "actual",
        "matched",
        "unpredicted",
        "missing",
        "verdict"
      ],
      "properties": {
        "predicted": {
          "type": "integer",
          "minimum": 0
        },
        "actual": {
          "type": "integer",
          "minimum": 0
        },
        "matched": {
          "type": "integer",
          "minimum": 0
        },
        "unpredicted": {
          "type": "integer",
          "minimum": 0
        },
        "missing": {
          "type": "integer",
          "minimum": 0
        },
        "verdict": {
          "enum": [
            "exact",
            "within-expectation",
            "surprising",
            "no-prediction"
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "$defs": {
    "operations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "operation",
          "targetKind",
          "targetId"
        ],
        "properties": {
          "operation": {
            "type": "string",
            "minLength": 1
          },
          "targetKind": {
            "type": "string",
            "minLength": 1
          },
          "targetId": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    }
  }
}