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 path | Type | Required | Meaning | Constraints |
|---|---|---|---|---|
| $defs.manifest.archiveFormat | enum | No | Defines the archiveformat value at this contract boundary. | enum: zip-store, zip-deflate |
| $defs.manifest.compression | enum | No | Defines the compression value at this contract boundary. | enum: store, deflate |
| $defs.manifest.containerFormat | enum | No | Defines the containerformat value at this contract boundary. | enum: zip, zip64 |
| $defs.manifest.exportedAt | string | Yes | Defines the exportedat value at this contract boundary. | format: date-time |
| $defs.manifest.exportedBy | enum | No | Defines the exportedby value at this contract boundary. | enum: workspai, workspai-vscode |
| $defs.manifest.files | array | Yes | Defines the files value at this contract boundary. | — |
| $defs.manifest.files[].path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| $defs.manifest.files[].sha256 | string | Yes | Defines the sha256 value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| $defs.manifest.files[].size | integer | Yes | Defines the size value at this contract boundary. | minimum: 0 |
| $defs.manifest.kind | string | Yes | Defines the kind value at this contract boundary. | const: "workspai.workspace.archive" |
| $defs.manifest.schemaVersion | string | No | Defines the schemaversion value at this contract boundary. | const: "workspai-workspace-archive-manifest-v1" |
| $defs.manifest.security | object | Yes | Defines the security value at this contract boundary. | additionalProperties: false |
| $defs.manifest.security.envFilesIncluded | boolean | Yes | Defines the envfilesincluded value at this contract boundary. | — |
| $defs.manifest.security.excludedByDefault | array | Yes | Defines the excludedbydefault value at this contract boundary. | — |
| $defs.manifest.streaming | boolean | No | Defines the streaming value at this contract boundary. | — |
| $defs.manifest.version | number | Yes | Defines the version value at this contract boundary. | const: 1 |
| $defs.manifest.workspaceName | string | Yes | Defines the workspacename value at this contract boundary. | minLength: 1 |
| archivePath | string | No | Defines the archivepath value at this contract boundary. | minLength: 1 |
| archivePathOrUrl | string | No | Defines the archivepathorurl value at this contract boundary. | minLength: 1 |
| bytesWritten | integer | No | Defines the byteswritten value at this contract boundary. | minimum: 0 |
| checks | array | No | Defines the checks value at this contract boundary. | — |
| checks[].id | string | Yes | Defines the id value at this contract boundary. | minLength: 1 |
| checks[].message | string | Yes | Defines the message value at this contract boundary. | — |
| checks[].status | enum | Yes | Defines the status value at this contract boundary. | enum: passed, warning, failed |
| dryRun | boolean | No | Defines the dryrun value at this contract boundary. | — |
| entries | array | No | Defines the entries value at this contract boundary. | — |
| entries[].hasChecksum | boolean | Yes | Defines the haschecksum value at this contract boundary. | — |
| entries[].path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| entries[].size | integer | Yes | Defines the size value at this contract boundary. | minimum: 0 |
| error | object | No | Defines the error value at this contract boundary. | additionalProperties: false |
| error.code | string | Yes | Defines the code value at this contract boundary. | minLength: 1 |
| error.message | string | Yes | Defines the message value at this contract boundary. | minLength: 1 |
| extraArchiveEntries | reference | No | Defines the extraarchiveentries value at this contract boundary. | ref: #/$defs/pathList |
| fileCount | integer | No | Defines the filecount value at this contract boundary. | minimum: 0 |
| files | array | No | Defines the files value at this contract boundary. | — |
| files[].path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| files[].size | integer | Yes | Defines the size value at this contract boundary. | minimum: 0 |
| manifest | any | No | Defines the manifest value at this contract boundary. | — |
| mismatches | array | No | Defines the mismatches value at this contract boundary. | — |
| mismatches[].actual | object | Yes | Defines the actual value at this contract boundary. | additionalProperties: false |
| mismatches[].actual.sha256 | string | Yes | Defines the sha256 value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| mismatches[].actual.size | integer | Yes | Defines the size value at this contract boundary. | minimum: 0 |
| mismatches[].expected | object | Yes | Defines the expected value at this contract boundary. | additionalProperties: false |
| mismatches[].expected.sha256 | string | No | Defines the sha256 value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| mismatches[].expected.size | integer | No | Defines the size value at this contract boundary. | minimum: 0 |
| mismatches[].path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| missingArchiveEntries | reference | No | Defines the missingarchiveentries value at this contract boundary. | ref: #/$defs/pathList |
| missingChecksumFiles | reference | No | Defines the missingchecksumfiles value at this contract boundary. | ref: #/$defs/pathList |
| operation | enum | Yes | Defines the operation value at this contract boundary. | enum: export, inspect, verify, doctor, hydrate |
| outputPath | string | No | Defines the outputpath value at this contract boundary. | minLength: 1 |
| recommendedActions | array | No | Defines the recommendedactions value at this contract boundary. | — |
| schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "workspai-workspace-archive-operation-result-v1" |
| status | enum | Yes | Defines the status value at this contract boundary. | enum: passed, warning, failed, error |
| timestamp | string | No | Defines the timestamp value at this contract boundary. | format: date-time |
| totalBytes | integer | No | Defines the totalbytes value at this contract boundary. | minimum: 0 |
| verifiedFiles | integer | No | Defines the verifiedfiles value at this contract boundary. | minimum: 0 |
| workspaceName | string | No | Defines 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
}
}
}