Chapter 2: the Worker, where everything actually happens
Last changed
Everything you see at https://lmjtfy.fun comes out of this folder. It is one Cloudflare Worker: a small program Cloudflare runs at its edge, started fresh for each request in milliseconds, written here in Rust and compiled to WebAssembly. There is no server to keep running. A request arrives, the Worker answers it, and that is that.
Two things have to outlive a single request: what was already asked (so it is never asked again) and how much of today's budget is left. For those the Worker has two Durable Objects, which are the closest Cloudflare comes to a tiny server with a memory: one object per name, anywhere in the world, with its own SQLite. The Worker talks to them; they remember.
flowchart LR V["Visitor's browser"] -->|"/, /ask, /gate"| W["Worker (src/lib.rs)"] V -->|"/live (socket)"| A G["git clone"] -->|"/lmjtfy.git"| W W --> A["Archive object: every call, the feed, the sockets"] W --> B["Budget object: today's spend, per-visitor limits"] A --> J["Jev (TypeSafe)"] A --> L["LLM (Workers AI)"] W --> GH["GitHub (read-only token)"]
What it serves
| Address | What happens |
|---|---|
/ and /?q=... | The page. With ?q=, it types the question in for you and asks. |
POST /ask | Answers a question as a stream: the whole transcript, re-sent as each call finishes. |
POST /api/v1/ask | POST /ask for a program: a question as JSON, with a key, answered as JSON (below, The API). It is the one post a page does not make, and so the one that does not say a page's form id; it says a key instead. |
POST /rate | A browser's 👍 or 👎 on Jev's answer, and the votes after it. |
POST /comment | The words a browser adds to its vote, from the box that opens under the 👍 and 👎. Trimmed, 1,000 characters at most, five a minute a visitor, and only while the browser has a vote; answered with "Thanks" or why not, in fixed words. The text is kept (below) and is in no log line or event. |
POST /tracking | The visitor's say on being tracked, say=yes or say=no, from the question at the foot of the page or the line in the footer (below, Two ids, and the visitor's say). A plain form: it works with no script, and answers by going back to the page. |
POST /seen | A page's report of itself: as it is left, how long it was in view, how far down, the screen; a link followed off the site; how fast it loaded; a part of it that came into view or was pressed. Kept, and answered with nothing. |
POST /mine | The questions this browser asked, told to it alone so its page can underline them. Asked for once a browser. |
POST /gate | Run as you type, 300 ms after each pause. First, the questions already on the feed that what is typed could be the start of, which asks nobody anything; then the facts request, so the answer starts from what Jev already said. Text that stops part way is said to be unfinished, and not judged. |
POST /picture | A picture pasted into the box, as the page drew it again (at most 700 pixels on its shorter edge, WebP or JPEG, and nothing of the file but its pixels). Read by its own bytes, kept once by its SHA-256 in pictures, and answered with its name, which goes with the question. Like every post, it must be the site's own page's (below); ten a minute a visitor. Nothing is asked of Jev. |
/picture/<name> | A kept picture, by its name (its hash and its extension). It never changes, so it is cached for good. |
/q/<slug> | A question's page, at an address of words (below, A question's address). A slug that has been replaced redirects to the one the page is at now. |
/sitemap.xml | The home page and the page of every question the feed may show. |
/feed | The next page of "asked lately", which the feed asks for when it is scrolled to its end. It reads the archive and asks nobody anything. |
/live | A WebSocket each open page holds: how many are online, toasts, live feeds, and "a new version is live". |
/rules | The site's rule set with every fact clickable, asking nobody anything. |
/robots.txt | Asks crawlers to leave /rules?… alone: with facts set it is a page per combination, each linking to more. |
/rules.svg | The rules drawn as a standalone picture, for the docs (chapter 6). |
/card.png | The picture a link unfurls with (chapter 11). |
/icons/<name>.png | The explorer's file and folder icons (chapter 15⅝). |
/lmjtfy.git and the other repositories | With GIT_REDIRECT on, redirected with the same path and query to code.lmjtfy.fun; with it off, served here as before (below). |
And at code.lmjtfy.fun, which is the same Worker answering to another name and serving only this:
| Address | What happens |
|---|---|
/ | Every repository served, with its git clone command and a copy button. |
/lmjtfy.git | git clone it, or open it in a browser and read the code (you are probably here). |
/jevcrates.git, /postjevsql.git, /jevsnes.git, /jevhooks.git, /jevstrudel.git, /whiskers.git | The client lmjtfy shares with the owner's other Jev projects, and those projects, served the same way. |
/whiskers/latest/<kind> | The file of that repository's latest GitHub release of that kind (below), downloaded through the Worker. GET and HEAD, Range honoured. Cached five minutes. |
/whiskers/releases/<tag>/<asset> | That exact file of that exact release. Cached for good. |
/whiskers/latest/, /whiskers/releases/ | A page listing the latest release, or the recent ones, each file with its size and a link. |
/icons/<name>.png, /emoji.woff2, /card.png?code=, /robots.txt | What those pages draw themselves with. |
Try it. Open https://lmjtfy.fun/rules and click "it ran" under the picture, step after step, until the rules say it is done. Each click is one step of a real question, with you in place of Jev. That is the engine from chapter 6 running in your browser's address bar.
Live: who is here, and what just happened
Every browser with the site open keeps one socket to /live, held by the
archive object. Its sockets are "hibernatable": while nothing happens, the
object can sleep and nothing is billed, and the sockets stay open.
One socket per browser, not per tab: the socket belongs to a SharedWorker
(src/live.js), a script the browser runs once for all of a site's tabs
and keeps while any of them is open. Each tab talks to it, and it passes on
everything the archive sends; a tab that opens later is handed the current
count and places at once. A tab the browser freezes in the background
cannot take the socket down with it, which is what goes wrong when one tab
holds the socket for the rest. A browser without SharedWorker opens a socket
per tab, as every page used to.
Aside. Pages of different builds use different workers (the build is in the worker's address), so after a deploy a reloaded tab gets a fresh one while a tab from before keeps its own until it reloads too.
It pushes four things:
- How many browsers are open, and where, shown as "N online" in the top bar; hover it for a flag and a place for each, most first. The place is Cloudflare's: every request arrives with a rough country and city, and the Worker passes them to the archive when a page connects (in headers it sets over any the page sent, so a page cannot name its own). The archive keeps them on that page's socket while it is open, for the list. (What is kept for good is below, in What is kept about visitors.) Pages are told at most once a second, so a deploy, which reconnects every page at once, is one update rather than one per page. A page that reconnects while the deploy is still reaching Cloudflare's edge can come through the Worker from before, which passes no place; ten seconds on, when the deploy has settled, the archive asks it to reconnect (close code 1012), and it comes back placed.
- A toast when someone asks a question or clones the code. A question the feed may show is shown with Jev's answer; any other is "someone asked Jev something". The page that asked does not get its own toast. A toast says who asked only this far: a browser the site has seen before is "Someone", under its country's flag, the same flag the online list shows it under; a browser with no cookie of the site's is "a new or cookieless visitor", since the two cannot be told apart; and a bot is "a bot". The site sends pages nothing else about who is connected: no address, no browser, no history.
- Asked, and viewed. A question is asked when someone types it and
submits it, and viewed when a page opens with it: a shared link, its own
page, an address from the sitemap. Only an asking adds to "asked ×N",
moves the question up, tells the open pages and gives it a chip. A view
is counted beside it, "viewed ×N", once for each browser the site had
seen before; an open from a browser with no cookie is in
eventsand nowhere else, so a crawler raises neither number. The first answer a question ever gets is an asking, whoever opened it. Pressing ↻ on one of an answer's calls, or stepping through its versions, is a second look by someone already there: Jev's answer is kept as it now is,events.viasaysrefreshorversion, and nothing is counted. The counts from before the two were told apart were split whereeventscould tell: an ask made by a page within two minutes of opening that question's own link was a view (step 27,archive::opens). - Who asked, as a colour and a flag. A question's line in the feeds,
and its own page, carry a chip for each colour and country that asked
it: the flag of the country the asking came from, and for a browser that
may be tracked, one of five faint colours behind it (typesafe.ai's). The
country is read from the request and from no cookie, so every browser's
asking has its flag (
askers.country); a bot's has none. A browser's colour is worked out from its voter's id (askers.colour), and is shown only by the visitor's say (colour_shown): a no takes the colour off what they asked, and a yes puts it on, on what they asked before too. The viewasked_byis what a line shows. Five colours are shared by everyone who has ever asked, so a chip is not a person: two questions under the same flag and colour are likely one browser's, never certainly. - The feeds themselves. After each toast the archive sends the home page's feeds as HTML elements with ids, and a page replaces the ones it has: most asked and so far whole. A question just asked goes to the top of asked lately, taking its line from wherever it was, so the older lines a page has scrolled in stay put. No refresh.
- The build. Every page carries the commit its Worker was built from
(
build.rs). A deploy restarts the archive object, every socket closes, every page reconnects, and the archive tells each one the build that is live now. A page from an older build shows a toast that stays, with a Reload button. If the deployed commit has aRelease-Note:trailer, an older page also gets that line as a toast, so the people on the site hear what changed.
The API: the same answers, for a program
A page asks by posting to /ask and drawing what streams back. A program
has no use for the drawing, so POST /api/v1/ask does the same answering
and sends back the typed result as one piece of JSON. It is served at the
site's own address only, never at the code host's.
curl https://lmjtfy.fun/api/v1/ask \
-H 'Authorization: Bearer lmjtfy_...' \
-H 'Content-Type: application/json' \
-d '{"q": "Is a hot dog a sandwich?"}'
The request is {"q": "...", "picture": "<name>"}. q is the
question, made into the same key /ask makes (one line, with the picture's
name beside it if there is one); picture is optional and is the name
POST /picture gave a kept picture. Any other field is a 400: there is no
field that sends a kept request again, because only a page's ↻ may.
The reply is:
| Field | What |
|---|---|
ending | How it ended: answered, not_a_question, no_question, failed, slow, offline, spent or empty. (undecided and not_kept are endings of a page's ask that an API ask cannot come to.) |
answers | What Jev said, one entry for each answer the page would show: headline and a kind (noul, chance, choice, score, box or unknown) with its numbers (p_yes; p; confidence and options, likeliest first; score, confidence and levels, lowest first; the box's edges as fractions of the picture). |
checked | Jev's probability that each answer is right, by its place in answers, or null where the check did not come back. |
calls | {"sent": n, "kept": n}: how many calls this ask made, and how many were answered from the archive. |
took_ms | How long the ask took. |
p_yes | Only on not_a_question: Jev's own probability that it could judge the input at all. |
error | Only on failed: the Worker's own words, cut to 500 characters, with its secrets taken out. |
resets_ms | Only on spent: when the day's budget turns over, in Unix milliseconds. |
The status is 200 for every ending but these: 400 for nothing asked or a
body that is not as above, 401 for no key or one that is not live, 429
for more asks in a minute than the key allows (with Retry-After), 503
for Jev without its key and for a day's budget spent (resets_ms, and
Retry-After). An ending that is a refusal of the question, such as
not_a_question, is still a 200: the API worked and Jev said no.
Keys. A key is lmjtfy_ and 43 characters, made from 32 random bytes.
The owner makes one through the admin door (Admin::Key: a name and how
many asks a minute it may make) and is told it once. The archive keeps the
SHA-256 of it (the table api_keys, in the diagram below) and nothing else,
so there is no key in the archive to steal and none to show again; a lost
key is revoked (Admin::Revoke) and another made. A revoked key's row
stays, with when it ended. The limit is counted by the budget object under
the key's name, as a visitor's is under their address (chapter 10); a
caller guessing keys is counted by address.
It answers from the shared archive. The ask goes through the same
rules and the same archive as a page's, so the same request is never sent
to the same model twice: a question already asked, by anyone, is answered
from what was kept, calls.sent is 0 and nothing is spent. An API ask is
not a visitor's: it is not put on the feed, counted in "asked ×N", toasted
or kept as a run, it is given no cookie, and it has no voter's id. It
leaves one api event in events, with client api and the key's
name beside the ending, for the owner. It is kept as an api event and
not an answer, so no view of visitors counts it.
Try it.
mise run test lmjtfy apiruns the checks on the key's shape, on how each ending becomes a status, and on the JSON above.
The code pages
git clone --recurse-submodules https://code.lmjtfy.fun/lmjtfy.git
The address is code.lmjtfy.fun. With GIT_REDIRECT on, the old
https://lmjtfy.fun/lmjtfy.git (and www, and workers.dev, and every
other served repository) is sent there with a 308, path and query kept: git follows the redirect of its
first request, GET /lmjtfy.git/info/refs?service=git-upload-pack, and
makes every request after it at the new address, so git clone https://lmjtfy.fun/lmjtfy.git still works, and so does the relative
submodule URL ../jevcrates.git, which git resolves against the address the
redirect gave it. A POST that reaches the old address is not git
following a redirect, so it is not redirected: it is answered 405 with the
address to use. A GET is a 308 because a client that must keep its method
should; a person's browser follows either.
The switch, GIT_REDIRECT
The redirect is a Worker var, GIT_REDIRECT, "on" or "off"
([vars] in wrangler.toml, which says "off"), so the code host can be
deployed and checked before anyone is sent to it. It is read by
host::GitRedirect, which accepts exactly those two words and an unset
var as off. Anything else (ON, true, an empty string) is logged as an
error on every request and runs as off: off is the behaviour that cannot
break a working clone, where on would send every clone to an address that
may not be live.
off (default) | on | |
|---|---|---|
lmjtfy.fun/<repo>.git… | Served here, as before the code host | 308 to code.lmjtfy.fun, path and query kept; a POST is answered 405 |
www and workers.dev, a repository's path | 301 to lmjtfy.fun, which serves it (git follows it) | 308 straight to the code host |
www and workers.dev, anything else | 301 to lmjtfy.fun | the same |
code.lmjtfy.fun | Serves the repositories and the front page | the same |
| The home page's clone command and "Get the code" link | https://lmjtfy.fun/lmjtfy.git: no page names the code host | https://code.lmjtfy.fun/lmjtfy.git |
| Code pages on the apex: the clone command | The apex | The code host (and the apex's paths never get that far: they redirect) |
lmjtfy.fun/<name>/latest…, /<name>/releases… (release files) | 404: not served here, in either mode | 308 to code.lmjtfy.fun like a clone (a POST is 405) |
| Staging and dev servers | Serve it themselves, release files too | the same: no code host there |
The links follow the switch so that no page advertises an address that has not been checked. The code host answers in both modes.
Rolling out
The order matters: the code host is deployed and checked before the apex sends anyone to it.
- Deploy with the var off (the toml's default). This ships the code host,
its front page and the custom domain;
lmjtfy.fun/<repo>.gitserves clones exactly as before, and the home page still names the apex. Check by hand, sincetools/check-hostsexpects the token to be missing:curl -sI https://code.lmjtfy.fun/is200, andgit clone --recurse-submodules https://code.lmjtfy.fun/lmjtfy.gitworks, submodules included. The custom domain's certificate can take a few minutes. - Flip it:
lmjtfy-wrangler apps/lmjtfy deploy --var GIT_REDIRECT:on, or change the toml to"on"and deploy. Checkcurl -sI https://lmjtfy.fun/lmjtfy.git/info/refs?service=git-upload-packis a308to the code host, andgit clone --recurse-submodules https://lmjtfy.fun/lmjtfy.git(through the old address) still works. - To go back:
lmjtfy-wrangler apps/lmjtfy rollback(the previous version, which has no redirect), or deploy with--var GIT_REDIRECT:off. Make the toml say what is live afterwards.
The Worker gives each host its own routes (src/host.rs). The code host has
the repositories, their pages and the front page, and nothing that asks Jev
or reads the archive: no /ask, /feed, /live or /seen, so its pages
show no online count and no toasts. Staging has no code host (a second
address is a second way round Access); it serves the repositories itself,
where it is.
Release files: the downloads of a private repository
src/release.rs serves the files of a repository's GitHub releases, so a
release of a private repository can be downloaded by anyone (the whiskers
site links to these addresses). <name> is a served repository's name
without .git.
| Address | What |
|---|---|
/<name>/latest/<kind> | The file of the latest release whose kind is <kind>. Cache-Control: public, max-age=300, because it moves. |
/<name>/releases/<tag>/<asset> | The exact file of the exact tag. public, max-age=86400, immutable. |
/<name>/latest/, /<name>/releases/ | A page (the code pages' look) of the latest release, or the last twenty, with sizes and links. |
/.well-known/packslip/<name>.json | The latest release's file named packslip.json, as application/json: the signed release list packslip and mise look for when a project is called code.lmjtfy.fun/<name>. The same answer as /<name>/latest/packslip.json; 404 when the latest release has none. |
Anything else under /<name>/latest or /<name>/releases is a plain 404,
and so is a name that is not in Repo::ALL. A path segment may hold only
letters, digits and . _ + ~ @ - (never . or ..), so there is no
percent-encoding, encoded slash or dot-dot to be decoded later.
A file's kind is its name with the release's version taken out: everything
after the first -<tag>- in the name (whiskers-2026.10.5-arm64.apk is
arm64.apk; whiskersd-2026.10.5-x86_64-linux.tar.gz is
x86_64-linux.tar.gz). A tag with a leading v is also looked for without
it. A name with no -<tag>- in it, such as SHA256SUMS, is its own kind. So
the address of "the arm64 build" does not change when the version does. If
two files of the release have one kind, that kind is a 404 and the log
names the release: it is never a guess. The pinned address is always exact.
How a file is served: the release is looked up through the GitHub API with
the same read-only token (/releases/latest, /releases/tags/<tag>; kept a
minute per isolate, good answers only). The file is asked for at
/releases/assets/<id> with Accept: application/octet-stream; GitHub
answers 302 to a short-lived signed address, which is followed by hand and
fetched without the token, and its body is streamed to the visitor, never
held in memory. A file is answered as the runtime's own response (Served::File,
before the router): an http body is re-written through Rust as a plain
stream, which is sent chunked with no length, and a download bar needs the
length. The content length passes through; the type is chosen from
the name (.apk is application/vnd.android.package-archive, .tar.gz is
application/gzip, SHA256SUMS is text/plain, else
application/octet-stream), with content-disposition: attachment and
x-content-type-options: nosniff. HEAD answers from the release's own
record of the size and fetches nothing. A Range header of plain
bytes=… is forwarded to the signed address, which answers 206. GitHub
failing is a 502 in fixed words; no GitHub text is in a response or a log.
A download from its start (no Range, or one from byte 0) is an event of
what download in the archive, its detail <name>/<file name>. what is
free text, so no migration was needed. The GET is not also a view
(event::is_download), and nothing shows a download on the home page: no
toast, no count. The two listing pages are views.
Only the code host serves these (Host::serves_downloads), and a dev server
or staging, which have no code host.
To add a repository: add its name to the
repositories! list in src/clone.rs and answer the compiler's match
errors there. That one list is what is served, what the code host's front
page lists, and what the old addresses redirect; a test holds the three
together. Give the GitHub token Contents: read on it too.
The repository is private on GitHub, and is shared from here instead, so
nobody needs a GitHub account and nothing is announced. The Worker speaks
git's smart HTTP (src/clone.rs): the two requests a clone or fetch makes,
info/refs?service=git-upload-pack and git-upload-pack, are forwarded to
GitHub with a fine-grained token that can read the served repositories and nothing else. A push is refused here, and GitHub
would refuse it anyway. jevcrates is served beside it at /jevcrates.git,
because .gitmodules names it by the relative URL ../jevcrates.git, which
git resolves against wherever lmjtfy was cloned from. The owner's three other
Jev projects (postjevsql, jevsnes, jevhooks) are served too, as is whiskers (which uses Jev as its guard), and name
jevcrates the same way, so each clones with its submodule from here.
Clones and pulls are counted, anonymously, per repository; "So far" shows
lmjtfy's, and a clone of any project but jevcrates is toasted. jevcrates is
fetched along with every project cloned with its submodules, so its toasts
would double up. A pull names the commits it
already has (have lines) and a clone does not; a fetch counts on the round
GitHub answers with the pack, so a long negotiation counts once and a pull
with nothing new is not counted.
Git only ever asks for lmjtfy.git/info/refs and lmjtfy.git/git-upload-pack,
so every other path under /lmjtfy.git is free for people. The code pages
(src/browse.rs) are laid out like an editor, full width. On the left, a
sidebar of panels: the explorer (the whole tree, jevcrates included,
opened on the way to the page you are on), the outline of the page's
headings, the clone command, the latest commit, and every repository served
here; jevcrates' pages add the Cargo.toml lines for depending on it, pinned
to its latest commit. On the right, the page:
a folder's README and CLAUDE.md as two tabs, "for people" and "for agents",
between a ◀ tab for the chapter before and a ▶ tab for the chapter after
(from the chapter's own last line, or, in a repository with no guide, the
next folder with a README in a depth-first walk),
with their diagrams drawn (click one to enlarge it); a source file
with its comments rendered on the left and the code they are about on the
right, coloured (chapter 12½), or rendered if it is markdown, each with a tab
for its source top to bottom; ?raw
gives a file as it is. /lmjtfy.git itself is the root folder, whose
README is the prologue. On a phone the sidebar moves below the page.
Everything is read from GitHub's API with the same token, kept a minute per
isolate: folders and files from the contents API, the explorer's tree in one
request from the git trees API. What each repository says it is (the
description, homepage and topics on the code host's front page, in the
sidebar, the page's link preview and the picture) is GitHub's own, from
GET /repos/{owner}/{name}, asked for all the repositories together and kept
the same minute. Nothing about a repository is written here: change it on
GitHub. If GitHub cannot be read, or a repository has no description, its card
simply has none. jevcrates is browsed under
third-party/jevcrates/ at the commit lmjtfy pins.
Storage
Two Durable Objects keep everything that outlasts a request. Each is one
object for the whole site (id_from_name), so every visitor reads the same
rows.
The archive (src/archive.rs)
A SQLite database, changed only by adding a step to MIGRATIONS. The tables
share no keys, the tracking id (browser) aside: an asked row's answers are what the versions behind it said,
copied, and counts is a tally.
declined is the questions Jev could not take (NotAQuestion and
NoQuestion), so a link to one unfurls as "Please choose an LLM instead"
with its own card (Card::Declined) and not as "Let me Jev that for you". It
is apart from asked on purpose: nothing was answered, so none of them is
counted, listed, toasted or votable. asked wins: a question that has since
been answered is shown as answered.
A question Jev declined can be voted on and commented on too, under the
same thumbs and box. Its vote is keyed by answer = 'declined' (no hash of
answers can be that word) and by the question, which is the declined row's
key, so ratings.input = declined.input AND ratings.answer = 'declined'
joins a vote to its record, and a comment to its vote as always. The thumbs
mean other things there: up is "Jev was right to pass", down is "Jev could
have answered". about on ratings and comments, and on both views, says
which kind a row is (answered or declined); it is worked out from
answer, never written. A question answered since is voted on as answered,
and its earlier declined votes stay as they were.
A question is one line: its words hold no line break and no control
character (ask::Input::typed makes each run of white space that holds one
a single space, as the page does with a paste), since a post straight to
/ask never meets the page. A question kept before that with a line break
in it keeps its key, and every request it was answered by keeps its bytes.
kept_as says, for each, the key it would be made with now, and the Worker
looks every key it makes of a request's words up there first
(archive::kept_under, asked once an isolate), so such a question is still
found and still answered from what was kept.
askers is how a question counts each browser once. A browser gets a
random id in a cookie when it first asks or votes (lmjtfy_voter, a year,
its voter's id); the Worker hashes the id with the question and the archive
keeps only that, as who. A browser asking again, or opening its own
question from the feed, finds its row and is not counted, toasted or moved
up the feed again. The rows of two questions from one browser have nothing
in common, and the id cannot be had back from one. So the key says nothing
about who asked. The browser column beside it is the other id, the
tracking id, and is empty unless the visitor may be tracked (below). A
client that keeps no cookies (a script) is a new browser every time, and
counts every time. Counts from before 2026-10-02 stay as they were.
ratings holds the 👍 and 👎 under each answer ("Was Jev right?"): one vote
per browser, keyed the same way, and pressed again to take it back. A vote is
on the answer as it was kept when it was cast, by the hash of its answers, so
if the question is answered differently later, that answer starts with no
votes and the old one keeps its own.
comments is what a visitor adds under their vote: the box that opens when
they press 👍 or 👎 ("Comments?", and a grey "Let us know what we can improve"
that goes as they type). It is a table of its own because ratings is the
vote now, and a vote taken back is deleted, which would take the words with
it; and because events is the request log, whose columns are what an
Event says. Like events it takes INSERT and nothing else (a trigger
refuses the rest): a row for every Save, with the vote as it was (vote)
and the same key as ratings (input, answer, who). Saving the same
words twice for the same vote keeps one row. What the visitor wrote is
untrusted text from the public: it reaches the page only through maud's
escaping, is in no log line and no event, and the owner's backend must show
it as text, never as markup.
The owner reads it through two views, which are not by the day and so have no
finished copy: vote_comments is every comment (comment, at_ms, input,
browser) beside the vote it was said of (vote_then) and the vote as it
stands (vote_now, NULL if taken back), with latest for the last one of a
vote; votes_commented is every vote now standing (vote) with its latest
comment, NULL if it has none.
erDiagram
versions {
text sent_to PK "Jev's endpoint, or a Workers AI model id"
text request PK "the exact body sent"
integer version PK "1, 2, ...: each time it was sent, newest last"
text response "the exact body that came back"
text request_id "Jev's id for the call, if it gave one"
integer attempts "tries the client made"
real took_ms
real answered_ms "when it was answered"
}
asked {
text input PK "the question, cleaned"
text answers "JSON: one Answer per question Jev answered"
real asked_ms "last asked"
integer times "how often it was asked: typed and submitted, each browser once (before step 26, opens too)"
integer views "how many browsers seen before opened it without asking it, each once"
integer listed "1 if the feed may show it (Jev's fit fact)"
integer llm "1 if an LLM had to be asked"
integer moderated "the owner's say: 1 show, 0 hide, NULL leave it to listed"
}
viewers {
text input PK "the question"
text who PK "as in askers: the browser's one view of it"
text browser "the tracking id, if the visitor may be tracked; else empty"
}
declined {
text input PK "a question Jev could not take"
real declined_ms "last time"
integer times "how often"
}
events {
integer id PK
real at_ms "when"
text what "view, answer, gate, vote, comment, consent, more, card, fetch, moved, live, left, read, out, load, part, tap, open, api (an API ask: counted by no view of visitors), refused (a post that was not the site's own page's)"
text method
text host
text path
text query "as it came"
text input "the question typed, asked or voted on"
text detail "how an ask ended, which way a vote went, clone or pull, yes or no to tracking, what a gate found (suggested seen unfinished)"
real status
real sent "calls sent for it"
real kept "calls answered from versions"
real llm
real took_ms "an answer's time, or how long a page stayed"
real first "1 on a visitor's first page ever, worked out from their earlier rows"
real daily "1 on their first page of the UTC day"
real session "1 on their first page in half an hour"
text referrer "the page that linked here, whole"
text source "utm_source or ref"
text client "browser, git, bot, other"
text family "Chrome, Firefox, ..."
text os
text device "mobile or desktop"
text language "Accept-Language"
text agent "User-Agent"
text browser "the tracking id (the lmjtfy_browser cookie); empty when the visitor has not allowed it"
text ip
text country
text region
text city
text postcode
text timezone
real latitude
real longitude
real asn "the network's number"
text network "whose network: the ISP"
text colo "Cloudflare's data centre"
text protocol "HTTP and TLS versions"
text medium "utm_medium"
text campaign "utm_campaign"
text screen "1920x1080, as the page says"
text viewport "the window"
real scroll "how far down the page was seen, 0 to 1"
text region_code "the region within its country: CA for California"
text continent
text metro "Cloudflare's metro area code, where it has one"
text bot "the kind of bot Cloudflare verified it as, if any"
text who "for an event about a question: the per-question hash askers keeps; else empty"
text via "for an ask: form when typed and submitted, link when a page opened with it"
integer day "days since 1970, worked out from at_ms, and indexed"
text family_version "the browser's version, as far as it says it truly: 140, 17.2"
text os_version "the system's version where it is said truly; empty where every browser says the same one"
integer nth "for a page of a visit: which page of the visit, from 1; 0 on any other event"
text entry "for a page of a visit: the page the visit began on"
text from_path "for a page of a visit: the page before it; empty on the first"
text arms "the arms of the running experiments this visitor is in, a JSON list of experiment=arm; experiment=outside for a person who is not counted"
real ttfb_ms "for a load: milliseconds to the first byte, by the browser's clock"
real paint_ms "for a load: to the first paint"
real largest_ms "for a load: to the largest paint, two seconds after everything loaded"
real ready_ms "for a load: to the document ready"
real load_ms "for a load: to everything loaded"
text page_view "a token made for one page as it is given, on its view and on each report it makes; of a page load, not a visitor"
integer touch "for a load: how many touches at once the screen feels, as the page says; a Mac with any is an iPad asking for desktop pages"
real from_at_ms "for a page of a visit after its first: when the page before it was given"
}
placed_before {
integer event PK "a page kept before step 31, by its row of events"
integer placed_nth "which page of its visit it was, worked out from the visitor and the visits the events mark"
text placed_entry "the page that visit began on"
text placed_from "the page before it; empty on the first"
}
tallies_by_day_finished {
integer day PK "a day that is over"
text chart PK "which chart the number is for: source, medium, campaign, client, asker, stayed, read, out, missing, missing by, load, hour"
any label PK "what it is counted under"
real n "the count, or for read and load the milliseconds added up"
integer among "for load: how many loads the milliseconds are of, so days can be put together into a mean"
}
whos_by_day_finished {
integer day PK "a day that is over"
text chart PK "which chart: screen, device, language"
any label PK "what it is counted under"
text who PK "a browser that was under it that day, once"
}
opened_before {
integer event PK "a question's page kept before a page's event said which question it is of, by its row of events"
text question "the question: by the slug of `/q/<slug>`, or read from the query of `/?q=` as the page reads it"
}
went_on_from {
integer event PK "a page of a visit after its first, kept before pages said when the one before was given, by its row of events"
real left_at_ms "when the page before it was given"
}
agent_versions {
text agent PK "a browser's user agent, of events kept before versions were"
text read_family_version "the browser's version as the agent says it"
text read_os_version "the system's, where the agent says it truly"
}
counts {
text name PK "sent, kept, clone:lmjtfy.git, pull:lmjtfy.git, ..."
integer n
}
askers {
text input PK "the question"
text who PK "SHA-256 of the voter's id and the question: all that is kept of that id"
text browser "the tracking id, if the visitor may be tracked; else empty"
integer colour "one of five, for a browser that may be tracked; else null"
text country "where the asking came from, for any browser's asking: the flag beside the question; empty for a bot's or when not known"
integer colour_shown "the visitor's say: 0 after a no, which takes the colour off the chip and keeps what it was"
text was "the hash this asking had while its browser's voter's id was also its tracking id; empty for any other"
integer opened "1 if it was counted as an asking before step 26 and was a page opening the question's link: a view since step 27"
}
ratings {
text input PK "the question"
text answer PK "SHA-256 of the answers as kept, or 'declined' for a question Jev declined"
text who PK "as in askers"
integer vote "1 right, -1 wrong (on declined: right to pass, could have answered)"
text browser "as in askers"
text about "answered or declined, worked out from answer"
}
comments {
integer id PK "in the order saved"
real at_ms
text input "the question"
text answer "as in ratings"
text who "as in askers"
text browser "as in askers"
text about "answered or declined, as in ratings"
integer vote "the vote it was said of, 1 right, -1 wrong"
text comment "the visitor's own words, up to 1,000 characters: text, never markup"
}
pictures {
text sha256 PK "the SHA-256 of the bytes: a pictured question's key names it"
text media "webp or jpg, read from the bytes"
integer width "pixels, as the picture says"
integer height
blob bytes "the picture as the page drew it again: at most 1.5 MB, and nothing of the original file but its pixels"
real kept_ms "when it was first kept"
}
runs {
integer id PK "in the order they ran"
text input "the question's key"
text build "the commit of the code that answered it"
real at_ms "when it ended"
text ending "how it ended, as events.detail names it"
integer sent "the calls it sent; a run that sent none is kept only as its build's first"
text transcript "the transcript as the page showed it at the end"
}
kept_as {
text typed PK "the key a question is made with now: its words one line"
text input "the key it was kept under, from before a question was one line"
}
api_keys {
text hash PK "the SHA-256 of an API key and a fixed phrase: all that is kept of the key, which is said once, when it is made"
text name "the owner's name for it: what an event and the limit know it by; of the live keys, no two share one"
integer per_minute "how many asks a minute the key may make"
real made_ms "when it was made"
real revoked_ms "when it was ended, or NULL while it is live; a revoked key's row stays"
}
migrated {
integer version PK "MIGRATIONS steps run"
real at_ms "when the step ran, from step 18 on"
text build "the commit of the build that ran it"
}
finished {
text name PK "a view whose days that are over are copied into a table"
integer through "the last day copied, in days since 1970"
}
slugs {
text slug PK "the words in /q/<slug>"
text input "the question it leads to"
integer canonical "1 for the slug the question's page is at; the others redirect to it"
real made_ms
text made_by "minted (from the question's words) or owner"
}
consent_rules {
text country PK "Cloudflare's two letters; the row with none is a request with no country. A country with no row asks about neither"
text counting "asked, or default: a cookie used for totals alone is set unless the visitor objects"
text tracking "asked, or default: a cookie that knows the visitor again is set unless they say no"
text why "EU, EEA, UK, or no country known"
}
counted {
text id PK "a hash of a counting cookie; the cookie itself is kept nowhere"
real first_ms "when it was first given a page; the row is removed a year after"
real last_ms "when it was last given a page: what marks a page view first ever, first today, first in half an hour"
integer nth "which page of its visit that page was"
text entry "the page that visit began on"
text path "that page: the next is placed after it, and each of the three is replaced by the next"
}
Two ids, and the visitor's say
A visitor has two ids, in two cookies, with two jobs (src/consent.rs).
The voter's id (lmjtfy_voter) | The tracking id (lmjtfy_browser) | |
|---|---|---|
| What it is for | One vote a browser, taking a vote back, counting a question once a browser | Tying one browser's rows together, so the owner can count visitors and visits |
| When it is given | When a browser first asks or votes | On a browser's first page, where it may be tracked |
| What is kept of it | Only who: a hash of it and one question | Itself: events.browser and every browser column |
| The visitor's say | None: the site cannot count a vote once without it | Theirs. A no puts it away at once |
Whether a visitor may be tracked is their say if they have given one
(lmjtfy_tracking, yes or no, changed from the line in the footer), and
otherwise it is where the request is from: in the countries of
consent_asked_in they are asked first, with one line at the foot of the
page, and nothing is kept until a yes; everywhere else they are tracked
until they say no. That table is the whole rule. The Worker has no list of
countries of its own: it asks the archive for the rules of every country
(Ask::Rules, the whole of consent_rules) and keeps the answer ten
minutes an isolate. Changing who is asked is a
migration step, with its reason in why. If the archive cannot be asked,
everyone is treated as asked first.
Aside. Why two cookies and not one? Because the rule for a cookie nobody was asked about is that every one of its jobs must be something the visitor came for. Counting a vote once is. Counting visitors is the owner's wish, not the visitor's. One cookie doing both is a tracking cookie with an excuse; two cookies let the visitor refuse the one and still vote.
Every post that does something (an ask, a vote, a comment, a picture, a
say, a report) must be the site's own page's, or it is refused before
anything is done. Every page is given a third cookie, the form's id,
for the session, and writes the same id into itself; a post says it back
(a page's script in the header x-lmjtfy-form, a plain form in the field
form), and the server checks the two agree and that the post came from
this site (Origin, Sec-Fetch-Site). Another site can make a browser
post here but cannot read the page, so it cannot say the id; a script that
keeps no cookie cannot either, so it cannot spend what everyone shares or
vote at all. The form's id secures the forms the visitor is using and does
nothing else: it is not kept, hashed or put on an event, so it is set on
every page whatever the visitor has said. A question already kept still
opens for anyone, from the page.
A visitor who is asked first and has not answered must answer before a new question is asked: the answer window says so, with the same yes and no, and either one lets the question through. A question that is already kept is shown to anyone, answered or not, so a link still opens.
A yes reaches back. What the browser asked and voted on before it said yes
is tied to its tracking id then (askers.browser, ratings.browser), found
by hashing its voter's id against each question. The hashing is done in the
Worker (own), so the id itself never reaches the archive. Its earlier rows of
events and comments take no changes, so nothing is written to them:
an event about a question carries the same per-question hash (who), and
the views events_linked and comments_linked read each row with the
browser its asker was later tied to (linked). An event about no question,
a page view say, has no hash, so it cannot be tied for certain.
events_linked gives it a guess in a column of its own, probable: the
browser that said yes from the same address with the same user agent
within a day after. People who share an address and a browser build are
one browser to that guess, which is why it is never mixed into linked.
What a visitor says is an event (what consent, detail yes or no),
and the view consents is those rows, for asking of a stretch of days.
A browser from before 2026-10-06 has one cookie, lmjtfy_browser, which did
both jobs then, and perhaps lmjtfy_visit, which said when it was last
counted. Its votes and counts are still its own: on its first page it is
given a voter's id of its own, and on its next its rows are moved from the
old id's hashes to the new one's, so that no browser's voter's id is an id
the archive holds as it is. Where it must now be asked first, the old id is
not used as a tracking id, and nothing is kept under it, until it answers;
its cookie is left in the browser meanwhile and read by nothing, so that a
yes takes up the same id, and a no puts it away. The visit cookie is put
away when it is seen: a visit is now counted by the archive as it keeps a
page view.
A visitor's own questions are marked in the feeds. That list is kept by the
page, in the browser's own storage (page.js), and nowhere else.
A question's address
A question's page is at /q/<slug>: Is a hot dog a sandwich? is at
/q/is-a-hot-dog-a-sandwich. The slug is made from the question's words as
it is first answered (archive::slugify), and a question that comes to
words another already has gets -2, -3. So a slug cannot be worked back
into its question, and slugs is what says whose it is.
Aside. Why a table, when a slug could carry a short id and need none? Because a row can change. The owner can give a question a better slug (
Admin::Slug), and the one it had, which may be in a hundred pasted links, keeps working: it answers with a redirect to the new one. A question has any number of slugs and its page is at exactly one, thecanonicalone; an index holds that to one.
/?q=<the question> still works for anything at all, as it must: it is how
a question that has never been asked gets asked. Once the question has a
slug its ?q= page names the slug's page as its canonical address, and the
feeds and the "Send it to them" link use the slug.
What a search engine may keep is what the feed may show. A question's page
leaves the server with the question and Jev's kept answer in it, read from
the archive, so a reader that runs no script has them. The page of a
question the feed hides, of one Jev declined, and of text nobody was ever
answered about says noindex. /sitemap.xml lists the home page and the
page of every question the feed may show, and robots.txt points at it.
asked_slugged is asked with each question's slug and shown
(COALESCE(moderated, listed)), which is what every reader of a question
reads.
The questions the owner's backend asks are views here, not SQL in the
backend. SQLite has no functions of one's own to define, so a question
that would be a function of a day is a view with a day column, asked
with WHERE day = .... events.day is indexed, so asking of a day reads
that day's events and no others.
| View | What |
|---|---|
hits | Every event, with what it counts as said once: viewed (a page given to a browser), asked, answered, voted, a visitor (the browser, or the address of one with no cookie), came_from (the site that linked here). |
hours, days, today_by_hour | The site's numbers for each hour and each day: views, visitors, sessions, new browsers, asks, answers, votes, clones, time read. |
browser_days | What each browser did on each day it came: viewed, typed, asked, voted, and whether it was its first. |
outcomes_by_day, ask_endings_by_day, pages_by_day, questions_by_day, referrers_by_day | A label and its number n for each day: what happened, how asks ended, pages viewed, questions asked, sites that linked here. |
countries_by_day, cities_by_day, networks_by_day, agents_by_day | The same, where n is how many different visitors: by country, city, network, and kind of browser. |
country_visitors, city_visitors, network_visitors, agent_browsers | Who those visitors were (who), a row each. The same visitor on two days is one visitor, so a stretch of days is counted from these: COUNT(DISTINCT who). |
journeys_by_day, entries_by_day, visit_depths_by_day | How visits went, a label and n for each day: each step from one page to the next (/ → /rules), the page each visit began on, and how many visits reached a first, second, third page. |
exits_by_day, bounces_by_day | The page each visit ended on, and the page each one-page visit began and ended on. Nobody can say a page was the last when it is given, only that the one before was not, so these are sums: every page of a visit, less every page that was gone on from. The one taken off falls where the page gone on from was given (from_at_ms), so a visit that passes midnight UTC is an exit of the day it ended on and of no other. |
page_ends | The same sums, an event at a time with its at_ms, for a stretch that is not whole days: SUM(n) by page, where kind is exit or bounce. |
devices_by_day, browser_versions_by_day, os_versions_by_day | Visits by what made them: desktop, mobile or tablet; the browser with its version; the system with its version. |
campaigns_by_day | Pages opened by a tagged link: source / medium / campaign. |
scroll_by_day, parts_by_day | How far down pages were read when they were left, and the parts of a page that came into view (feed seen) or were pressed (feed pressed). |
first_byte_by_day, first_paint_by_day, loaded_by_day | How fast pages came, by the browser's own clock, in bands: to the first byte, the first paint, and everything loaded. |
visit_kinds_by_day | Visits by what the first page shows of who made it: a person: its page stayed open (the socket every page opens came from its address and browser), a crawler that ran the page (its script ran, and no socket came: some crawlers render what they fetch), or no script ran (a crawler that only fetched, or a person with scripts turned off). The views of how visits went count only the first. |
question_opens_by_day, question_opens | A question's pages given, by who to: by_people (the page's socket came), by_crawlers (a crawler ran the page) and by_bots (what says it is a bot, and what ran no script), a day at a time and added up. asked.times and asked.views count browsers, each once, and no crawler; this counts pages, and is where to see that a question is mostly fetched by bots. hits.opened is the question a page view is of, by /q/<slug> or /?q=. |
tallies_by_day, whos_by_day | The plain counts by a label that have no view of their own, a chart a chart, kept by the day like the rest: a number (and for a mean, what it is among), or each different browser once. Each chart reads a thin view of one: sources_by_day, mediums_by_day, campaign_names_by_day, clients_by_day, askers_by_day, stays_by_day, read_by_day, links_out_by_day, missing_by_day, missing_askers_by_day, events_by_hour, load_by_day, screen_browsers, device_browsers, language_browsers. |
visitors_by_day, bounce_rates_by_day, bounce_rate_by_day | A day's visitors, from days; and bounces among visits begun, by where they began and over all, from bounces_by_day and entries_by_day. Nothing more is kept for them. |
arms_by_day | What the visitors in each arm of an experiment did: ask-button=bigger: visit, ask-button=bigger: answer. A person who is not counted is in no arm and sees the page as it was; theirs are ask-button=outside: visit, which is how much an experiment's numbers leave out. Empty while no experiment runs (src/experiment.rs). |
A day that is over never changes. So each view by the day (all of those
above but hits, days and today_by_hour, and the trees' below) is
three things: <name>_live works it out from
events, <name>_finished is a table the days that are over are copied
into, once, and <name> is the two together, which is the one to ask.
finished says how far each has been copied. A day is over half an hour
after midnight UTC, not at it (archive::settled): a page given late in
the day is gone on from, voted from, or shown to be a person's by what
comes in the half hour after. The first event after that is what copies
the day before (Shelf::finish).
Aside. Other databases call this a materialized view and keep it up to date themselves. SQLite has none. But a view of a finished day has nothing left to keep up with, so copying it once is the whole job.
Two trees are for drilling into: the site's pages, and where visitors came from.
| View | What |
|---|---|
pages | A row per page with its views by people, browsers, views by bots and not-found answers, for all time. /lmjtfy.git/apps/x counts for /lmjtfy.git, for /lmjtfy.git/apps and for itself. WHERE parent IS NULL is the top of the site; WHERE parent = '/lmjtfy.git' is what is under it. |
places | The same for country, region, city and network: events, views, browsers and addresses for each place, with a region's code and the latitude and longitude of the middle of where its visitors were. WHERE parent IS NULL is the countries. |
page_days, place_days | A tree's rows for each day, kept as the views above are, for asking of a stretch of days. |
page_visitors, place_visitors, place_addresses | Who was on each page and from each place each day (who), for counting once over many days. pages and places are these added up. |
vote_comments, votes_commented | The comments under votes: every comment beside the vote it was said of and the vote now; and every standing vote beside its latest comment; both with about (answered or declined: up and down mean different things). Not by the day. |
page_hits, place_hits | Every event once for each level it belongs to, with its at_ms: for a question the others cannot answer, such as who read one page. They read events, so ask them of a stretch of time. |
Aside. SQLite has no function to split a path, and a Durable Object's SQLite takes no functions of our own. So
page_hitsturns a path into a JSON array (/a/bbecomes["","a","b"]) and reads it back as rows withjson_each, which SQLite does have: a row per folder.
An event is never changed, so what is worked out later about old events
is kept beside them, and hits reads either: placed_before is the place
in its visit of each page kept before pages were placed, and
agent_versions the versions those pages' agents say. A page view and the
reports its page makes share a token (page_view), by which hits reads
the system's version from the page's own load report, and from the same
report whether a page that says it is a Mac's is an iPad's (touch: no
Mac's screen feels one, so hits gives such a page tablet and iOS,
with no version, since the one its agent gives is made up). Whether a
page is a person's (hits.ran) is known by one thing: the socket the page
opens for the online list (live, and left when it closes) from the
same address and browser, open when the page was given or within a minute
after. A person's browser holds it open. A crawler that renders what it
fetches runs the page's script, types and asks as the page does, and would
send the page's reports, but holds no socket: such a page is rendered,
told by a report with its token, by a request only a page's script makes
(a look as you type, an ask, a report, the feed's next page), or by a socket
from its address that says it is a bot's (a headless browser that says it
is a phone on the page says HeadlessChrome on its socket), and is a bot's
like one whose script never ran. The socket is what
the page does to work, so it tells a person from a crawler for every
visitor, whatever they were asked or said. A socket is matched to its
page by address, and a phone's page and socket can leave by different
ones, so three more things show a person: the page's own word, with its
token, that its socket is open (an open event, where a page may
report); a socket from the same browser on the same network in the same
city in the minute after; and what only a person does, a vote, a comment
or a question sent by the form. A socket that was cut with
nothing said, as a deploy cuts every one, is said to have gone when the
archive next starts.
hits counts a browser's page view whose socket never came as a bot's:
its client is bot (client_said keeps what the request said), and it
is no page viewed, no visitor, no visit and no new browser. Every view
above reads hits, and those that count visitors by where or what they
came from (countries, cities, networks, kinds of browser, the places tree's
browsers, the sites that linked here, devices and languages) count the
pages given to people (viewed), not every event that said it was a
browser's: a crawler's own looks and reports are no visitor. So visitors,
pages, countries, cities, networks and both trees are of people, and a
tree's by_bots holds the rest.
versions, events and comments can be added to and nothing else: a trigger on
each refuses a change or a deletion. What was kept stays as it was kept.
It also holds, in memory only, the calls on the wire (so identical asks wait
on one) and the /live sockets of every open page.
The budgets (src/meter.rs)
Key-value storage, a JSON value per key.
erDiagram
neurons {
integer day "days since 1970, UTC"
real used "Workers AI neurons spent that day"
}
jev_dollars {
integer day
real used "dollars of Jev spent that day"
}
account {
integer day
real at_ms "when Cloudflare's figure was read"
real neurons "the whole account's neurons that day"
}
Each visitor's count for the minute (budget::Visits) is in memory and
written nowhere by the site.
The owner's admin reads the three keys as they are stored, through the
budget object's own door (budget::ADMIN, the message budget::Admin),
as it reads the archive through the archive's. It only reads: a meter
changes by holds and settles alone.
What is kept about visitors
The site keeps a record of what happens on it, for three reasons: so that it works, so that it feels like a place other people are in, and so that the one person who runs it can see how it is used. It shows no adverts and sells or gives nothing to anyone. The only other party is Cloudflare, which runs the site (below).
What you do, and what is kept for it
| When you | The site keeps | So that |
|---|---|---|
| Open a page | The page, the time, your address, your browser's user agent, the page you came from, and where Cloudflare places the request: network, country, region, city, postcode, timezone, coordinates | Visits can be counted, a crawler can be told from a person, and misuse of a budget everyone shares can be seen and stopped |
| Ask a question | The question, Jev's answer, and every request sent to get it, word for word | The same request is never paid for twice, the answer opens at once for the next person, and everyone can see how it was reached |
| Paste a picture into the box | The picture as your browser drew it again: its pixels, at most 700 on the shorter edge, and nothing else of the file (a photo's place and camera stay on your device). It is part of your question, so it is shown wherever the question is | The question means what you asked; the same picture pasted twice is kept once |
| Ask, or open, a question | One mark that this browser asked it, or opened it: a hash of a cookie and that one question | "Asked ×3 · viewed ×12" counts people, not reloads |
| Vote on an answer, or say why | The vote, under the same kind of mark, and your words | One browser has one vote, can take it back, and Jev's misses can be read |
| Open a page, once it has loaded | How long it took to come, by your browser's own clock; your browser's and your system's version; phone, tablet or desktop, with how many touches at once your screen feels (an iPad asking for desktop pages says in every other way that it is a Mac) | A slow page, or one broken in a browser nobody here uses, can be found |
| Go from one page to the next | Which page of your visit each one is, the page before it, and the page the visit began on | The ways through the site can be seen: where visits begin, where they end, and which pages send people on |
| Scroll to a part of a page, or press something in it | The part's name: the feed, the answer, the foot | The parts nobody reaches can be moved up or cut |
| Leave a page | How long it was in view, how far down it was read, the size of the screen | The pages nobody finishes can be found and mended |
| Open a page whose script runs | That the page opened its socket, which it does to show who is online and what is being asked; and, where a page may report, a token made for that one page, on the page view and on each thing it reports | A person's visit can be told from a crawler's, which is given the page and runs nothing |
| Clone the code | That a clone or a pull happened, and of which repository | The count on the home page is true |
| Say yes or no to being known again, or to being counted | Your answer, and when | It is kept to |
There are four cookies, each for one thing:
| Cookie | For | Set | Your say |
|---|---|---|---|
| The form's id | Knowing a post came from this site's own page, so another site cannot ask, vote or say yes in your name | On every page, for the session | None: no form here is safe without it. It is not kept anywhere |
| The voter's id | One vote and one asking a browser | When you first ask or vote | None: the site cannot count a vote once without it. Only a hash of it and one question is ever kept |
| The counting id | Totals: how many visitors, how many visits, how many came back | Where the law lets a site count without asking (today the UK), on your first page; elsewhere only if you choose it | "Stop counting", always in the footer. The archive keeps a hash of it with the page it was last given (when, which page of the visit, and where the visit began), each replaced by the next, on no row of anything you did, and lets that go after a year |
| The tracking id | Knowing this browser again: your rows read together, your questions and votes tied to it, your colour | Where a visitor must be asked first, only after a yes; elsewhere on your first page | Yes or no, always in the footer |
A visitor who is known again is counted by the tracking id, and has no counting id.
What a page reports of itself (how fast it came, how far it was read, the parts reached and pressed) is read from your device, so it follows the same rule as the counting id. Where a site may count without asking, a page reports until you say "Stop counting". Where it must ask first, a page reports nothing until you say yes: it is given no token to report with, and its script reads nothing. The page you were given, and its place in your visit, are the request itself and are kept either way.
What everyone sees
This is what makes it a shared place and not a search box:
- The questions and Jev's answers, in the feeds, if Jev judged the question fit to show. Never who asked.
- How often: "asked ×N" and "viewed ×N".
- A chip beside a question for each browser that asked it: the flag of the country the asking came from. That is read from the request, as any site reads it, and from no cookie. For a browser that allows it the flag sits on one of five colours, which the browser keeps, so a run of teal chips under one flag is probably one regular. Five colours are shared by everyone, so it is never certainly anyone.
- A toast as it happens: someone asked, someone cloned the code. A browser's asking has the flag of the country it came from, cookies or none; a bot's has a bot's mark, and so has an asking from a program with no page open.
- Who is here now: how many pages are open, and the country and city each connected from, for as long as it is open. A page is open in a person's browser whether or not it keeps cookies, so everyone here is on the list. Under them, how many bots came in the last fifteen minutes: what says it is one, and what was given a page and ran none of it. That line is counted again each minute while a page is open, since a bot comes and goes without any page opening or closing; open pages hear of it only when the list has changed.
No page, feed, toast or link preview shows an address, a cookie's id, a network, or anything that tells two visitors from one country apart beyond that colour.
What only the owner sees
Everything in the first table, row by row, in a private backend behind a login (the admin door, below). That is where a visitor's rows can be read together, by the tracking id if they allowed one, or by address.
Your say, and what it changes
The line at the foot of every page says how things stand for this browser
and changes it with one press. What a country's visitors are asked first is
a row of consent_rules, one column for counting and one for being known
again; where being known again is asked, the question is put first, and a
new question waits for either answer. Where counting is not asked, the same
line tells the visitor they are counted and how to stop it. A country's
rule is tried on staging or the dev server by saying the country in a
header (x-lmjtfy-country: DE, host::country_said), which the site's own
addresses never read. The details of the two cookies are above, in Two ids,
and the visitor's say.
| With a yes | With a no | |
|---|---|---|
| The tracking cookie | Kept for a year | Removed, and not set again |
| Your rows in the archive | Carry its id, and so do the questions and votes from before the yes | Carry no id |
| The colour on your chips | Shown on what you ask | Not shown, and taken off what you asked before |
| The flag on your chips | Shown | Shown: it is where the request came from, and no cookie tells it |
| Counting your vote and your asking once | Works | Works: this is the other cookie, which is only ever kept as a hash for one question |
A no does not stop the row itself being kept, address included: that is what guards the shared budget. Nothing kept has an expiry.
Every one of these is a row of events in the archive
(packages/archive/src/event.rs), written after the response has gone
(wait_until), so keeping it delays nobody. A visit is worked out by the
archive as it keeps a page view: it looks up when that visitor was last
given a page, by tracking id or with none by address, and marks the view
their first ever, first today, or first in half an hour. No cookie carries
that time.
The admin door
The owner reads all of this from a separate, private Worker, which binds
this Worker's archive object (script_name in its wrangler.toml) and
posts archive::Admin messages to the object's /admin path:
-
Select: one SQL statement that only reads (archive::reads_only), and its rows back, with how many rows SQLite read to find them. Cloudflare meters rows read by the day, and a small answer can cost a whole table. -
Moderate: the owner's say on whether a question is on the feed, kept inasked.moderatedbeside Jev's own verdict inlisted. The feed showsCOALESCE(moderated, listed). -
Slug: the owner's slug for a question. Its page moves there, and the slug it had redirects to it. Refused, with nothing changed, if the slug is another question's or cannot be an address. -
KeyandRevoke: an API key for a name and a limit a minute, answered with the key itself, once (Answered::Key), and ending the live key of a name. Only the key's hash is kept (the API). A name may be made again once its key is revoked. -
BookmarkandRestore: Cloudflare keeps thirty days of the archive's history.Bookmarknames a moment in it;Restorehas the archive start again as it was then, everything since lost, and answers with the bookmark that undoes it. They are for a migration that went wrong, and they work when nothing else does: an archive whose migrations did not run refuses everything but these two.migrated.at_msis when each step ran, which is the moment to go back to just before.
This Worker has no route that reaches that path. A visitor's request is
passed to the object only as a socket upgrade on /live.
The archive's copies are made through the same door, with Select and
nothing else. Once a day the owner's Worker reads every table and keeps it,
as Parquet, in a private R2 bucket of the same account: the tables that
only gain rows (versions, events, comments, runs, pictures) as the
rows after the last copy, the rest whole. A picture is read as hex(),
since Select only says how big a blob is. Those copies are as private as
the archive: nothing on this site serves them. The owner can also take the
whole archive as an SQL file, the same way, by hand.
What Cloudflare keeps
Cloudflare, which runs the site, keeps its own record, in the owner's account and nowhere public:
- Workers Logs, for 3 days: one entry per request the Worker or its objects handle, with the request as it arrived, address included.
- Traces, for 7 days: each request's timing, through the fetches and the Durable Object calls it made.
- Metrics, the request counts and errors every Worker has.
- Web Analytics: on
lmjtfy.fun, Cloudflare adds its beacon script (static.cloudflareinsights.com/beacon.min.js) to each page it serves to a browser, and the browser reports page views and load times tolmjtfy.fun/cdn-cgi/rum. It sets no cookie. The Worker's own HTML does not contain the script: Cloudflare adds it on the way out, and only for browsers, socurldoes not see it.
Logs and traces are on since 2026-10-02 and Web Analytics since the domain
was set up on 2026-10-03. They are configured in
wrangler.toml under [observability].
In this folder
| Path | What |
|---|---|
| src/ | The Worker's code. Chapter 3 walks through it. |
| wrangler.toml | The Worker's name, the pinned Jev model, the chosen LLM, the Jev budget, the bindings and the declared secrets; and the same again for staging, a second Worker with its own archive where a change is tried first. |
| build.rs | Stamps the build with the commit it came from (LMJTFY_BUILD), and writes the scripts and the stylesheet the pages are served with, without their comments. |
| Cargo.toml | The crate: a cdylib for the Worker, and an rlib so its tests run natively. |
build/ and .wrangler/ are the build's and the dev server's and are not
committed.
← Previous: Chapter 1, apps/ · Up: apps · Next: Chapter 3, the source →