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
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 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.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.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
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.
evidence.proofsarrayYesDefines the proofs value at this contract boundary.maxItems: 128
evidence.readOrderarrayYesDefines the readorder value at this contract boundary.
evidence.relationsarrayYesDefines the relations value at this contract boundary.maxItems: 128
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.
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.modelGeneratedAtstringNoDefines the modelgeneratedat value at this contract boundary.format: date-time
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.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.ownersreferenceYesDefines the owners 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: 32
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: 128
intelligence.topology.dependentsarrayYesDefines the dependents value at this contract boundary.maxItems: 128
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.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.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.localBindingstringYesDefines the localbinding value at this contract boundary.const: ".workspai/workspace-link.local.json"
workspace.contractstringYesDefines the contract value at this contract boundary.const: ".workspai/workspace.contract.json"
workspace.knowledgeGraphstringYesDefines the knowledgegraph value at this contract boundary.const: ".workspai/reports/workspace-knowledge-graph.json"
workspace.modelstringYesDefines the model value at this contract boundary.const: ".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.relationshipenumYesDefines 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
}