Signal Quest · Lecturer library

Rendered Mermaid diagrams, with source you can copy.

Each diagram is rendered from the canonical Mermaid source. Open “Copy Mermaid source” to paste an editable block into Excalidraw or your lecture notes. These are teaching diagrams and design targets, not claims of live-market performance or trading authority.

← Back to Machine Learning Masterclass

22 diagrams

D01

Full evidence-to-authority architecture

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","secondaryColor":"#050505","tertiaryColor":"#050505","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  subgraph E["EVIDENCE"]
    direction LR
    A["Raw events<br/>and hashes"] --> B{"Schema<br/>valid?"}
    B -->|yes| C{"Available<br/>by cutoff?"}
    B -->|no| Q["Quarantine"]
    C -->|yes| D["Feature recipe"]
    C -->|no| X["Ineligible"]
  end

  subgraph L["LEARNING"]
    direction LR
    D --> M["Frozen model"]
    M --> K["Frozen calibrator"]
    K --> P["Probability<br/>evidence"]
  end

  subgraph R["RESEARCH POLICY"]
    direction LR
    P --> G{"Hard gates<br/>pass?"}
    G -->|yes| V{"Conservative<br/>value positive?"}
    G -->|no| N["Abstain"]
    V -->|yes| PA["Paper action"]
    V -->|no| N
  end

  subgraph O["REPLAY AND RECORD"]
    direction LR
    PA --> RP["Event replay"]
    N --> RP
    RP --> DL["Decision ledger"]
  end

  subgraph U["AUTHORITY"]
    direction LR
    DL --> GD["Bounded guardian"]
    GD --> HR["Human review"]
    HR --> AP["Approve research<br/>state change"]
    GD -. no capability .-> NO["Live orders<br/>unavailable"]
  end

  classDef evidence fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef decision fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef good fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  classDef record fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:2px;
  classDef human fill:#050505,stroke:#FF7AE5,color:#F7F7F7,stroke-width:3px;
  class A,B,C,D evidence;
  class M,K,P model;
  class G,V decision;
  class PA good;
  class Q,X,N,NO stop;
  class RP,DL record;
  class GD,HR,AP human;
D02

Claim status and evidence promotion

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  I["Illustrative<br/>explains"] --> C["Consistency<br/>check"]
  S["Simulated<br/>synthetic output"] --> R["Seed, config,<br/>artifact"]
  P["Implemented<br/>local component"] --> T["Source and<br/>focused test"]
  D["Design target<br/>required behavior"] --> A["Acceptance<br/>test"]
  L["Literature-derived<br/>bounded setting"] --> B["Primary source<br/>and boundary"]

  C --> X{"Qualifying<br/>real-data run?"}
  R --> X
  T --> X
  A --> X
  B --> X
  X -->|no| N["Keep current<br/>status"]
  X -->|yes| M["Measured<br/>manifest + hashes +<br/>command + limits"]

  classDef info fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef method fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:2px;
  class I,S,P,D,L info;
  class C,R,T,A,B method;
  class X gate;
  class M pass;
  class N stop;
D03

The five clocks

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  E["1 · Event time<br/>source says"] --> R["2 · Receive time<br/>system sees"]
  R --> P["3 · Process time<br/>features ready"]
  P --> D["4 · Decision time<br/>policy ready"]
  D --> S["5 · Settlement time<br/>label known"]

  C(("cutoff")) -. eligible if<br/>receive ≤ cutoff .-> R
  R -. transport delay .-> P
  P -. compute delay .-> D
  S -. never a feature .-> C

  classDef clock fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef compute fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef action fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef future fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class E,R clock;
  class P compute;
  class D,C action;
  class S future;
D04

