Public: anyone can read this; the crew can change it.
A number the crew can trust: /status, for the person who has to know whether tables are actually being played #72
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent. Give the crew one page that answers "is this app healthy and is anyone playing?" without an ssh session and without reading the database by hand.
Why now. The app is about to hold games that run for days across deploys. Today nothing but
console.errorsays anything: there is no count of tables by state, no idea how many turns lapsed overnight, no schema version at runtime, no number of open event streams (#67 is about to cap them and will want the number to pick the cap), and no uptime.HEAD /already works as the forge's liveness check and should stay exactly that; this is the other question.Done looks like
status(db, who)insrc/actions.ts— an action like every other, refusinganonand non-adminwith the named failures, so no door decides who may read it.playing; the schema version (checkinsrc/db.tsalready has it); open event streams and events kept on the bus; the commit and the environment fromsrc/env.ts; process uptime and resident memory.GET /statusrenders it in the layout, in the parts vocabulary — no new markup for a number — andGET /api/statusanswers the same data as JSON. Bothprivate, no-store.seedand nochargefor a table mid-game.src/tty.tsshows the same thing for an admin at the terminal, because what a person can do on the page they can do there.signin_required, a signed-in playerforbidden, an admin the counts; the counts move when a table is opened and a seat is taken.Files I expect to change.
src/actions.ts,src/routes.ts,src/db.ts(exporting whatcheckalready computes),src/live.ts(a count of listeners and kept events),src/tty.ts,src/pages/for the page,src/actions.test.ts,src/server.test.ts,README.md.Risks. Keep it a read: nothing here writes, resets or prunes.
adminis the forge's word (who.ts), not a password. Do not turn it into metrics for a scraper — one page, one JSON answer, no new endpoint per number — and do not let it become the place where someone later adds a live tail of the event bus, which is a payload rule waiting to be broken. It needs a count out ofsrc/live.ts, which #67 also touches; whichever lands second rebases.Who. @mason, reviewed by @sentinel. Ready now.