All contracts

Workspace Intelligence / JSON Schema

Workspai Workspace Repair Proposal v1

A bounded, hash-pinned source change proposed by an IDE model for execution by the CLI Repair Engine.

Schema version
workspai.workspace-repair-proposal.v1
Contract path
contracts/workspace-intelligence/workspace-repair-proposal.v1.json
Publication
json-schema
Defined fields
25
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.change.contentstringNoDefines the content value at this contract boundary.maxLength: 5242880
$defs.change.expectedBeforeHashanyYesDefines the expectedbeforehash value at this contract boundary.
$defs.change.idstringYesDefines the id value at this contract boundary.pattern: ^[A-Za-z0-9._-]{1,160}$
$defs.change.operationenumYesDefines the operation value at this contract boundary.enum: write, delete
$defs.change.pathstringYesDefines the path value at this contract boundary.minLength: 1 · maxLength: 1000
$defs.change.riskenumYesDefines the risk value at this contract boundary.enum: safe, guarded, invasive
$defs.change.summarystringYesDefines the summary value at this contract boundary.minLength: 1 · maxLength: 1000
$defs.validation.argsarrayYesDefines the args value at this contract boundary.maxItems: 100
$defs.validation.cwdstringYesDefines the cwd value at this contract boundary.minLength: 1 · maxLength: 1000
$defs.validation.executablestringYesDefines the executable value at this contract boundary.minLength: 1 · maxLength: 1000
$defs.validation.idstringYesDefines the id value at this contract boundary.pattern: ^[A-Za-z0-9._-]{1,160}$
$defs.validation.kindenumYesDefines the kind value at this contract boundary.enum: audit, test, build
$defs.validation.requiredbooleanYesDefines the required value at this contract boundary.
$defs.validation.riskenumYesDefines the risk value at this contract boundary.enum: safe, guarded, invasive
$defs.validation.summarystringYesDefines the summary value at this contract boundary.minLength: 1 · maxLength: 1000
$defs.validation.timeoutMsintegerNoDefines the timeoutms value at this contract boundary.minimum: 1000 · maximum: 900000
blockerSignaturestringNoDefines the blockersignature value at this contract boundary.minLength: 1 · maxLength: 256
cardIdstringYesDefines the cardid value at this contract boundary.minLength: 1 · maxLength: 160
changesarrayYesDefines the changes value at this contract boundary.minItems: 1 · maxItems: 100
projectNamestringNoDefines the projectname value at this contract boundary.minLength: 1 · maxLength: 200
projectPathstringNoDefines the projectpath value at this contract boundary.minLength: 1 · maxLength: 1000
rationalestringYesDefines the rationale value at this contract boundary.minLength: 1 · maxLength: 4000
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai.workspace-repair-proposal.v1"
targetActionIdsarrayNoDefines the targetactionids value at this contract boundary.minItems: 1 · maxItems: 200
validationarrayNoDefines the validation value at this contract boundary.maxItems: 20

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-intelligence/workspace-repair-proposal.v1.json",
  "title": "Workspai Workspace Repair Proposal v1",
  "description": "A bounded, hash-pinned source change proposed by an IDE model for execution by the CLI Repair Engine.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "cardId",
    "rationale",
    "changes"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspai.workspace-repair-proposal.v1"
    },
    "cardId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "blockerSignature": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "targetActionIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
      }
    },
    "projectName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "projectPath": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000
    },
    "rationale": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "changes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "$ref": "#/$defs/change"
      }
    },
    "validation": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/validation"
      }
    }
  },
  "$defs": {
    "change": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "path",
        "operation",
        "expectedBeforeHash",
        "risk",
        "summary"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._-]{1,160}$"
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "operation": {
          "enum": [
            "write",
            "delete"
          ]
        },
        "expectedBeforeHash": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "content": {
          "type": "string",
          "maxLength": 5242880
        },
        "risk": {
          "enum": [
            "safe",
            "guarded",
            "invasive"
          ]
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "operation": {
                "const": "write"
              }
            }
          },
          "then": {
            "properties": {
              "content": {
                "type": "string",
                "maxLength": 5242880
              }
            },
            "required": [
              "content"
            ]
          },
          "else": {
            "not": {
              "required": [
                "content"
              ]
            }
          }
        }
      ]
    },
    "validation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "kind",
        "cwd",
        "executable",
        "args",
        "required",
        "risk",
        "summary"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._-]{1,160}$"
        },
        "kind": {
          "enum": [
            "audit",
            "test",
            "build"
          ]
        },
        "cwd": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "executable": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "args": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string",
            "maxLength": 4000
          }
        },
        "required": {
          "type": "boolean"
        },
        "risk": {
          "enum": [
            "safe",
            "guarded",
            "invasive"
          ]
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 900000
        }
      }
    }
  }
}