Label and feature eligibility

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart TB
  C["Decision cutoff t"]

  subgraph F["FEATURE SIDE"]
    direction LR
    RE["Raw event"] --> SV{"Schema valid?"}
    SV -->|yes| AV{"Receive time<br/>≤ t?"}
    SV -->|no| FR["Reject reason"]
    AV -->|yes| PHI["Recipe φ_k"]
    AV -->|no| FR
    PHI --> X["Eligible X_t"]
  end

  subgraph Y["LABEL SIDE"]
    direction LR
    LC["Source + horizon<br/>+ equality rule"] --> SR{"Settlement<br/>resolved?"}
    SR -->|yes| YY["Label Y_t"]
    SR -->|no| LR["Label pending<br/>or missing"]
  end

  C -. governs .-> AV
  C -. starts horizon .-> LC
  X --> PAIR{"Both sides<br/>admissible?"}
  YY --> PAIR
  FR --> NO["Row ineligible"]
  LR --> NO
  PAIR -->|yes| ROW["Training pair<br/>(X_t, Y_t)"]
  PAIR -->|no| NO

  classDef evidence fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef label fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:2px;
  class RE,PHI,X evidence;
  class LC,YY label;
  class C,SV,AV,SR,PAIR gate;
  class ROW pass;
  class FR,LR,NO stop;
D05

Temporal split with purge and embargo

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  TR["Earlier train<br/>fit parameters"] --> PU["PURGE<br/>drop crossing support"]
  PU --> VA["Validation<br/>select pipeline"]
  VA --> EM["EMBARGO<br/>declared gap"]
  EM --> TE["Later test<br/>open once"]

  FS["Feature support"] -. boundary audit .-> PU
  LS["Label support"] -. boundary audit .-> PU
  AD["Availability delay"] -. gap input .-> EM
  SB["Source behavior"] -. gap input .-> EM
  VA --> FZ["Freeze features,<br/>model, calibrator,<br/>threshold"]
  FZ --> TE
  TE --> CL["Claim about frozen<br/>procedure and interval"]

  classDef train fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef select fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef guard fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  classDef freeze fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef claim fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  class TR,FS,LS,AD,SB train;
  class VA select;
  class PU,EM guard;
  class FZ freeze;
  class TE,CL claim;
D06

Confusion matrix as four conditional events

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart TB
  AP["Actual +"] --> TP["TP<br/>Predict +"]
  AP --> FN["FN<br/>Predict −"]
  AN["Actual −"] --> FP["FP<br/>Predict +"]
  AN --> TN["TN<br/>Predict −"]

  TP --> PRE["Precision<br/>TP / predicted +"]
  FP --> PRE
  TP --> REC["Recall<br/>TP / actual +"]
  FN --> REC
  TN --> SPE["Specificity<br/>TN / actual −"]
  FP --> SPE
  TP --> ACC["Accuracy<br/>correct / all"]
  TN --> ACC

  classDef actual fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef correct fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef error fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  classDef metric fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  class AP,AN actual;
  class TP,TN correct;
  class FP,FN error;
  class PRE,REC,SPE,ACC metric;
D07

Threshold sweep

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  SC["Held-out scores"] --> SW["Sweep τ"]
  SW --> LO["Lower τ<br/>more predicted +"]
  SW --> MD["Middle τ<br/>tradeoff point"]
  SW --> HI["Higher τ<br/>fewer predicted +"]

  LO --> LR["Recall tends ↑<br/>FP may ↑"]
  MD --> UT["Evaluate declared<br/>utility and constraints"]
  HI --> HP["Precision may ↑<br/>FN may ↑"]

  LR --> VS["Validation-only<br/>selection"]
  UT --> VS
  HP --> VS
  VS --> FZ["Freeze τ and<br/>abstention region"]
  FZ --> FT["Final test<br/>estimate once"]

  classDef score fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef sweep fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef trade fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef freeze fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  class SC score;
  class SW,LO,MD,HI sweep;
  class LR,UT,HP,VS trade;
  class FZ,FT freeze;
D08

ROC versus precision–recall

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart TB
  S["Scores across<br/>thresholds"] --> R["ROC"]
  S --> P["Precision–recall"]

  R --> RX["x: FPR<br/>FP / actual −"]
  R --> RY["y: TPR<br/>TP / actual +"]
  R --> RI["Ranking view"]

  P --> PX["x: Recall<br/>TP / actual +"]
  P --> PY["y: Precision<br/>TP / predicted +"]
  P --> PI["Positive-class view<br/>prevalence matters"]

  RI --> NO["Neither proves<br/>calibration, value,<br/>or execution"]
  PI --> NO
  P --> AP["Name AP when<br/>AP is computed"]

  classDef input fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef roc fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef pr fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class S input;
  class R,RX,RY,RI roc;
  class P,PX,PY,PI,AP pr;
  class NO stop;
