# Signal Quest Mermaid Library for Excalidraw

This lecturer-facing library follows the canonical masterclass from measurement through governed refusal. Each block is standalone and can be pasted into Excalidraw's Mermaid dialog. The dark fills and high-contrast strokes are designed to remain legible on a Vantablack-style canvas.

These are conceptual teaching diagrams, not results figures. **Design target** describes required or proposed system behavior; **Literature-derived** describes a bounded mechanism from the cited method family; neither status asserts implementation, BTC/Polymarket performance, profitability, or live-trading authority. The one incident is explicitly **Illustrative**. A probability is evidence, not permission.

## Diagram-to-lecture map

| ID | Diagram | Lecture module | PPTX physical slides | Canonical manuscript section |
|---|---|---|---:|---|
| D01 | Evidence-to-authority architecture | S0–S10 | 134–137 | Final synthesis: the complete Signal Quest |
| D02 | Claim status and promotion | S0 | 2–3 | Delivery contract; Source and epistemic note |
| D03 | Five clocks | S4, S9 | 14, 117–119 | The evidence set has a clock |
| D04 | Label and feature eligibility | S0, S4 | 8–19 | The first object is not a model; Raw evidence before clean rows |
| D05 | Temporal split, purge, and embargo | S4 | 24–25 | Train, validation, and test are different roles |
| D06 | Confusion matrix | S2 | 39–44 | Begin with the confusion matrix |
| D07 | Threshold sweep | S2, S3 | 45–47 | A hard prediction is a thresholded score |
| D08 | ROC versus precision–recall | S2 | 45–47 | AUC cannot select the decision alone |
| D09 | Calibration | S3 | 48–56 | Calibration: when a score may speak probability |
| D10 | Proper scores | S2, S3 | 53–56 | Calibration; proper-score worked trace |
| D11 | Expected value and abstention gates | S3 | 57–63 | Expected value is a policy calculation; Abstention is a first-class output |
| D12 | Gradient boosting | S5 | 74–77 | Gradient boosting from the loss downward |
| D13 | CatBoost ordered statistics | S5 | 78–83 | Why CatBoost is a demanding tabular baseline |
| D14 | Self-supervised pretraining | S6 | 86–90 | From engineered rows to learned representations; Freeze, fine-tune, or ensemble |
| D15 | Causal LOB Transformer | S7 | 91–99 | Attention as tensor computation; Causal architecture is not causal evidence |
| D16 | Model ladder | S5–S7 | 74–107 | The baseline is an instrument; Final synthesis |
| D17 | Supervised learning versus RL | S1, S10 | 100, 107, 143 | A supplemental contrast: reinforcement learning |
| D18 | LLM code-generation gate | S8 | 109–115 | The LLM plus Python workflow; A teleprompt-ready gated code trace |
| D19 | Event-driven replay | S9 | 116–123 | Replay is an executable causal claim; Fees, latency, and fills |
| D20 | Decision ledger | S9 | 121–123 | The immutable decision ledger |
| D21 | Bounded guardian | S10 | 124–126 | Bounded agentic monitoring; The authority matrix |
| D22 | End-to-end schema incident | S10 | 127–132 | The cumulative incident trace |

## Movement I — Measurement

### D01 — Full evidence-to-authority architecture

**Teaching purpose.** Show that evidence can flow from capture to a paper-only research decision while authority remains separated, bounded, and human-governed.

**Status:** Design target — architecture, not an implementation or performance claim.

