{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Agentic Engineering Harness TaskContract",
  "type": "object",
  "required": ["version", "task"],
  "properties": {
    "version": { "const": 1 },
    "mode": { "enum": ["spec", "quick"] },
    "task": { "type": "object", "required": ["id", "title"], "properties": { "id": { "type": "string" }, "title": { "type": "string" } } },
    "request": { "type": "string" },
    "quick": { "type": "object", "properties": { "request": { "type": "string" }, "acceptance": { "type": "array", "items": { "type": "string" } }, "triage": { "type": "object" } } },
    "source": { "type": "object", "properties": { "proposal": { "type": "string" }, "spec": { "type": "string" }, "design": { "type": "string" }, "tasks": { "type": "string" }, "acceptance": { "type": "string" }, "issue": { "type": "string" } } },
    "issue": { "type": "object", "required": ["provider", "repository", "number", "url", "state", "fetchedAt", "updatedAt", "contentSha256", "snapshotPath"], "properties": { "provider": { "const": "github" }, "repository": { "type": "string", "pattern": "^[^/]+/[^/]+$" }, "number": { "type": "integer", "minimum": 1 }, "url": { "type": "string", "format": "uri" }, "state": { "type": "string" }, "fetchedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "contentSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "snapshotPath": { "type": "string" } } },
    "git": { "type": "object", "properties": { "baseRef": { "type": "string" }, "originatingBranch": { "type": "string" } } },
    "scope": { "type": "object" },
    "routing": { "type": "object", "properties": { "intent": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "risk": { "enum": ["low", "medium", "high"] }, "agent": { "type": "string" }, "reviewers": { "type": "array", "items": { "type": "string" } }, "profile": { "type": "string" } } },
    "requirements": { "type": "array" }, "constraints": { "type": "object" }, "impact": { "type": "object" }, "repair": { "type": "object" }, "verification": { "type": "object" }
  }
}
