{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oms.local/schemas/service-plan.schema.json",
  "title": "OMS generated reconciliation service plan",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "manager", "executable_path", "state_root", "workspace_root", "jobs"],
  "properties": {
    "schema_version": { "const": 1 },
    "manager": { "type": "string", "enum": ["cron", "systemd", "launchd"] },
    "executable_path": { "type": "string", "minLength": 2, "maxLength": 4096 },
    "state_root": { "type": "string", "minLength": 2, "maxLength": 4096 },
    "workspace_root": { "type": "string", "minLength": 2, "maxLength": 4096 },
    "jobs": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "interval_seconds", "argv"],
        "properties": {
          "id": { "type": "string", "enum": ["minute", "watchdog"] },
          "interval_seconds": { "type": "integer", "minimum": 60, "maximum": 900 },
          "argv": {
            "type": "array",
            "minItems": 8,
            "maxItems": 8,
            "items": { "type": "string", "minLength": 1, "maxLength": 4096 }
          }
        }
      }
    }
  }
}
