flowchart TB
Start["Student requests a page
covered by an active experiment"]:::start
OptOut{"District opted out
of experimentation?"}:::decide
Reach{"Assignment service
reachable?"}:::decide
C1["Serve control arm
excluded from randomization"]:::control
C2["Serve control arm
non-blocking fallback; statement still recorded"]:::control
Hash["Compute variant = hash(experiment_id, unit_id) mod k"]:::path
Edge["Look up ASSIGNED_TO edge,
or create it on first assignment"]:::path
Sticky["Serve the assigned variant
sticky for this student"]:::sticky
Start --> OptOut
OptOut -->|yes| C1
OptOut -->|no| Reach
Reach -->|no| C2
Reach -->|yes| Hash --> Edge --> Sticky
classDef start fill:#37474f,stroke:#1c2529,color:#fff,font-size:12px
classDef decide fill:#e9a23b,stroke:#b8791f,color:#222,font-size:12px
classDef control fill:#8b9bb0,stroke:#5f6e82,color:#fff,font-size:12px
classDef path fill:#5cbca0,stroke:#3b9b80,color:#08312c,font-size:12px
classDef sticky fill:#2a9d8f,stroke:#1f7a6f,color:#fff,font-size:12px
linkStyle default stroke:#999,stroke-width:2px