All contracts

Diagnostics and remediation / JSON Schema

RapidKit Doctor Remediation Plan v2 Legacy Path Alias

Deprecated compatibility path. New consumers must resolve contracts/doctor-remediation-plan.v2.json.

Schema version
doctor-remediation-plan-v2
Contract path
contracts/doctor-remediation-plan.v1.json
Publication
synced-supporting-contract
Defined fields
55
Artifact bindings
0

Why this contract exists

Architecture role

Carries structured evidence, findings, and verdicts across governance boundaries.

Consumption boundary

  • Workspai CLI
  • CI and release automation
  • Developers

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.diffPreview.availablebooleanYesDefines the available value at this contract boundary.
$defs.diffPreview.formatenumYesDefines the format value at this contract boundary.enum: unified, summary, none
$defs.diffPreview.hunksarrayYesDefines the hunks value at this contract boundary.
$defs.diffPreview.limitationsarrayNoDefines the limitations value at this contract boundary.
$defs.diffPreview.summarystringYesDefines the summary value at this contract boundary.
$defs.preview.changesarrayYesDefines the changes value at this contract boundary.
$defs.preview.summarystringYesDefines the summary value at this contract boundary.
$defs.preview.titlestringYesDefines the title value at this contract boundary.
$defs.repairIntent.confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium, low
$defs.repairIntent.modeenumYesDefines the mode value at this contract boundary.enum: none, run-command, edit-file, review-required, verify-before-fix, refresh-evidence, manual-guidance
$defs.repairIntent.primaryActionLabelstringYesDefines the primaryactionlabel value at this contract boundary.
$defs.repairIntent.reasonstringYesDefines the reason value at this contract boundary.
$defs.repairIntent.relatedCommandsarrayYesDefines the relatedcommands value at this contract boundary.
$defs.repairIntent.requiresApprovalbooleanYesDefines the requiresapproval value at this contract boundary.
$defs.repairIntent.requiresFreshEvidencebooleanYesDefines the requiresfreshevidence 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
$defs.rollback.availablebooleanYesDefines the available value at this contract boundary.
$defs.rollback.strategyenumYesDefines the strategy value at this contract boundary.enum: snapshot, idempotent, manual, none
$defs.step.blockedReasonstringNoDefines the blockedreason value at this contract boundary.
$defs.step.dependsOnarrayYesDefines the dependson value at this contract boundary.
$defs.step.diffPreviewreferenceYesDefines the diffpreview value at this contract boundary.ref: #/$defs/diffPreview
$defs.step.executablebooleanYesDefines the executable value at this contract boundary.
$defs.step.executableInCurrentEnvironmentbooleanYesDefines the executableincurrentenvironment value at this contract boundary.
$defs.step.filesarrayYesDefines the files value at this contract boundary.
$defs.step.idstringYesDefines the id value at this contract boundary.
$defs.step.issueClassenumNoDefines the issueclass value at this contract boundary.enum: dependency, environment, security, test, quality, container, deployment, runtime, workspace-contract, source-tree, framework, configuration, custom, unknown
$defs.step.issueIdstringNoDefines the issueid value at this contract boundary.
$defs.step.kindenumYesDefines the kind value at this contract boundary.enum: env-copy, package-json-script, file-create, file-append, json-edit, env-key-add, makefile-target, rapidkit-init, go-mod-tidy, dependency-sync, manual-url, shell
$defs.step.operationreferenceNoDefines the operation value at this contract boundary.ref: #/$defs/repairOperation
$defs.step.operationalImpactenumNoDefines the operationalimpact value at this contract boundary.enum: none, developer-friction, ci-risk, release-risk, security-risk, runtime-risk, customer-risk
$defs.step.orderintegerYesDefines the order value at this contract boundary.minimum: 1
$defs.step.originalCommandstringYesDefines the originalcommand value at this contract boundary.
$defs.step.phaseenumYesDefines the phase value at this contract boundary.enum: dependency-baseline, local-environment, source-hygiene, command-contract, runtime-governance, manual-review, generic-execution
$defs.step.previewreferenceYesDefines the preview value at this contract boundary.ref: #/$defs/preview
$defs.step.projectNamestringYesDefines the projectname value at this contract boundary.
$defs.step.projectPathstringYesDefines the projectpath value at this contract boundary.
$defs.step.reasonstringNoDefines the reason value at this contract boundary.
$defs.step.refreshCommandsarrayYesDefines the refreshcommands value at this contract boundary.
$defs.step.repairIntentreferenceNoDefines the repairintent value at this contract boundary.ref: #/$defs/repairIntent
$defs.step.riskenumYesDefines the risk value at this contract boundary.enum: safe, guarded, invasive
$defs.step.rollbackreferenceYesDefines the rollback value at this contract boundary.ref: #/$defs/rollback
$defs.step.studioStatusreferenceYesDefines the studiostatus value at this contract boundary.ref: #/$defs/studioStatus
$defs.step.verifyCommandstringNoDefines the verifycommand value at this contract boundary.
$defs.studioStatus.reasonstringYesDefines the reason value at this contract boundary.
$defs.studioStatus.stateenumYesDefines the state value at this contract boundary.enum: ready, blocked, review-required, guidance-only
executableStepsintegerYesDefines the executablesteps value at this contract boundary.minimum: 0
fixableProjectsintegerYesDefines the fixableprojects value at this contract boundary.minimum: 0
generatedAtstringYesDefines the generatedat value at this contract boundary.
policyProfileenumYesDefines the policyprofile value at this contract boundary.enum: local, ci, release, enterprise-strict
riskreferenceYesDefines the risk value at this contract boundary.ref: #/$defs/riskSummary
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "doctor-remediation-plan-v2"
stepsarrayYesDefines the steps value at this contract boundary.
totalStepsintegerYesDefines the totalsteps value at this contract boundary.minimum: 0

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/doctor-remediation-plan.v1.json",
  "title": "RapidKit Doctor Remediation Plan v2 Legacy Path Alias",
  "description": "Deprecated compatibility path. New consumers must resolve contracts/doctor-remediation-plan.v2.json.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "generatedAt",
    "policyProfile",
    "fixableProjects",
    "totalSteps",
    "executableSteps",
    "risk",
    "steps"
  ],
  "properties": {
    "schemaVersion": {
      "const": "doctor-remediation-plan-v2"
    },
    "generatedAt": {
      "type": "string"
    },
    "policyProfile": {
      "enum": [
        "local",
        "ci",
        "release",
        "enterprise-strict"
      ]
    },
    "fixableProjects": {
      "type": "integer",
      "minimum": 0
    },
    "totalSteps": {
      "type": "integer",
      "minimum": 0
    },
    "executableSteps": {
      "type": "integer",
      "minimum": 0
    },
    "risk": {
      "$ref": "#/$defs/riskSummary"
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/step"
      }
    }
  },
  "$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
        }
      }
    },
    "preview": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "summary",
        "changes"
      ],
      "properties": {
        "title": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "changes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "rollback": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "available",
        "strategy"
      ],
      "properties": {
        "available": {
          "type": "boolean"
        },
        "strategy": {
          "enum": [
            "snapshot",
            "idempotent",
            "manual",
            "none"
          ]
        }
      }
    },
    "diffPreview": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "available",
        "format",
        "summary",
        "hunks"
      ],
      "properties": {
        "available": {
          "type": "boolean"
        },
        "format": {
          "enum": [
            "unified",
            "summary",
            "none"
          ]
        },
        "summary": {
          "type": "string"
        },
        "hunks": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "studioStatus": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "state",
        "reason"
      ],
      "properties": {
        "state": {
          "enum": [
            "ready",
            "blocked",
            "review-required",
            "guidance-only"
          ]
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "repairIntent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "confidence",
        "primaryActionLabel",
        "requiresApproval",
        "requiresFreshEvidence",
        "reason",
        "relatedCommands"
      ],
      "properties": {
        "mode": {
          "enum": [
            "none",
            "run-command",
            "edit-file",
            "review-required",
            "verify-before-fix",
            "refresh-evidence",
            "manual-guidance"
          ]
        },
        "primaryActionLabel": {
          "type": "string"
        },
        "requiresApproval": {
          "type": "boolean"
        },
        "confidence": {
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "requiresFreshEvidence": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "relatedCommands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "repairOperation": {
      "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",
            "path",
            "lines",
            "ensureNewline"
          ],
          "properties": {
            "type": {
              "const": "file-append"
            },
            "path": {
              "type": "string"
            },
            "lines": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "ensureNewline": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "sourcePath",
            "path",
            "overwrite"
          ],
          "properties": {
            "type": {
              "const": "file-copy"
            },
            "sourcePath": {
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "overwrite": {
              "const": false
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "path",
            "scriptName",
            "scriptValue"
          ],
          "properties": {
            "type": {
              "const": "package-json-script"
            },
            "path": {
              "type": "string"
            },
            "scriptName": {
              "type": "string"
            },
            "scriptValue": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "path",
            "edits"
          ],
          "properties": {
            "type": {
              "const": "json-edit"
            },
            "path": {
              "type": "string"
            },
            "edits": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "pointer",
                  "value"
                ],
                "properties": {
                  "pointer": {
                    "type": "string"
                  },
                  "value": {
                    "type": [
                      "string",
                      "number",
                      "boolean",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "path",
            "keys"
          ],
          "properties": {
            "type": {
              "const": "env-key-add"
            },
            "path": {
              "type": "string"
            },
            "keys": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "value"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "path",
            "target",
            "command",
            "phony"
          ],
          "properties": {
            "type": {
              "const": "makefile-target"
            },
            "path": {
              "type": "string"
            },
            "target": {
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "phony": {
              "type": "boolean"
            }
          }
        }
      ]
    },
    "step": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "phase",
        "order",
        "dependsOn",
        "projectName",
        "projectPath",
        "originalCommand",
        "kind",
        "risk",
        "executable",
        "files",
        "preview",
        "diffPreview",
        "refreshCommands",
        "rollback",
        "studioStatus",
        "executableInCurrentEnvironment"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "phase": {
          "enum": [
            "dependency-baseline",
            "local-environment",
            "source-hygiene",
            "command-contract",
            "runtime-governance",
            "manual-review",
            "generic-execution"
          ]
        },
        "order": {
          "type": "integer",
          "minimum": 1
        },
        "dependsOn": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "projectName": {
          "type": "string"
        },
        "projectPath": {
          "type": "string"
        },
        "originalCommand": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "env-copy",
            "package-json-script",
            "file-create",
            "file-append",
            "json-edit",
            "env-key-add",
            "makefile-target",
            "rapidkit-init",
            "go-mod-tidy",
            "dependency-sync",
            "manual-url",
            "shell"
          ]
        },
        "risk": {
          "enum": [
            "safe",
            "guarded",
            "invasive"
          ]
        },
        "executable": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "issueId": {
          "type": "string"
        },
        "issueClass": {
          "enum": [
            "dependency",
            "environment",
            "security",
            "test",
            "quality",
            "container",
            "deployment",
            "runtime",
            "workspace-contract",
            "source-tree",
            "framework",
            "configuration",
            "custom",
            "unknown"
          ]
        },
        "operationalImpact": {
          "enum": [
            "none",
            "developer-friction",
            "ci-risk",
            "release-risk",
            "security-risk",
            "runtime-risk",
            "customer-risk"
          ]
        },
        "repairIntent": {
          "$ref": "#/$defs/repairIntent"
        },
        "files": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "operation": {
          "$ref": "#/$defs/repairOperation"
        },
        "preview": {
          "$ref": "#/$defs/preview"
        },
        "diffPreview": {
          "$ref": "#/$defs/diffPreview"
        },
        "verifyCommand": {
          "type": "string"
        },
        "refreshCommands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rollback": {
          "$ref": "#/$defs/rollback"
        },
        "studioStatus": {
          "$ref": "#/$defs/studioStatus"
        },
        "executableInCurrentEnvironment": {
          "type": "boolean"
        },
        "blockedReason": {
          "type": "string"
        }
      }
    }
  }
}