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
- 111
- 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 path | Schema | Producer |
|---|---|---|
| .workspai/reports/project-context-agent.json | project-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 path | Type | Required | Meaning | Constraints |
|---|---|---|---|---|
| $defs.blocker.code | string | No | Defines the code value at this contract boundary. | — |
| $defs.blocker.message | string | Yes | Defines the message value at this contract boundary. | — |
| $defs.blocker.severity | enum | Yes | Defines the severity value at this contract boundary. | enum: warning, error |
| $defs.blocker.source | string | Yes | Defines the source value at this contract boundary. | — |
| $defs.entity.attributes | object | Yes | Defines the attributes value at this contract boundary. | additionalProperties: true |
| $defs.entity.id | string | Yes | Defines the id value at this contract boundary. | — |
| $defs.entity.kind | string | Yes | Defines the kind value at this contract boundary. | — |
| $defs.entity.label | string | Yes | Defines the label value at this contract boundary. | — |
| $defs.entity.proofIds | array | Yes | Defines the proofids value at this contract boundary. | — |
| $defs.port.attribute | string | Yes | Defines the attribute value at this contract boundary. | — |
| $defs.port.entityId | string | Yes | Defines the entityid value at this contract boundary. | — |
| $defs.port.label | string | Yes | Defines the label value at this contract boundary. | — |
| $defs.proof.artifact | reference | Yes | Defines the artifact value at this contract boundary. | ref: #/$defs/portableString |
| $defs.proof.confidence | string | Yes | Defines the confidence value at this contract boundary. | — |
| $defs.proof.derivation | string | Yes | Defines the derivation value at this contract boundary. | — |
| $defs.proof.freshness | string | Yes | Defines the freshness value at this contract boundary. | — |
| $defs.proof.id | string | Yes | Defines the id value at this contract boundary. | — |
| $defs.proof.line | integer | No | Defines the line value at this contract boundary. | minimum: 1 |
| $defs.proof.pointer | string | No | Defines the pointer value at this contract boundary. | — |
| $defs.proof.provider | string | Yes | Defines the provider value at this contract boundary. | — |
| $defs.proof.trust | string | Yes | Defines the trust value at this contract boundary. | — |
| $defs.relation.confidence | string | Yes | Defines the confidence value at this contract boundary. | — |
| $defs.relation.derivation | string | Yes | Defines the derivation value at this contract boundary. | — |
| $defs.relation.from | string | Yes | Defines the from value at this contract boundary. | — |
| $defs.relation.id | string | Yes | Defines the id value at this contract boundary. | — |
| $defs.relation.kind | string | Yes | Defines the kind value at this contract boundary. | — |
| $defs.relation.proofIds | array | Yes | Defines the proofids value at this contract boundary. | — |
| $defs.relation.to | string | Yes | Defines the to value at this contract boundary. | — |
| $defs.relation.trust | string | Yes | Defines the trust value at this contract boundary. | — |
| $defs.topologyRelation.confidence | string | Yes | Defines the confidence value at this contract boundary. | minLength: 1 |
| $defs.topologyRelation.evidence | array | Yes | Defines the evidence value at this contract boundary. | — |
| $defs.topologyRelation.kind | string | Yes | Defines the kind value at this contract boundary. | minLength: 1 |
| $defs.topologyRelation.project | string | Yes | Defines the project value at this contract boundary. | minLength: 1 |
| $defs.topologyRelation.source | string | Yes | Defines the source value at this contract boundary. | minLength: 1 |
| blockers | array | Yes | Defines the blockers value at this contract boundary. | maxItems: 32 |
| commands | object | Yes | Defines the commands value at this contract boundary. | additionalProperties: false |
| commands.doctor | string | Yes | Defines the doctor value at this contract boundary. | minLength: 1 |
| commands.graphSearch | string | Yes | Defines the graphsearch value at this contract boundary. | minLength: 1 |
| commands.refresh | string | Yes | Defines the refresh value at this contract boundary. | minLength: 1 |
| commands.verify | string | Yes | Defines the verify value at this contract boundary. | minLength: 1 |
| commands.workspaceStatus | string | Yes | Defines the workspacestatus value at this contract boundary. | minLength: 1 |
| evidence | object | Yes | Defines the evidence value at this contract boundary. | additionalProperties: false |
| evidence.projectProofArtifacts | array | Yes | Defines the projectproofartifacts value at this contract boundary. | — |
| evidence.proofs | array | Yes | Defines the proofs value at this contract boundary. | maxItems: 128 |
| evidence.readOrder | array | Yes | Defines the readorder value at this contract boundary. | — |
| evidence.relations | array | Yes | Defines the relations value at this contract boundary. | maxItems: 128 |
| generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| integrity | object | Yes | Defines the integrity value at this contract boundary. | additionalProperties: false |
| integrity.absolutePathsEmitted | boolean | Yes | Defines the absolutepathsemitted value at this contract boundary. | const: false |
| integrity.algorithm | string | Yes | Defines the algorithm value at this contract boundary. | const: "sha256" |
| integrity.modelHash | string | No | Defines the modelhash value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| integrity.payloadHash | string | Yes | Defines the payloadhash value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| integrity.portable | boolean | Yes | Defines the portable value at this contract boundary. | const: true |
| intelligence | object | Yes | Defines the intelligence value at this contract boundary. | additionalProperties: false |
| intelligence.diagnostics | array | Yes | Defines the diagnostics value at this contract boundary. | — |
| intelligence.diagnostics[].code | string | Yes | Defines the code value at this contract boundary. | — |
| intelligence.diagnostics[].message | string | Yes | Defines the message value at this contract boundary. | — |
| intelligence.diagnostics[].recommendation | string | No | Defines the recommendation value at this contract boundary. | — |
| intelligence.diagnostics[].severity | string | Yes | Defines the severity value at this contract boundary. | — |
| intelligence.entitiesByKind | object | Yes | Defines the entitiesbykind value at this contract boundary. | — |
| intelligence.entityCount | integer | Yes | Defines the entitycount value at this contract boundary. | minimum: 0 |
| intelligence.freshness | object | Yes | Defines the freshness value at this contract boundary. | additionalProperties: false |
| intelligence.freshness.graph | enum | Yes | Defines the graph value at this contract boundary. | enum: fresh, stale, unknown, missing |
| intelligence.freshness.graphMatchesModel | boolean | Yes | Defines the graphmatchesmodel value at this contract boundary. | — |
| intelligence.freshness.model | enum | Yes | Defines the model value at this contract boundary. | enum: fresh, stale, unknown, missing |
| intelligence.graphGeneratedAt | string | No | Defines the graphgeneratedat value at this contract boundary. | format: date-time |
| intelligence.graphModelHash | string | No | Defines the graphmodelhash value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| intelligence.modelGeneratedAt | string | No | Defines the modelgeneratedat value at this contract boundary. | format: date-time |
| intelligence.proofCount | integer | Yes | Defines the proofcount value at this contract boundary. | minimum: 0 |
| intelligence.relatedProjects | array | Yes | Defines the relatedprojects value at this contract boundary. | — |
| intelligence.relationCount | integer | Yes | Defines the relationcount value at this contract boundary. | minimum: 0 |
| intelligence.relationsByKind | object | Yes | Defines the relationsbykind value at this contract boundary. | — |
| intelligence.surfaces | object | Yes | Defines the surfaces value at this contract boundary. | additionalProperties: false |
| intelligence.surfaces.apis | reference | Yes | Defines the apis value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.dataStores | reference | Yes | Defines the datastores value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.decisions | reference | Yes | Defines the decisions value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.deployments | reference | Yes | Defines the deployments value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.endpoints | reference | Yes | Defines the endpoints value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.owners | reference | Yes | Defines the owners value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.pipelines | reference | Yes | Defines the pipelines value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.ports | array | Yes | Defines the ports value at this contract boundary. | maxItems: 32 |
| intelligence.surfaces.services | reference | Yes | Defines the services value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.surfaces.tests | reference | Yes | Defines the tests value at this contract boundary. | ref: #/$defs/entityList |
| intelligence.topology | object | Yes | Defines the topology value at this contract boundary. | additionalProperties: false |
| intelligence.topology.dependencies | array | Yes | Defines the dependencies value at this contract boundary. | maxItems: 128 |
| intelligence.topology.dependents | array | Yes | Defines the dependents value at this contract boundary. | maxItems: 128 |
| intelligence.topology.status | enum | Yes | Defines the status value at this contract boundary. | enum: proven, unproven, unavailable |
| project | object | Yes | Defines the project value at this contract boundary. | additionalProperties: false |
| project.commands | object | Yes | Defines the commands value at this contract boundary. | additionalProperties: false |
| project.commands.fleetStages | array | Yes | Defines the fleetstages value at this contract boundary. | — |
| project.commands.supported | array | Yes | Defines the supported value at this contract boundary. | — |
| project.commands.unsupported | array | Yes | Defines the unsupported value at this contract boundary. | — |
| project.framework | string | No | Defines the framework value at this contract boundary. | — |
| project.importantFiles | array | Yes | Defines the importantfiles value at this contract boundary. | — |
| project.kind | string | No | Defines the kind value at this contract boundary. | — |
| project.kit | string | No | Defines the kit value at this contract boundary. | — |
| project.name | string | Yes | Defines the name value at this contract boundary. | minLength: 1 |
| project.relativePath | string | Yes | Defines the relativepath value at this contract boundary. | minLength: 1 |
| project.runtime | string | No | Defines the runtime value at this contract boundary. | — |
| project.supportTier | string | No | Defines the supporttier value at this contract boundary. | — |
| schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "project-context-agent.v1" |
| workspace | object | Yes | Defines the workspace value at this contract boundary. | additionalProperties: false |
| workspace.access | object | Yes | Defines the access value at this contract boundary. | additionalProperties: false |
| workspace.access.canonicalEvidenceAvailableAtGeneration | boolean | Yes | Defines the canonicalevidenceavailableatgeneration value at this contract boundary. | — |
| workspace.access.localBinding | string | Yes | Defines the localbinding value at this contract boundary. | const: ".workspai/workspace-link.local.json" |
| workspace.contract | string | Yes | Defines the contract value at this contract boundary. | const: ".workspai/workspace.contract.json" |
| workspace.knowledgeGraph | string | Yes | Defines the knowledgegraph value at this contract boundary. | const: ".workspai/reports/workspace-knowledge-graph.json" |
| workspace.model | string | Yes | Defines the model value at this contract boundary. | const: ".workspai/reports/workspace-model.json" |
| workspace.name | string | Yes | Defines the name value at this contract boundary. | minLength: 1 |
| workspace.profile | string | No | Defines the profile value at this contract boundary. | — |
| workspace.relationship | enum | Yes | Defines the relationship value at this contract boundary. | enum: managed, adopted, imported, linked, restored |
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",
"commands",
"integrity"
],
"properties": {
"schemaVersion": {
"const": "project-context-agent.v1"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"workspace": {
"type": "object",
"required": [
"name",
"relationship",
"contract",
"model",
"knowledgeGraph",
"access"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"profile": {
"type": "string"
},
"relationship": {
"enum": [
"managed",
"adopted",
"imported",
"linked",
"restored"
]
},
"contract": {
"const": ".workspai/workspace.contract.json"
},
"model": {
"const": ".workspai/reports/workspace-model.json"
},
"knowledgeGraph": {
"const": ".workspai/reports/workspace-knowledge-graph.json"
},
"access": {
"type": "object",
"required": [
"localBinding",
"canonicalEvidenceAvailableAtGeneration"
],
"properties": {
"localBinding": {
"const": ".workspai/workspace-link.local.json"
},
"canonicalEvidenceAvailableAtGeneration": {
"type": "boolean"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"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"
},
"framework": {
"type": "string"
},
"kit": {
"type": "string"
},
"supportTier": {
"type": "string"
},
"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",
"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
}
},
"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": 128
},
"dependents": {
"type": "array",
"items": {
"$ref": "#/$defs/topologyRelation"
},
"maxItems": 128
}
},
"additionalProperties": false
},
"surfaces": {
"type": "object",
"required": [
"services",
"apis",
"endpoints",
"dataStores",
"deployments",
"pipelines",
"tests",
"owners",
"decisions",
"ports"
],
"properties": {
"services": {
"$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": 32,
"items": {
"$ref": "#/$defs/port"
}
}
},
"additionalProperties": false
},
"diagnostics": {
"type": "array",
"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",
"items": {
"type": "string"
},
"uniqueItems": true
},
"projectProofArtifacts": {
"type": "array",
"items": {
"type": "string",
"not": {
"pattern": "^(?:/|[A-Za-z]:[\\\\/])"
}
},
"uniqueItems": true
},
"relations": {
"type": "array",
"maxItems": 128,
"items": {
"$ref": "#/$defs/relation"
}
},
"proofs": {
"type": "array",
"maxItems": 128,
"items": {
"$ref": "#/$defs/proof"
}
}
},
"additionalProperties": false
},
"blockers": {
"type": "array",
"maxItems": 32,
"items": {
"$ref": "#/$defs/blocker"
}
},
"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": {
"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
}