All contracts

Recovery and archival / JSON Schema

Workspai Activity Monitor Snapshot

A deterministic local projection of durable Workspai activity journals. It is observational and is not verification evidence by itself.

Schema version
workspace-activity-monitor-snapshot.v1
Contract path
contracts/workspace-activity-monitor-snapshot.v1.json
Publication
capability-contract
Defined fields
69
Artifact bindings
0

Why this contract exists

Architecture role

Preserves recoverable state and records the safety boundary of destructive operations.

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.artifact.atstringYesDefines the at value at this contract boundary.format: date-time
$defs.artifact.locatorstringYesDefines the locator value at this contract boundary.
$defs.attempt.attemptintegerYesDefines the attempt value at this contract boundary.minimum: 1
$defs.attempt.durationMsnumberNoDefines the durationms value at this contract boundary.minimum: 0
$defs.attempt.progressreferenceNoDefines the progress value at this contract boundary.ref: #/$defs/progress
$defs.attempt.startedAtstringYesDefines the startedat value at this contract boundary.format: date-time
$defs.attempt.statusreferenceYesDefines the status value at this contract boundary.ref: #/$defs/status
$defs.attempt.updatedAtstringYesDefines the updatedat value at this contract boundary.format: date-time
$defs.block.attemptintegerNoDefines the attempt value at this contract boundary.minimum: 1
$defs.block.attemptsarrayYesDefines the attempts value at this contract boundary.
$defs.block.durationMsnumberNoDefines the durationms value at this contract boundary.minimum: 0
$defs.block.evidenceBindingsarrayNoDefines the evidencebindings value at this contract boundary.maxItems: 100
$defs.block.groupstringNoDefines the group value at this contract boundary.minLength: 1
$defs.block.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.block.labelstringYesDefines the label value at this contract boundary.minLength: 1
$defs.block.layoutHintenumNoDefines the layouthint value at this contract boundary.enum: source, process, gate, sink
$defs.block.ordernumberYesDefines the order value at this contract boundary.
$defs.block.parentIdstringNoDefines the parentid value at this contract boundary.minLength: 1
$defs.block.progressreferenceNoDefines the progress value at this contract boundary.ref: #/$defs/progress
$defs.block.statusreferenceYesDefines the status value at this contract boundary.ref: #/$defs/status
$defs.block.updatedAtstringYesDefines the updatedat value at this contract boundary.format: date-time
$defs.edge.fromBlockIdstringYesDefines the fromblockid value at this contract boundary.minLength: 1
$defs.edge.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.edge.kindenumYesDefines the kind value at this contract boundary.enum: sequence, parallel, gate, handoff
$defs.edge.ordernumberYesDefines the order value at this contract boundary.
$defs.edge.statusreferenceYesDefines the status value at this contract boundary.ref: #/$defs/status
$defs.edge.toBlockIdstringYesDefines the toblockid value at this contract boundary.minLength: 1
$defs.edge.updatedAtstringYesDefines the updatedat value at this contract boundary.format: date-time
$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
$defs.origin.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.origin.kindenumYesDefines the kind value at this contract boundary.enum: project, workspace-root
$defs.origin.labelstringYesDefines the label value at this contract boundary.minLength: 1
$defs.progress.completednumberNoDefines the completed value at this contract boundary.minimum: 0
$defs.progress.iterationnumberNoDefines the iteration value at this contract boundary.minimum: 0
$defs.progress.iterationsnumberNoDefines the iterations value at this contract boundary.minimum: 0
$defs.progress.percentnumberNoDefines the percent value at this contract boundary.minimum: 0 · maximum: 100
$defs.progress.totalnumberNoDefines the total value at this contract boundary.minimum: 0
$defs.run.artifactsarrayYesDefines the artifacts value at this contract boundary.
$defs.run.blocksarrayYesDefines the blocks value at this contract boundary.
$defs.run.commandarrayYesDefines the command value at this contract boundary.
$defs.run.durationMsnumberNoDefines the durationms value at this contract boundary.minimum: 0
$defs.run.edgesarrayYesDefines the edges value at this contract boundary.
$defs.run.evidenceBindingsarrayNoDefines the evidencebindings value at this contract boundary.maxItems: 100
$defs.run.originreferenceNoDefines the origin value at this contract boundary.ref: #/$defs/origin
$defs.run.orphanedbooleanNoDefines the orphaned value at this contract boundary.
$defs.run.parentRunIdstringNoDefines the parentrunid value at this contract boundary.minLength: 1
$defs.run.pidintegerNoDefines the pid value at this contract boundary.minimum: 1
$defs.run.runIdstringYesDefines the runid value at this contract boundary.minLength: 1
$defs.run.startedAtstringYesDefines the startedat value at this contract boundary.format: date-time
$defs.run.statusreferenceYesDefines the status value at this contract boundary.ref: #/$defs/status
$defs.run.touchesarrayYesDefines the touches value at this contract boundary.
$defs.run.updatedAtstringYesDefines the updatedat value at this contract boundary.format: date-time
$defs.run.warningsarrayYesDefines the warnings value at this contract boundary.
$defs.scope.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.scope.kindenumYesDefines the kind value at this contract boundary.enum: ephemeral-project, project, workspace
$defs.scope.labelstringYesDefines the label value at this contract boundary.minLength: 1
$defs.scope.portablebooleanYesDefines the portable value at this contract boundary.
$defs.touch.atstringYesDefines the at value at this contract boundary.format: date-time
$defs.touch.locatorstringYesDefines the locator value at this contract boundary.
$defs.touch.operationstringNoDefines the operation value at this contract boundary.
diagnosticsarrayYesDefines the diagnostics value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
runsarrayYesDefines the runs value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-activity-monitor-snapshot.v1"
scopereferenceYesDefines the scope value at this contract boundary.ref: #/$defs/scope

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-monitor-snapshot.v1.json",
  "title": "Workspai Activity Monitor Snapshot",
  "description": "A deterministic local projection of durable Workspai activity journals. It is observational and is not verification evidence by itself.",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "scope",
    "runs",
    "diagnostics"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-activity-monitor-snapshot.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "scope": {
      "$ref": "#/$defs/scope"
    },
    "runs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/run"
      }
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "status": {
      "enum": [
        "planned",
        "running",
        "succeeded",
        "warned",
        "blocked",
        "failed",
        "cancelled",
        "skipped",
        "rolled-back"
      ]
    },
    "scope": {
      "type": "object",
      "required": [
        "kind",
        "id",
        "label",
        "portable"
      ],
      "properties": {
        "kind": {
          "enum": [
            "ephemeral-project",
            "project",
            "workspace"
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "portable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "origin": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "label"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "enum": [
            "project",
            "workspace-root"
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "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
    },
    "attempt": {
      "type": "object",
      "required": [
        "attempt",
        "status",
        "startedAt",
        "updatedAt"
      ],
      "properties": {
        "attempt": {
          "type": "integer",
          "minimum": 1
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "progress": {
          "$ref": "#/$defs/progress"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "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
    },
    "block": {
      "type": "object",
      "required": [
        "id",
        "label",
        "status",
        "order",
        "updatedAt",
        "attempts"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "order": {
          "type": "number"
        },
        "parentId": {
          "type": "string",
          "minLength": 1
        },
        "progress": {
          "$ref": "#/$defs/progress"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        },
        "layoutHint": {
          "enum": [
            "source",
            "process",
            "gate",
            "sink"
          ]
        },
        "group": {
          "type": "string",
          "minLength": 1
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "attempt": {
          "type": "integer",
          "minimum": 1
        },
        "attempts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/attempt"
          }
        },
        "evidenceBindings": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/evidenceBinding"
          }
        }
      },
      "additionalProperties": false
    },
    "edge": {
      "type": "object",
      "required": [
        "id",
        "fromBlockId",
        "toBlockId",
        "kind",
        "status",
        "order",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "fromBlockId": {
          "type": "string",
          "minLength": 1
        },
        "toBlockId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "enum": [
            "sequence",
            "parallel",
            "gate",
            "handoff"
          ]
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "order": {
          "type": "number"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "touch": {
      "type": "object",
      "required": [
        "locator",
        "at"
      ],
      "properties": {
        "locator": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "artifact": {
      "type": "object",
      "required": [
        "locator",
        "at"
      ],
      "properties": {
        "locator": {
          "type": "string"
        },
        "at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "run": {
      "type": "object",
      "required": [
        "runId",
        "command",
        "status",
        "startedAt",
        "updatedAt",
        "blocks",
        "edges",
        "touches",
        "artifacts",
        "warnings"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "parentRunId": {
          "type": "string",
          "minLength": 1
        },
        "pid": {
          "type": "integer",
          "minimum": 1
        },
        "orphaned": {
          "type": "boolean"
        },
        "origin": {
          "$ref": "#/$defs/origin"
        },
        "command": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "durationMs": {
          "type": "number",
          "minimum": 0
        },
        "blocks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/block"
          }
        },
        "edges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/edge"
          }
        },
        "touches": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/touch"
          }
        },
        "artifacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "evidenceBindings": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/evidenceBinding"
          }
        }
      },
      "additionalProperties": false
    }
  }
}