All contracts

Diagnostics and remediation / JSON Schema

RapidKit Doctor Workspace Evidence

Defines the versioned doctor workspace evidence v1 boundary used by Workspai and its consumers.

Schema version
doctor-workspace-evidence-v1
Contract path
contracts/doctor-workspace-evidence.v1.json
Publication
embedded-type
Defined fields
100
Artifact bindings
1

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.

Produced artifacts

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

Artifact pathSchemaProducer
.workspai/reports/doctor-last-run.jsondoctor-workspace-evidence-v1
workspai doctor workspace --json

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.evidenceFreshness.generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
$defs.evidenceFreshness.liveStateProbeCountintegerYesDefines the livestateprobecount value at this contract boundary.minimum: 0
$defs.evidenceFreshness.oldestProbeGeneratedAtstringNoDefines the oldestprobegeneratedat value at this contract boundary.format: date-time
$defs.evidenceFreshness.staleProbeCountintegerYesDefines the staleprobecount value at this contract boundary.minimum: 0
$defs.evidenceFreshness.statusenumYesDefines the status value at this contract boundary.enum: fresh, stale, unknown
$defs.evidenceFreshness.unknownProbeCountintegerYesDefines the unknownprobecount value at this contract boundary.minimum: 0
$defs.evidenceFreshness.verifyBeforeUseProbeCountintegerYesDefines the verifybeforeuseprobecount value at this contract boundary.minimum: 0
$defs.freshness.categoryenumYesDefines the category value at this contract boundary.enum: structure, verification, state
$defs.freshness.expiresAtstringNoDefines the expiresat value at this contract boundary.format: date-time
$defs.freshness.generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
$defs.freshness.reasonstringYesDefines the reason value at this contract boundary.
$defs.freshness.statusenumYesDefines the status value at this contract boundary.enum: fresh, stale, unknown
$defs.freshness.ttlSecondsinteger | nullYesDefines the ttlseconds value at this contract boundary.minimum: 0
$defs.freshness.verifyBeforeUsebooleanYesDefines the verifybeforeuse value at this contract boundary.
$defs.policyProfile.advisoryWarningsBlockReleasebooleanYesDefines the advisorywarningsblockrelease value at this contract boundary.
$defs.policyProfile.descriptionstringYesDefines the description value at this contract boundary.
$defs.policyProfile.exitOnErrorsbooleanYesDefines the exitonerrors value at this contract boundary.const: true
$defs.policyProfile.exitOnWarningsbooleanYesDefines the exitonwarnings value at this contract boundary.
$defs.policyProfile.nameenumYesDefines the name value at this contract boundary.enum: local, ci, release, enterprise-strict
$defs.policyProfile.warningExitCodeenumYesDefines the warningexitcode value at this contract boundary.enum: 0, 1, 2
$defs.probe.freshnessreferenceNoDefines the freshness value at this contract boundary.ref: #/$defs/freshness
$defs.probe.idstringNoDefines the id value at this contract boundary.minLength: 1
$defs.probe.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.probe.labelstringNoDefines the label value at this contract boundary.minLength: 1
$defs.probe.operationalImpactenumNoDefines the operationalimpact value at this contract boundary.enum: none, developer-friction, ci-risk, release-risk, security-risk, runtime-risk, customer-risk
$defs.probe.reasonstringNoDefines the reason value at this contract boundary.
$defs.probe.recommendationstringNoDefines the recommendation value at this contract boundary.
$defs.probe.repairCapabilityreferenceNoDefines the repaircapability value at this contract boundary.ref: #/$defs/repairCapability
$defs.probe.repairIntentreferenceNoDefines the repairintent value at this contract boundary.ref: #/$defs/repairIntent
$defs.probe.scopestringNoDefines the scope value at this contract boundary.
$defs.probe.severityenumNoDefines the severity value at this contract boundary.enum: info, warn, error
$defs.probe.statusenumNoDefines the status value at this contract boundary.enum: pass, warn, fail
$defs.repairCapability.canAutoFixbooleanYesDefines the canautofix value at this contract boundary.
$defs.repairCapability.canEditFilesbooleanYesDefines the caneditfiles value at this contract boundary.
$defs.repairCapability.commandstringNoDefines the command value at this contract boundary.
$defs.repairCapability.filesarrayYesDefines the files value at this contract boundary.
$defs.repairCapability.fixKindenumYesDefines the fixkind value at this contract boundary.enum: package-json-script, file-create, file-append, file-copy, dependency-sync, command, manual
$defs.repairCapability.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.repairCapability.issueIdstringYesDefines the issueid value at this contract boundary.minLength: 1
$defs.repairCapability.limitationsarrayNoDefines the limitations value at this contract boundary.
$defs.repairCapability.operationreferenceNoDefines the operation value at this contract boundary.ref: #/$defs/repairOperation
$defs.repairCapability.reasonstringYesDefines the reason value at this contract boundary.
$defs.repairCapability.refreshCommandsarrayYesDefines the refreshcommands value at this contract boundary.
$defs.repairCapability.requiresApprovalbooleanYesDefines the requiresapproval value at this contract boundary.
$defs.repairCapability.requiresReviewbooleanYesDefines the requiresreview value at this contract boundary.
$defs.repairCapability.riskenumYesDefines the risk value at this contract boundary.enum: safe, guarded, invasive
$defs.repairCapability.statusenumYesDefines the status value at this contract boundary.enum: available, manual, blocked
$defs.repairCapability.titlestringYesDefines the title value at this contract boundary.minLength: 1
$defs.repairCapability.verifyCommandstringNoDefines the verifycommand 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.repairOperation.commandstringNoDefines the command value at this contract boundary.
$defs.repairOperation.contentstringNoDefines the content value at this contract boundary.
$defs.repairOperation.editsarrayNoDefines the edits value at this contract boundary.
$defs.repairOperation.edits[].pointerstringYesDefines the pointer value at this contract boundary.
$defs.repairOperation.edits[].valuestring | number | boolean | nullYesDefines the value value at this contract boundary.
$defs.repairOperation.ensureNewlinebooleanNoDefines the ensurenewline value at this contract boundary.
$defs.repairOperation.keysarrayNoDefines the keys value at this contract boundary.
$defs.repairOperation.keys[].commentstringNoDefines the comment value at this contract boundary.
$defs.repairOperation.keys[].namestringYesDefines the name value at this contract boundary.
$defs.repairOperation.keys[].valuestringYesDefines the value value at this contract boundary.
$defs.repairOperation.linesarrayNoDefines the lines value at this contract boundary.
$defs.repairOperation.overwritebooleanNoDefines the overwrite value at this contract boundary.
$defs.repairOperation.pathstringYesDefines the path value at this contract boundary.minLength: 1
$defs.repairOperation.phonybooleanNoDefines the phony value at this contract boundary.
$defs.repairOperation.scriptNamestringNoDefines the scriptname value at this contract boundary.
$defs.repairOperation.scriptValuestringNoDefines the scriptvalue value at this contract boundary.
$defs.repairOperation.sourcePathstringNoDefines the sourcepath value at this contract boundary.minLength: 1
$defs.repairOperation.targetstringNoDefines the target value at this contract boundary.
$defs.repairOperation.typeenumYesDefines the type value at this contract boundary.enum: file-create, file-append, file-copy, package-json-script, json-edit, env-key-add, makefile-target
cachePathstring | nullNoDefines the cachepath value at this contract boundary.
contractobjectNoDefines the contract value at this contract boundary.additionalProperties: true
driftDeltaobjectNoDefines the driftdelta value at this contract boundary.additionalProperties: true
evidenceFreshnessreferenceNoDefines the evidencefreshness value at this contract boundary.ref: #/$defs/evidenceFreshness
evidenceTypestringYesDefines the evidencetype value at this contract boundary.const: "workspace"
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
healthScoreobjectNoDefines the healthscore value at this contract boundary.additionalProperties: true
policyProfilereferenceNoDefines the policyprofile value at this contract boundary.ref: #/$defs/policyProfile
projectsarrayYesDefines the projects value at this contract boundary.
projects[].probesarrayNoDefines the probes value at this contract boundary.
projects[].repairCapabilitiesarrayNoDefines the repaircapabilities value at this contract boundary.
projectScanCachedbooleanNoDefines the projectscancached value at this contract boundary.
projectScanSignaturestringNoDefines the projectscansignature value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "doctor-workspace-evidence-v1"
scoreBreakdownarrayNoDefines the scorebreakdown value at this contract boundary.
summaryobjectYesDefines the summary value at this contract boundary.additionalProperties: true
summary.hasSystemErrorsbooleanYesDefines the hassystemerrors value at this contract boundary.
summary.projectAdvisoryWarningProjectsintegerNoDefines the projectadvisorywarningprojects value at this contract boundary.minimum: 0
summary.projectAdvisoryWarningsintegerNoDefines the projectadvisorywarnings value at this contract boundary.minimum: 0
summary.scopeProvenanceobjectNoDefines the scopeprovenance value at this contract boundary.additionalProperties: true
summary.totalIssuesintegerYesDefines the totalissues value at this contract boundary.minimum: 0
summary.totalProjectsintegerYesDefines the totalprojects value at this contract boundary.minimum: 0
systemobjectNoDefines the system value at this contract boundary.additionalProperties: true
workspaceNamestringNoDefines the workspacename value at this contract boundary.
workspacePathstringYesDefines the workspacepath 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://getrapidkit.com/schemas/doctor-workspace-evidence.v1.json",
  "title": "RapidKit Doctor Workspace Evidence",
  "type": "object",
  "required": [
    "schemaVersion",
    "evidenceType",
    "generatedAt",
    "workspacePath",
    "summary",
    "projects"
  ],
  "properties": {
    "schemaVersion": {
      "const": "doctor-workspace-evidence-v1"
    },
    "evidenceType": {
      "const": "workspace"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "workspacePath": {
      "type": "string",
      "minLength": 1
    },
    "workspaceName": {
      "type": "string"
    },
    "projectScanCached": {
      "type": "boolean"
    },
    "projectScanSignature": {
      "type": "string"
    },
    "cachePath": {
      "type": [
        "string",
        "null"
      ]
    },
    "healthScore": {
      "type": "object",
      "additionalProperties": true
    },
    "evidenceFreshness": {
      "$ref": "#/$defs/evidenceFreshness"
    },
    "system": {
      "type": "object",
      "additionalProperties": true
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "probes": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/probe"
            }
          },
          "repairCapabilities": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/repairCapability"
            }
          }
        },
        "additionalProperties": true
      }
    },
    "summary": {
      "type": "object",
      "required": [
        "totalProjects",
        "totalIssues",
        "hasSystemErrors"
      ],
      "properties": {
        "totalProjects": {
          "type": "integer",
          "minimum": 0
        },
        "totalIssues": {
          "type": "integer",
          "minimum": 0
        },
        "projectAdvisoryWarningProjects": {
          "type": "integer",
          "minimum": 0
        },
        "projectAdvisoryWarnings": {
          "type": "integer",
          "minimum": 0
        },
        "hasSystemErrors": {
          "type": "boolean"
        },
        "scopeProvenance": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "driftDelta": {
      "type": "object",
      "additionalProperties": true
    },
    "scoreBreakdown": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "contract": {
      "type": "object",
      "additionalProperties": true
    },
    "policyProfile": {
      "$ref": "#/$defs/policyProfile"
    }
  },
  "$defs": {
    "freshness": {
      "type": "object",
      "required": [
        "category",
        "generatedAt",
        "ttlSeconds",
        "status",
        "verifyBeforeUse",
        "reason"
      ],
      "properties": {
        "category": {
          "enum": [
            "structure",
            "verification",
            "state"
          ]
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "ttlSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "enum": [
            "fresh",
            "stale",
            "unknown"
          ]
        },
        "verifyBeforeUse": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "evidenceFreshness": {
      "type": "object",
      "required": [
        "generatedAt",
        "status",
        "staleProbeCount",
        "unknownProbeCount",
        "liveStateProbeCount",
        "verifyBeforeUseProbeCount"
      ],
      "properties": {
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "enum": [
            "fresh",
            "stale",
            "unknown"
          ]
        },
        "staleProbeCount": {
          "type": "integer",
          "minimum": 0
        },
        "unknownProbeCount": {
          "type": "integer",
          "minimum": 0
        },
        "liveStateProbeCount": {
          "type": "integer",
          "minimum": 0
        },
        "verifyBeforeUseProbeCount": {
          "type": "integer",
          "minimum": 0
        },
        "oldestProbeGeneratedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "repairIntent": {
      "type": "object",
      "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"
          ]
        },
        "confidence": {
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "primaryActionLabel": {
          "type": "string"
        },
        "requiresApproval": {
          "type": "boolean"
        },
        "requiresFreshEvidence": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "relatedCommands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "policyProfile": {
      "type": "object",
      "required": [
        "name",
        "exitOnErrors",
        "exitOnWarnings",
        "warningExitCode",
        "advisoryWarningsBlockRelease",
        "description"
      ],
      "properties": {
        "name": {
          "enum": [
            "local",
            "ci",
            "release",
            "enterprise-strict"
          ]
        },
        "exitOnErrors": {
          "const": true
        },
        "exitOnWarnings": {
          "type": "boolean"
        },
        "warningExitCode": {
          "enum": [
            0,
            1,
            2
          ]
        },
        "advisoryWarningsBlockRelease": {
          "type": "boolean"
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "probe": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "pass",
            "warn",
            "fail"
          ]
        },
        "severity": {
          "enum": [
            "info",
            "warn",
            "error"
          ]
        },
        "scope": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "recommendation": {
          "type": "string"
        },
        "freshness": {
          "$ref": "#/$defs/freshness"
        },
        "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"
        },
        "repairCapability": {
          "$ref": "#/$defs/repairCapability"
        }
      },
      "additionalProperties": true
    },
    "repairCapability": {
      "type": "object",
      "required": [
        "id",
        "issueId",
        "title",
        "status",
        "fixKind",
        "risk",
        "canAutoFix",
        "canEditFiles",
        "requiresApproval",
        "requiresReview",
        "files",
        "refreshCommands",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "issueId": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "available",
            "manual",
            "blocked"
          ]
        },
        "fixKind": {
          "enum": [
            "package-json-script",
            "file-create",
            "file-append",
            "file-copy",
            "dependency-sync",
            "command",
            "manual"
          ]
        },
        "risk": {
          "enum": [
            "safe",
            "guarded",
            "invasive"
          ]
        },
        "canAutoFix": {
          "type": "boolean"
        },
        "canEditFiles": {
          "type": "boolean"
        },
        "requiresApproval": {
          "type": "boolean"
        },
        "requiresReview": {
          "type": "boolean"
        },
        "files": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "command": {
          "type": "string"
        },
        "operation": {
          "$ref": "#/$defs/repairOperation"
        },
        "verifyCommand": {
          "type": "string"
        },
        "refreshCommands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reason": {
          "type": "string"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    },
    "repairOperation": {
      "type": "object",
      "required": [
        "type",
        "path"
      ],
      "properties": {
        "type": {
          "enum": [
            "file-create",
            "file-append",
            "file-copy",
            "package-json-script",
            "json-edit",
            "env-key-add",
            "makefile-target"
          ]
        },
        "sourcePath": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "content": {
          "type": "string"
        },
        "overwrite": {
          "type": "boolean"
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ensureNewline": {
          "type": "boolean"
        },
        "scriptName": {
          "type": "string"
        },
        "scriptValue": {
          "type": "string"
        },
        "edits": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pointer",
              "value"
            ],
            "properties": {
              "pointer": {
                "type": "string"
              },
              "value": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "keys": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "value"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "comment": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "target": {
          "type": "string"
        },
        "command": {
          "type": "string"
        },
        "phony": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": true
}