All contracts

Workspace Intelligence / JSON Schema

Workspai Project Context for Agents

Portable, bounded project lens derived from the canonical Workspace Model and evidence-backed Knowledge Graph.

Schema version
project-context-agent.v1
Contract path
contracts/workspace-intelligence/project-context-agent.v1.json
Publication
json-schema
Defined fields
171
Artifact bindings
1

Why this contract exists

Architecture role

Projects workspace intelligence into stable grounding surfaces for agents and integrations.

Consumption boundary

  • Workspai CLI
  • AI agents
  • IDEs and MCP clients

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/project-context-agent.jsonproject-context-agent.v1
workspai adopt
workspai import
workspai workspace sync
workspai workspace agent-sync --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.blocker.codestringNoDefines the code value at this contract boundary.
$defs.blocker.messagestringYesDefines the message value at this contract boundary.
$defs.blocker.severityenumYesDefines the severity value at this contract boundary.enum: warning, error
$defs.blocker.sourcestringYesDefines the source value at this contract boundary.
$defs.entity.attributesobjectYesDefines the attributes value at this contract boundary.additionalProperties: true
$defs.entity.idstringYesDefines the id value at this contract boundary.
$defs.entity.kindstringYesDefines the kind value at this contract boundary.
$defs.entity.labelstringYesDefines the label value at this contract boundary.
$defs.entity.proofIdsarrayYesDefines the proofids value at this contract boundary.
$defs.governanceControl.evidencearrayYesDefines the evidence value at this contract boundary.
$defs.governanceControl.providerstring | nullYesDefines the provider value at this contract boundary.
$defs.governanceControl.referencestring | nullYesDefines the reference value at this contract boundary.
$defs.governanceControl.statusenumYesDefines the status value at this contract boundary.enum: repository, external-declared, external-observed, unknown
$defs.port.attributestringYesDefines the attribute value at this contract boundary.
$defs.port.entityIdstringYesDefines the entityid value at this contract boundary.
$defs.port.labelstringYesDefines the label value at this contract boundary.
$defs.projectGovernance.cireferenceYesDefines the ci value at this contract boundary.ref: #/$defs/governanceControl
$defs.projectGovernance.ownershipreferenceYesDefines the ownership value at this contract boundary.ref: #/$defs/governanceControl
$defs.projectGovernance.releasereferenceYesDefines the release value at this contract boundary.ref: #/$defs/governanceControl
$defs.projectGovernance.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai.project-governance.v1"
$defs.proof.artifactreferenceYesDefines the artifact value at this contract boundary.ref: #/$defs/portableString
$defs.proof.confidencestringYesDefines the confidence value at this contract boundary.
$defs.proof.derivationstringYesDefines the derivation value at this contract boundary.
$defs.proof.freshnessstringYesDefines the freshness value at this contract boundary.
$defs.proof.idstringYesDefines the id value at this contract boundary.
$defs.proof.lineintegerNoDefines the line value at this contract boundary.minimum: 1
$defs.proof.pointerstringNoDefines the pointer value at this contract boundary.
$defs.proof.providerstringYesDefines the provider value at this contract boundary.
$defs.proof.truststringYesDefines the trust value at this contract boundary.
$defs.relation.confidencestringYesDefines the confidence value at this contract boundary.
$defs.relation.derivationstringYesDefines the derivation value at this contract boundary.
$defs.relation.fromstringYesDefines the from value at this contract boundary.
$defs.relation.idstringYesDefines the id value at this contract boundary.
$defs.relation.kindstringYesDefines the kind value at this contract boundary.
$defs.relation.proofIdsarrayYesDefines the proofids value at this contract boundary.
$defs.relation.tostringYesDefines the to value at this contract boundary.
$defs.relation.truststringYesDefines the trust value at this contract boundary.
$defs.topologyRelation.confidencestringYesDefines the confidence value at this contract boundary.minLength: 1
$defs.topologyRelation.evidencearrayYesDefines the evidence value at this contract boundary.
$defs.topologyRelation.kindstringYesDefines the kind value at this contract boundary.minLength: 1
$defs.topologyRelation.projectstringYesDefines the project value at this contract boundary.minLength: 1
$defs.topologyRelation.sourcestringYesDefines the source value at this contract boundary.minLength: 1
agentRoutingobjectYesMachine-readable mandatory routing policy that prevents agents from bypassing canonical workspace evidence.additionalProperties: false
agentRouting.degradedModeobjectYesDefines the degradedmode value at this contract boundary.additionalProperties: false
agentRouting.degradedMode.allowCompleteArchitectureClaimsbooleanYesDefines the allowcompletearchitectureclaims value at this contract boundary.const: false
agentRouting.degradedMode.requireDisclosurebooleanYesDefines the requiredisclosure value at this contract boundary.const: true
agentRouting.enforcementstringYesDefines the enforcement value at this contract boundary.const: "required"
agentRouting.mandatoryPreflightobjectYesDefines the mandatorypreflight value at this contract boundary.additionalProperties: false
agentRouting.mandatoryPreflight.commandstringYesDefines the command value at this contract boundary.const: "workspai agent bootstrap --for-agent generic --strict --json"
agentRouting.mandatoryPreflight.successConditionstringYesDefines the successcondition value at this contract boundary.const: "ready"
agentRouting.requiredReadOrderarrayYesDefines the requiredreadorder value at this contract boundary.minItems: 4 · maxItems: 10
agentRouting.workspaceEvidenceRequiredForarrayYesDefines the workspaceevidencerequiredfor value at this contract boundary.minItems: 1
agentRouting.workspaceLocatorobjectYesDefines the workspacelocator value at this contract boundary.additionalProperties: false
agentRouting.workspaceLocator.commandstringYesDefines the command value at this contract boundary.const: "workspai project workspace status --json"
agentRouting.workspaceLocator.disclosurestringYesDefines the disclosure value at this contract boundary.const: "forbidden"
agentRouting.workspaceLocator.outputClassificationstringYesDefines the outputclassification value at this contract boundary.const: "machine-local"
agentRouting.workspaceLocator.persistencestringYesDefines the persistence value at this contract boundary.const: "forbidden"
agentRouting.workspaceLocator.portableUriSchemestringYesDefines the portableurischeme value at this contract boundary.const: "workspace:"
agentRouting.workspaceLocator.successConditionstringYesDefines the successcondition value at this contract boundary.const: "resolved"
blockersarrayYesDefines the blockers value at this contract boundary.maxItems: 32
commandsobjectYesDefines the commands value at this contract boundary.additionalProperties: false
commands.doctorstringYesDefines the doctor value at this contract boundary.minLength: 1
commands.graphSearchstringYesDefines the graphsearch value at this contract boundary.minLength: 1
commands.refreshstringYesDefines the refresh value at this contract boundary.minLength: 1
commands.verifystringYesDefines the verify value at this contract boundary.minLength: 1
commands.workspaceStatusstringYesDefines the workspacestatus value at this contract boundary.minLength: 1
evidenceobjectYesDefines the evidence value at this contract boundary.additionalProperties: false
evidence.projectProofArtifactsarrayYesDefines the projectproofartifacts value at this contract boundary.maxItems: 24
evidence.proofsarrayYesDefines the proofs value at this contract boundary.maxItems: 16
evidence.readOrderarrayYesDefines the readorder value at this contract boundary.maxItems: 12
evidence.relationsarrayYesDefines the relations value at this contract boundary.maxItems: 16
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
integrityobjectYesDefines the integrity value at this contract boundary.additionalProperties: false
integrity.absolutePathsEmittedbooleanYesDefines the absolutepathsemitted value at this contract boundary.const: false
integrity.algorithmstringYesDefines the algorithm value at this contract boundary.const: "sha256"
integrity.modelHashstringNoDefines the modelhash value at this contract boundary.pattern: ^[a-f0-9]{64}$
integrity.payloadHashstringYesDefines the payloadhash value at this contract boundary.pattern: ^[a-f0-9]{64}$
integrity.portablebooleanYesDefines the portable value at this contract boundary.const: true
intelligenceobjectYesDefines the intelligence value at this contract boundary.additionalProperties: false
intelligence.diagnosticsarrayYesDefines the diagnostics value at this contract boundary.maxItems: 16
intelligence.diagnostics[].codestringYesDefines the code value at this contract boundary.
intelligence.diagnostics[].messagestringYesDefines the message value at this contract boundary.
intelligence.diagnostics[].recommendationstringNoDefines the recommendation value at this contract boundary.
intelligence.diagnostics[].severitystringYesDefines the severity value at this contract boundary.
intelligence.entitiesByKindobjectYesDefines the entitiesbykind value at this contract boundary.
intelligence.entityCountintegerYesDefines the entitycount value at this contract boundary.minimum: 0
intelligence.freshnessobjectYesDefines the freshness value at this contract boundary.additionalProperties: false
intelligence.freshness.graphenumYesDefines the graph value at this contract boundary.enum: fresh, stale, unknown, missing
intelligence.freshness.graphMatchesModelbooleanYesDefines the graphmatchesmodel value at this contract boundary.
intelligence.freshness.modelenumYesDefines the model value at this contract boundary.enum: fresh, stale, unknown, missing
intelligence.graphGeneratedAtstringNoDefines the graphgeneratedat value at this contract boundary.format: date-time
intelligence.graphModelHashstringNoDefines the graphmodelhash value at this contract boundary.pattern: ^[a-f0-9]{64}$
intelligence.languagesobjectYesDefines the languages value at this contract boundary.
intelligence.modelGeneratedAtstringNoDefines the modelgeneratedat value at this contract boundary.format: date-time
intelligence.projectionobjectYesObservable bounds for the representative entity projection. Counts remain exhaustive; omitted entities are available through bounded graph search.additionalProperties: false
intelligence.projection.byteBudgetintegerYesDefines the bytebudget value at this contract boundary.minimum: 1
intelligence.projection.continuationCommandstringYesDefines the continuationcommand value at this contract boundary.minLength: 1
intelligence.projection.eligibleCountintegerYesDefines the eligiblecount value at this contract boundary.minimum: 0
intelligence.projection.maxEntitiesintegerYesDefines the maxentities value at this contract boundary.minimum: 1
intelligence.projection.modestringYesDefines the mode value at this contract boundary.const: "stratified-byte-bounded"
intelligence.projection.omittedByKindobjectYesDefines the omittedbykind value at this contract boundary.
intelligence.projection.omittedCountintegerYesDefines the omittedcount value at this contract boundary.minimum: 0
intelligence.projection.selectedByKindobjectYesDefines the selectedbykind value at this contract boundary.
intelligence.projection.selectedBytesintegerYesDefines the selectedbytes value at this contract boundary.minimum: 0
intelligence.projection.selectedCountintegerYesDefines the selectedcount value at this contract boundary.minimum: 0
intelligence.proofCountintegerYesDefines the proofcount value at this contract boundary.minimum: 0
intelligence.relatedProjectsarrayYesDefines the relatedprojects value at this contract boundary.
intelligence.relationCountintegerYesDefines the relationcount value at this contract boundary.minimum: 0
intelligence.relationsByKindobjectYesDefines the relationsbykind value at this contract boundary.
intelligence.semanticobjectYesDefines the semantic value at this contract boundary.additionalProperties: false
intelligence.semantic.equivalenceBindingsintegerYesDefines the equivalencebindings value at this contract boundary.minimum: 0
intelligence.semantic.generationBindingsintegerYesDefines the generationbindings value at this contract boundary.minimum: 0
intelligence.semantic.lifecycleStageCountintegerYesDefines the lifecyclestagecount value at this contract boundary.minimum: 0
intelligence.semantic.protocolConceptCountintegerYesDefines the protocolconceptcount value at this contract boundary.minimum: 0
intelligence.semantic.protocolImplementationBindingsintegerYesDefines the protocolimplementationbindings value at this contract boundary.minimum: 0
intelligence.semantic.runtimeCoveragearrayYesDefines the runtimecoverage value at this contract boundary.
intelligence.semantic.runtimeUnitCountintegerYesDefines the runtimeunitcount value at this contract boundary.minimum: 0
intelligence.surfacesobjectYesDefines the surfaces value at this contract boundary.additionalProperties: false
intelligence.surfaces.apisreferenceYesDefines the apis value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.dataStoresreferenceYesDefines the datastores value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.decisionsreferenceYesDefines the decisions value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.deploymentsreferenceYesDefines the deployments value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.endpointsreferenceYesDefines the endpoints value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.lifecycleStagesreferenceYesDefines the lifecyclestages value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.ownersreferenceYesDefines the owners value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.packagesreferenceYesDefines the packages value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.pipelinesreferenceYesDefines the pipelines value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.portsarrayYesDefines the ports value at this contract boundary.maxItems: 8
intelligence.surfaces.protocolsreferenceYesDefines the protocols value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.runtimeUnitsreferenceYesDefines the runtimeunits value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.servicesreferenceYesDefines the services value at this contract boundary.ref: #/$defs/entityList
intelligence.surfaces.testsreferenceYesDefines the tests value at this contract boundary.ref: #/$defs/entityList
intelligence.topologyobjectYesDefines the topology value at this contract boundary.additionalProperties: false
intelligence.topology.dependenciesarrayYesDefines the dependencies value at this contract boundary.maxItems: 16
intelligence.topology.dependentsarrayYesDefines the dependents value at this contract boundary.maxItems: 16
intelligence.topology.statusenumYesDefines the status value at this contract boundary.enum: proven, unproven, unavailable
projectobjectYesDefines the project value at this contract boundary.additionalProperties: false
project.commandsobjectYesDefines the commands value at this contract boundary.additionalProperties: false
project.commands.fleetStagesarrayYesDefines the fleetstages value at this contract boundary.
project.commands.supportedarrayYesDefines the supported value at this contract boundary.
project.commands.unsupportedarrayYesDefines the unsupported value at this contract boundary.
project.frameworkstringNoDefines the framework value at this contract boundary.
project.governancereferenceNoDefines the governance value at this contract boundary.ref: #/$defs/projectGovernance
project.importantFilesarrayYesDefines the importantfiles value at this contract boundary.
project.kindstringNoDefines the kind value at this contract boundary.
project.kitstringNoDefines the kit value at this contract boundary.
project.namestringYesDefines the name value at this contract boundary.minLength: 1
project.relativePathstringYesDefines the relativepath value at this contract boundary.minLength: 1
project.runtimestringNoDefines the runtime value at this contract boundary.
project.runtimeCandidatesarrayNoDefines the runtimecandidates value at this contract boundary.
project.supportTierstringNoDefines the supporttier value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "project-context-agent.v1"
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: false
workspace.accessobjectYesDefines the access value at this contract boundary.additionalProperties: false
workspace.access.canonicalEvidenceAvailableAtGenerationbooleanYesDefines the canonicalevidenceavailableatgeneration value at this contract boundary.
workspace.access.identityIsFilesystemPathbooleanYesDefines the identityisfilesystempath value at this contract boundary.const: false
workspace.access.localBindingstringYesDefines the localbinding value at this contract boundary.const: ".workspai/workspace-link.local.json"
workspace.access.portableUriSchemestringYesDefines the portableurischeme value at this contract boundary.const: "workspace:"
workspace.access.resolvedPathPolicystringYesDefines the resolvedpathpolicy value at this contract boundary.const: "runtime-private-never-persist"
workspace.access.resolverCommandstringYesDefines the resolvercommand value at this contract boundary.const: "workspai project workspace status --json"
workspace.boundedGraphSearchstringNoDefines the boundedgraphsearch value at this contract boundary.minLength: 1
workspace.contextstringNoDefines the context value at this contract boundary.const: "workspace:.workspai/reports/workspace-context-agent.json"
workspace.contractstringYesDefines the contract value at this contract boundary.const: "workspace:.workspai/workspace.contract.json"
workspace.indexstringNoDefines the index value at this contract boundary.const: "workspace:.workspai/reports/INDEX.json"
workspace.knowledgeGraphstringNoDefines the knowledgegraph value at this contract boundary.const: "workspace:.workspai/reports/workspace-knowledge-graph.json"
workspace.modelstringNoDefines the model value at this contract boundary.const: "workspace:.workspai/reports/workspace-model.json"
workspace.namestringYesDefines the name value at this contract boundary.minLength: 1
workspace.profilestringNoDefines the profile value at this contract boundary.
workspace.projectKnowledgeGraphstringNoDefines the projectknowledgegraph value at this contract boundary.const: ".workspai/reports/project-knowledge-graph-reference.json"
workspace.relationshipenumYesDefines the relationship value at this contract boundary.enum: managed, adopted, imported, linked, restored
workspace.skillsIndexstringNoDefines the skillsindex value at this contract boundary.const: "workspace:.workspai/reports/workspace-skills-index.json"

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/project-context-agent.v1.json",
  "title": "Workspai Project Context for Agents",
  "description": "Portable, bounded project lens derived from the canonical Workspace Model and evidence-backed Knowledge Graph.",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "workspace",
    "project",
    "intelligence",
    "evidence",
    "blockers",
    "agentRouting",
    "commands",
    "integrity"
  ],
  "properties": {
    "schemaVersion": {
      "const": "project-context-agent.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "workspace": {
      "type": "object",
      "required": [
        "name",
        "relationship",
        "contract",
        "access"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "profile": {
          "type": "string"
        },
        "relationship": {
          "enum": [
            "managed",
            "adopted",
            "imported",
            "linked",
            "restored"
          ]
        },
        "contract": {
          "const": "workspace:.workspai/workspace.contract.json"
        },
        "projectKnowledgeGraph": {
          "const": ".workspai/reports/project-knowledge-graph-reference.json"
        },
        "model": {
          "const": "workspace:.workspai/reports/workspace-model.json"
        },
        "knowledgeGraph": {
          "const": "workspace:.workspai/reports/workspace-knowledge-graph.json"
        },
        "index": {
          "const": "workspace:.workspai/reports/INDEX.json"
        },
        "context": {
          "const": "workspace:.workspai/reports/workspace-context-agent.json"
        },
        "skillsIndex": {
          "const": "workspace:.workspai/reports/workspace-skills-index.json"
        },
        "boundedGraphSearch": {
          "type": "string",
          "minLength": 1
        },
        "access": {
          "type": "object",
          "required": [
            "localBinding",
            "canonicalEvidenceAvailableAtGeneration",
            "identityIsFilesystemPath",
            "resolverCommand",
            "portableUriScheme",
            "resolvedPathPolicy"
          ],
          "properties": {
            "localBinding": {
              "const": ".workspai/workspace-link.local.json"
            },
            "canonicalEvidenceAvailableAtGeneration": {
              "type": "boolean"
            },
            "identityIsFilesystemPath": {
              "const": false
            },
            "resolverCommand": {
              "const": "workspai project workspace status --json"
            },
            "portableUriScheme": {
              "const": "workspace:"
            },
            "resolvedPathPolicy": {
              "const": "runtime-private-never-persist"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "anyOf": [
        {
          "properties": {
            "model": {
              "const": "workspace:.workspai/reports/workspace-model.json"
            },
            "knowledgeGraph": {
              "const": "workspace:.workspai/reports/workspace-knowledge-graph.json"
            }
          },
          "required": [
            "model",
            "knowledgeGraph"
          ]
        },
        {
          "properties": {
            "index": {
              "const": "workspace:.workspai/reports/INDEX.json"
            },
            "context": {
              "const": "workspace:.workspai/reports/workspace-context-agent.json"
            },
            "skillsIndex": {
              "const": "workspace:.workspai/reports/workspace-skills-index.json"
            },
            "boundedGraphSearch": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "index",
            "context",
            "skillsIndex",
            "boundedGraphSearch"
          ]
        }
      ]
    },
    "project": {
      "type": "object",
      "required": [
        "name",
        "relativePath",
        "commands",
        "importantFiles"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "relativePath": {
          "type": "string",
          "minLength": 1,
          "not": {
            "pattern": "^(?:/|[A-Za-z]:[\\\\/])"
          }
        },
        "kind": {
          "type": "string"
        },
        "runtime": {
          "type": "string"
        },
        "runtimeCandidates": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "framework": {
          "type": "string"
        },
        "kit": {
          "type": "string"
        },
        "supportTier": {
          "type": "string"
        },
        "governance": {
          "$ref": "#/$defs/projectGovernance"
        },
        "commands": {
          "type": "object",
          "required": [
            "supported",
            "unsupported",
            "fleetStages"
          ],
          "properties": {
            "supported": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "unsupported": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "fleetStages": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          },
          "additionalProperties": false
        },
        "importantFiles": {
          "type": "array",
          "items": {
            "type": "string",
            "not": {
              "pattern": "^(?:/|[A-Za-z]:[\\\\/])"
            }
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "intelligence": {
      "type": "object",
      "required": [
        "entityCount",
        "relationCount",
        "proofCount",
        "entitiesByKind",
        "relationsByKind",
        "languages",
        "semantic",
        "projection",
        "relatedProjects",
        "freshness",
        "topology",
        "surfaces",
        "diagnostics"
      ],
      "properties": {
        "modelGeneratedAt": {
          "type": "string",
          "format": "date-time"
        },
        "graphGeneratedAt": {
          "type": "string",
          "format": "date-time"
        },
        "graphModelHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "entityCount": {
          "type": "integer",
          "minimum": 0
        },
        "relationCount": {
          "type": "integer",
          "minimum": 0
        },
        "proofCount": {
          "type": "integer",
          "minimum": 0
        },
        "entitiesByKind": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          }
        },
        "relationsByKind": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          }
        },
        "languages": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "required": [
              "fileCount",
              "symbolCount",
              "generatedFileCount"
            ],
            "properties": {
              "fileCount": {
                "type": "integer",
                "minimum": 0
              },
              "symbolCount": {
                "type": "integer",
                "minimum": 0
              },
              "generatedFileCount": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "semantic": {
          "type": "object",
          "required": [
            "protocolConceptCount",
            "protocolImplementationBindings",
            "equivalenceBindings",
            "generationBindings",
            "runtimeUnitCount",
            "lifecycleStageCount",
            "runtimeCoverage"
          ],
          "properties": {
            "protocolConceptCount": {
              "type": "integer",
              "minimum": 0
            },
            "protocolImplementationBindings": {
              "type": "integer",
              "minimum": 0
            },
            "equivalenceBindings": {
              "type": "integer",
              "minimum": 0
            },
            "generationBindings": {
              "type": "integer",
              "minimum": 0
            },
            "runtimeUnitCount": {
              "type": "integer",
              "minimum": 0
            },
            "lifecycleStageCount": {
              "type": "integer",
              "minimum": 0
            },
            "runtimeCoverage": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            }
          },
          "additionalProperties": false
        },
        "projection": {
          "description": "Observable bounds for the representative entity projection. Counts remain exhaustive; omitted entities are available through bounded graph search.",
          "type": "object",
          "required": [
            "mode",
            "maxEntities",
            "byteBudget",
            "selectedBytes",
            "eligibleCount",
            "selectedCount",
            "omittedCount",
            "selectedByKind",
            "omittedByKind",
            "continuationCommand"
          ],
          "properties": {
            "mode": {
              "const": "stratified-byte-bounded"
            },
            "maxEntities": {
              "type": "integer",
              "minimum": 1
            },
            "byteBudget": {
              "type": "integer",
              "minimum": 1
            },
            "selectedBytes": {
              "type": "integer",
              "minimum": 0
            },
            "eligibleCount": {
              "type": "integer",
              "minimum": 0
            },
            "selectedCount": {
              "type": "integer",
              "minimum": 0
            },
            "omittedCount": {
              "type": "integer",
              "minimum": 0
            },
            "selectedByKind": {
              "type": "object",
              "additionalProperties": {
                "type": "integer",
                "minimum": 0
              }
            },
            "omittedByKind": {
              "type": "object",
              "additionalProperties": {
                "type": "integer",
                "minimum": 1
              }
            },
            "continuationCommand": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "relatedProjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "freshness": {
          "type": "object",
          "required": [
            "model",
            "graph",
            "graphMatchesModel"
          ],
          "properties": {
            "model": {
              "enum": [
                "fresh",
                "stale",
                "unknown",
                "missing"
              ]
            },
            "graph": {
              "enum": [
                "fresh",
                "stale",
                "unknown",
                "missing"
              ]
            },
            "graphMatchesModel": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "topology": {
          "type": "object",
          "required": [
            "status",
            "dependencies",
            "dependents"
          ],
          "properties": {
            "status": {
              "enum": [
                "proven",
                "unproven",
                "unavailable"
              ]
            },
            "dependencies": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/topologyRelation"
              },
              "maxItems": 16
            },
            "dependents": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/topologyRelation"
              },
              "maxItems": 16
            }
          },
          "additionalProperties": false
        },
        "surfaces": {
          "type": "object",
          "required": [
            "services",
            "packages",
            "protocols",
            "runtimeUnits",
            "lifecycleStages",
            "apis",
            "endpoints",
            "dataStores",
            "deployments",
            "pipelines",
            "tests",
            "owners",
            "decisions",
            "ports"
          ],
          "properties": {
            "services": {
              "$ref": "#/$defs/entityList"
            },
            "packages": {
              "$ref": "#/$defs/entityList"
            },
            "protocols": {
              "$ref": "#/$defs/entityList"
            },
            "runtimeUnits": {
              "$ref": "#/$defs/entityList"
            },
            "lifecycleStages": {
              "$ref": "#/$defs/entityList"
            },
            "apis": {
              "$ref": "#/$defs/entityList"
            },
            "endpoints": {
              "$ref": "#/$defs/entityList"
            },
            "dataStores": {
              "$ref": "#/$defs/entityList"
            },
            "deployments": {
              "$ref": "#/$defs/entityList"
            },
            "pipelines": {
              "$ref": "#/$defs/entityList"
            },
            "tests": {
              "$ref": "#/$defs/entityList"
            },
            "owners": {
              "$ref": "#/$defs/entityList"
            },
            "decisions": {
              "$ref": "#/$defs/entityList"
            },
            "ports": {
              "type": "array",
              "maxItems": 8,
              "items": {
                "$ref": "#/$defs/port"
              }
            }
          },
          "additionalProperties": false
        },
        "diagnostics": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "type": "object",
            "required": [
              "code",
              "severity",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "recommendation": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "evidence": {
      "type": "object",
      "required": [
        "readOrder",
        "projectProofArtifacts",
        "relations",
        "proofs"
      ],
      "properties": {
        "readOrder": {
          "type": "array",
          "maxItems": 12,
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "projectProofArtifacts": {
          "type": "array",
          "items": {
            "type": "string",
            "not": {
              "pattern": "^(?:/|[A-Za-z]:[\\\\/])"
            }
          },
          "uniqueItems": true,
          "maxItems": 24
        },
        "relations": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/relation"
          }
        },
        "proofs": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/proof"
          }
        }
      },
      "additionalProperties": false
    },
    "blockers": {
      "type": "array",
      "maxItems": 32,
      "items": {
        "$ref": "#/$defs/blocker"
      }
    },
    "agentRouting": {
      "description": "Machine-readable mandatory routing policy that prevents agents from bypassing canonical workspace evidence.",
      "type": "object",
      "required": [
        "enforcement",
        "mandatoryPreflight",
        "workspaceLocator",
        "workspaceEvidenceRequiredFor",
        "requiredReadOrder",
        "degradedMode"
      ],
      "properties": {
        "enforcement": {
          "const": "required"
        },
        "mandatoryPreflight": {
          "type": "object",
          "required": [
            "command",
            "successCondition"
          ],
          "properties": {
            "command": {
              "const": "workspai agent bootstrap --for-agent generic --strict --json"
            },
            "successCondition": {
              "const": "ready"
            }
          },
          "additionalProperties": false
        },
        "workspaceLocator": {
          "type": "object",
          "required": [
            "command",
            "successCondition",
            "outputClassification",
            "persistence",
            "disclosure",
            "portableUriScheme"
          ],
          "properties": {
            "command": {
              "const": "workspai project workspace status --json"
            },
            "successCondition": {
              "const": "resolved"
            },
            "outputClassification": {
              "const": "machine-local"
            },
            "persistence": {
              "const": "forbidden"
            },
            "disclosure": {
              "const": "forbidden"
            },
            "portableUriScheme": {
              "const": "workspace:"
            }
          },
          "additionalProperties": false
        },
        "workspaceEvidenceRequiredFor": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "enum": [
              "repository-analysis",
              "architecture-analysis",
              "change-impact",
              "cross-project-change",
              "contract-change",
              "infrastructure-change",
              "release-readiness"
            ]
          }
        },
        "requiredReadOrder": {
          "type": "array",
          "minItems": 4,
          "maxItems": 10,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "degradedMode": {
          "type": "object",
          "required": [
            "allowCompleteArchitectureClaims",
            "requireDisclosure"
          ],
          "properties": {
            "allowCompleteArchitectureClaims": {
              "const": false
            },
            "requireDisclosure": {
              "const": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "commands": {
      "type": "object",
      "required": [
        "refresh",
        "verify",
        "graphSearch",
        "doctor",
        "workspaceStatus"
      ],
      "properties": {
        "refresh": {
          "type": "string",
          "minLength": 1
        },
        "verify": {
          "type": "string",
          "minLength": 1
        },
        "graphSearch": {
          "type": "string",
          "minLength": 1
        },
        "doctor": {
          "type": "string",
          "minLength": 1
        },
        "workspaceStatus": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "integrity": {
      "type": "object",
      "required": [
        "algorithm",
        "payloadHash",
        "portable",
        "absolutePathsEmitted"
      ],
      "properties": {
        "algorithm": {
          "const": "sha256"
        },
        "modelHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "payloadHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "portable": {
          "const": true
        },
        "absolutePathsEmitted": {
          "const": false
        }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "governanceControl": {
      "type": "object",
      "required": [
        "status",
        "provider",
        "evidence",
        "reference"
      ],
      "properties": {
        "status": {
          "enum": [
            "repository",
            "external-declared",
            "external-observed",
            "unknown"
          ]
        },
        "provider": {
          "type": [
            "string",
            "null"
          ]
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "reference": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "projectGovernance": {
      "type": "object",
      "required": [
        "schemaVersion",
        "ci",
        "release",
        "ownership"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspai.project-governance.v1"
        },
        "ci": {
          "$ref": "#/$defs/governanceControl"
        },
        "release": {
          "$ref": "#/$defs/governanceControl"
        },
        "ownership": {
          "$ref": "#/$defs/governanceControl"
        }
      },
      "additionalProperties": false
    },
    "portableString": {
      "type": "string",
      "not": {
        "pattern": "^(?:/|[A-Za-z]:[\\\\/])"
      }
    },
    "topologyRelation": {
      "type": "object",
      "required": [
        "project",
        "kind",
        "source",
        "confidence",
        "evidence"
      ],
      "properties": {
        "project": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "confidence": {
          "type": "string",
          "minLength": 1
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/portableString"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "entityList": {
      "type": "array",
      "maxItems": 32,
      "items": {
        "$ref": "#/$defs/entity"
      }
    },
    "entity": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "label",
        "attributes",
        "proofIds"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "attributes": {
          "type": "object",
          "additionalProperties": true
        },
        "proofIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "port": {
      "type": "object",
      "required": [
        "entityId",
        "label",
        "attribute",
        "value"
      ],
      "properties": {
        "entityId": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "attribute": {
          "type": "string"
        },
        "value": true
      },
      "additionalProperties": false
    },
    "relation": {
      "type": "object",
      "required": [
        "id",
        "from",
        "to",
        "kind",
        "derivation",
        "trust",
        "confidence",
        "proofIds"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "derivation": {
          "type": "string"
        },
        "trust": {
          "type": "string"
        },
        "confidence": {
          "type": "string"
        },
        "proofIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "proof": {
      "type": "object",
      "required": [
        "id",
        "provider",
        "artifact",
        "derivation",
        "trust",
        "confidence",
        "freshness"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "artifact": {
          "$ref": "#/$defs/portableString"
        },
        "pointer": {
          "type": "string"
        },
        "line": {
          "type": "integer",
          "minimum": 1
        },
        "derivation": {
          "type": "string"
        },
        "trust": {
          "type": "string"
        },
        "confidence": {
          "type": "string"
        },
        "freshness": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "blocker": {
      "type": "object",
      "required": [
        "source",
        "severity",
        "message"
      ],
      "properties": {
        "source": {
          "type": "string"
        },
        "severity": {
          "enum": [
            "warning",
            "error"
          ]
        },
        "message": {
          "type": "string"
        },
        "code": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}