Public: anyone can read this; the crew can change it.
An operator can see the app's state: /api/health and a boot line that names what is missing #22
Check · Review · Land · Live done — Landed and live in production.
`GET /api/health` is now an action (`health` in `src/actions.ts`) that every door calls: anyone gets `{ok, env, commit, schemaVersion, uptimeSeconds}` and nothing else, and an admin gets `{identity, dataDir, databaseBytes, writable, terminal}` on top — the gate is in the action, so the JSON route, the new `health` MCP tool and anything added later cannot disagree about what a guest sees. `ok` is f…
shipped production is serving it deploy 2adbe7d
Sign in to join this conversation.
GET /api/healthis now an action (healthinsrc/actions.ts) that every door calls: anyone gets{ok, env, commit, schemaVersion, uptimeSeconds}and nothing else, and an admin gets{identity, dataDir, databaseBytes, writable, terminal}on top — the gate is in the action, so the JSON route, the newhealthMCP tool and anything added later cannot disagree about what a guest sees.okis false, and the status 503, when the schema in the file is not the one this code knows, when the data directory has stopped taking writes, or when SQLite reports the file corrupt; the corruption check is aquick_checkremembered for a minute per database, so a probe reads a version, two stats and nothing else — a hundred probes in a row measured 14.8 ms in total, and no probe writes.At boot
src/server.tsprints one line per real problem, from a purewarnings()insrc/env.ts: an emptyFORGE_APP_IDENTITY_KEYsays every request is anonymous and nobody can write, aFORGE_APP_URLthat is unset orhttp://localhostsays cookies will not beSecureand same-origin checks compare againsthttp://localhost. It names the variable and the cost, never the value, and a healthy boot adds nothing to the line it already printed.FORGE_APP_SSHis echoed exactly as given interminal, or the wordoffwhen it is unset. The identity key itself never leavesserver.ts: what travels on the request context is the fact"verified"/"disabled", not the secret.Worth a look: the shape tests in
src/server.test.tsassert the public keys exactly, for a guest and a signed-in user, and that the key string appears nowhere in an admin's answer; a second short-lived server whoseschema_versionrow is removed answers 503. What I chose not to do: no admin page (that is #10), no row counts or usernames anywhere in the answer, no timing assertion in the test suite (a wall clock in CI is a flaky test, so the speed claim is the design — oneSELECT, twostats, a cachedquick_check), and I leftsrc/tty.tsalone since the terminal has no status surface yet. No new dependencies.bun testis green (45 tests).🤖 Generated with Claude Code
Closes #14