firehose-judge
The live Bluesky firehose, judged post by post, with a lane for humans.
# firehose-judge
Put typed, calibrated judgment on a live stream. This repo watches the Bluesky
firehose and asks [Jev](https://typesafe.ai) eight questions about every
sampled post in a single call: intent, topic, sentiment, engagement bait,
hostility, sarcasm, bot-ness, and whether it is safe to put on a screen. The
answers come back as typed distributions with confidence, in a few hundred
milliseconds, for about three thousandths of a cent per post.
Live at [cloutmetrics.ai](https://cloutmetrics.ai).
The interesting part is not that a model can label posts. It is that this one
says how sure it is, and the page routes on that: anything the model would not
commit to slides into a second lane labelled "needs a human". You can watch it
be certain about spam and hesitate over sarcasm.
## How it works
```
Bluesky Jetstream ──ws──▶ Durable Object ──POST──▶ api.typesafe.ai
(one, named) ◀─json──
│
└──ws broadcast──▶ every open browser tab
```
- One **Durable Object** holds the upstream websocket, samples posts with a
token bucket, calls Jev, persists counters and a ring of recent posts in
SQLite, and fans results out to viewers over hibernatable websockets.
- It only runs while someone is watching. When the last tab closes the
heartbeat alarm drops the firehose connection, so an idle deploy costs
nothing. Counters survive because they live in the DO's storage.
- One upstream stream regardless of viewer count, so a busy day cannot run up
the bill.
- Posts Jev flags as unsafe are dropped server-side and counted, never sent to
browsers.
- The frontend is one HTML file, one stylesheet, one script. No framework.
## Run it
```bash
npm install
echo 'TYPESAFE_API_KEY=...' >