All contracts

Recovery and archival / JSON Schema

Workspai Workspace Archive Operation Result v1

Defines the versioned workspace archive operation result v1 boundary used by Workspai and its consumers.

Schema version
workspai-workspace-archive-operation-result-v1
Contract path
contracts/workspace-archive-operation-result.v1.json
Publication
json-schema
Defined fields
57
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.manifest.archiveFormatenumNoDefines the archiveformat value at this contract boundary.enum: zip-store, zip-deflate
$defs.manifest.compressionenumNoDefines the compression value at this contract boundary.enum: store, deflate
$defs.manifest.containerFormatenumNoDefines the containerformat value at this contract boundary.enum: zip, zip64
$defs.manifest.exportedAtstringYesDefines the exportedat value at this contract boundary.format: date-time
$defs.manifest.exportedByenumNoDefines the exportedby value at this contract boundary.enum: workspai, workspai-vscode
$defs.manifest.filesarrayYesDefines the files value at this contract boundary.
$defs.manifest.files[].pathstringYesDefines the path value at this contract boundary.minLength: 1
$defs.manifest.files[].sha256stringYesDefines the sha256 value at this contract boundary.pattern: ^[a-f0-9]{64}$
$defs.manifest.files[].sizeintegerYesDefines the size value at this contract boundary.minimum: 0
$defs.manifest.kindstringYesDefines the kind value at this contract boundary.const: "workspai.workspace.archive"
$defs.manifest.schemaVersionstringNoDefines the schemaversion value at this contract boundary.const: "workspai-workspace-archive-manifest-v1"
$defs.manifest.securityobjectYesDefines the security value at this contract boundary.additionalProperties: false
$defs.manifest.security.envFilesIncludedbooleanYesDefines the envfilesincluded value at this contract boundary.
$defs.manifest.security.excludedByDefaultarrayYesDefines the excludedbydefault value at this contract boundary.
$defs.manifest.streamingbooleanNoDefines the streaming value at this contract boundary.
$defs.manifest.versionnumberYesDefines the version value at this contract boundary.const: 1
$defs.manifest.workspaceNamestringYesDefines the workspacename value at this contract boundary.minLength: 1
archivePathstringNoDefines the archivepath value at this contract boundary.minLength: 1
archivePathOrUrlstringNoDefines the archivepathorurl value at this contract boundary.minLength: 1
bytesWrittenintegerNoDefines the byteswritten value at this contract boundary.minimum: 0
checksarrayNoDefines the checks value at this contract boundary.
checks[].idstringYesDefines the id value at this contract boundary.minLength: 1
checks[].messagestringYesDefines the message value at this contract boundary.
checks[].statusenumYesDefines the status value at this contract boundary.enum: passed, warning, failed
dryRunbooleanNoDefines the dryrun value at this contract boundary.
entriesarrayNoDefines the entries value at this contract boundary.
entries[].hasChecksumbooleanYesDefines the haschecksum value at this contract boundary.
entries[].pathstringYesDefines the path value at this contract boundary.minLength: 1
entries[].sizeintegerYesDefines the size value at this contract boundary.minimum: 0
errorobjectNoDefines the error value at this contract boundary.additionalProperties: false
error.codestringYesDefines the code value at this contract boundary.minLength: 1
error.messagestringYesDefines the message value at this contract boundary.minLength: 1
extraArchiveEntriesreferenceNoDefines the extraarchiveentries value at this contract boundary.ref: #/$defs/pathList
fileCountintegerNoDefines the filecount value at this contract boundary.minimum: 0
filesarrayNoDefines the files value at this contract boundary.
files[].pathstringYesDefines the path value at this contract boundary.minLength: 1
files[].sizeintegerYesDefines the size value at this contract boundary.minimum: 0
manifestanyNoDefines the manifest value at this contract boundary.
mismatchesarrayNoDefines the mismatches value at this contract boundary.
mismatches[].actualobjectYesDefines the actual value at this contract boundary.additionalProperties: false
mismatches[].actual.sha256stringYesDefines the sha256 value at this contract boundary.pattern: ^[a-f0-9]{64}$
mismatches[].actual.sizeintegerYesDefines the size value at this contract boundary.minimum: 0
mismatches[].expectedobjectYesDefines the expected value at this contract boundary.additionalProperties: false
mismatches[].expected.sha256stringNoDefines the sha256 value at this contract boundary.pattern: ^[a-f0-9]{64}$
mismatches[].expected.sizeintegerNoDefines the size value at this contract boundary.minimum: 0
mismatches[].pathstringYesDefines the path value at this contract boundary.minLength: 1
missingArchiveEntriesreferenceNoDefines the missingarchiveentries value at this contract boundary.ref: #/$defs/pathList
missingChecksumFilesreferenceNoDefines the missingchecksumfiles value at this contract boundary.ref: #/$defs/pathList
operationenumYesDefines the operation value at this contract boundary.enum: export, inspect, verify, doctor, hydrate
outputPathstringNoDefines the outputpath value at this contract boundary.minLength: 1
recommendedActionsarrayNoDefines the recommendedactions value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai-workspace-archive-operation-result-v1"
statusenumYesDefines the status value at this contract boundary.enum: passed, warning, failed, error
timestampstringNoDefines the timestamp value at this contract boundary.format: date-time
totalBytesintegerNoDefines the totalbytes value at this contract boundary.minimum: 0
verifiedFilesintegerNoDefines the verifiedfiles value at this contract boundary.minimum: 0
workspaceNamestringNoDefines the workspacename value at this contract boundary.minLength: 1

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-archive-operation-result.v1.json",
  "title": "Workspai Workspace Archive Operation Result v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "operation",
    "status"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspai-workspace-archive-operation-result-v1"
    },
    "operation": {
      "enum": [
        "export",
        "inspect",
        "verify",
        "doctor",
        "hydrate"
      ]
    },
    "status": {
      "enum": [
        "passed",
        "warning",
        "failed",
        "error"
      ]
    },
    "archivePath": {
      "type": "string",
      "minLength": 1
    },
    "outputPath": {
      "type": "string",
      "minLength": 1
    },
    "dryRun": {
      "type": "boolean"
    },
    "archivePathOrUrl": {
      "type": "string",
      "minLength": 1
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "manifest": {
      "anyOf": [
        {
          "$ref": "#/$defs/manifest"
        },
        {
          "type": "null"
        }
      ]
    },
    "bytesWritten": {
      "type": "integer",
      "minimum": 0
    },
    "workspaceName": {
      "type": "string",
      "minLength": 1
    },
    "fileCount": {
      "type": "integer",
      "minimum": 0
    },
    "totalBytes": {
      "type": "integer",
      "minimum": 0
    },
    "verifiedFiles": {
      "type": "integer",
      "minimum": 0
    },
    "missingChecksumFiles": {
      "$ref": "#/$defs/pathList"
    },
    "missingArchiveEntries": {
      "$ref": "#/$defs/pathList"
    },
    "extraArchiveEntries": {
      "$ref": "#/$defs/pathList"
    },
    "recommendedActions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "size",
          "hasChecksum"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "hasChecksum": {
            "type": "boolean"
          }
        }
      }
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "size"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1
          },
          "size": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "mismatches": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "expected",
          "actual"
        ],
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1
          },
          "expected": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          },
          "actual": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "size",
              "sha256"
            ],
            "properties": {
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          }
        }
      }
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "message"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "enum": [
              "passed",
              "warning",
              "failed"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "operation": {
            "const": "export"
          },
          "status": {
            "enum": [
              "passed",
              "warning",
              "failed"
            ]
          }
        },
        "required": [
          "operation",
          "status"
        ]
      },
      "then": {
        "properties": {
          "archivePath": true,
          "manifest": true,
          "bytesWritten": true
        },
        "required": [
          "archivePath",
          "manifest",
          "bytesWritten"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "operation": {
            "const": "inspect"
          },
          "status": {
            "enum": [
              "passed",
              "warning",
              "failed"
            ]
          }
        },
        "required": [
          "operation",
          "status"
        ]
      },
      "then": {
        "properties": {
          "archivePath": true,
          "manifest": true,
          "fileCount": true,
          "totalBytes": true,
          "entries": true
        },
        "required": [
          "archivePath",
          "manifest",
          "fileCount",
          "totalBytes",
          "entries"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "operation": {
            "const": "verify"
          },
          "status": {
            "enum": [
              "passed",
              "warning",
              "failed"
            ]
          }
        },
        "required": [
          "operation",
          "status"
        ]
      },
      "then": {
        "properties": {
          "archivePath": true,
          "manifest": true,
          "fileCount": true,
          "totalBytes": true,
          "verifiedFiles": true,
          "missingChecksumFiles": true,
          "missingArchiveEntries": true,
          "extraArchiveEntries": true,
          "mismatches": true
        },
        "required": [
          "archivePath",
          "manifest",
          "fileCount",
          "totalBytes",
          "verifiedFiles",
          "missingChecksumFiles",
          "missingArchiveEntries",
          "extraArchiveEntries",
          "mismatches"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "operation": {
            "const": "doctor"
          },
          "status": {
            "enum": [
              "passed",
              "warning",
              "failed"
            ]
          }
        },
        "required": [
          "operation",
          "status"
        ]
      },
      "then": {
        "properties": {
          "archivePath": true,
          "workspaceName": true,
          "fileCount": true,
          "totalBytes": true,
          "checks": true,
          "recommendedActions": true
        },
        "required": [
          "archivePath",
          "workspaceName",
          "fileCount",
          "totalBytes",
          "checks",
          "recommendedActions"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "operation": {
            "const": "hydrate"
          },
          "status": {
            "enum": [
              "passed",
              "warning",
              "failed"
            ]
          }
        },
        "required": [
          "operation",
          "status"
        ]
      },
      "then": {
        "properties": {
          "archivePath": true,
          "outputPath": true,
          "dryRun": true,
          "manifest": true,
          "files": true
        },
        "required": [
          "archivePath",
          "outputPath",
          "dryRun",
          "manifest",
          "files"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "status": {
            "const": "error"
          }
        },
        "required": [
          "status"
        ]
      },
      "then": {
        "properties": {
          "archivePathOrUrl": true,
          "timestamp": true,
          "error": true
        },
        "required": [
          "timestamp",
          "error"
        ]
      }
    }
  ],
  "$defs": {
    "manifest": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "version",
        "kind",
        "workspaceName",
        "exportedAt",
        "security",
        "files"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspai-workspace-archive-manifest-v1"
        },
        "version": {
          "const": 1
        },
        "kind": {
          "const": "workspai.workspace.archive"
        },
        "workspaceName": {
          "type": "string",
          "minLength": 1
        },
        "exportedAt": {
          "type": "string",
          "format": "date-time"
        },
        "exportedBy": {
          "enum": [
            "workspai",
            "workspai-vscode"
          ]
        },
        "archiveFormat": {
          "enum": [
            "zip-store",
            "zip-deflate"
          ]
        },
        "containerFormat": {
          "enum": [
            "zip",
            "zip64"
          ]
        },
        "compression": {
          "enum": [
            "store",
            "deflate"
          ]
        },
        "streaming": {
          "type": "boolean"
        },
        "security": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "envFilesIncluded",
            "excludedByDefault"
          ],
          "properties": {
            "envFilesIncluded": {
              "type": "boolean"
            },
            "excludedByDefault": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          }
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path",
              "size",
              "sha256"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          }
        }
      }
    },
    "pathList": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    }
  }
}