All contracts

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 pathSchemaProducer
.workspai/reports/project-test-coverage-last-run.jsonworkspai.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 pathTypeRequiredMeaningConstraints
$defs.invocation.argsarrayYesDefines the args value at this contract boundary.
$defs.invocation.cwdstringYesDefines the cwd value at this contract boundary.minLength: 1
$defs.invocation.executablestringYesDefines the executable value at this contract boundary.minLength: 1
$defs.metric.coveredintegerYesDefines the covered value at this contract boundary.minimum: 0
$defs.metric.percentnumber | nullYesDefines the percent value at this contract boundary.minimum: 0 · maximum: 100
$defs.metric.skippedintegerYesDefines the skipped value at this contract boundary.minimum: 0
$defs.metric.totalintegerYesDefines the total value at this contract boundary.minimum: 0
artifactPathsobjectYesDefines the artifactpaths value at this contract boundary.additionalProperties: false
artifactPaths.projectstringYesDefines the project value at this contract boundary.minLength: 1
artifactPaths.workspaceLateststring | nullYesDefines the workspacelatest value at this contract boundary.
artifactPaths.workspaceProjectstring | nullYesDefines the workspaceproject value at this contract boundary.
diagnosticsarrayYesDefines the diagnostics value at this contract boundary.
executionobjectYesDefines the execution value at this contract boundary.additionalProperties: false
execution.durationMsintegerYesDefines the durationms value at this contract boundary.minimum: 0
execution.exitCodesarrayYesDefines the exitcodes value at this contract boundary.
execution.invocationsarrayYesDefines the invocations value at this contract boundary.
execution.requestedbooleanYesDefines the requested value at this contract boundary.
filesarrayYesDefines the files value at this contract boundary.
files[].metricsobjectYesDefines the metrics value at this contract boundary.additionalProperties: false
files[].metrics.branchesreferenceNoDefines the branches value at this contract boundary.ref: #/$defs/metric
files[].metrics.functionsreferenceNoDefines the functions value at this contract boundary.ref: #/$defs/metric
files[].metrics.linesreferenceNoDefines the lines value at this contract boundary.ref: #/$defs/metric
files[].metrics.statementsreferenceNoDefines the statements value at this contract boundary.ref: #/$defs/metric
files[].pathstringYesDefines the path value at this contract boundary.minLength: 1
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
lowCoverageFilesarrayYesDefines the lowcoveragefiles value at this contract boundary.
lowCoverageFiles[].pathstringYesDefines the path value at this contract boundary.minLength: 1
lowCoverageFiles[].percentnumber | nullYesDefines the percent value at this contract boundary.minimum: 0 · maximum: 100
lowCoverageFiles[].uncoveredintegerYesDefines the uncovered value at this contract boundary.minimum: 0
metricsobjectYesDefines the metrics value at this contract boundary.additionalProperties: false
metrics.branchesreferenceNoDefines the branches value at this contract boundary.ref: #/$defs/metric
metrics.functionsreferenceNoDefines the functions value at this contract boundary.ref: #/$defs/metric
metrics.linesreferenceNoDefines the lines value at this contract boundary.ref: #/$defs/metric
metrics.statementsreferenceNoDefines the statements value at this contract boundary.ref: #/$defs/metric
projectobjectYesDefines the project value at this contract boundary.additionalProperties: false
project.idstringYesDefines the id value at this contract boundary.minLength: 1
project.namestringYesDefines the name value at this contract boundary.minLength: 1
project.pathstringYesDefines the path value at this contract boundary.minLength: 1
project.workspacePathstring | nullYesDefines the workspacepath value at this contract boundary.
runnerstring | nullYesDefines the runner value at this contract boundary.
runtimeenumYesDefines 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
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai.project-test-coverage.v1"
sourceobjectYesDefines the source value at this contract boundary.additionalProperties: false
source.formatenumYesDefines 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.pathstring | nullYesDefines the path value at this contract boundary.
source.sha256string | nullYesDefines the sha256 value at this contract boundary.pattern: ^[a-f0-9]{64}$
statusenumYesDefines the status value at this contract boundary.enum: passed, below-target, unavailable, failed
targetobjectYesDefines the target value at this contract boundary.additionalProperties: false
target.metricenumYesDefines the metric value at this contract boundary.enum: lines, branches, functions, statements
target.percentintegerYesDefines 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
}