{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aiosforge.dev/schemas/parallel-status.schema.json",
  "title": "AIOSON parallel:status --json output",
  "type": "object",
  "required": [
    "ok",
    "targetDir",
    "parallelDir",
    "laneCount",
    "statusCounts",
    "scopeCount",
    "blockerCount",
    "deliverables",
    "sharedDecisions",
    "lanes"
  ],
  "properties": {
    "ok": { "type": "boolean", "const": true },
    "targetDir": { "type": "string" },
    "parallelDir": { "type": "string" },
    "laneCount": { "type": "integer", "minimum": 1 },
    "statusCounts": {
      "type": "object",
      "required": ["pending", "in_progress", "completed", "merged", "blocked", "other"],
      "properties": {
        "pending": { "type": "integer", "minimum": 0 },
        "in_progress": { "type": "integer", "minimum": 0 },
        "completed": { "type": "integer", "minimum": 0 },
        "merged": { "type": "integer", "minimum": 0 },
        "blocked": { "type": "integer", "minimum": 0 },
        "other": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": true
    },
    "scopeCount": { "type": "integer", "minimum": 0 },
    "blockerCount": { "type": "integer", "minimum": 0 },
    "deliverables": {
      "type": "object",
      "required": ["completed", "total"],
      "properties": {
        "completed": { "type": "integer", "minimum": 0 },
        "total": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": true
    },
    "sharedDecisions": {
      "type": "object",
      "required": ["exists", "entries"],
      "properties": {
        "exists": { "type": "boolean" },
        "entries": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": true
    },
    "machineFiles": {
      "type": "object",
      "properties": {
        "workspaceManifest": { "type": "boolean" },
        "ownershipMap": { "type": "boolean" },
        "mergePlan": { "type": "boolean" }
      },
      "additionalProperties": true
    },
    "ownership": {
      "type": "object",
      "properties": {
        "assignedScopeCount": { "type": "integer", "minimum": 0 },
        "conflictCount": { "type": "integer", "minimum": 0 },
        "conflicts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "scope_key": { "type": "string" },
              "lanes": {
                "type": "array",
                "items": { "type": "integer", "minimum": 1 }
              }
            },
            "additionalProperties": true
          }
        }
      },
      "additionalProperties": true
    },
    "writeScope": {
      "type": "object",
      "properties": {
        "laneCount": { "type": "integer", "minimum": 0 },
        "totalPathCount": { "type": "integer", "minimum": 0 },
        "uncoveredAssignedLaneCount": { "type": "integer", "minimum": 0 },
        "invalidPatternCount": { "type": "integer", "minimum": 0 },
        "conflictCount": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": true
    },
    "dependencies": {
      "type": "object",
      "properties": {
        "declaredCount": { "type": "integer", "minimum": 0 },
        "invalidCount": { "type": "integer", "minimum": 0 },
        "blockedCount": { "type": "integer", "minimum": 0 },
        "orderViolationCount": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": true
    },
    "merge": {
      "type": "object",
      "properties": {
        "strategy": { "type": ["string", "null"] },
        "order": {
          "type": "array",
          "items": { "type": "integer", "minimum": 1 }
        },
        "laneCount": { "type": "integer", "minimum": 0 },
        "orderViolationCount": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": true
    },
    "sync": {
      "type": "object",
      "properties": {
        "workspaceManifestInSync": { "type": "boolean" },
        "ownershipMapInSync": { "type": "boolean" },
        "mergePlanInSync": { "type": "boolean" },
        "staleFiles": {
          "type": "array",
          "items": { "type": "string" }
        }
      },
      "additionalProperties": true
    },
    "lanes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "lane",
          "file",
          "status",
          "owner",
          "priority",
          "updatedAt",
          "scopeCount",
          "blockerCount",
          "deliverables"
        ],
        "properties": {
          "lane": { "type": "integer", "minimum": 1 },
          "file": { "type": "string" },
          "status": { "type": "string" },
          "owner": { "type": "string" },
          "priority": { "type": "string" },
          "updatedAt": { "type": "string" },
          "scopeCount": { "type": "integer", "minimum": 0 },
          "dependencyCount": { "type": "integer", "minimum": 0 },
          "dependencies": {
            "type": "array",
            "items": { "type": "string" }
          },
          "mergeRank": { "type": "integer", "minimum": 1 },
          "writePathCount": { "type": "integer", "minimum": 0 },
          "writePaths": {
            "type": "array",
            "items": { "type": "string" }
          },
          "blockerCount": { "type": "integer", "minimum": 0 },
          "deliverables": {
            "type": "object",
            "required": ["completed", "total"],
            "properties": {
              "completed": { "type": "integer", "minimum": 0 },
              "total": { "type": "integer", "minimum": 0 }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
