All contracts

Workspace operations / JSON Schema

Workspai Workspace Activity Event

Local-first operational activity emitted by Workspai commands. Activity is observational and does not by itself establish evidence or decision authority.

Schema version
workspace-activity-event.v1
Contract path
contracts/workspace-activity-event.v1.json
Publication
json-schema
Defined fields
50
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
$defs.evidenceBinding.graphSourceHashstringNoDefines the graphsourcehash value at this contract boundary.minLength: 1
$defs.evidenceBinding.kindenumYesDefines the kind value at this contract boundary.enum: artifact, graph-entity, graph-relation, proof, project
$defs.evidenceBinding.provenanceenumYesDefines the provenance value at this contract boundary.enum: authoritative, observed
$defs.evidenceBinding.refstringYesDefines the ref value at this contract boundary.minLength: 1
$defs.evidenceBinding.roleenumYesDefines the role value at this contract boundary.enum: input, output, verification, subject
attemptintegerNoDefines the attempt value at this contract boundary.minimum: 1
attributesobjectNoDefines the attributes value at this contract boundary.additionalProperties: true
blockIdstringNoDefines the blockid value at this contract boundary.minLength: 1
causationIdstringNoDefines the causationid value at this contract boundary.minLength: 1
componentstringYesDefines the component value at this contract boundary.minLength: 1
correlationIdstringNoDefines the correlationid value at this contract boundary.minLength: 1
durationMsnumberNoDefines the durationms value at this contract boundary.minimum: 0
edgeobjectNoDefines the edge value at this contract boundary.additionalProperties: false
edge.fromBlockIdstringYesDefines the fromblockid value at this contract boundary.minLength: 1
edge.idstringYesDefines the id value at this contract boundary.minLength: 1
edge.kindenumYesDefines the kind value at this contract boundary.enum: sequence, parallel, gate, handoff
edge.toBlockIdstringYesDefines the toblockid value at this contract boundary.minLength: 1
eventIdstringYesDefines the eventid value at this contract boundary.minLength: 8
evidenceBindingsarrayNoDefines the evidencebindings value at this contract boundary.maxItems: 100
kindenumYesDefines the kind value at this contract boundary.enum: run.started, run.completed, run.failed, run.cancelled, block.planned, block.started, block.progress, block.completed, block.failed, block.blocked, block.skipped, edge.declared, operation.started, operation.completed, operation.failed, touch.planned, touch.observed, artifact.published, artifact.rejected, warning.detected
messagestringYesDefines the message value at this contract boundary.minLength: 1
originobjectNoDefines the origin value at this contract boundary.additionalProperties: false
origin.idstringYesDefines the id value at this contract boundary.minLength: 8
origin.kindenumYesDefines the kind value at this contract boundary.enum: project, workspace-root
origin.labelstringYesDefines the label value at this contract boundary.minLength: 1
parentRunIdstringNoDefines the parentrunid value at this contract boundary.minLength: 8
parentSpanIdstringNoDefines the parentspanid value at this contract boundary.minLength: 1
progressobjectNoDefines the progress value at this contract boundary.additionalProperties: false
progress.completednumberNoDefines the completed value at this contract boundary.minimum: 0
progress.iterationnumberNoDefines the iteration value at this contract boundary.minimum: 0
progress.iterationsnumberNoDefines the iterations value at this contract boundary.minimum: 0
progress.percentnumberNoDefines the percent value at this contract boundary.minimum: 0 · maximum: 100
progress.totalnumberNoDefines the total value at this contract boundary.minimum: 0
projectIdstringNoDefines the projectid value at this contract boundary.minLength: 1
runIdstringYesDefines the runid value at this contract boundary.minLength: 8
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-activity-event.v1"
scopeobjectYesDefines the scope value at this contract boundary.additionalProperties: false
scope.idstringYesDefines the id value at this contract boundary.minLength: 8
scope.kindenumYesDefines the kind value at this contract boundary.enum: ephemeral-project, project, workspace
scope.labelstringYesDefines the label value at this contract boundary.minLength: 1
scope.portablebooleanYesDefines the portable value at this contract boundary.
sequenceintegerYesDefines the sequence value at this contract boundary.minimum: 1
spanIdstringNoDefines the spanid value at this contract boundary.minLength: 1
statusenumYesDefines the status value at this contract boundary.enum: planned, running, succeeded, warned, blocked, failed, cancelled, skipped, rolled-back
targetobjectNoDefines the target value at this contract boundary.additionalProperties: false
target.kindenumYesDefines the kind value at this contract boundary.enum: file, directory, artifact, process, workspace, project, other
target.locatorstringNoDefines the locator value at this contract boundary.
target.operationstringNoDefines the operation value at this contract boundary.
target.provenanceenumNoDefines the provenance value at this contract boundary.enum: authoritative, observed, inferred
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",
  "$id": "https://workspai.dev/contracts/workspace-activity-event.v1.json",
  "title": "Workspai Workspace Activity Event",
  "description": "Local-first operational activity emitted by Workspai commands. Activity is observational and does not by itself establish evidence or decision authority.",
  "type": "object",
  "required": [
    "schemaVersion",
    "eventId",
    "sequence",
    "timestamp",
    "runId",
    "scope",
    "kind",
    "status",
    "component",
    "message"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-activity-event.v1"
    },
    "eventId": {
      "type": "string",
      "minLength": 8
    },
    "sequence": {
      "type": "integer",
      "minimum": 1
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "runId": {
      "type": "string",
      "minLength": 8
    },
    "parentRunId": {
      "type": "string",
      "minLength": 8
    },
    "spanId": {
      "type": "string",
      "minLength": 1
    },
    "parentSpanId": {
      "type": "string",
      "minLength": 1
    },
    "causationId": {
      "type": "string",
      "minLength": 1
    },
    "correlationId": {
      "type": "string",
      "minLength": 1
    },
    "scope": {
      "type": "object",
      "required": [
        "kind",
        "id",
        "label",
        "portable"
      ],
      "properties": {
        "kind": {
          "enum": [
            "ephemeral-project",
            "project",
            "workspace"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 8
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "portable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "kind": {
      "enum": [
        "run.started",
        "run.completed",
        "run.failed",
        "run.cancelled",
        "block.planned",
        "block.started",
        "block.progress",
        "block.completed",
        "block.failed",
        "block.blocked",
        "block.skipped",
        "edge.declared",
        "operation.started",
        "operation.completed",
        "operation.failed",
        "touch.planned",
        "touch.observed",
        "artifact.published",
        "artifact.rejected",
        "warning.detected"
      ]
    },
    "status": {
      "enum": [
        "planned",
        "running",
        "succeeded",
        "warned",
        "blocked",
        "failed",
        "cancelled",
        "skipped",
        "rolled-back"
      ]
    },
    "component": {
      "type": "string",
      "minLength": 1
    },
    "message": {
      "type": "string",
      "minLength": 1
    },
    "blockId": {
      "type": "string",
      "minLength": 1
    },
    "attempt": {
      "type": "integer",
      "minimum": 1
    },
    "origin": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "label"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 8
        },
        "kind": {
          "enum": [
            "project",
            "workspace-root"
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "projectId": {
      "type": "string",
      "minLength": 1
    },
    "durationMs": {
      "type": "number",
      "minimum": 0
    },
    "progress": {
      "type": "object",
      "properties": {
        "completed": {
          "type": "number",
          "minimum": 0
        },
        "total": {
          "type": "number",
          "minimum": 0
        },
        "percent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "iteration": {
          "type": "number",
          "minimum": 0
        },
        "iterations": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "target": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "enum": [
            "file",
            "directory",
            "artifact",
            "process",
            "workspace",
            "project",
            "other"
          ]
        },
        "locator": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "provenance": {
          "enum": [
            "authoritative",
            "observed",
            "inferred"
          ]
        }
      },
      "additionalProperties": false
    },
    "evidenceBindings": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/$defs/evidenceBinding"
      }
    },
    "edge": {
      "type": "object",
      "required": [
        "id",
        "fromBlockId",
        "toBlockId",
        "kind"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "fromBlockId": {
          "type": "string",
          "minLength": 1
        },
        "toBlockId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "enum": [
            "sequence",
            "parallel",
            "gate",
            "handoff"
          ]
        }
      },
      "additionalProperties": false
    },
    "attributes": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": false,
  "$defs": {
    "evidenceBinding": {
      "type": "object",
      "required": [
        "kind",
        "ref",
        "role",
        "provenance"
      ],
      "properties": {
        "kind": {
          "enum": [
            "artifact",
            "graph-entity",
            "graph-relation",
            "proof",
            "project"
          ]
        },
        "ref": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "enum": [
            "input",
            "output",
            "verification",
            "subject"
          ]
        },
        "provenance": {
          "enum": [
            "authoritative",
            "observed"
          ]
        },
        "graphSourceHash": {
          "type": "string",
          "minLength": 1
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "kind": {
                "enum": [
                  "graph-entity",
                  "graph-relation",
                  "proof"
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          "then": {
            "required": [
              "graphSourceHash"
            ]
          }
        }
      ],
      "additionalProperties": false
    }
  }
}