All contracts

Workspace Intelligence / JSON Schema

Workspai Evidence-backed Workspace Knowledge Graph

Portable, provider-neutral workspace entities, relations and proof paths derived from and structurally bound to the canonical Workspace Model. The embedded project topology is the model's graph projection.

Schema version
workspace-knowledge-graph.v1
Contract path
contracts/workspace-intelligence/workspace-knowledge-graph.v1.json
Publication
embedded-type, json-schema
Defined fields
130
Artifact bindings
1

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.

Produced artifacts

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

Artifact pathSchemaProducer
.workspai/reports/workspace-knowledge-graph.jsonworkspace-knowledge-graph.v1
workspai workspace model --json --write

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.bindingCoverage.boundCountintegerYesDefines the boundcount value at this contract boundary.minimum: 0
$defs.bindingCoverage.coverageRationumber | nullYesDefines the coverageratio value at this contract boundary.minimum: 0 · maximum: 1
$defs.bindingCoverage.eligibleCountintegerYesDefines the eligiblecount value at this contract boundary.minimum: 0
$defs.bindingCoverage.unknownCountintegerYesDefines the unknowncount value at this contract boundary.minimum: 0
diagnosticsarrayYesDefines the diagnostics value at this contract boundary.
diagnostics[].codestringYesDefines the code value at this contract boundary.minLength: 1
diagnostics[].entityIdsarrayNoDefines the entityids value at this contract boundary.
diagnostics[].messagestringYesDefines the message value at this contract boundary.minLength: 1
diagnostics[].recommendationstringNoDefines the recommendation value at this contract boundary.
diagnostics[].relationIdsarrayNoDefines the relationids value at this contract boundary.
diagnostics[].severityenumYesDefines the severity value at this contract boundary.enum: info, warning, error
entitiesarrayYesDefines the entities value at this contract boundary.
entities[].attributesobjectYesDefines the attributes value at this contract boundary.
entities[].idstringYesDefines the id value at this contract boundary.minLength: 1
entities[].identityobjectYesDefines the identity value at this contract boundary.additionalProperties: false
entities[].identity.aliasesarrayYesDefines the aliases value at this contract boundary.
entities[].identity.fingerprintstringYesDefines the fingerprint value at this contract boundary.pattern: ^[a-f0-9]{64}$
entities[].identity.keystringYesDefines the key value at this contract boundary.minLength: 1
entities[].identity.scopeenumYesDefines the scope value at this contract boundary.enum: workspace, project
entities[].kindenumYesDefines the kind value at this contract boundary.enum: workspace, project, service, api, endpoint, schema, protocol, language, package, runtime-unit, lifecycle-stage, module, file, symbol, database, queue, container, deployment, pipeline, environment, document, decision, test-suite, owner
entities[].labelstringYesDefines the label value at this contract boundary.minLength: 1
entities[].projectIdstringNoDefines the projectid value at this contract boundary.minLength: 1
entities[].proofIdsarrayYesDefines the proofids value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
projectTopologyreferenceYesDefines the projecttopology value at this contract boundary.ref: workspace-dependency-graph.v1.json
proofsarrayYesDefines the proofs value at this contract boundary.
proofs[].artifactstringYesDefines the artifact value at this contract boundary.minLength: 1
proofs[].columnintegerNoDefines the column value at this contract boundary.minimum: 1
proofs[].confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium, low
proofs[].contentHashstringNoDefines the contenthash value at this contract boundary.pattern: ^[a-f0-9]{64}$
proofs[].derivationenumYesDefines the derivation value at this contract boundary.enum: extracted, inferred, authored
proofs[].detailstringNoDefines the detail value at this contract boundary.
proofs[].freshnessenumYesDefines the freshness value at this contract boundary.enum: fresh, stale, unknown
proofs[].idstringYesDefines the id value at this contract boundary.minLength: 1
proofs[].lineintegerNoDefines the line value at this contract boundary.minimum: 1
proofs[].observedAtstringYesDefines the observedat value at this contract boundary.format: date-time
proofs[].pointerstringNoDefines the pointer value at this contract boundary.
proofs[].providerstringYesDefines the provider value at this contract boundary.minLength: 1
proofs[].trustenumYesDefines the trust value at this contract boundary.enum: authoritative, corroborated, observed, ambiguous
providersarrayYesDefines the providers value at this contract boundary.
providers[].diagnosticsarrayYesDefines the diagnostics value at this contract boundary.
providers[].discoveredEntitiesintegerYesDefines the discoveredentities value at this contract boundary.minimum: 0
providers[].discoveredRelationsintegerYesDefines the discoveredrelations value at this contract boundary.minimum: 0
providers[].idstringYesDefines the id value at this contract boundary.minLength: 1
providers[].inputCoveragearrayNoDefines the inputcoverage value at this contract boundary.
providers[].inputCoverage[].eligibleFilesintegerYesDefines the eligiblefiles value at this contract boundary.minimum: 0
providers[].inputCoverage[].fileBudgetintegerNoDefines the filebudget value at this contract boundary.minimum: 1
providers[].inputCoverage[].scopeenumYesDefines the scope value at this contract boundary.enum: workspace, project
providers[].inputCoverage[].scopeIdstringYesDefines the scopeid value at this contract boundary.minLength: 1
providers[].inputCoverage[].selectionStrategyenumYesDefines the selectionstrategy value at this contract boundary.enum: complete, component-language-round-robin-v1, derived
providers[].inputCoverage[].statusenumYesDefines the status value at this contract boundary.enum: complete, bounded, not-applicable
providers[].inputCoverage[].suppliedFilesintegerYesDefines the suppliedfiles value at this contract boundary.minimum: 0
providers[].inputCoverage[].tierenumYesDefines the tier value at this contract boundary.enum: complete-inventory, adaptive-semantic, adaptive-deep, derived
providers[].permissionenumYesDefines the permission value at this contract boundary.enum: filesystem-read, git-read, runtime-probe, network
providers[].proofCountintegerYesDefines the proofcount value at this contract boundary.minimum: 0
providers[].statusenumYesDefines the status value at this contract boundary.enum: passed, partial, skipped, failed
providers[].versionstringYesDefines the version value at this contract boundary.minLength: 1
qualityobjectYesDefines the quality value at this contract boundary.additionalProperties: false
quality.bindingCoverageobjectNoDefines the bindingcoverage value at this contract boundary.additionalProperties: false
quality.bindingCoverage.apiImplementationreferenceYesDefines the apiimplementation value at this contract boundary.ref: #/$defs/bindingCoverage
quality.bindingCoverage.apiRuntimeRegistrationreferenceYesDefines the apiruntimeregistration value at this contract boundary.ref: #/$defs/bindingCoverage
quality.bindingCoverage.projectDeploymentreferenceYesDefines the projectdeployment value at this contract boundary.ref: #/$defs/bindingCoverage
quality.bindingCoverage.projectOwnershipreferenceYesDefines the projectownership value at this contract boundary.ref: #/$defs/bindingCoverage
quality.bindingCoverage.projectTestsreferenceYesDefines the projecttests value at this contract boundary.ref: #/$defs/bindingCoverage
quality.completenessobjectNoDefines the completeness value at this contract boundary.additionalProperties: false
quality.completeness.inventoryobjectYesDefines the inventory value at this contract boundary.additionalProperties: false
quality.completeness.inventory.boundedScopesintegerYesDefines the boundedscopes value at this contract boundary.minimum: 0
quality.completeness.inventory.completeScopesintegerYesDefines the completescopes value at this contract boundary.minimum: 0
quality.completeness.inventory.eligibleFileCountExactbooleanYesDefines the eligiblefilecountexact value at this contract boundary.
quality.completeness.inventory.eligibleFilesintegerYesDefines the eligiblefiles value at this contract boundary.minimum: 0
quality.completeness.inventory.indexedFilesintegerYesDefines the indexedfiles value at this contract boundary.minimum: 0
quality.completeness.inventory.scopeCountintegerYesDefines the scopecount value at this contract boundary.minimum: 0
quality.completeness.providersobjectYesDefines the providers value at this contract boundary.additionalProperties: false
quality.completeness.providers.boundedintegerYesDefines the bounded value at this contract boundary.minimum: 0
quality.completeness.providers.completeintegerYesDefines the complete value at this contract boundary.minimum: 0
quality.completeness.providers.failedintegerYesDefines the failed value at this contract boundary.minimum: 0
quality.completeness.providers.notApplicableintegerYesDefines the notapplicable value at this contract boundary.minimum: 0
quality.completeness.statusenumYesDefines the status value at this contract boundary.enum: complete, bounded
quality.conflictCountintegerYesDefines the conflictcount value at this contract boundary.minimum: 0
quality.entityCountintegerYesDefines the entitycount value at this contract boundary.minimum: 0
quality.entityProofCoverageRationumberYesDefines the entityproofcoverageratio value at this contract boundary.minimum: 0 · maximum: 1
quality.portablebooleanYesDefines the portable value at this contract boundary.const: true
quality.proofCountintegerYesDefines the proofcount value at this contract boundary.minimum: 0
quality.providerSuccessRationumberYesDefines the providersuccessratio value at this contract boundary.minimum: 0 · maximum: 1
quality.relationCountintegerYesDefines the relationcount value at this contract boundary.minimum: 0
quality.relationProofCoverageRationumberYesDefines the relationproofcoverageratio value at this contract boundary.minimum: 0 · maximum: 1
quality.secretValuesEmittedbooleanYesDefines the secretvaluesemitted value at this contract boundary.const: false
quality.unknownCountintegerYesDefines the unknowncount value at this contract boundary.minimum: 0
relationsarrayYesDefines the relations value at this contract boundary.
relations[].confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium, low
relations[].derivationenumYesDefines the derivation value at this contract boundary.enum: extracted, inferred, authored
relations[].fromstringYesDefines the from value at this contract boundary.minLength: 1
relations[].idstringYesDefines the id value at this contract boundary.minLength: 1
relations[].kindenumYesDefines the kind value at this contract boundary.enum: contains, defines, imports, depends-on, exposes, implements, implements-protocol, uses-language, equivalent-to, calls, reads-from, writes-to, publishes, consumes, deploys, runs-on, routes-to, documents, decided-by, tests, owns, generated-by, generated-from, configured-by, references
relations[].proofIdsarrayYesDefines the proofids value at this contract boundary.minItems: 1
relations[].tostringYesDefines the to value at this contract boundary.minLength: 1
relations[].trustenumYesDefines the trust value at this contract boundary.enum: authoritative, corroborated, observed, ambiguous
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-knowledge-graph.v1"
sourceobjectYesDefines the source value at this contract boundary.additionalProperties: false
source.artifactstringYesCanonical model artifact whose stable structural projection is identified by source.hash.const: ".workspai/reports/workspace-model.json"
source.hashstringYesSHA-256 of the stable structural Workspace Model projection. Volatile timestamps, run correlation, live evidence and freshness fields are intentionally excluded.pattern: ^[a-f0-9]{64}$
source.hashAlgorithmstringYesDefines the hashalgorithm value at this contract boundary.const: "sha256"
source.inputsobjectNoDefines the inputs value at this contract boundary.additionalProperties: false
source.inputs.hashstringYesDefines the hash value at this contract boundary.pattern: ^[a-f0-9]{64}$
source.inputs.hashAlgorithmstringYesDefines the hashalgorithm value at this contract boundary.const: "sha256"
source.inputs.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-knowledge-graph-inputs.v1"
source.inputs.scopesarrayYesDefines the scopes value at this contract boundary.
source.inputs.scopes[].eligibleFileCountintegerNoDefines the eligiblefilecount value at this contract boundary.minimum: 0
source.inputs.scopes[].eligibleFileCountExactbooleanNoDefines the eligiblefilecountexact value at this contract boundary.
source.inputs.scopes[].fileCountintegerYesDefines the filecount value at this contract boundary.minimum: 0
source.inputs.scopes[].fileLimitintegerYesDefines the filelimit value at this contract boundary.minimum: 1
source.inputs.scopes[].hashstringYesDefines the hash value at this contract boundary.pattern: ^[a-f0-9]{64}$
source.inputs.scopes[].idstringYesDefines the id value at this contract boundary.minLength: 1
source.inputs.scopes[].inventoryModeenumNoDefines the inventorymode value at this contract boundary.enum: complete, emergency-bounded
source.inputs.scopes[].inventoryStrategyenumNoDefines the inventorystrategy value at this contract boundary.enum: git-index-worktree-v1, filesystem-bfs-v1
source.inputs.scopes[].kindenumYesDefines the kind value at this contract boundary.enum: workspace, project
source.inputs.scopes[].selectionobjectNoDefines the selection value at this contract boundary.additionalProperties: false
source.inputs.scopes[].selection.deepFileBudgetintegerYesDefines the deepfilebudget value at this contract boundary.minimum: 1
source.inputs.scopes[].selection.deepFileCountintegerYesDefines the deepfilecount value at this contract boundary.minimum: 0
source.inputs.scopes[].selection.semanticFileBudgetintegerYesDefines the semanticfilebudget value at this contract boundary.minimum: 1
source.inputs.scopes[].selection.semanticFileCountintegerYesDefines the semanticfilecount value at this contract boundary.minimum: 0
source.inputs.scopes[].selection.sourceExtractionFileBudgetintegerYesDefines the sourceextractionfilebudget value at this contract boundary.minimum: 1
source.inputs.scopes[].selection.strategystringYesDefines the strategy value at this contract boundary.const: "component-language-round-robin-v1"
source.inputs.scopes[].strategyenumYesDefines the strategy value at this contract boundary.enum: git-worktree-v2, content-merkle-v1
source.inputs.scopes[].truncatedbooleanYesDefines the truncated value at this contract boundary.
source.inputs.strategystringYesDefines the strategy value at this contract boundary.const: "hybrid-git-content-v2"
source.kindstringYesThe canonical Workspace Model is the sole source-of-truth authority for an integrated CLI knowledge graph.const: "workspace-model"
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: false
workspace.namestringYesDefines the name value at this contract boundary.minLength: 1
workspace.profilestringNoDefines the profile value at this contract boundary.

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/workspace-knowledge-graph.v1.json",
  "title": "Workspai Evidence-backed Workspace Knowledge Graph",
  "description": "Portable, provider-neutral workspace entities, relations and proof paths derived from and structurally bound to the canonical Workspace Model. The embedded project topology is the model's graph projection.",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "source",
    "workspace",
    "projectTopology",
    "entities",
    "relations",
    "proofs",
    "providers",
    "quality",
    "diagnostics"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-knowledge-graph.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "source": {
      "type": "object",
      "required": [
        "kind",
        "artifact",
        "hashAlgorithm",
        "hash"
      ],
      "properties": {
        "kind": {
          "const": "workspace-model",
          "description": "The canonical Workspace Model is the sole source-of-truth authority for an integrated CLI knowledge graph."
        },
        "artifact": {
          "const": ".workspai/reports/workspace-model.json",
          "description": "Canonical model artifact whose stable structural projection is identified by source.hash."
        },
        "hashAlgorithm": {
          "const": "sha256"
        },
        "hash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$",
          "description": "SHA-256 of the stable structural Workspace Model projection. Volatile timestamps, run correlation, live evidence and freshness fields are intentionally excluded."
        },
        "inputs": {
          "type": "object",
          "required": [
            "schemaVersion",
            "strategy",
            "hashAlgorithm",
            "hash",
            "scopes"
          ],
          "properties": {
            "schemaVersion": {
              "const": "workspace-knowledge-graph-inputs.v1"
            },
            "strategy": {
              "const": "hybrid-git-content-v2"
            },
            "hashAlgorithm": {
              "const": "sha256"
            },
            "hash": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "kind",
                  "id",
                  "strategy",
                  "hash",
                  "fileCount",
                  "fileLimit",
                  "truncated"
                ],
                "properties": {
                  "kind": {
                    "enum": [
                      "workspace",
                      "project"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "strategy": {
                    "enum": [
                      "git-worktree-v2",
                      "content-merkle-v1"
                    ]
                  },
                  "hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "fileCount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "fileLimit": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "truncated": {
                    "type": "boolean"
                  },
                  "eligibleFileCount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "eligibleFileCountExact": {
                    "type": "boolean"
                  },
                  "inventoryMode": {
                    "enum": [
                      "complete",
                      "emergency-bounded"
                    ]
                  },
                  "inventoryStrategy": {
                    "enum": [
                      "git-index-worktree-v1",
                      "filesystem-bfs-v1"
                    ]
                  },
                  "selection": {
                    "type": "object",
                    "required": [
                      "strategy",
                      "semanticFileCount",
                      "semanticFileBudget",
                      "deepFileCount",
                      "deepFileBudget",
                      "sourceExtractionFileBudget"
                    ],
                    "properties": {
                      "strategy": {
                        "const": "component-language-round-robin-v1"
                      },
                      "semanticFileCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "semanticFileBudget": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "deepFileCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "deepFileBudget": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "sourceExtractionFileBudget": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "workspace": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "profile": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "projectTopology": {
      "$ref": "workspace-dependency-graph.v1.json"
    },
    "entities": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "label",
          "identity",
          "attributes",
          "proofIds"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "enum": [
              "workspace",
              "project",
              "service",
              "api",
              "endpoint",
              "schema",
              "protocol",
              "language",
              "package",
              "runtime-unit",
              "lifecycle-stage",
              "module",
              "file",
              "symbol",
              "database",
              "queue",
              "container",
              "deployment",
              "pipeline",
              "environment",
              "document",
              "decision",
              "test-suite",
              "owner"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "projectId": {
            "type": "string",
            "minLength": 1
          },
          "identity": {
            "type": "object",
            "required": [
              "key",
              "scope",
              "aliases",
              "fingerprint"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "scope": {
                "enum": [
                  "workspace",
                  "project"
                ]
              },
              "aliases": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "fingerprint": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "additionalProperties": false
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null",
                "array"
              ],
              "items": {
                "type": [
                  "string",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            }
          },
          "proofIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          }
        },
        "additionalProperties": false
      }
    },
    "relations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "from",
          "to",
          "kind",
          "derivation",
          "trust",
          "confidence",
          "proofIds"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "from": {
            "type": "string",
            "minLength": 1
          },
          "to": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "enum": [
              "contains",
              "defines",
              "imports",
              "depends-on",
              "exposes",
              "implements",
              "implements-protocol",
              "uses-language",
              "equivalent-to",
              "calls",
              "reads-from",
              "writes-to",
              "publishes",
              "consumes",
              "deploys",
              "runs-on",
              "routes-to",
              "documents",
              "decided-by",
              "tests",
              "owns",
              "generated-by",
              "generated-from",
              "configured-by",
              "references"
            ]
          },
          "derivation": {
            "enum": [
              "extracted",
              "inferred",
              "authored"
            ]
          },
          "trust": {
            "enum": [
              "authoritative",
              "corroborated",
              "observed",
              "ambiguous"
            ]
          },
          "confidence": {
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "proofIds": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1,
            "uniqueItems": true
          }
        },
        "additionalProperties": false
      }
    },
    "proofs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "provider",
          "artifact",
          "observedAt",
          "derivation",
          "trust",
          "confidence",
          "freshness"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "provider": {
            "type": "string",
            "minLength": 1
          },
          "artifact": {
            "type": "string",
            "minLength": 1,
            "not": {
              "pattern": "^(?:/|[A-Za-z]:[\\\\/])"
            }
          },
          "pointer": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "minimum": 1
          },
          "column": {
            "type": "integer",
            "minimum": 1
          },
          "contentHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "derivation": {
            "enum": [
              "extracted",
              "inferred",
              "authored"
            ]
          },
          "trust": {
            "enum": [
              "authoritative",
              "corroborated",
              "observed",
              "ambiguous"
            ]
          },
          "confidence": {
            "enum": [
              "high",
              "medium",
              "low"
            ]
          },
          "freshness": {
            "enum": [
              "fresh",
              "stale",
              "unknown"
            ]
          },
          "detail": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "providers": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "version",
          "status",
          "permission",
          "discoveredEntities",
          "discoveredRelations",
          "proofCount",
          "diagnostics"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "enum": [
              "passed",
              "partial",
              "skipped",
              "failed"
            ]
          },
          "permission": {
            "enum": [
              "filesystem-read",
              "git-read",
              "runtime-probe",
              "network"
            ]
          },
          "discoveredEntities": {
            "type": "integer",
            "minimum": 0
          },
          "discoveredRelations": {
            "type": "integer",
            "minimum": 0
          },
          "proofCount": {
            "type": "integer",
            "minimum": 0
          },
          "diagnostics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "inputCoverage": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "scope",
                "scopeId",
                "tier",
                "status",
                "eligibleFiles",
                "suppliedFiles",
                "selectionStrategy"
              ],
              "properties": {
                "scope": {
                  "enum": [
                    "workspace",
                    "project"
                  ]
                },
                "scopeId": {
                  "type": "string",
                  "minLength": 1
                },
                "tier": {
                  "enum": [
                    "complete-inventory",
                    "adaptive-semantic",
                    "adaptive-deep",
                    "derived"
                  ]
                },
                "status": {
                  "enum": [
                    "complete",
                    "bounded",
                    "not-applicable"
                  ]
                },
                "eligibleFiles": {
                  "type": "integer",
                  "minimum": 0
                },
                "suppliedFiles": {
                  "type": "integer",
                  "minimum": 0
                },
                "fileBudget": {
                  "type": "integer",
                  "minimum": 1
                },
                "selectionStrategy": {
                  "enum": [
                    "complete",
                    "component-language-round-robin-v1",
                    "derived"
                  ]
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      }
    },
    "quality": {
      "type": "object",
      "required": [
        "entityCount",
        "relationCount",
        "proofCount",
        "entityProofCoverageRatio",
        "relationProofCoverageRatio",
        "providerSuccessRatio",
        "conflictCount",
        "unknownCount",
        "portable",
        "secretValuesEmitted"
      ],
      "properties": {
        "entityCount": {
          "type": "integer",
          "minimum": 0
        },
        "relationCount": {
          "type": "integer",
          "minimum": 0
        },
        "proofCount": {
          "type": "integer",
          "minimum": 0
        },
        "entityProofCoverageRatio": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "relationProofCoverageRatio": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "providerSuccessRatio": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "conflictCount": {
          "type": "integer",
          "minimum": 0
        },
        "unknownCount": {
          "type": "integer",
          "minimum": 0
        },
        "bindingCoverage": {
          "type": "object",
          "required": [
            "apiImplementation",
            "apiRuntimeRegistration",
            "projectTests",
            "projectDeployment",
            "projectOwnership"
          ],
          "properties": {
            "apiImplementation": {
              "$ref": "#/$defs/bindingCoverage"
            },
            "apiRuntimeRegistration": {
              "$ref": "#/$defs/bindingCoverage"
            },
            "projectTests": {
              "$ref": "#/$defs/bindingCoverage"
            },
            "projectDeployment": {
              "$ref": "#/$defs/bindingCoverage"
            },
            "projectOwnership": {
              "$ref": "#/$defs/bindingCoverage"
            }
          },
          "additionalProperties": false
        },
        "completeness": {
          "type": "object",
          "required": [
            "status",
            "inventory",
            "providers"
          ],
          "properties": {
            "status": {
              "enum": [
                "complete",
                "bounded"
              ]
            },
            "inventory": {
              "type": "object",
              "required": [
                "scopeCount",
                "completeScopes",
                "boundedScopes",
                "eligibleFiles",
                "indexedFiles",
                "eligibleFileCountExact"
              ],
              "properties": {
                "scopeCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "completeScopes": {
                  "type": "integer",
                  "minimum": 0
                },
                "boundedScopes": {
                  "type": "integer",
                  "minimum": 0
                },
                "eligibleFiles": {
                  "type": "integer",
                  "minimum": 0
                },
                "indexedFiles": {
                  "type": "integer",
                  "minimum": 0
                },
                "eligibleFileCountExact": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "providers": {
              "type": "object",
              "required": [
                "complete",
                "bounded",
                "notApplicable",
                "failed"
              ],
              "properties": {
                "complete": {
                  "type": "integer",
                  "minimum": 0
                },
                "bounded": {
                  "type": "integer",
                  "minimum": 0
                },
                "notApplicable": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "portable": {
          "const": true
        },
        "secretValuesEmitted": {
          "const": false
        }
      },
      "additionalProperties": false
    },
    "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
          },
          "entityIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "relationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recommendation": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "$defs": {
    "bindingCoverage": {
      "type": "object",
      "required": [
        "eligibleCount",
        "boundCount",
        "unknownCount",
        "coverageRatio"
      ],
      "properties": {
        "eligibleCount": {
          "type": "integer",
          "minimum": 0
        },
        "boundCount": {
          "type": "integer",
          "minimum": 0
        },
        "unknownCount": {
          "type": "integer",
          "minimum": 0
        },
        "coverageRatio": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}