{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/schemas/workspace-intelligence/verified-goal-status.v1.json",
  "title": "Workspai Verified Goal Status",
  "description": "The durable progress and evidence-derived terminal state of a Workspai verified goal.",
  "type": "object",
  "required": ["schemaVersion", "goalId", "goalFingerprint", "workspacePath", "updatedAt", "state", "attempt", "progress", "checks", "blockingReasons", "evidencePaths", "nextActions", "artifactPath"],
  "properties": {
    "schemaVersion": { "const": "workspai.verified-goal-status.v1" },
    "goalId": { "type": "string", "minLength": 8 },
    "goalFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "workspacePath": { "type": "string", "minLength": 1 },
    "updatedAt": { "type": "string", "format": "date-time" },
    "state": { "enum": ["planned", "active", "blocked", "verified", "failed", "cancelled"] },
    "attempt": { "type": "integer", "minimum": 0 },
    "progress": { "$ref": "#/$defs/measurement" },
    "checks": { "type": "array", "items": { "type": "object", "required": ["id", "label", "status", "expected", "actual", "message"], "properties": { "id": { "type": "string", "minLength": 1 }, "label": { "type": "string", "minLength": 1 }, "status": { "enum": ["passed", "failed", "blocked", "missing", "skipped"] }, "expected": { "type": "string", "minLength": 1 }, "actual": { "type": "string", "minLength": 1 }, "evidencePath": { "type": "string", "minLength": 1 }, "message": { "type": "string", "minLength": 1 } }, "additionalProperties": false } },
    "blockingReasons": { "type": "array", "items": { "type": "string", "minLength": 1 } },
    "evidencePaths": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
    "nextActions": { "type": "array", "items": { "type": "string", "minLength": 1 } },
    "artifactPath": { "type": "string", "minLength": 1 }
  },
  "$defs": {
    "measurement": { "type": "object", "required": ["measuredAt", "value", "target", "unit", "status", "evidencePaths", "message"], "properties": { "measuredAt": { "type": "string", "format": "date-time" }, "value": { "type": ["number", "null"] }, "target": { "type": ["number", "null"] }, "unit": { "enum": ["percent", "blocking-vulnerabilities", "gates", "unknown"] }, "status": { "enum": ["satisfied", "unsatisfied", "unavailable"] }, "evidencePaths": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "message": { "type": "string", "minLength": 1 } }, "additionalProperties": false }
  },
  "additionalProperties": false
}
