Platform contracts / JSON Schema
Workspai Project Lifecycle Context
A bounded, manifest-derived projection of project runtime units and their supported lifecycle commands, or a typed refusal that preserves completeness.
- Schema version
https://workspai.dev/contracts/project-lifecycle-context.v1.json- Contract path
contracts/project-lifecycle-context.v1.json- Publication
- json-schema
- Defined fields
- 33
- Artifact bindings
- 0
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.
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.requiredBudget.accounting | string | Yes | Defines the accounting value at this contract boundary. | const: "utf8-json-with-newline" |
| $defs.requiredBudget.maxBytes | integer | Yes | Defines the maxbytes value at this contract boundary. | minimum: 1024 · maximum: 65536 |
| $defs.requiredBudget.requiredBytes | integer | Yes | Defines the requiredbytes value at this contract boundary. | minimum: 1 |
| $defs.selection.mode | enum | Yes | Defines the mode value at this contract boundary. | enum: all-units, closest-unit |
| $defs.selection.path | string | null | Yes | Defines the path value at this contract boundary. | — |
| $defs.stage.argvSequence | array | No | Defines the argvsequence value at this contract boundary. | — |
| $defs.stage.argvSequence[].args | array | Yes | Defines the args value at this contract boundary. | — |
| $defs.stage.argvSequence[].executable | string | Yes | Defines the executable value at this contract boundary. | minLength: 1 |
| $defs.stage.command | string | Yes | Defines the command value at this contract boundary. | minLength: 1 |
| $defs.stage.confidence | enum | Yes | Defines the confidence value at this contract boundary. | enum: high, medium |
| $defs.stage.cwd | string | No | Working directory relative to the canonical selected project root; source reads do not select this directory for terminal commands. | minLength: 1 |
| $defs.stage.focus | string | No | Defines the focus value at this contract boundary. | minLength: 1 |
| $defs.stage.ownerManifest | string | No | Defines the ownermanifest value at this contract boundary. | minLength: 1 |
| $defs.stage.preflight | enum | Yes | Defines the preflight value at this contract boundary. | enum: executable-and-inputs, executable |
| $defs.stage.setup | object | No | Defines the setup value at this contract boundary. | additionalProperties: false |
| $defs.stage.setup.args | array | Yes | Defines the args value at this contract boundary. | — |
| $defs.stage.setup.executable | string | Yes | Defines the executable value at this contract boundary. | minLength: 1 |
| $defs.stage.stage | enum | Yes | Defines the stage value at this contract boundary. | enum: init, test, build, start |
| $defs.unit.ecosystem | string | Yes | Defines the ecosystem value at this contract boundary. | minLength: 1 |
| $defs.unit.id | string | Yes | Defines the id value at this contract boundary. | minLength: 1 |
| $defs.unit.manifest | string | Yes | Defines the manifest value at this contract boundary. | minLength: 1 |
| $defs.unit.provenance | string | Yes | Defines the provenance value at this contract boundary. | const: "manifest-derived" |
| $defs.unit.role | enum | Yes | Defines the role value at this contract boundary. | enum: production, tooling, test, example |
| $defs.unit.root | string | Yes | Defines the root value at this contract boundary. | minLength: 1 |
| $defs.unit.runtime | string | Yes | Defines the runtime value at this contract boundary. | minLength: 1 |
| $defs.unit.stages | array | Yes | Defines the stages value at this contract boundary. | — |
| $defs.unit.workspaceOwner | object | No | Defines the workspaceowner value at this contract boundary. | additionalProperties: false |
| $defs.unit.workspaceOwner.manifest | string | Yes | Defines the manifest value at this contract boundary. | minLength: 1 |
| $defs.unit.workspaceOwner.packageManager | enum | Yes | Defines the packagemanager value at this contract boundary. | enum: npm, pnpm, yarn, bun |
| $defs.unit.workspaceOwner.root | string | Yes | Defines the root value at this contract boundary. | minLength: 1 |
| $defs.usedBudget.accounting | string | Yes | Defines the accounting value at this contract boundary. | const: "utf8-json-with-newline" |
| $defs.usedBudget.maxBytes | integer | Yes | Defines the maxbytes value at this contract boundary. | minimum: 1024 · maximum: 65536 |
| $defs.usedBudget.usedBytes | integer | Yes | Defines the usedbytes value at this contract boundary. | minimum: 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://workspai.dev/contracts/project-lifecycle-context.v1.json",
"title": "Workspai Project Lifecycle Context",
"description": "A bounded, manifest-derived projection of project runtime units and their supported lifecycle commands, or a typed refusal that preserves completeness.",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"schemaVersion",
"status",
"project",
"selection",
"units",
"omittedUnits",
"budget"
],
"properties": {
"schemaVersion": {
"const": "workspai.project-lifecycle-context.v1"
},
"status": {
"enum": [
"ready",
"no-lifecycle-units"
]
},
"project": {
"const": "."
},
"selection": {
"$ref": "#/$defs/selection"
},
"units": {
"type": "array",
"items": {
"$ref": "#/$defs/unit"
}
},
"omittedUnits": {
"const": 0
},
"budget": {
"$ref": "#/$defs/usedBudget"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"schemaVersion",
"status",
"project",
"selection",
"message",
"nextActions"
],
"properties": {
"schemaVersion": {
"const": "workspai.project-lifecycle-context.v1"
},
"status": {
"enum": [
"insufficient-budget",
"path-not-mapped"
]
},
"project": {
"const": "."
},
"selection": {
"$ref": "#/$defs/selection"
},
"budget": {
"$ref": "#/$defs/requiredBudget"
},
"message": {
"type": "string",
"minLength": 1
},
"nextActions": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
}
},
"allOf": [
{
"if": {
"properties": {
"status": {
"const": "insufficient-budget"
}
}
},
"then": {
"required": [
"budget"
]
},
"else": {
"not": {
"required": [
"budget"
]
}
}
}
]
}
],
"$defs": {
"selection": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"mode"
],
"properties": {
"path": {
"type": [
"string",
"null"
]
},
"mode": {
"enum": [
"all-units",
"closest-unit"
]
}
}
},
"usedBudget": {
"type": "object",
"additionalProperties": false,
"required": [
"maxBytes",
"usedBytes",
"accounting"
],
"properties": {
"maxBytes": {
"type": "integer",
"minimum": 1024,
"maximum": 65536
},
"usedBytes": {
"type": "integer",
"minimum": 1
},
"accounting": {
"const": "utf8-json-with-newline"
}
}
},
"requiredBudget": {
"type": "object",
"additionalProperties": false,
"required": [
"maxBytes",
"requiredBytes",
"accounting"
],
"properties": {
"maxBytes": {
"type": "integer",
"minimum": 1024,
"maximum": 65536
},
"requiredBytes": {
"type": "integer",
"minimum": 1
},
"accounting": {
"const": "utf8-json-with-newline"
}
}
},
"stage": {
"type": "object",
"additionalProperties": false,
"required": [
"stage",
"command",
"confidence",
"preflight"
],
"properties": {
"stage": {
"enum": [
"init",
"test",
"build",
"start"
]
},
"command": {
"type": "string",
"minLength": 1
},
"cwd": {
"type": "string",
"minLength": 1,
"description": "Working directory relative to the canonical selected project root; source reads do not select this directory for terminal commands."
},
"confidence": {
"enum": [
"high",
"medium"
]
},
"preflight": {
"enum": [
"executable-and-inputs",
"executable"
]
},
"focus": {
"type": "string",
"minLength": 1
},
"ownerManifest": {
"type": "string",
"minLength": 1
},
"setup": {
"type": "object",
"additionalProperties": false,
"required": [
"executable",
"args"
],
"properties": {
"executable": {
"type": "string",
"minLength": 1
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"argvSequence": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"executable",
"args"
],
"properties": {
"executable": {
"type": "string",
"minLength": 1
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"unit": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"runtime",
"ecosystem",
"role",
"root",
"manifest",
"provenance",
"stages"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"runtime": {
"type": "string",
"minLength": 1
},
"ecosystem": {
"type": "string",
"minLength": 1
},
"role": {
"enum": [
"production",
"tooling",
"test",
"example"
]
},
"root": {
"type": "string",
"minLength": 1
},
"manifest": {
"type": "string",
"minLength": 1
},
"provenance": {
"const": "manifest-derived"
},
"workspaceOwner": {
"type": "object",
"additionalProperties": false,
"required": [
"root",
"manifest",
"packageManager"
],
"properties": {
"root": {
"type": "string",
"minLength": 1
},
"manifest": {
"type": "string",
"minLength": 1
},
"packageManager": {
"enum": [
"npm",
"pnpm",
"yarn",
"bun"
]
}
}
},
"stages": {
"type": "array",
"items": {
"$ref": "#/$defs/stage"
}
}
}
}
}
}