D09

Calibration and reliability

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  RS["Raw model score"] --> CF["Fit calibrator<br/>on validation"]
  CF --> CZ["Freeze calibrator"]
  CZ --> UP["Untouched<br/>probabilities"]
  UP --> BN["Bin forecasts"]
  BN --> MP["Mean predicted"]
  BN --> OR["Observed rate"]
  MP --> REL["Reliability<br/>comparison"]
  OR --> REL
  REL --> OK{"Adequate evidence<br/>with uncertainty?"}
  OK -->|yes| PP["Probability claim<br/>for stated interval"]
  OK -->|no| NP["Score only<br/>or abstain"]
  PP --> LIM["Not a future<br/>guarantee"]

  classDef score fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef method fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class RS,UP score;
  class CF,CZ,BN,MP,OR,REL method;
  class OK gate;
  class PP pass;
  class NP,LIM stop;
D10

Proper probabilistic scores

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart TB
  F["Forecast p"] --> B["Brier<br/>(p − y)²"]
  Y["Outcome y"] --> B
  F --> L["Log loss<br/>−log probability<br/>of observed class"]
  Y --> L

  B --> BS["Quadratic penalty"]
  L --> LS["Sharp penalty for<br/>confident error"]
  BS --> PR["Proper score<br/>truthful forecast favored<br/>in expectation"]
  LS --> PR
  PR --> CMP["Compare on same<br/>sample and protocol"]
  CMP --> REL["Add reliability,<br/>prevalence, uncertainty"]
  REL --> NO["Score alone does not<br/>isolate calibration<br/>or decision value"]

  classDef input fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef score fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef rule fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class F,Y input;
  class B,L,BS,LS score;
  class PR,CMP,REL rule;
  class NO stop;
D11

Expected value and abstention gates

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  P["Frozen probability"] --> G1{"Fresh data?"}
  G1 -->|yes| G2{"Artifacts match?"}
  G2 -->|yes| G3{"Calibration current?"}
  G3 -->|yes| G4{"Book and costs<br/>observable?"}
  G4 -->|yes| EV["Conservative EV<br/>probability × payoff<br/>− loss − costs<br/>− uncertainty"]
  EV --> POS{"EV clears<br/>declared buffer?"}
  POS -->|yes| PA["Paper-only action"]

  G1 -->|no| AB["Abstain<br/>with reason"]
  G2 -->|no| AB
  G3 -->|no| AB
  G4 -->|no| AB
  POS -->|no| AB
  PA --> BD["No live-order<br/>authority"]
  AB --> LG["Ledger"]
  PA --> LG

  classDef evidence fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef calc fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  classDef record fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:2px;
  class P evidence;
  class G1,G2,G3,G4,POS gate;
  class EV calc;
  class PA pass;
  class AB,BD stop;
  class LG record;
D12

Gradient boosting from the loss downward

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  D["Training rows"] --> F0["Base score F₀"]
  F0 --> LS["Evaluate loss"]
  LS --> NG["Negative gradient<br/>pseudo-residual"]
  NG --> WT["Fit weak tree h_m"]
  WT --> UP["Update<br/>F_m = F_m−1 + ηh_m"]
  UP --> VS{"Validation<br/>stop?"}
  VS -->|continue| LS
  VS -->|stop| EN["Frozen ensemble"]
  EN --> CA["Splits describe<br/>model behavior,<br/>not causation"]

  classDef data fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:2px;
  class D data;
  class F0,LS,NG,WT,UP model;
  class VS gate;
  class EN pass;
  class CA stop;
D13

