All contracts

Diagnostics and remediation / JSON Schema

RapidKit Artifact Remediation Plan

Defines the versioned artifact remediation plan v1 boundary used by Workspai and its consumers.

Schema version
artifact-remediation-plan-v1
Contract path
contracts/artifact-remediation-plan.v1.json
Publication
json-schema
Defined fields
42
Artifact bindings
1

Why this contract exists

Architecture role

Defines a versioned interoperability boundary used by Workspai and contract-aware consumers.

Consumption boundary

  • Workspai CLI
  • Contract-aware integrations

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.

Produced artifacts

These durable files are emitted by registered commands and validated against this contract.

Artifact pathSchemaProducer
.workspai/reports/artifact-remediation-plan-last-run.jsonartifact-remediation-plan-v1
workspai workspace remediation-plan

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.action.artifactKindstringYesDefines the artifactkind value at this contract boundary.
$defs.action.blockerstringYesDefines the blocker value at this contract boundary.
$defs.action.cardIdstringYesDefines the cardid value at this contract boundary.
$defs.action.commandstringNoDefines the command value at this contract boundary.
$defs.action.cwdenumYesDefines the cwd value at this contract boundary.enum: workspace, project
$defs.action.filesarrayYesDefines the files value at this contract boundary.
$defs.action.idstringYesDefines the id value at this contract boundary.
$defs.action.modeenumYesDefines the mode value at this contract boundary.enum: edit-file, run-command, refresh-evidence, verify-before-fix, manual-guidance
$defs.action.notesarrayYesDefines the notes value at this contract boundary.
$defs.action.operationreferenceNoDefines the operation value at this contract boundary.ref: #/$defs/operation
$defs.action.orderintegerYesDefines the order value at this contract boundary.minimum: 0
$defs.action.phasestringYesDefines the phase value at this contract boundary.
$defs.action.requiresApprovalbooleanYesDefines the requiresapproval value at this contract boundary.
$defs.action.riskenumYesDefines the risk value at this contract boundary.enum: safe, guarded, invasive
$defs.action.rollbackobjectYesDefines the rollback value at this contract boundary.additionalProperties: false
$defs.action.rollback.availablebooleanYesDefines the available value at this contract boundary.
$defs.action.rollback.strategyenumYesDefines the strategy value at this contract boundary.enum: idempotent, manual, none
$defs.action.scopeenumYesDefines the scope value at this contract boundary.enum: workspace, project
$defs.action.statusenumYesDefines the status value at this contract boundary.enum: ready, review-required, blocked, guidance-only
$defs.action.summarystringYesDefines the summary value at this contract boundary.
$defs.action.titlestringYesDefines the title value at this contract boundary.
$defs.action.verifyCommandstringYesDefines the verifycommand value at this contract boundary.
$defs.riskSummary.guardedintegerYesDefines the guarded value at this contract boundary.minimum: 0
$defs.riskSummary.invasiveintegerYesDefines the invasive value at this contract boundary.minimum: 0
$defs.riskSummary.safeintegerYesDefines the safe value at this contract boundary.minimum: 0
actionsarrayYesDefines the actions value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "artifact-remediation-plan-v1"
sourceobjectYesDefines the source value at this contract boundary.additionalProperties: false
source.ciModebooleanYesDefines the cimode value at this contract boundary.
source.commandstringYesDefines the command value at this contract boundary.const: "workspace remediation-plan"
source.includeAbsolutePathsbooleanYesDefines the includeabsolutepaths value at this contract boundary.
source.reportsDirstringYesDefines the reportsdir value at this contract boundary.
summaryobjectYesDefines the summary value at this contract boundary.additionalProperties: false
summary.artifactsScannedintegerYesDefines the artifactsscanned value at this contract boundary.minimum: 0
summary.cardsCoveredintegerYesDefines the cardscovered value at this contract boundary.minimum: 0
summary.executableActionsintegerYesDefines the executableactions value at this contract boundary.minimum: 0
summary.riskreferenceYesDefines the risk value at this contract boundary.ref: #/$defs/riskSummary
summary.totalActionsintegerYesDefines the totalactions value at this contract boundary.minimum: 0
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: false
workspace.namestringYesDefines the name value at this contract boundary.
workspace.pathstringNoDefines the path value at this contract boundary.

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://rapidkit.dev/contracts/artifact-remediation-plan.v1.json",
  "title": "RapidKit Artifact Remediation Plan",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "generatedAt",
    "workspace",
    "source",
    "summary",
    "actions"
  ],
  "properties": {
    "schemaVersion": {
      "const": "artifact-remediation-plan-v1"
    },
    "generatedAt": {
      "type": "string"
    },
    "workspace": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "path": {
          "type": "string"
        }
      }
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "command",
        "reportsDir",
        "includeAbsolutePaths",
        "ciMode"
      ],
      "properties": {
        "command": {
          "const": "workspace remediation-plan"
        },
        "reportsDir": {
          "type": "string"
        },
        "includeAbsolutePaths": {
          "type": "boolean"
        },
        "ciMode": {
          "type": "boolean"
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifactsScanned",
        "cardsCovered",
        "totalActions",
        "executableActions",
        "risk"
      ],
      "properties": {
        "artifactsScanned": {
          "type": "integer",
          "minimum": 0
        },
        "cardsCovered": {
          "type": "integer",
          "minimum": 0
        },
        "totalActions": {
          "type": "integer",
          "minimum": 0
        },
        "executableActions": {
          "type": "integer",
          "minimum": 0
        },
        "risk": {
          "$ref": "#/$defs/riskSummary"
        }
      }
    },
    "actions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/action"
      }
    }
  },
  "$defs": {
    "riskSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "safe",
        "guarded",
        "invasive"
      ],
      "properties": {
        "safe": {
          "type": "integer",
          "minimum": 0
        },
        "guarded": {
          "type": "integer",
          "minimum": 0
        },
        "invasive": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "operation": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "path",
            "content",
            "overwrite"
          ],
          "properties": {
            "type": {
              "const": "file-create"
            },
            "path": {
              "type": "string"
            },
            "content": {
              "type": "string"
            },
            "overwrite": {
              "const": false
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "command",
            "cwd"
          ],
          "properties": {
            "type": {
              "const": "run-command"
            },
            "command": {
              "type": "string"
            },
            "cwd": {
              "enum": [
                "workspace",
                "project"
              ]
            }
          }
        }
      ]
    },
    "action": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "artifactKind",
        "cardId",
        "title",
        "order",
        "phase",
        "scope",
        "status",
        "mode",
        "risk",
        "requiresApproval",
        "blocker",
        "summary",
        "verifyCommand",
        "cwd",
        "files",
        "rollback",
        "notes"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "artifactKind": {
          "type": "string"
        },
        "cardId": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "order": {
          "type": "integer",
          "minimum": 0
        },
        "phase": {
          "type": "string"
        },
        "scope": {
          "enum": [
            "workspace",
            "project"
          ]
        },
        "status": {
          "enum": [
            "ready",
            "review-required",
            "blocked",
            "guidance-only"
          ]
        },
        "mode": {
          "enum": [
            "edit-file",
            "run-command",
            "refresh-evidence",
            "verify-before-fix",
            "manual-guidance"
          ]
        },
        "risk": {
          "enum": [
            "safe",
            "guarded",
            "invasive"
          ]
        },
        "requiresApproval": {
          "type": "boolean"
        },
        "blocker": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "command": {
          "type": "string"
        },
        "verifyCommand": {
          "type": "string"
        },
        "cwd": {
          "enum": [
            "workspace",
            "project"
          ]
        },
        "files": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "operation": {
          "$ref": "#/$defs/operation"
        },
        "rollback": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "available",
            "strategy"
          ],
          "properties": {
            "available": {
              "type": "boolean"
            },
            "strategy": {
              "enum": [
                "idempotent",
                "manual",
                "none"
              ]
            }
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}