```mermaid
%%{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

**Teaching purpose.** Make students distinguish a teaching artifact or proposed mechanism from a measured claim that requires retained real-data evidence.

**Status:** Design target — epistemic workflow.

```mermaid
%%{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

**Teaching purpose.** Separate when an event occurred, arrived, finished processing, became actionable, and later resolved its label.

**Status:** Design target — temporal contract.

```mermaid
%%{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

**Teaching purpose.** Show that a row is usable only when its feature evidence was available by the cutoff and its later label follows the frozen settlement contract.

**Status:** Design target — eligibility contract.

```mermaid
%%{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

**Teaching purpose.** Demonstrate how overlapping feature or label support is removed before evaluation and how a declared gap protects the next interval.

**Status:** Design target — durations must be derived from the actual clock and overlap contract.

```mermaid
%%{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;
```

## Movement II — Decision

### D06 — Confusion matrix as four conditional events

**Teaching purpose.** Ground every threshold metric in the four outcome counts and make its denominator visible.

**Status:** Literature-derived — standard binary-classification definitions, with no empirical counts shown.

```mermaid
%%{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

**Teaching purpose.** Show that moving the threshold changes the operating tradeoff and that selection belongs to validation rather than the final test.

**Status:** Literature-derived — standard threshold behavior; the selected point is a design decision.

```mermaid
%%{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

**Teaching purpose.** Contrast the denominators and interpretations of ROC and precision–recall while refusing to treat either curve as calibration or decision value.

**Status:** Literature-derived — standard ranking diagnostics.

```mermaid
%%{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

**Teaching purpose.** Explain how a frozen calibrator earns probability language on untouched temporal evidence without turning historical reliability into a guarantee.

**Status:** Design target — no current Signal Quest calibration claim.

```mermaid
%%{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

**Teaching purpose.** Compare Brier score and log loss as proper whole-forecast scores and separate both from a standalone claim about calibration.

**Status:** Literature-derived — standard proper-score interpretation.

```mermaid
%%{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

**Teaching purpose.** Show that conservative expected value is evaluated only after hard evidence gates pass and can authorize at most a paper-only research action.

**Status:** Design target — policy logic, not a profitability claim.

```mermaid
%%{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;
```

## Movement III — Representation

### D12 — Gradient boosting from the loss downward

**Teaching purpose.** Present boosting as sequential correction of the current ensemble under a declared loss rather than as a collection of causal rules.

**Status:** Literature-derived — simplified gradient-boosting mechanism.

```mermaid
%%{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

**Teaching purpose.** Explain how an ordered category statistic uses only earlier rows in a permutation while remaining separate from market-time validation.

**Status:** Literature-derived — CatBoost mechanism, not local Signal Quest performance.

```mermaid
%%{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

**Teaching purpose.** Show how pretext learning can build an encoder from training-period input structure while downstream direction skill remains a separate test.

**Status:** Literature-derived mechanism plus Design target evaluation boundary.

```mermaid
%%{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

**Teaching purpose.** Trace eligible order-book tokens through spatial and past-only temporal attention while testing that future perturbations cannot change an earlier score.

**Status:** Literature-derived architecture family plus Design target end-to-end causal test.

```mermaid
%%{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

**Teaching purpose.** Frame model complexity as a sequence of increasingly demanding hypotheses that must earn advancement under one temporal and policy contract.

**Status:** Design target — comparison protocol, not a ranking result.

```mermaid
%%{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

**Teaching purpose.** Distinguish fitting labeled settlement forecasts from learning an action policy through reward-bearing environment interaction.

**Status:** Literature-derived conceptual contrast; RL is intentionally out of Signal Quest scope.

```mermaid
%%{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;
```

## Movement IV — Governed Deployment

### D18 — LLM code-generation gate

**Teaching purpose.** Position LLM-generated code as a preserved proposal that cannot execute or become accepted evidence until independent gates pass.

**Status:** Implemented teaching workflow at narrow scope; not proof that generated code is safe or scientifically valid.

```mermaid
%%{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

**Teaching purpose.** Show a proposed evaluator advancing in availability order and applying latency, executable-book, cost, and settlement assumptions before recording a simulated outcome.

**Status:** Design target — the contracted event-driven evaluator is not currently implemented.

```mermaid
%%{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

**Teaching purpose.** Make one decision reconstructible from frozen evidence, versions, gates, execution assumptions, and later outcome without dropping refusals.

**Status:** Design target — required lineage, not current byte-for-byte replay evidence.

```mermaid
%%{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

**Teaching purpose.** Define the guardian as a fixed-predicate, allowlisted containment loop that records and escalates without changing scientific contracts or touching orders.

**Status:** Design target — bounded monitor architecture; local notebook functions are evidence-only teaching components.

```mermaid
%%{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

**Teaching purpose.** Walk one unknown-schema incident from immutable capture through fail-closed abstention, bounded containment, human-approved repair, and verified restoration.

**Status:** Illustrative — a constructed incident trace, not an observed production event.

```mermaid
%%{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;
```

## Lecturer close

Use D01 to open the system, D03–D05 to establish temporal admissibility, D06–D11 to separate ranking, probability, and policy, D12–D17 to make model complexity earn its place, and D18–D22 to end with replayable evidence and bounded authority. The completion sentence remains: the system refuses when either evidence or authority is incomplete.
