{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "title": "NextActionPlan",
  "type": "object",
  "required": ["generatedAt", "root", "phase", "actionId", "title", "command", "summary", "confidence", "safeToAutoApply", "classification", "evidence", "blockingConditions", "followUps", "alternatives"],
  "properties": {
    "generatedAt": { "type": "string", "minLength": 1 },
    "root": { "type": "string", "minLength": 1 },
    "phase": { "type": "string", "enum": ["setup", "operate", "maintain", "recover", "unknown"] },
    "actionId": { "type": "string", "minLength": 1 },
    "title": { "type": "string", "minLength": 1 },
    "command": { "type": "string", "minLength": 1 },
    "summary": { "type": "string", "minLength": 1 },
    "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
    "safeToAutoApply": { "type": "boolean" },
    "classification": { "type": "string", "enum": ["safe-auto", "safe-manual", "review-required", "unsafe-for-auto"] },
    "evidence": { "type": "array", "items": { "type": "object" } },
    "blockingConditions": { "type": "array", "items": { "type": "string" } },
    "followUps": { "type": "array", "items": { "type": "object", "required": ["actionId", "title", "command", "reason"], "properties": { "actionId": { "type": "string" }, "title": { "type": "string" }, "command": { "type": "string" }, "reason": { "type": "string" } } } },
    "alternatives": { "type": "array", "items": { "type": "object" } }
  }
}