CatBoost ordered category statistic

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  P["Training permutation"] --> RI["Current row i<br/>category c"]
  P --> PRE["Rows before i"]
  PRE --> SAME["Earlier rows<br/>with category c"]
  SAME --> ST["Earlier labels<br/>+ prior + smoothing"]
  ST --> ENC["Ordered statistic<br/>for row i"]
  RI --> ENC
  ENC --> BT["Boosted-tree input"]

  FUT["Rows after i"] -. forbidden in<br/>this statistic .-> ENC
  BT --> WARN["Still audit feature clocks,<br/>folds, purge, embargo"]
  WARN --> NOTE["Ordered method ≠<br/>chronological validation"]

  classDef data fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef method fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class P,RI,PRE,SAME data;
  class ST,ENC,BT method;
  class WARN gate;
  class FUT,NOTE stop;
D14

Self-supervised pretraining boundary

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  TR["Training-period<br/>eligible LOB windows"] --> VIEW["Causal input view<br/>mask or transform"]
  VIEW --> ENC["Encoder"]
  ENC --> DEC["Pretext head"]
  DEC --> PL["Pretext loss"]
  PL --> ENC

  ENC --> CH{"Transfer choice<br/>on validation"}
  CH --> FR["Freeze encoder"]
  CH --> FT["Fine-tune encoder"]
  FR --> DH["Direction head"]
  FT --> DH
  DH --> EV["Untouched temporal<br/>downstream evaluation"]

  FUT["Future or final-period<br/>behavior"] -. must not select<br/>the pretext system .-> VIEW
  PL --> NO["Low pretext loss ≠<br/>direction skill"]

  classDef data fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class TR,VIEW data;
  class ENC,DEC,PL,FR,FT,DH model;
  class CH gate;
  class EV pass;
  class FUT,NO stop;
D15

Causal LOB Transformer

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  LOB["Eligible LOB<br/>events ≤ cutoff"] --> TOK["Causal tokens<br/>price × side × time"]
  TOK --> NORM["Train-fitted<br/>normalization"]
  NORM --> SPA["Spatial encoder"]
  SPA --> TMP["Temporal attention"]
  MASK["Lower-triangular<br/>permission mask"] --> TMP
  TMP --> REP["Representation at t"]
  REP --> HEAD["Direction head"]
  HEAD --> SCORE["Score at t"]

  FUT["Future raw events"] -. blocked .-> TOK
  FUT --> PERT["Future-event<br/>perturbation test"]
  SCORE --> PERT
  PERT --> INV{"Earlier score<br/>unchanged?"}
  INV -->|yes| NAR["Past-only invariant<br/>for tested path"]
  INV -->|no| FAIL["Causal contract fails"]
  NAR --> LIM["Not causal-effect<br/>identification"]

  classDef data fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class LOB,TOK,NORM,FUT data;
  class SPA,TMP,MASK,REP,HEAD,SCORE model;
  class PERT,INV gate;
  class NAR pass;
  class FAIL,LIM stop;
D16

The model ladder

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  C["Constant<br/>probability"] --> M["Majority<br/>class"]
  M --> X["Valid external<br/>reference"]
  X --> LR["Regularized<br/>logistic"]
  LR --> CB["CatBoost<br/>tabular"]
  CB --> EN["SSL encoder<br/>+ simple head"]
  EN --> SEL{"Select one<br/>sequence family"}
  SEL --> TL["TLOB"]
  SEL --> LI["LiT"]
  TL --> ES["Predeclared<br/>ensemble test"]
  LI --> ES

  SAME["Same labels, eligibility,<br/>splits, costs, opportunities"] -. governs every rung .-> C
  SAME -.-> LR
  SAME -.-> CB
  SAME -.-> EN
  SAME -.-> SEL
  PROOF["Advance only with<br/>incremental held-out evidence<br/>and latency budget"] -. gate .-> LR
  PROOF -. gate .-> CB
  PROOF -. gate .-> EN
  PROOF -. gate .-> SEL

  classDef base fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:3px;
  classDef advanced fill:#050505,stroke:#FF7AE5,color:#F7F7F7,stroke-width:2px;
  class C,M,X,LR base;
  class CB,EN model;
  class SAME,PROOF,SEL gate;
  class TL,LI,ES advanced;
D17

