← Files OpsTruthARCHIVED FILE

contracts/donestate/verification-report-v1.schema.json

3.42 KB · Oct 3, 2026 · 06:32 UTC

↓ Download file

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/AyobamiH/donestate/schemas/verification-report-v1.schema.json",
  "title": "OpsTruth DoneState verification report v1",
  "type": "object",
  "required": ["schema", "runId", "handoffDigest", "verificationNonce", "observedAt", "subject", "decision", "requirementResults", "subjectErrors", "incompleteActions", "evidenceRefs", "changedState"],
  "additionalProperties": false,
  "properties": {
    "schema": { "const": "opstruth.donestate-verification-report.v1" },
    "runId": { "type": "string", "format": "uuid" },
    "handoffDigest": { "$ref": "#/$defs/digest" },
    "verificationNonce": { "$ref": "#/$defs/digest" },
    "observedAt": { "type": "string", "format": "date-time" },
    "subject": { "$ref": "#/$defs/subject" },
    "decision": { "enum": ["verified", "failed", "uncertain"] },
    "requirementResults": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/requirementResult" } },
    "subjectErrors": { "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_.:-]{0,127}$" } },
    "incompleteActions": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/incompleteAction" } },
    "evidenceRefs": { "type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": { "type": "string", "format": "uri", "pattern": "^https://" } },
    "changedState": { "const": false }
  },
  "$defs": {
    "digest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "commit": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
    "subject": {
      "type": "object",
      "required": ["repository", "providerRepositoryId", "baseHeadSha", "expectedHeadSha", "observedHeadSha"],
      "additionalProperties": false,
      "properties": {
        "repository": { "type": "string", "pattern": "^[A-Za-z0-9_.-]{1,100}/[A-Za-z0-9_.-]{1,100}$" },
        "providerRepositoryId": { "type": ["integer", "null"], "minimum": 1 },
        "baseHeadSha": { "$ref": "#/$defs/commit" },
        "expectedHeadSha": { "$ref": "#/$defs/commit" },
        "observedHeadSha": { "anyOf": [{ "$ref": "#/$defs/commit" }, { "type": "null" }] }
      }
    },
    "requirementResult": {
      "type": "object",
      "required": ["requirementId", "criterionIndex", "kind", "verdict", "observed", "evidenceRefs", "explanation"],
      "additionalProperties": false,
      "properties": {
        "requirementId": { "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,63}$" },
        "criterionIndex": { "type": "integer", "minimum": 0, "maximum": 19 },
        "kind": { "enum": ["path_exists", "path_absent", "file_contains", "json_equals", "changed_files", "github_checks_pass"] },
        "verdict": { "enum": ["VERIFIED", "CONTRADICTED", "UNPROVEN"] },
        "observed": {},
        "evidenceRefs": { "type": "array", "maxItems": 100, "uniqueItems": true, "items": { "type": "string", "format": "uri", "pattern": "^https://" } },
        "explanation": { "type": "string", "minLength": 1, "maxLength": 4000 },
        "reasonCode": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_.:-]{0,127}$" }
      }
    },
    "incompleteAction": {
      "type": "object",
      "required": ["id", "state"],
      "additionalProperties": false,
      "properties": {
        "id": { "type": "string", "minLength": 1, "maxLength": 200 },
        "state": { "enum": ["PENDING", "RUNNING", "FAILED", "AMBIGUOUS"] }
      }
    }
  }
}

SHA-256: c15295d0d87f66e0ca07d455e98c94a2a77a17b6dced7a1f56a8e90a557e4999