All contracts

Workspace Intelligence / JSON Schema

Workspai Workspace Dependency Graph

First-class, versioned dependency graph of inter-project relationships consumed by impact, verify, run --blast-radius, and risk weighting.

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

Why this contract exists

Architecture role

Relates workspace structure and change so downstream reasoning remains traceable.

Consumption boundary

  • Workspai CLI
  • Workspace Intelligence consumers
  • IDEs and agents

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
diagnosticsarrayNoDefines the diagnostics value at this contract boundary.
diagnostics[].codestringYesDefines the code value at this contract boundary.minLength: 1
diagnostics[].messagestringYesDefines the message value at this contract boundary.minLength: 1
diagnostics[].nodeIdsarrayNoDefines the nodeids value at this contract boundary.
diagnostics[].recommendationstringNoDefines the recommendation value at this contract boundary.
diagnostics[].severityenumYesDefines the severity value at this contract boundary.enum: info, warning, error
edgesarrayYesDefines the edges value at this contract boundary.
edges[].confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium, low
edges[].evidencearrayYesDefines the evidence value at this contract boundary.
edges[].evidence[].detailstringNoDefines the detail value at this contract boundary.
edges[].evidence[].filestringYesDefines the file value at this contract boundary.minLength: 1
edges[].fromstringYesDefines the from value at this contract boundary.minLength: 1
edges[].kindenumYesDefines the kind value at this contract boundary.enum: code-import, package-dep, event-pub-sub, service-dependsOn, shared-resource
edges[].sourceenumYesDefines the source value at this contract boundary.enum: inferred, contract, manual
edges[].tostringYesDefines the to value at this contract boundary.minLength: 1
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
nodesarrayYesDefines the nodes value at this contract boundary.
nodes[].frameworkstringNoDefines the framework value at this contract boundary.
nodes[].idstringYesDefines the id value at this contract boundary.minLength: 1
nodes[].kindstringNoDefines the kind value at this contract boundary.
nodes[].operationalProfileobjectNoDefines the operationalprofile value at this contract boundary.additionalProperties: true
nodes[].operationalProfile.centralityobjectYesDefines the centrality value at this contract boundary.additionalProperties: true
nodes[].operationalProfile.centrality.betweennessnumberYesDefines the betweenness value at this contract boundary.minimum: 0
nodes[].operationalProfile.centrality.fanInintegerYesDefines the fanin value at this contract boundary.minimum: 0
nodes[].operationalProfile.centrality.fanOutintegerYesDefines the fanout value at this contract boundary.minimum: 0
nodes[].operationalProfile.centrality.isHotspotbooleanYesDefines the ishotspot value at this contract boundary.
nodes[].operationalProfile.centrality.reachintegerYesDefines the reach value at this contract boundary.minimum: 0
nodes[].operationalProfile.reasonsarrayYesDefines the reasons value at this contract boundary.
nodes[].operationalProfile.scoreintegerYesDefines the score value at this contract boundary.minimum: 0 · maximum: 100
nodes[].operationalProfile.verificationPriorityenumYesDefines the verificationpriority value at this contract boundary.enum: normal, elevated, strict
nodes[].operationalProfile.weightenumYesDefines the weight value at this contract boundary.enum: low, medium, high, critical
nodes[].pathstringYesDefines the path value at this contract boundary.minLength: 1
nodes[].runtimestringNoDefines the runtime value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-dependency-graph.v1"
statsobjectYesDefines the stats value at this contract boundary.additionalProperties: true
stats.authoritativeEdgesintegerYesDefines the authoritativeedges value at this contract boundary.minimum: 0
stats.connectedNodeCountintegerYesDefines the connectednodecount value at this contract boundary.minimum: 0
stats.contractEdgesintegerYesDefines the contractedges value at this contract boundary.minimum: 0
stats.densitynumberYesDefines the density value at this contract boundary.minimum: 0
stats.edgeCountintegerYesDefines the edgecount value at this contract boundary.minimum: 0
stats.edgeCoverageRationumberYesDefines the edgecoverageratio value at this contract boundary.minimum: 0 · maximum: 1
stats.evidenceCoverageRationumberYesDefines the evidencecoverageratio value at this contract boundary.minimum: 0 · maximum: 1
stats.hasCyclebooleanYesDefines the hascycle value at this contract boundary.
stats.hotspotCountintegerYesDefines the hotspotcount value at this contract boundary.minimum: 0
stats.inferredEdgesintegerYesDefines the inferrededges value at this contract boundary.minimum: 0
stats.lowConfidenceEdgesintegerYesDefines the lowconfidenceedges value at this contract boundary.minimum: 0
stats.manualEdgesintegerYesDefines the manualedges value at this contract boundary.minimum: 0
stats.nodeCountintegerYesDefines the nodecount value at this contract boundary.minimum: 0
stats.orphanCountintegerYesDefines the orphancount 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://getrapidkit.com/schemas/workspace-dependency-graph.v1.json",
  "title": "Workspai Workspace Dependency Graph",
  "description": "First-class, versioned dependency graph of inter-project relationships consumed by impact, verify, run --blast-radius, and risk weighting.",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "nodes",
    "edges",
    "stats"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-dependency-graph.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "path"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "path": {
            "type": "string",
            "minLength": 1
          },
          "runtime": {
            "type": "string"
          },
          "framework": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "operationalProfile": {
            "type": "object",
            "required": [
              "weight",
              "score",
              "verificationPriority",
              "reasons",
              "centrality"
            ],
            "properties": {
              "weight": {
                "enum": [
                  "low",
                  "medium",
                  "high",
                  "critical"
                ]
              },
              "score": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "verificationPriority": {
                "enum": [
                  "normal",
                  "elevated",
                  "strict"
                ]
              },
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "centrality": {
                "type": "object",
                "required": [
                  "fanIn",
                  "fanOut",
                  "reach",
                  "betweenness",
                  "isHotspot"
                ],
                "properties": {
                  "fanIn": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "fanOut": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reach": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "betweenness": {
                    "type": "number",
                    "minimum": 0
                  },
                  "isHotspot": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "from",
          "to",
          "kind",
          "source",
          "confidence",
          "evidence"
        ],
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1
          },
          "to": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "enum": [
              "code-import",
              "package-dep",
              "event-pub-sub",
              "service-dependsOn",
              "shared-resource"
            ]
          },
          "source": {
            "enum": [
              "inferred",
              "contract",
              "manual"
            ]
          },
          "confidence": {
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "file"
              ],
              "properties": {
                "file": {
                  "type": "string",
                  "minLength": 1
                },
                "detail": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      }
    },
    "stats": {
      "type": "object",
      "required": [
        "nodeCount",
        "edgeCount",
        "inferredEdges",
        "contractEdges",
        "manualEdges",
        "authoritativeEdges",
        "lowConfidenceEdges",
        "orphanCount",
        "connectedNodeCount",
        "density",
        "edgeCoverageRatio",
        "evidenceCoverageRatio",
        "hotspotCount",
        "hasCycle"
      ],
      "properties": {
        "nodeCount": {
          "type": "integer",
          "minimum": 0
        },
        "edgeCount": {
          "type": "integer",
          "minimum": 0
        },
        "inferredEdges": {
          "type": "integer",
          "minimum": 0
        },
        "contractEdges": {
          "type": "integer",
          "minimum": 0
        },
        "manualEdges": {
          "type": "integer",
          "minimum": 0
        },
        "authoritativeEdges": {
          "type": "integer",
          "minimum": 0
        },
        "lowConfidenceEdges": {
          "type": "integer",
          "minimum": 0
        },
        "orphanCount": {
          "type": "integer",
          "minimum": 0
        },
        "connectedNodeCount": {
          "type": "integer",
          "minimum": 0
        },
        "density": {
          "type": "number",
          "minimum": 0
        },
        "edgeCoverageRatio": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "evidenceCoverageRatio": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "hotspotCount": {
          "type": "integer",
          "minimum": 0
        },
        "hasCycle": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "severity",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "error"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "recommendation": {
            "type": "string"
          },
          "nodeIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}