{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://acdl.cloudinit.dev/schemas/contract.schema.json", "title": "ACDL Contract", "description": "Consumer-declared intent. The central pipeline resolves a contract to a Target Stack IR (schemas/ir.schema.json), the Terraform adapter compiles the IR to a plan. Strict fail-fast at schema stage with reason codes from a published vocabulary.", "$comment": "Per-env mandatory inputs per W3.E (PROJECT.md). dev requires stack+environment; qa adds validation.e2eSuite + validation.loadTest; prod adds runbook+dashboard+oncall; dr adds drDrillRef. inputs always optional. profile: agentic fields optional everywhere (naturalLanguageIntent required when profile is agentic). W2.A (tag for dev/qa, SHA for prod) is a workflow-reference concern, not a schema field; the platform CLI resolves tag->SHA for prod-bound workflows.", "type": "object", "required": ["stack", "environment"], "properties": { "stack": { "type": "string", "pattern": "^l2-[a-z][a-z0-9-]*$", "description": "L2 thin-composition reference (resolved by the pipeline to a Target Stack IR)." }, "environment": { "type": "string", "enum": ["dev", "qa", "prod", "dr"], "description": "Target environment. Staging does not exist (Path A locked, ARCHITECTURE.md §5)." }, "inputs": { "type": "object", "description": "L2-level parameter map. Free-form in v1, typed per-L1 in v1.2 (W3.E).", "additionalProperties": {"type": ["string", "number", "boolean"]} }, "validation": { "type": "object", "description": "Validation evidence required in qa (W3.E).", "properties": { "e2eSuite": {"type": "string", "description": "Reference to the contract-declared e2e suite (last 24h, pass rate >= 99%)."}, "loadTest": {"type": "string", "description": "Reference to the load test report (last 7d, p99 < declared NFR)."} } }, "runbook": {"type": "string", "description": "Runbook reference, mandatory in prod (W3.E)."}, "dashboard": {"type": "string", "description": "Dashboard reference, mandatory in prod (W3.E)."}, "oncall": {"type": "string", "description": "On-call rotation reference, mandatory in prod (W3.E)."}, "drDrillRef": {"type": "string", "description": "DR drill report reference (last 180d), mandatory in dr (W3.E)."}, "profile": { "type": "string", "enum": ["developer", "agentic"], "default": "developer", "description": "Consumer surface. 'agentic' unlocks L3B fields (ARCHITECTURE.md §5)." }, "naturalLanguageIntent": { "type": "string", "description": "L3B: the original natural-language prompt. Required when profile is agentic (W3.E)." }, "confidenceAtSubmission": { "type": "number", "minimum": 0, "maximum": 1, "description": "L3B: the agent's self-reported confidence at submission time." }, "agentTrace": { "type": "string", "description": "L3B: reference to the agent's execution trace." }, "supersedes": { "type": "string", "format": "uuid", "description": "Prior contractId this re-submission replaces (after rejection — ARCHITECTURE.md §10.6)." } }, "allOf": [ { "if": {"properties": {"environment": {"const": "qa"}}}, "then": {"required": ["validation"], "properties": {"validation": {"required": ["e2eSuite", "loadTest"]}}} }, { "if": {"properties": {"environment": {"const": "prod"}}}, "then": {"required": ["runbook", "dashboard", "oncall"]} }, { "if": {"properties": {"environment": {"const": "dr"}}}, "then": {"required": ["drDrillRef"]} }, { "if": {"required": ["profile"], "properties": {"profile": {"const": "agentic"}}}, "then": {"required": ["naturalLanguageIntent"]} } ] }