%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#1B1B1B", "primaryBorderColor": "#D6002A", "primaryTextColor": "#fff", "secondaryColor": "#fff", "secondaryBorderColor": "#D6002A", "secondaryTextColor": "#1B1B1B", "tertiaryColor": "#F0F0F0", "clusterBkg": "#F0F0F0", "lineColor": "#1B1B1B", "fontFamily": "\"Akkurat Pro\", \"Helvetica Neue\", \"Arial\", sans-serif"}}}%%

flowchart LR
    A["Deployment arrives\nat env gate"] --> B["Confidence signal\ncomputed"]
    B --> C{"Meets\nthreshold?"}
    C -->|No / Critical| D["Halt —\nexplainable reason"]
    C -->|Yes| E{"Human attestation\nrequired?"}
    E -->|No — dev| F["Autonomous\nproceed"]
    E -->|Yes — qa/prod/dr| G["Approver reviews:\ncontract + plan + evidence"]
    G --> H{"Approver\ndecides"}
    H -->|Approve| I["Attestation recorded\n(identity + state)"]
    H -->|Reject| J["Halt — rejection\nextends audit chain"]
    I --> K["Deployment\nproceeds"]
    F --> K
    K --> L["Evidence written\nRPO=0"]
classDef accent fill:#1B1B1B,color:#fff,stroke:#D6002A,stroke-width:2px
classDef supporting fill:#fff,color:#1B1B1B,stroke:#D6002A,stroke-width:1px
class C,E,I,K,L accent

