Hookline
Sign in
Overall system architectureDetailed internals

The whole system on one page.

Three subsystems, one runtime, one analysis engine, two tables. Everything a learner touches travels the same short path — browser, named call, edge, engine, storage — and every hop is a boundary with a rule attached.

3 subsystems5 layers2 tablesPython 3 reference
Data flow diagramascii
        learner
           │
           ▼
   ┌──────────────────┐   first load: server-rendered HTML
   │   browser tab    │──────────────┬───────────────────────┐
   │  React interface │              │                       │
   └────────┬─────────┘              ▼                       │
            │ later: named        ┌──────────────────────────┴──┐
            │ server-function     │   edge runtime (Workers)    │
            │ calls only          │   routes · guards · RPC     │
            └────────────────────▶└──┬────────┬────────┬────────┘
                                      │        │        │
                     ┌────────────────┘        │        └────────────────┐
                     ▼                         ▼                         ▼
          ┌────────────────────┐    ┌────────────────────┐    ┌────────────────────┐
          │   scenario data    │    │  analysis engine   │    │    entity store    │
          │  + reference pages │    │  A–Z codes + model │    │  RLS per owner     │
          └────────────────────┘    └─────────┬──────────┘    └────────────────────┘
                                              ▼
                                   ┌────────────────────┐
                                   │     AI gateway     │
                                   └────────────────────┘

Nothing skips a layer. The browser reaches the database and the model only through a named server function, and the reference pages never reach either.

Subsystems

Three ways in, one rubric behind them.

Trainer

A simulated inbox: one realistic email at a time, one decision per email — report it or let it through. Feedback names the tells, and every answer is recorded so accuracy is measurable from the first attempt.

scenario setDrillAttempt
Open the drill
Inspector

The live half. Any message a learner is unsure about is pasted in and pulled apart: verdict, score, every flag quoted from the text itself, the tactics behind it, and one clear next step.

analysis engineInspection
Open the inspector
Reference

The rubric both halves are judged against: the red-flag field guide, and the twenty-six A–Z codes with their Python predicates. Static pages, no storage, open to anyone.

static datano storage
Read the code list
Lifecycle

One request, end to end.

  1. 01

    A screen renders

    The router matches the URL and renders the page. Gated screens check the session first, so the page never appears with someone else's data in it.

  2. 02

    The learner acts

    Report or pass a drill email, or paste a suspicious message into the inspector. The browser holds only what is typed on screen.

  3. 03

    One call crosses the boundary

    A single named server function carries the action. It is the only door: the browser has no key to the database or the model.

  4. 04

    Checked before it is used

    The caller must be signed in, and every field is trimmed and capped. Anything outside the limits stops at the door with an error, not a partial run.

  5. 05

    Work happens at the edge

    A drill answer is scored in place. A pasted message goes to the analysis engine and comes back as a verdict, a score, quoted flags and a next step.

  6. 06

    The result is kept

    The attempt or the inspection is written under the asker's own access rules, so history builds up per person without anyone seeing anyone else's.

Trust boundaries

Where trust is decided.

Four places decide what the system believes. Each one assumes the layer before it could be wrong.

Browser

01

Untrusted by default. It renders text and never live email HTML, and it holds a session token, not authority.

Server function

02

Rejects anonymous callers, caps every string, and refuses fields it did not ask for. No credit is spent before the check.

Entity store

03

Rules, not queries. Each record is scoped to its creator on read, update and delete; the browser never holds an elevated key.

Model call

04

The pasted email is fenced and labelled as evidence. Instructions inside it are data — and the reply must match a fixed JSON schema or it is rejected.

Scope

What is deliberately absent.

  • No mailbox connection — nothing is read from a real inbox, you paste what you choose.
  • No credential capture — the app never asks for a password outside the platform's own sign-in.
  • No clickable links in samples — addresses are shown as text so nothing opens by accident.
  • No hidden scoring — every flag on screen maps to a letter in the code list.
  • No shared history — one person's attempts are never part of another person's view.
  • No stored raw HTML — messages are kept as text, so nothing re-renders later.

Go one level down.

Layer responsibilities, the full analysis pipeline, the response contract and how history is scoped are on the detailed page.