Platform contracts / JSON Schema
Workspai Project Test Coverage Evidence
Defines the versioned project test coverage v1 boundary used by Workspai and its consumers.
- Schema version
workspai.project-test-coverage.v1- Contract path
contracts/project-test-coverage.v1.json- Publication
- json-schema
- Defined fields
- 50
- Artifact bindings
- 1
Why this contract exists
Architecture role
Defines a versioned interoperability boundary used by Workspai and contract-aware consumers.
Consumption boundary
- • Workspai CLI
- • Contract-aware integrations
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-test-coverage-last-run.json | workspai.project-test-coverage.v1 | workspai project coverage |
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.invocation.args | array | Yes | Defines the args value at this contract boundary. | — |
| $defs.invocation.cwd | string | Yes | Defines the cwd value at this contract boundary. | minLength: 1 |
| $defs.invocation.executable | string | Yes | Defines the executable value at this contract boundary. | minLength: 1 |
| $defs.metric.covered | integer | Yes | Defines the covered value at this contract boundary. | minimum: 0 |
| $defs.metric.percent | number | null | Yes | Defines the percent value at this contract boundary. | minimum: 0 · maximum: 100 |
| $defs.metric.skipped | integer | Yes | Defines the skipped value at this contract boundary. | minimum: 0 |
| $defs.metric.total | integer | Yes | Defines the total value at this contract boundary. | minimum: 0 |
| artifactPaths | object | Yes | Defines the artifactpaths value at this contract boundary. | additionalProperties: false |
| artifactPaths.project | string | Yes | Defines the project value at this contract boundary. | minLength: 1 |
| artifactPaths.workspaceLatest | string | null | Yes | Defines the workspacelatest value at this contract boundary. | — |
| artifactPaths.workspaceProject | string | null | Yes | Defines the workspaceproject value at this contract boundary. | — |
| diagnostics | array | Yes | Defines the diagnostics value at this contract boundary. | — |
| execution | object | Yes | Defines the execution value at this contract boundary. | additionalProperties: false |
| execution.durationMs | integer | Yes | Defines the durationms value at this contract boundary. | minimum: 0 |
| execution.exitCodes | array | Yes | Defines the exitcodes value at this contract boundary. | — |
| execution.invocations | array | Yes | Defines the invocations value at this contract boundary. | — |
| execution.requested | boolean | Yes | Defines the requested value at this contract boundary. | — |
| files | array | Yes | Defines the files value at this contract boundary. | — |
| files[].metrics | object | Yes | Defines the metrics value at this contract boundary. | additionalProperties: false |
| files[].metrics.branches | reference | No | Defines the branches value at this contract boundary. | ref: #/$defs/metric |
| files[].metrics.functions | reference | No | Defines the functions value at this contract boundary. | ref: #/$defs/metric |
| files[].metrics.lines | reference | No | Defines the lines value at this contract boundary. | ref: #/$defs/metric |
| files[].metrics.statements | reference | No | Defines the statements value at this contract boundary. | ref: #/$defs/metric |
| files[].path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| lowCoverageFiles | array | Yes | Defines the lowcoveragefiles value at this contract boundary. | — |
| lowCoverageFiles[].path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| lowCoverageFiles[].percent | number | null | Yes | Defines the percent value at this contract boundary. | minimum: 0 · maximum: 100 |
| lowCoverageFiles[].uncovered | integer | Yes | Defines the uncovered value at this contract boundary. | minimum: 0 |
| metrics | object | Yes | Defines the metrics value at this contract boundary. | additionalProperties: false |
| metrics.branches | reference | No | Defines the branches value at this contract boundary. | ref: #/$defs/metric |
| metrics.functions | reference | No | Defines the functions value at this contract boundary. | ref: #/$defs/metric |
| metrics.lines | reference | No | Defines the lines value at this contract boundary. | ref: #/$defs/metric |
| metrics.statements | reference | No | Defines the statements value at this contract boundary. | ref: #/$defs/metric |
| project | object | Yes | Defines the project value at this contract boundary. | additionalProperties: false |
| project.id | string | Yes | Defines the id value at this contract boundary. | minLength: 1 |
| project.name | string | Yes | Defines the name value at this contract boundary. | minLength: 1 |
| project.path | string | Yes | Defines the path value at this contract boundary. | minLength: 1 |
| project.workspacePath | string | null | Yes | Defines the workspacepath value at this contract boundary. | — |
| runner | string | null | Yes | Defines the runner value at this contract boundary. | — |
| runtime | enum | Yes | Defines the runtime value at this contract boundary. | enum: node, bun, deno, python, go, java, dotnet, rust, php, ruby, elixir, clojure, scala, kotlin, c, cpp, unknown |
| schemaVersion | string | Yes | Defines the schemaversion value at this contract boundary. | const: "workspai.project-test-coverage.v1" |
| source | object | Yes | Defines the source value at this contract boundary. | additionalProperties: false |
| source.format | enum | Yes | Defines the format value at this contract boundary. | enum: istanbul-json, coverage-py-json, lcov, go-coverprofile, jacoco-xml, cobertura-xml, clover-xml, scoverage-xml, simplecov-json, llvm-cov-json, unknown |
| source.path | string | null | Yes | Defines the path value at this contract boundary. | — |
| source.sha256 | string | null | Yes | Defines the sha256 value at this contract boundary. | pattern: ^[a-f0-9]{64}$ |
| status | enum | Yes | Defines the status value at this contract boundary. | enum: passed, below-target, unavailable, failed |
| target | object | Yes | Defines the target value at this contract boundary. | additionalProperties: false |
| target.metric | enum | Yes | Defines the metric value at this contract boundary. | enum: lines, branches, functions, statements |
| target.percent | integer | Yes | Defines the percent value at this contract boundary. | minimum: 0 · maximum: 100 |
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-test-coverage.v1.json",
"title": "Workspai Project Test Coverage Evidence",
"type": "object",
"required": [
"schemaVersion",
"generatedAt",
"status",
"project",
"runtime",
"runner",
"target",
"metrics",
"files",
"lowCoverageFiles",
"source",
"execution",
"diagnostics",
"artifactPaths"
],
"properties": {
"schemaVersion": {
"const": "workspai.project-test-coverage.v1"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"status": {
"enum": [
"passed",
"below-target",
"unavailable",
"failed"
]
},
"project": {
"type": "object",
"required": [
"id",
"name",
"path",
"workspacePath"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string",
"minLength": 1
},
"path": {
"type": "string",
"minLength": 1
},
"workspacePath": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
},
"runtime": {
"enum": [
"node",
"bun",
"deno",
"python",
"go",
"java",
"dotnet",
"rust",
"php",
"ruby",
"elixir",
"clojure",
"scala",
"kotlin",
"c",
"cpp",
"unknown"
]
},
"runner": {
"type": [
"string",
"null"
]
},
"target": {
"type": "object",
"required": [
"metric",
"percent"
],
"properties": {
"metric": {
"enum": [
"lines",
"branches",
"functions",
"statements"
]
},
"percent": {
"type": "integer",
"minimum": 0,
"maximum": 100
}
},
"additionalProperties": false
},
"metrics": {
"type": "object",
"properties": {
"lines": {
"$ref": "#/$defs/metric"
},
"branches": {
"$ref": "#/$defs/metric"
},
"functions": {
"$ref": "#/$defs/metric"
},
"statements": {
"$ref": "#/$defs/metric"
}
},
"additionalProperties": false
},
"files": {
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"metrics"
],
"properties": {
"path": {
"type": "string",
"minLength": 1
},
"metrics": {
"type": "object",
"properties": {
"lines": {
"$ref": "#/$defs/metric"
},
"branches": {
"$ref": "#/$defs/metric"
},
"functions": {
"$ref": "#/$defs/metric"
},
"statements": {
"$ref": "#/$defs/metric"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"lowCoverageFiles": {
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"percent",
"uncovered"
],
"properties": {
"path": {
"type": "string",
"minLength": 1
},
"percent": {
"type": [
"number",
"null"
],
"minimum": 0,
"maximum": 100
},
"uncovered": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": false
}
},
"source": {
"type": "object",
"required": [
"format",
"path",
"sha256"
],
"properties": {
"format": {
"enum": [
"istanbul-json",
"coverage-py-json",
"lcov",
"go-coverprofile",
"jacoco-xml",
"cobertura-xml",
"clover-xml",
"scoverage-xml",
"simplecov-json",
"llvm-cov-json",
"unknown"
]
},
"path": {
"type": [
"string",
"null"
]
},
"sha256": {
"type": [
"string",
"null"
],
"pattern": "^[a-f0-9]{64}$"
}
},
"additionalProperties": false
},
"execution": {
"type": "object",
"required": [
"requested",
"invocations",
"exitCodes",
"durationMs"
],
"properties": {
"requested": {
"type": "boolean"
},
"invocations": {
"type": "array",
"items": {
"$ref": "#/$defs/invocation"
}
},
"exitCodes": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0
}
},
"durationMs": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": false
},
"diagnostics": {
"type": "array",
"items": {
"type": "string"
}
},
"artifactPaths": {
"type": "object",
"required": [
"project",
"workspaceLatest",
"workspaceProject"
],
"properties": {
"project": {
"type": "string",
"minLength": 1
},
"workspaceLatest": {
"type": [
"string",
"null"
]
},
"workspaceProject": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
}
},
"$defs": {
"metric": {
"type": "object",
"required": [
"total",
"covered",
"skipped",
"percent"
],
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"covered": {
"type": "integer",
"minimum": 0
},
"skipped": {
"type": "integer",
"minimum": 0
},
"percent": {
"type": [
"number",
"null"
],
"minimum": 0,
"maximum": 100
}
},
"additionalProperties": false
},
"invocation": {
"type": "object",
"required": [
"cwd",
"executable",
"args"
],
"properties": {
"cwd": {
"type": "string",
"minLength": 1
},
"executable": {
"type": "string",
"minLength": 1
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}