Workspace Intelligence / JSON Schema
Workspai Workspace Graph Stream
Transport-neutral, revision-safe events for hydrating and incrementally updating a Workspace Knowledge Graph consumer.
- Schema version
workspace-graph-stream.v1- Contract path
contracts/workspace-intelligence/workspace-graph-stream.v1.json- Publication
- json-schema
- Defined fields
- 50
- Artifact bindings
- 0
Why this contract exists
Architecture role
Relates workspace structure and change so downstream reasoning remains traceable.
Consumption boundary
- • Workspai CLI
- • Workspace Intelligence consumers
- • IDEs and agents
Related commands
Commands are linked only when the runtime contract identifies a direct production relationship. Supporting contracts may be consumed without having a single producer command.
This is a supporting, capability, cache, compatibility, or consumer contract. It has no single direct producer command in the canonical Workspace Intelligence execution registry.
Produced artifacts
These durable files are emitted by registered commands and validated against this contract.
No canonical file artifact is registered for this contract. It may describe capabilities, embedded data, runtime exchange, or supporting state instead of a standalone report.
Field reference
Every declared schema property or published capability path is listed here. Required means the contract declares or publishes that field at the shown boundary.
| Field path | Type | Required | Meaning | Constraints |
|---|---|---|---|---|
| $defs.controlPayload.message | string | No | Defines the message value at this contract boundary. | — |
| $defs.controlPayload.reason | string | No | Defines the reason value at this contract boundary. | — |
| $defs.deltaPayload.diagnostics | array | Yes | Defines the diagnostics value at this contract boundary. | — |
| $defs.deltaPayload.entitiesAdded | array | Yes | Defines the entitiesadded value at this contract boundary. | — |
| $defs.deltaPayload.entitiesRemoved | array | Yes | Defines the entitiesremoved value at this contract boundary. | — |
| $defs.deltaPayload.entitiesUpdated | array | Yes | Defines the entitiesupdated value at this contract boundary. | — |
| $defs.deltaPayload.proofsAdded | array | Yes | Defines the proofsadded value at this contract boundary. | — |
| $defs.deltaPayload.proofsRemoved | array | Yes | Defines the proofsremoved value at this contract boundary. | — |
| $defs.deltaPayload.proofsUpdated | array | Yes | Defines the proofsupdated value at this contract boundary. | — |
| $defs.deltaPayload.providersUpdated | array | Yes | Defines the providersupdated value at this contract boundary. | — |
| $defs.deltaPayload.quality | any | No | Defines the quality value at this contract boundary. | — |
| $defs.deltaPayload.relationsAdded | array | Yes | Defines the relationsadded value at this contract boundary. | — |
| $defs.deltaPayload.relationsRemoved | array | Yes | Defines the relationsremoved value at this contract boundary. | — |
| $defs.deltaPayload.relationsUpdated | array | Yes | Defines the relationsupdated value at this contract boundary. | — |
| $defs.errorPayload.code | string | Yes | Defines the code value at this contract boundary. | minLength: 1 |
| $defs.errorPayload.message | string | Yes | Defines the message value at this contract boundary. | minLength: 1 |
| $defs.errorPayload.providerId | string | No | Defines the providerid value at this contract boundary. | — |
| $defs.errorPayload.recoverable | boolean | Yes | Defines the recoverable value at this contract boundary. | — |
| $defs.proofInvalidatedPayload.entityIds | array | No | Defines the entityids value at this contract boundary. | — |
| $defs.proofInvalidatedPayload.proofIds | array | Yes | Defines the proofids value at this contract boundary. | minItems: 1 |
| $defs.proofInvalidatedPayload.reason | string | Yes | Defines the reason value at this contract boundary. | minLength: 1 |
| $defs.proofInvalidatedPayload.relationIds | array | No | Defines the relationids value at this contract boundary. | — |
| $defs.providerProgressPayload.completed | integer | No | Defines the completed value at this contract boundary. | minimum: 0 |
| $defs.providerProgressPayload.message | string | No | Defines the message value at this contract boundary. | — |
| $defs.providerProgressPayload.providerId | reference | Yes | Defines the providerid value at this contract boundary. | ref: #/$defs/id |
| $defs.providerProgressPayload.status | enum | Yes | Defines the status value at this contract boundary. | enum: queued, running, passed, partial, skipped, failed |
| $defs.providerProgressPayload.total | integer | No | Defines the total value at this contract boundary. | minimum: 0 |
| $defs.qualityPayload.diagnostics | array | No | Defines the diagnostics value at this contract boundary. | — |
| $defs.qualityPayload.quality | reference | Yes | Defines the quality value at this contract boundary. | ref: workspace-knowledge-graph.v1.json#/properties/quality |
| $defs.resyncPayload.expectedRevision | integer | No | Defines the expectedrevision value at this contract boundary. | minimum: 0 |
| $defs.resyncPayload.message | string | No | Defines the message value at this contract boundary. | — |
| $defs.resyncPayload.reason | enum | Yes | Defines the reason value at this contract boundary. | enum: revision-gap, identity-mismatch, generation-regression, schema-unsupported, hash-discontinuity, validation-failed, queue-overflow |
| $defs.resyncPayload.receivedBaseRevision | integer | No | Defines the receivedbaserevision value at this contract boundary. | minimum: 0 |
| $defs.snapshotPayload.graph | reference | Yes | Defines the graph value at this contract boundary. | ref: workspace-knowledge-graph.v1.json |
| $defs.snapshotPayload.reason | enum | No | Defines the reason value at this contract boundary. | enum: initial, refresh, recovery, schema-transition |
| baseGraphHash | reference | No | Defines the basegraphhash value at this contract boundary. | ref: #/$defs/hash |
| baseModelHash | reference | No | Defines the basemodelhash value at this contract boundary. | ref: #/$defs/hash |
| baseRevision | integer | No | Defines the baserevision value at this contract boundary. | minimum: 0 |
| causationId | string | Yes | Defines the causationid value at this contract boundary. | minLength: 1 |
| correlationId | string | Yes | Defines the correlationid value at this contract boundary. | minLength: 1 |
| generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| generation | integer | Yes | Defines the generation value at this contract boundary. | minimum: 0 |
| graphHash | reference | Yes | Defines the graphhash value at this contract boundary. | ref: #/$defs/hash |
| modelHash | reference | Yes | Defines the modelhash value at this contract boundary. | ref: #/$defs/hash |
| payload | object | Yes | Defines the payload value at this contract boundary. | — |
| revision | integer | Yes | Defines the revision value at this contract boundary. | minimum: 0 |
| schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "workspace-graph-stream.v1" |
| sessionId | string | Yes | Defines the sessionid value at this contract boundary. | minLength: 1 |
| type | enum | Yes | Defines the type value at this contract boundary. | enum: graph.snapshot, graph.delta, graph.provider-progress, graph.quality-changed, graph.proof-invalidated, graph.resync-required, graph.paused, graph.complete, graph.heartbeat, graph.error |
| workspaceId | string | Yes | Defines the workspaceid value at this contract boundary. | minLength: 1 |
Canonical machine-readable definition
The raw synchronized contract remains authoritative. The educational sections above are projections of this definition.
Show raw JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://getrapidkit.com/schemas/workspace-graph-stream.v1.json",
"title": "Workspai Workspace Graph Stream",
"description": "Transport-neutral, revision-safe events for hydrating and incrementally updating a Workspace Knowledge Graph consumer.",
"type": "object",
"required": [
"schemaVersion",
"type",
"workspaceId",
"sessionId",
"generation",
"revision",
"modelHash",
"graphHash",
"generatedAt",
"causationId",
"correlationId",
"payload"
],
"properties": {
"schemaVersion": {
"const": "workspace-graph-stream.v1"
},
"type": {
"enum": [
"graph.snapshot",
"graph.delta",
"graph.provider-progress",
"graph.quality-changed",
"graph.proof-invalidated",
"graph.resync-required",
"graph.paused",
"graph.complete",
"graph.heartbeat",
"graph.error"
]
},
"workspaceId": {
"type": "string",
"minLength": 1
},
"sessionId": {
"type": "string",
"minLength": 1
},
"generation": {
"type": "integer",
"minimum": 0
},
"baseRevision": {
"type": "integer",
"minimum": 0
},
"baseModelHash": {
"$ref": "#/$defs/hash"
},
"baseGraphHash": {
"$ref": "#/$defs/hash"
},
"revision": {
"type": "integer",
"minimum": 0
},
"modelHash": {
"$ref": "#/$defs/hash"
},
"graphHash": {
"$ref": "#/$defs/hash"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"causationId": {
"type": "string",
"minLength": 1
},
"correlationId": {
"type": "string",
"minLength": 1
},
"payload": {
"type": "object"
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "graph.snapshot"
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/snapshotPayload"
},
"baseRevision": false,
"baseModelHash": false,
"baseGraphHash": false
}
}
},
{
"if": {
"properties": {
"type": {
"const": "graph.delta"
}
}
},
"then": {
"required": [
"baseRevision",
"baseModelHash",
"baseGraphHash"
],
"properties": {
"payload": {
"$ref": "#/$defs/deltaPayload"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "graph.provider-progress"
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/providerProgressPayload"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "graph.quality-changed"
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/qualityPayload"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "graph.proof-invalidated"
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/proofInvalidatedPayload"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "graph.resync-required"
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/resyncPayload"
}
}
}
},
{
"if": {
"properties": {
"type": {
"enum": [
"graph.paused",
"graph.complete",
"graph.heartbeat"
]
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/controlPayload"
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "graph.error"
}
}
},
"then": {
"properties": {
"payload": {
"$ref": "#/$defs/errorPayload"
}
}
}
}
],
"$defs": {
"hash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"id": {
"type": "string",
"minLength": 1
},
"snapshotPayload": {
"type": "object",
"required": [
"graph"
],
"properties": {
"graph": {
"$ref": "workspace-knowledge-graph.v1.json"
},
"reason": {
"enum": [
"initial",
"refresh",
"recovery",
"schema-transition"
]
}
},
"additionalProperties": false
},
"deltaPayload": {
"type": "object",
"required": [
"entitiesAdded",
"entitiesUpdated",
"entitiesRemoved",
"relationsAdded",
"relationsUpdated",
"relationsRemoved",
"proofsAdded",
"proofsUpdated",
"proofsRemoved",
"providersUpdated",
"diagnostics"
],
"properties": {
"entitiesAdded": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items"
}
},
"entitiesUpdated": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items"
}
},
"entitiesRemoved": {
"type": "array",
"items": {
"$ref": "#/$defs/id"
},
"uniqueItems": true
},
"relationsAdded": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/relations/items"
}
},
"relationsUpdated": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/relations/items"
}
},
"relationsRemoved": {
"type": "array",
"items": {
"$ref": "#/$defs/id"
},
"uniqueItems": true
},
"proofsAdded": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/proofs/items"
}
},
"proofsUpdated": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/proofs/items"
}
},
"proofsRemoved": {
"type": "array",
"items": {
"$ref": "#/$defs/id"
},
"uniqueItems": true
},
"providersUpdated": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/providers/items"
}
},
"quality": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "workspace-knowledge-graph.v1.json#/properties/quality"
}
]
},
"diagnostics": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/diagnostics/items"
}
}
},
"additionalProperties": false
},
"providerProgressPayload": {
"type": "object",
"required": [
"providerId",
"status"
],
"properties": {
"providerId": {
"$ref": "#/$defs/id"
},
"status": {
"enum": [
"queued",
"running",
"passed",
"partial",
"skipped",
"failed"
]
},
"completed": {
"type": "integer",
"minimum": 0
},
"total": {
"type": "integer",
"minimum": 0
},
"message": {
"type": "string"
}
},
"additionalProperties": false
},
"qualityPayload": {
"type": "object",
"required": [
"quality"
],
"properties": {
"quality": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/quality"
},
"diagnostics": {
"type": "array",
"items": {
"$ref": "workspace-knowledge-graph.v1.json#/properties/diagnostics/items"
}
}
},
"additionalProperties": false
},
"proofInvalidatedPayload": {
"type": "object",
"required": [
"proofIds",
"reason"
],
"properties": {
"proofIds": {
"type": "array",
"items": {
"$ref": "#/$defs/id"
},
"minItems": 1,
"uniqueItems": true
},
"reason": {
"type": "string",
"minLength": 1
},
"entityIds": {
"type": "array",
"items": {
"$ref": "#/$defs/id"
},
"uniqueItems": true
},
"relationIds": {
"type": "array",
"items": {
"$ref": "#/$defs/id"
},
"uniqueItems": true
}
},
"additionalProperties": false
},
"resyncPayload": {
"type": "object",
"required": [
"reason"
],
"properties": {
"reason": {
"enum": [
"revision-gap",
"identity-mismatch",
"generation-regression",
"schema-unsupported",
"hash-discontinuity",
"validation-failed",
"queue-overflow"
]
},
"expectedRevision": {
"type": "integer",
"minimum": 0
},
"receivedBaseRevision": {
"type": "integer",
"minimum": 0
},
"message": {
"type": "string"
}
},
"additionalProperties": false
},
"controlPayload": {
"type": "object",
"properties": {
"reason": {
"type": "string"
},
"message": {
"type": "string"
}
},
"additionalProperties": false
},
"errorPayload": {
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"providerId": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}