Supervised learning versus reinforcement learning

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart TB
  Q["Learning question"] --> SL["SUPERVISED"]
  Q --> RL["REINFORCEMENT"]

  SL --> SD["Historical pairs<br/>(X, Y)"]
  SD --> SF["Fit forecast fθ"]
  SF --> SP["Estimate settlement<br/>probability"]
  SP --> DP["Separate frozen<br/>research policy"]

  RL --> ST["State"]
  ST --> AC["Agent action"]
  AC --> ENV["Environment<br/>transition"]
  ENV --> RW["Action-dependent<br/>reward"]
  RW --> LP["Learn policy"]
  LP --> AC

  DP --> IN["Signal Quest scope"]
  LP --> OUT["Out of scope:<br/>no reward optimizer,<br/>exploration, or order authority"]

  classDef root fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:2px;
  classDef supervised fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef policy fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef rl fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class Q root;
  class SL,SD,SF,SP supervised;
  class DP,IN policy;
  class RL,ST,AC,ENV,RW,LP rl;
  class OUT stop;
D18

LLM code-generation gate

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  CT["Small code contract<br/>inputs, outputs, bans"] --> CX["Bounded context<br/>untrusted text = data"]
  CX --> LLM["LLM proposal"]
  LLM --> PR["Store response<br/>and hash"]
  PR --> ST{"Static checks<br/>pass?"}
  ST -->|yes| HR{"Human diff<br/>approves test?"}
  HR -->|yes| SB["Isolated test<br/>no secrets or network"]
  SB --> TS{"Named tests<br/>pass?"}
  TS -->|yes| EV["Retained evidence<br/>and limits"]
  EV --> AC["Human accepts<br/>candidate patch"]

  ST -->|no| RJ["Reject proposal"]
  HR -->|no| RJ
  TS -->|no| RJ
  ORD["Order APIs and<br/>credentials absent"] -. capability boundary .-> SB

  classDef input fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  classDef human fill:#050505,stroke:#FF7AE5,color:#F7F7F7,stroke-width:3px;
  class CT,CX input;
  class LLM,PR model;
  class ST,TS,SB gate;
  class EV pass;
  class HR,AC human;
  class RJ,ORD stop;
D19

Event-driven replay

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  CE["Captured events<br/>with receive time"] --> PQ["Stable event queue<br/>availability order"]
  PQ --> ST["Replay state"]
  ST --> CO{"Decision cutoff?"}
  CO -->|no| PQ
  CO -->|yes| EL["Expose only<br/>eligible evidence"]
  EL --> FE["Feature + model<br/>+ calibrator latency"]
  FE --> PO["Frozen policy"]
  PO --> EA["Earliest action time"]
  EA --> BK["Observable bid/ask<br/>and visible depth"]
  BK --> FI["Simulated partial,<br/>full, or no fill"]
  FI --> CS["Dated costs and<br/>declared assumptions"]
  CS --> SE["Later settlement"]
  SE --> LG["Append decision row"]

  LATE["Late or out-of-order<br/>event"] --> PQ
  LATE -. preserved, not<br/>backdated .-> LG
  LG --> LIM["Simulation under assumptions<br/>≠ future execution"]

  classDef data fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef method fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef record fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class CE,PQ,ST,LATE data;
  class EL,FE,PO,EA,BK,FI,CS,SE method;
  class CO gate;
  class LG record;
  class LIM stop;
D20

Immutable decision ledger

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart TB
  ID["Decision ID"] --> LG["Append-only<br/>decision record"]
  RAW["Raw-input hashes<br/>and receive order"] --> LG
  FT["Feature recipe<br/>and vector hash"] --> LG
  MOD["Model + calibrator<br/>artifact IDs"] --> LG
  CFG["Policy + config<br/>versions"] --> LG
  CLK["Cutoff + compute<br/>+ action clocks"] --> LG
  GAT["Gate results<br/>and reason codes"] --> LG
  EXE["Book + costs<br/>+ fill assumption"] --> LG
  OUT["Action or abstention<br/>+ settlement"] --> LG

  LG --> RC["Reconstruct one<br/>decision"]
  RC --> EQ{"Canonical output<br/>matches?"}
  EQ -->|yes| OK["Identity reproduced"]
  EQ -->|no| BAD["Replay divergence<br/>invalidates report"]
  OK --> LIM["Identity match<br/>does not prove realism"]

  classDef id fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:3px;
  classDef evidence fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef model fill:#050505,stroke:#A78BFA,color:#F7F7F7,stroke-width:2px;
  classDef record fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:3px;
  classDef pass fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:2px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class ID,GAT id;
  class RAW,FT,CLK evidence;
  class MOD,CFG,EXE model;
  class LG,OUT,RC,EQ record;
  class OK pass;
  class BAD,LIM stop;
