All contracts

Workspace Intelligence / JSON Schema

Workspai Doctor Graph Diagnosis

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

Schema version
doctor-graph-diagnosis.v1
Contract path
contracts/workspace-intelligence/doctor-graph-diagnosis.v1.json
Publication
json-schema
Defined fields
55
Artifact bindings
0

Why this contract exists

Architecture role

Relates workspace structure and change so downstream reasoning remains traceable.

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.entityRef.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.entityRef.kindenumYesDefines the kind value at this contract boundary.enum: workspace, project, service, api, endpoint, schema, package, module, file, symbol, database, queue, container, deployment, pipeline, environment, document, decision, test-suite, owner
$defs.entityRef.labelstringYesDefines the label value at this contract boundary.minLength: 1
$defs.entityRef.projectIdstringNoDefines the projectid value at this contract boundary.
$defs.finding.affectedEntitiesarrayYesDefines the affectedentities value at this contract boundary.
$defs.finding.issueClassstringYesDefines the issueclass value at this contract boundary.minLength: 1
$defs.finding.issueIdstringYesDefines the issueid value at this contract boundary.minLength: 1
$defs.finding.proofPathsarrayYesDefines the proofpaths value at this contract boundary.
$defs.finding.reasonstringYesDefines the reason value at this contract boundary.minLength: 1
$defs.finding.rootEntitiesarrayYesDefines the rootentities value at this contract boundary.
$defs.finding.scopestringYesDefines the scope value at this contract boundary.const: "structural-impact-candidates"
$defs.finding.sourceArtifactsarrayYesDefines the sourceartifacts value at this contract boundary.
$defs.finding.statusenumYesDefines the status value at this contract boundary.enum: warn, fail
$defs.finding.subjectsarrayYesDefines the subjects value at this contract boundary.
$defs.finding.unknownsarrayYesDefines the unknowns value at this contract boundary.
$defs.finding.unresolvedSubjectsarrayYesDefines the unresolvedsubjects value at this contract boundary.
$defs.finding.verificationTargetsarrayYesDefines the verificationtargets value at this contract boundary.
$defs.hop.directionenumYesDefines the direction value at this contract boundary.enum: forward, reverse
$defs.hop.fromstringYesDefines the from value at this contract boundary.minLength: 1
$defs.hop.kindenumYesDefines the kind value at this contract boundary.enum: contains, defines, imports, depends-on, exposes, implements, calls, reads-from, writes-to, publishes, consumes, deploys, runs-on, routes-to, documents, decided-by, tests, owns, generated-by, configured-by, references
$defs.hop.proofIdsarrayYesDefines the proofids value at this contract boundary.
$defs.hop.relationIdstringYesDefines the relationid value at this contract boundary.minLength: 1
$defs.hop.tostringYesDefines the to value at this contract boundary.minLength: 1
$defs.proofPath.entityPatharrayYesDefines the entitypath value at this contract boundary.
$defs.proofPath.fromstringYesDefines the from value at this contract boundary.minLength: 1
$defs.proofPath.hopsarrayYesDefines the hops value at this contract boundary.
$defs.proofPath.proofIdsarrayYesDefines the proofids value at this contract boundary.
$defs.proofPath.tostringYesDefines the to value at this contract boundary.minLength: 1
claimBoundarystringYesDefines the claimboundary value at this contract boundary.minLength: 1
diagnosticsarrayYesDefines the diagnostics value at this contract boundary.
findingsarrayYesDefines the findings value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
graphobjectYesDefines the graph value at this contract boundary.additionalProperties: false
graph.artifactstringYesDefines the artifact value at this contract boundary.const: ".workspai/reports/workspace-knowledge-graph.json"
graph.entityCountintegerNoDefines the entitycount value at this contract boundary.minimum: 0
graph.proofCountintegerNoDefines the proofcount value at this contract boundary.minimum: 0
graph.relationCountintegerNoDefines the relationcount value at this contract boundary.minimum: 0
graph.schemaVersionstringNoDefines the schemaversion value at this contract boundary.
graph.sourceArtifactstringNoDefines the sourceartifact value at this contract boundary.
graph.sourceHashstringNoDefines the sourcehash value at this contract boundary.
projectobjectYesDefines the project value at this contract boundary.additionalProperties: false
project.entityIdstringNoDefines the entityid 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.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "doctor-graph-diagnosis.v1"
statusenumYesDefines the status value at this contract boundary.enum: available, graph-missing, model-missing, stale, project-unresolved, invalid
summaryobjectYesDefines the summary value at this contract boundary.additionalProperties: false
summary.affectedEntityCountintegerYesDefines the affectedentitycount value at this contract boundary.minimum: 0
summary.findingCountintegerYesDefines the findingcount value at this contract boundary.minimum: 0
summary.proofPathCountintegerYesDefines the proofpathcount value at this contract boundary.minimum: 0
summary.rootEntityCountintegerYesDefines the rootentitycount value at this contract boundary.minimum: 0
summary.subjectCountintegerYesDefines the subjectcount value at this contract boundary.minimum: 0
summary.unknownCountintegerYesDefines the unknowncount value at this contract boundary.minimum: 0
summary.unresolvedSubjectCountintegerYesDefines the unresolvedsubjectcount value at this contract boundary.minimum: 0
summary.verificationTargetCountintegerYesDefines the verificationtargetcount 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://workspai.dev/schemas/workspace-intelligence/doctor-graph-diagnosis.v1.json",
  "title": "Workspai Doctor Graph Diagnosis",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "status",
    "claimBoundary",
    "graph",
    "project",
    "summary",
    "findings",
    "diagnostics"
  ],
  "properties": {
    "schemaVersion": {
      "const": "doctor-graph-diagnosis.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "enum": [
        "available",
        "graph-missing",
        "model-missing",
        "stale",
        "project-unresolved",
        "invalid"
      ]
    },
    "claimBoundary": {
      "type": "string",
      "minLength": 1
    },
    "graph": {
      "type": "object",
      "required": [
        "artifact"
      ],
      "properties": {
        "artifact": {
          "const": ".workspai/reports/workspace-knowledge-graph.json"
        },
        "schemaVersion": {
          "type": "string"
        },
        "sourceArtifact": {
          "type": "string"
        },
        "sourceHash": {
          "type": "string"
        },
        "entityCount": {
          "type": "integer",
          "minimum": 0
        },
        "relationCount": {
          "type": "integer",
          "minimum": 0
        },
        "proofCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "project": {
      "type": "object",
      "required": [
        "name",
        "path"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string"
        },
        "entityId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "summary": {
      "type": "object",
      "required": [
        "findingCount",
        "rootEntityCount",
        "affectedEntityCount",
        "verificationTargetCount",
        "proofPathCount",
        "subjectCount",
        "unresolvedSubjectCount",
        "unknownCount"
      ],
      "properties": {
        "findingCount": {
          "type": "integer",
          "minimum": 0
        },
        "rootEntityCount": {
          "type": "integer",
          "minimum": 0
        },
        "affectedEntityCount": {
          "type": "integer",
          "minimum": 0
        },
        "verificationTargetCount": {
          "type": "integer",
          "minimum": 0
        },
        "proofPathCount": {
          "type": "integer",
          "minimum": 0
        },
        "subjectCount": {
          "type": "integer",
          "minimum": 0
        },
        "unresolvedSubjectCount": {
          "type": "integer",
          "minimum": 0
        },
        "unknownCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/finding"
      }
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "entityRef": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "label"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "enum": [
            "workspace",
            "project",
            "service",
            "api",
            "endpoint",
            "schema",
            "package",
            "module",
            "file",
            "symbol",
            "database",
            "queue",
            "container",
            "deployment",
            "pipeline",
            "environment",
            "document",
            "decision",
            "test-suite",
            "owner"
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "projectId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "hop": {
      "type": "object",
      "required": [
        "from",
        "to",
        "relationId",
        "kind",
        "direction",
        "proofIds"
      ],
      "properties": {
        "from": {
          "type": "string",
          "minLength": 1
        },
        "to": {
          "type": "string",
          "minLength": 1
        },
        "relationId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "enum": [
            "contains",
            "defines",
            "imports",
            "depends-on",
            "exposes",
            "implements",
            "calls",
            "reads-from",
            "writes-to",
            "publishes",
            "consumes",
            "deploys",
            "runs-on",
            "routes-to",
            "documents",
            "decided-by",
            "tests",
            "owns",
            "generated-by",
            "configured-by",
            "references"
          ]
        },
        "direction": {
          "enum": [
            "forward",
            "reverse"
          ]
        },
        "proofIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "proofPath": {
      "type": "object",
      "required": [
        "from",
        "to",
        "entityPath",
        "hops",
        "proofIds"
      ],
      "properties": {
        "from": {
          "type": "string",
          "minLength": 1
        },
        "to": {
          "type": "string",
          "minLength": 1
        },
        "entityPath": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "hops": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/hop"
          }
        },
        "proofIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "finding": {
      "type": "object",
      "required": [
        "issueId",
        "issueClass",
        "status",
        "reason",
        "scope",
        "subjects",
        "unresolvedSubjects",
        "rootEntities",
        "affectedEntities",
        "verificationTargets",
        "proofPaths",
        "sourceArtifacts",
        "unknowns"
      ],
      "properties": {
        "issueId": {
          "type": "string",
          "minLength": 1
        },
        "issueClass": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "warn",
            "fail"
          ]
        },
        "reason": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "const": "structural-impact-candidates"
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "unresolvedSubjects": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "rootEntities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/entityRef"
          }
        },
        "affectedEntities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/entityRef"
          }
        },
        "verificationTargets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/entityRef"
          }
        },
        "proofPaths": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/proofPath"
          }
        },
        "sourceArtifacts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unknowns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}