{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://intentspec.org/schema.json",
    "title": "IntentSpec",
    "description": "A structured contract for AI Agent intent definition.",
    "type": "object",
    "required": [
        "id",
        "status",
        "objective",
        "outcomes"
    ],
    "properties": {
        "id": {
            "type": "string",
            "description": "Unique identifier for the intent specification."
        },
        "status": {
            "type": "string",
            "enum": [
                "draft",
                "validated",
                "approved",
                "shipped",
                "verified"
            ],
            "default": "draft"
        },
        "version": {
            "type": "integer",
            "default": 1
        },
        "objective": {
            "type": "string",
            "description": "The core problem to solve and why it matters."
        },
        "problemSeverity": {
            "type": "string",
            "enum": [
                "low",
                "medium",
                "high",
                "critical"
            ],
            "description": "Priority or severity of the problem."
        },
        "userGoal": {
            "type": "string",
            "description": "The specific goal the user is trying to achieve."
        },
        "outcomes": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Observable state changes indicating success."
        },
        "healthMetrics": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "metrics that must not degrade."
        },
        "constraints": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Hard boundaries the agent must respect."
        },
        "edgeCases": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "scenario": {
                        "type": "string"
                    },
                    "expectedBehavior": {
                        "type": "string"
                    }
                },
                "required": [
                    "scenario",
                    "expectedBehavior"
                ]
            }
        },
        "strategicAlignment": {
            "type": "string",
            "enum": [
                "high",
                "medium",
                "low",
                "deviation"
            ]
        },
        "alignmentNotes": {
            "type": "string"
        },
        "createdAt": {
            "type": "integer"
        },
        "updatedAt": {
            "type": "integer"
        }
    }
}