All contracts

Workspace Intelligence / JSON Schema

Workspai Universal Doctor Diagnosis

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

Schema version
workspai.doctor-diagnosis.v1
Contract path
contracts/workspace-intelligence/doctor-diagnosis.v1.json
Publication
json-schema
Defined fields
82
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.causalGroup.causalKeystringYesDefines the causalkey value at this contract boundary.minLength: 1
$defs.causalGroup.findingIdsarrayYesDefines the findingids value at this contract boundary.minItems: 1
$defs.causalGroup.issueClassstringYesDefines the issueclass value at this contract boundary.minLength: 1
$defs.causalGroup.projectPathsarrayYesDefines the projectpaths value at this contract boundary.minItems: 1
$defs.causalGroup.repairablebooleanYesDefines the repairable value at this contract boundary.
$defs.causalGroup.statusenumYesDefines the status value at this contract boundary.enum: blocking, advisory, informational, unknown
$defs.finding.applicabilityenumYesDefines the applicability value at this contract boundary.enum: applicable, not-applicable, unknown
$defs.finding.causalKeystringYesDefines the causalkey value at this contract boundary.minLength: 1
$defs.finding.confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium, low
$defs.finding.confidenceScorenumberYesDefines the confidencescore value at this contract boundary.minimum: 0 · maximum: 1
$defs.finding.diagnosisStateenumYesDefines the diagnosisstate value at this contract boundary.enum: confirmed, candidate, unknown
$defs.finding.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.finding.issueClassstringYesDefines the issueclass value at this contract boundary.minLength: 1
$defs.finding.labelstringYesDefines the label value at this contract boundary.minLength: 1
$defs.finding.operationalImpactstringYesDefines the operationalimpact value at this contract boundary.minLength: 1
$defs.finding.probeIdstringYesDefines the probeid value at this contract boundary.minLength: 1
$defs.finding.projectNamestringYesDefines the projectname value at this contract boundary.minLength: 1
$defs.finding.projectPathstringYesDefines the projectpath value at this contract boundary.minLength: 1
$defs.finding.proofsarrayYesDefines the proofs value at this contract boundary.minItems: 1
$defs.finding.recommendationstringNoDefines the recommendation value at this contract boundary.minLength: 1
$defs.finding.repairreferenceYesDefines the repair value at this contract boundary.ref: #/$defs/repair
$defs.finding.severityenumYesDefines the severity value at this contract boundary.enum: info, warn, error
$defs.finding.statusenumYesDefines the status value at this contract boundary.enum: blocking, advisory, informational, unknown
$defs.finding.symptomstringYesDefines the symptom value at this contract boundary.minLength: 1
$defs.proof.claimstringYesDefines the claim value at this contract boundary.minLength: 1
$defs.proof.kindenumYesDefines the kind value at this contract boundary.enum: probe, file, dependency, runtime, command, graph, unknown
$defs.proof.refstringYesDefines the ref value at this contract boundary.minLength: 1
$defs.proof.roleenumYesDefines the role value at this contract boundary.enum: observation, repair-target, subject, verification, impact
$defs.repair.capabilityIdstringNoDefines the capabilityid value at this contract boundary.minLength: 1
$defs.repair.dispositionenumYesDefines the disposition value at this contract boundary.enum: automatic, approval-required, manual, unavailable, not-needed
$defs.repair.operationTypestringNoDefines the operationtype value at this contract boundary.minLength: 1
$defs.repair.requiresFreshEvidencebooleanYesDefines the requiresfreshevidence value at this contract boundary.
$defs.repair.verifyCommandstringNoDefines the verifycommand value at this contract boundary.minLength: 1
capabilityobjectYesDefines the capability value at this contract boundary.additionalProperties: false
capability.adapterIdstringYesDefines the adapterid value at this contract boundary.minLength: 1
capability.confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium, low
capability.limitationsarrayYesDefines the limitations value at this contract boundary.
capability.nativeDomainsreferenceYesDefines the nativedomains value at this contract boundary.ref: #/$defs/domainList
capability.observableDomainsreferenceYesDefines the observabledomains value at this contract boundary.ref: #/$defs/domainList
capability.portableDomainsreferenceYesDefines the portabledomains value at this contract boundary.ref: #/$defs/domainList
capability.registryVersionstringYesDefines the registryversion value at this contract boundary.minLength: 1
capability.runtimeFamilystringYesDefines the runtimefamily value at this contract boundary.minLength: 1
capability.tierenumYesDefines the tier value at this contract boundary.enum: first-class, extended, fallback
capability.unsupportedDomainsreferenceYesDefines the unsupporteddomains value at this contract boundary.ref: #/$defs/domainList
causalGroupsarrayYesDefines the causalgroups value at this contract boundary.
contradictionsarrayYesDefines the contradictions value at this contract boundary.
contradictions[].probeIdstringYesDefines the probeid value at this contract boundary.minLength: 1
contradictions[].reasonstringYesDefines the reason value at this contract boundary.minLength: 1
contradictions[].statusesarrayYesDefines the statuses value at this contract boundary.minItems: 2
coverageobjectYesDefines the coverage value at this contract boundary.additionalProperties: false
coverage.advisoryFindingsintegerYesDefines the advisoryfindings value at this contract boundary.minimum: 0
coverage.blockingFindingsintegerYesDefines the blockingfindings value at this contract boundary.minimum: 0
coverage.contradictionCountintegerYesDefines the contradictioncount value at this contract boundary.minimum: 0
coverage.diagnosisCompletenessnumberYesDefines the diagnosiscompleteness value at this contract boundary.minimum: 0 · maximum: 100
coverage.evaluatedObservationsintegerYesDefines the evaluatedobservations value at this contract boundary.minimum: 0
coverage.manualFindingsintegerYesDefines the manualfindings value at this contract boundary.minimum: 0
coverage.passingObservationsintegerYesDefines the passingobservations value at this contract boundary.minimum: 0
coverage.repairableFindingsintegerYesDefines the repairablefindings value at this contract boundary.minimum: 0
coverage.totalObservationsintegerYesDefines the totalobservations value at this contract boundary.minimum: 0
coverage.unknownFindingsintegerYesDefines the unknownfindings value at this contract boundary.minimum: 0
coverage.unsupportedFindingsintegerYesDefines the unsupportedfindings value at this contract boundary.minimum: 0
domainsarrayYesDefines the domains value at this contract boundary.minItems: 6 · maxItems: 6
domains[].advisoryFindingsintegerYesDefines the advisoryfindings value at this contract boundary.minimum: 0
domains[].blockingFindingsintegerYesDefines the blockingfindings value at this contract boundary.minimum: 0
domains[].idenumYesDefines the id value at this contract boundary.enum: runtime, dependency, security, configuration, test, quality
domains[].observationCountintegerYesDefines the observationcount value at this contract boundary.minimum: 0
domains[].reasonstringYesDefines the reason value at this contract boundary.minLength: 1
domains[].statusenumYesDefines the status value at this contract boundary.enum: clean, findings, not-applicable, not-run, stale
engineVersionstringYesDefines the engineversion value at this contract boundary.const: "universal-diagnosis-v1"
findingsarrayYesDefines the findings value at this contract boundary.
projectobjectYesDefines the project value at this contract boundary.additionalProperties: false
project.frameworkstringYesDefines the framework value at this contract boundary.minLength: 1
project.namestringYesDefines the name value at this contract boundary.minLength: 1
project.pathstringYesDefines the path value at this contract boundary.minLength: 1
project.projectKindstringYesDefines the projectkind value at this contract boundary.minLength: 1
project.runtimeFamiliesarrayYesDefines the runtimefamilies value at this contract boundary.minItems: 1
project.runtimeFamilystringYesDefines the runtimefamily value at this contract boundary.minLength: 1
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai.doctor-diagnosis.v1"
unknownsarrayYesDefines the unknowns value at this contract boundary.
unknowns[].idstringYesDefines the id value at this contract boundary.minLength: 1
unknowns[].probeIdstringNoDefines the probeid value at this contract boundary.minLength: 1
unknowns[].reasonstringYesDefines the reason 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/schemas/workspace-intelligence/doctor-diagnosis.v1.json",
  "title": "Workspai Universal Doctor Diagnosis",
  "type": "object",
  "required": [
    "schemaVersion",
    "engineVersion",
    "project",
    "capability",
    "domains",
    "coverage",
    "findings",
    "causalGroups",
    "unknowns",
    "contradictions"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspai.doctor-diagnosis.v1"
    },
    "engineVersion": {
      "const": "universal-diagnosis-v1"
    },
    "project": {
      "type": "object",
      "required": [
        "name",
        "path",
        "runtimeFamily",
        "runtimeFamilies",
        "framework",
        "projectKind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "runtimeFamily": {
          "type": "string",
          "minLength": 1
        },
        "runtimeFamilies": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "framework": {
          "type": "string",
          "minLength": 1
        },
        "projectKind": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "capability": {
      "type": "object",
      "required": [
        "registryVersion",
        "adapterId",
        "runtimeFamily",
        "tier",
        "confidence",
        "nativeDomains",
        "portableDomains",
        "observableDomains",
        "unsupportedDomains",
        "limitations"
      ],
      "properties": {
        "registryVersion": {
          "type": "string",
          "minLength": 1
        },
        "adapterId": {
          "type": "string",
          "minLength": 1
        },
        "runtimeFamily": {
          "type": "string",
          "minLength": 1
        },
        "tier": {
          "enum": [
            "first-class",
            "extended",
            "fallback"
          ]
        },
        "confidence": {
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "nativeDomains": {
          "$ref": "#/$defs/domainList"
        },
        "portableDomains": {
          "$ref": "#/$defs/domainList"
        },
        "observableDomains": {
          "$ref": "#/$defs/domainList"
        },
        "unsupportedDomains": {
          "$ref": "#/$defs/domainList"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "domains": {
      "type": "array",
      "minItems": 6,
      "maxItems": 6,
      "items": {
        "type": "object",
        "required": [
          "id",
          "status",
          "observationCount",
          "blockingFindings",
          "advisoryFindings",
          "reason"
        ],
        "properties": {
          "id": {
            "enum": [
              "runtime",
              "dependency",
              "security",
              "configuration",
              "test",
              "quality"
            ]
          },
          "status": {
            "enum": [
              "clean",
              "findings",
              "not-applicable",
              "not-run",
              "stale"
            ]
          },
          "observationCount": {
            "type": "integer",
            "minimum": 0
          },
          "blockingFindings": {
            "type": "integer",
            "minimum": 0
          },
          "advisoryFindings": {
            "type": "integer",
            "minimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    },
    "coverage": {
      "type": "object",
      "required": [
        "totalObservations",
        "evaluatedObservations",
        "passingObservations",
        "blockingFindings",
        "advisoryFindings",
        "unknownFindings",
        "repairableFindings",
        "manualFindings",
        "unsupportedFindings",
        "contradictionCount",
        "diagnosisCompleteness"
      ],
      "properties": {
        "totalObservations": {
          "type": "integer",
          "minimum": 0
        },
        "evaluatedObservations": {
          "type": "integer",
          "minimum": 0
        },
        "passingObservations": {
          "type": "integer",
          "minimum": 0
        },
        "blockingFindings": {
          "type": "integer",
          "minimum": 0
        },
        "advisoryFindings": {
          "type": "integer",
          "minimum": 0
        },
        "unknownFindings": {
          "type": "integer",
          "minimum": 0
        },
        "repairableFindings": {
          "type": "integer",
          "minimum": 0
        },
        "manualFindings": {
          "type": "integer",
          "minimum": 0
        },
        "unsupportedFindings": {
          "type": "integer",
          "minimum": 0
        },
        "contradictionCount": {
          "type": "integer",
          "minimum": 0
        },
        "diagnosisCompleteness": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        }
      },
      "additionalProperties": false
    },
    "findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/finding"
      }
    },
    "causalGroups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/causalGroup"
      }
    },
    "unknowns": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "reason"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "reason": {
            "type": "string",
            "minLength": 1
          },
          "probeId": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    },
    "contradictions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "probeId",
          "statuses",
          "reason"
        ],
        "properties": {
          "probeId": {
            "type": "string",
            "minLength": 1
          },
          "statuses": {
            "type": "array",
            "items": {
              "enum": [
                "pass",
                "warn",
                "fail"
              ]
            },
            "minItems": 2,
            "uniqueItems": true
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    }
  },
  "$defs": {
    "domainList": {
      "type": "array",
      "items": {
        "enum": [
          "runtime",
          "dependency",
          "security",
          "configuration",
          "test",
          "quality"
        ]
      },
      "uniqueItems": true
    },
    "proof": {
      "type": "object",
      "required": [
        "kind",
        "role",
        "ref",
        "claim"
      ],
      "properties": {
        "kind": {
          "enum": [
            "probe",
            "file",
            "dependency",
            "runtime",
            "command",
            "graph",
            "unknown"
          ]
        },
        "role": {
          "enum": [
            "observation",
            "repair-target",
            "subject",
            "verification",
            "impact"
          ]
        },
        "ref": {
          "type": "string",
          "minLength": 1
        },
        "claim": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "repair": {
      "type": "object",
      "required": [
        "disposition",
        "requiresFreshEvidence"
      ],
      "properties": {
        "disposition": {
          "enum": [
            "automatic",
            "approval-required",
            "manual",
            "unavailable",
            "not-needed"
          ]
        },
        "capabilityId": {
          "type": "string",
          "minLength": 1
        },
        "operationType": {
          "type": "string",
          "minLength": 1
        },
        "verifyCommand": {
          "type": "string",
          "minLength": 1
        },
        "requiresFreshEvidence": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "finding": {
      "type": "object",
      "required": [
        "id",
        "causalKey",
        "projectName",
        "projectPath",
        "probeId",
        "label",
        "status",
        "severity",
        "issueClass",
        "operationalImpact",
        "applicability",
        "confidence",
        "confidenceScore",
        "diagnosisState",
        "symptom",
        "proofs",
        "repair"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "causalKey": {
          "type": "string",
          "minLength": 1
        },
        "projectName": {
          "type": "string",
          "minLength": 1
        },
        "projectPath": {
          "type": "string",
          "minLength": 1
        },
        "probeId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "blocking",
            "advisory",
            "informational",
            "unknown"
          ]
        },
        "severity": {
          "enum": [
            "info",
            "warn",
            "error"
          ]
        },
        "issueClass": {
          "type": "string",
          "minLength": 1
        },
        "operationalImpact": {
          "type": "string",
          "minLength": 1
        },
        "applicability": {
          "enum": [
            "applicable",
            "not-applicable",
            "unknown"
          ]
        },
        "confidence": {
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "confidenceScore": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "diagnosisState": {
          "enum": [
            "confirmed",
            "candidate",
            "unknown"
          ]
        },
        "symptom": {
          "type": "string",
          "minLength": 1
        },
        "recommendation": {
          "type": "string",
          "minLength": 1
        },
        "proofs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/proof"
          },
          "minItems": 1
        },
        "repair": {
          "$ref": "#/$defs/repair"
        }
      },
      "additionalProperties": false
    },
    "causalGroup": {
      "type": "object",
      "required": [
        "causalKey",
        "issueClass",
        "status",
        "findingIds",
        "projectPaths",
        "repairable"
      ],
      "properties": {
        "causalKey": {
          "type": "string",
          "minLength": 1
        },
        "issueClass": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "blocking",
            "advisory",
            "informational",
            "unknown"
          ]
        },
        "findingIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "repairable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}