D21

Bounded guardian

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  OB["Observe<br/>structured evidence"] --> PR{"Frozen predicate<br/>fails?"}
  PR -->|no| HL["Record healthy<br/>check only"]
  PR -->|yes| AL{"Allowlisted<br/>runbook exists?"}
  AL -->|no| ES["Escalate<br/>no action"]
  AL -->|yes| CT["Reversible containment<br/>stop, quarantine,<br/>mark ineligible"]
  CT --> VF{"Postcondition<br/>verified?"}
  VF -->|yes| AU["Audit event<br/>+ rollback ref"]
  VF -->|no| ES
  AU --> ES
  ES --> HU["Human owner"]

  HU --> RM["Human-reviewed<br/>remediation path"]
  NO["No credentials or APIs<br/>for live orders"] -. enforced boundary .-> CT
  CH["No schema, model,<br/>threshold, or policy approval"] -. withheld authority .-> CT

  classDef evidence fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef contain fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef record fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:2px;
  classDef human fill:#050505,stroke:#FF7AE5,color:#F7F7F7,stroke-width:3px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class OB evidence;
  class PR,AL,VF gate;
  class CT contain;
  class HL,AU record;
  class ES,HU,RM human;
  class NO,CH stop;
D22

One end-to-end schema incident

Copy Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#000000","primaryColor":"#050505","primaryTextColor":"#F7F7F7","primaryBorderColor":"#31E7FF","lineColor":"#D6DEE8","fontFamily":"Inter, Arial, sans-serif"},"flowchart":{"curve":"linear","htmlLabels":true}}}%%
flowchart LR
  EV["Unknown schema<br/>arrives"] --> RAW["Preserve payload,<br/>schema ID, hash"]
  RAW --> VAL{"Known schema?"}
  VAL -->|no| IN["Derived rows<br/>ineligible"]
  IN --> AB["Policy abstains"]
  IN --> GD["Guardian verifies<br/>predicate"]
  GD --> QT["Quarantine partition"]
  QT --> VR{"Containment<br/>verified?"}
  VR -->|no| ESC["Escalate with<br/>failed verification"]
  VR -->|yes| PA["Pause affected report"]
  PA --> IB["Incident bundle<br/>hashes, intervals,<br/>reasons, rollback"]
  AB --> IB
  IB --> HO["Human data-contract<br/>owner"]
  HO --> FIX["Approve scoped<br/>schema repair"]
  FIX --> TS["Focused tests<br/>+ causal fixtures<br/>+ replay comparison"]
  TS --> DEC{"Human accepts<br/>evidence?"}
  DEC -->|yes| RS["Restore eligible<br/>research state"]
  DEC -->|no| QT
  RS --> AUD["Link approval and<br/>new artifact versions"]

  ORD["Live orders<br/>unavailable"] -. throughout incident .-> AB

  classDef evidence fill:#050505,stroke:#31E7FF,color:#F7F7F7,stroke-width:2px;
  classDef gate fill:#050505,stroke:#FFD166,color:#F7F7F7,stroke-width:2px;
  classDef contain fill:#050505,stroke:#65FF9A,color:#F7F7F7,stroke-width:3px;
  classDef record fill:#050505,stroke:#F5F5F5,color:#F7F7F7,stroke-width:2px;
  classDef human fill:#050505,stroke:#FF7AE5,color:#F7F7F7,stroke-width:3px;
  classDef stop fill:#050505,stroke:#FF5C7A,color:#F7F7F7,stroke-width:3px;
  class EV,RAW evidence;
  class VAL,VR,DEC gate;
  class GD,QT,PA,TS,RS contain;
  class IB,AUD record;
  class HO,FIX human;
  class IN,AB,ESC,ORD stop;