{
    "$schema": "../../../../schemas/diagram-spec.schema.json",
    "schemaVersion": "2.0",
    "diagramKind": "state",
    "id": "editorial-release-state",
    "title": "Editorial Release Lifecycle",
    "description": "A reachable editorial lifecycle with explicit guarded review outcomes.",
    "language": "en",
    "initialStateId": "draft",
    "nodes": [
        {
            "id": "draft",
            "type": "state",
            "title": "Draft",
            "description": "Authoring and revision remain open."
        },
        {
            "id": "in-review",
            "type": "state",
            "title": "In Review",
            "description": "Editorial and policy checks are running."
        },
        {
            "id": "approved",
            "type": "state",
            "title": "Approved",
            "description": "All required checks passed."
        },
        {
            "id": "rejected",
            "type": "state",
            "title": "Rejected",
            "description": "A blocking issue requires a new draft."
        },
        {
            "id": "published",
            "type": "state",
            "title": "Published",
            "description": "The approved article is publicly available."
        },
        {
            "id": "retired",
            "type": "final-state",
            "title": "Retired",
            "description": "The release lifecycle is complete."
        }
    ],
    "edges": [
        {
            "id": "submit",
            "type": "transition",
            "from": "draft",
            "to": "in-review",
            "event": "submit",
            "action": "freeze"
        },
        {
            "id": "approve",
            "type": "transition",
            "from": "in-review",
            "to": "approved",
            "event": "decide",
            "guard": "checks-pass",
            "action": "approve"
        },
        {
            "id": "reject",
            "type": "transition",
            "from": "in-review",
            "to": "rejected",
            "event": "decide",
            "guard": "policy-block",
            "action": "block"
        },
        {
            "id": "revise",
            "type": "transition",
            "from": "in-review",
            "to": "draft",
            "event": "decide",
            "guard": "else",
            "action": "revise"
        },
        {
            "id": "redraft",
            "type": "transition",
            "from": "rejected",
            "to": "draft",
            "event": "redraft"
        },
        {
            "id": "publish",
            "type": "transition",
            "from": "approved",
            "to": "published",
            "event": "publish",
            "action": "release"
        },
        {
            "id": "retire",
            "type": "transition",
            "from": "published",
            "to": "retired",
            "event": "retire",
            "action": "archive"
        }
    ]
}
