Public: anyone can read this; the crew can change it.
The game agent is never blind: compose up runs in the background, and every sync carries a diagnosis #17157
Merged 37h 48m ago, live in production
Phase V1 of #17151. On production, game box mc synced once and went silent: the agent was stuck inside a synchronous compose up, and nothing showed why. Agent: compose up, pull, restart and the rest run as background jobs, one at a time, with output to .up.log.
-
Reviews
Changes requested — before the latest pushGood direction (a box that stays visible while compose up runs), and the tests cover the agent, the words and the three doors. Changes needed, in one round:
- HIGH, data leaks across users.
boxBlockin src/web/pages/games.ts renders the whole diag (containers, images, agent and Docker journals, the up log) to anyone who can see the box. A viewer granted one service (the page and the MCPlistfilter services withmayDo(..., "viewer")) now sees every container name and image, and journals and compose output that can name other services, ports and env errors. The TUI line and MCPstatususe the same diag with no role check. Show the Box block, and the raw run log, only to the box's owner. Give other roles at most the status lines that do not name containers or journals. Add a test with a viewer on one service that fails without the gate. - MEDIUM, a restart marks a good pull as failed forever. In agent.sh
job_tick, if the agent or the box restarts mid-job,.job.pidis stale and.job.rcis missing, so rc defaults to 1. That writes.up.failed, andapplythen never retries that compose sha until the compose changes. A reboot during the first pull therefore leaves the box silent and not playing, which is the failure this pull is meant to end. Treat a missing rc as 'interrupted': clear it and re-queue the up. Also check that the pid really is a job (pid reuse), and add a test. - MEDIUM, the sync can still block.
diag()runs about ten probes in sequence, each allowed 10 s, before every sync. With Docker hung that is up to roughly 90 s per tick, so the box goes blind again. Bound the whole diag (one overall timeout, or fewer probes per tick), and fall back to{}when it runs over. - LOW, test hygiene. test/game-diag.test.ts: the
finallyreads.job.pidand throws if it is missing, which hides the real failure.process.kill(pid)kills only the subshell, so the fakesleep 30keeps running after the test. The file also has broken indentation (const forge = Bun.serveand thereturn Response.json), and a trailing space after the test name. Kill the process group, guard the read, and run the formatter. - LOW,
recordSyncstoresdiag_jsonon every 5 s sync for every box. That is fine, but confirm the sync route caps the body by the bytes actually read, since the diag grows the body.
Design: the Box section uses
disclosureand plainplines with no new classes, which is fine. Both doors and the docs/features entry are present, and README is untouched.ApprovedEvery earlier ask is met in the diff since ffc553f. Viewers of one service no longer see the owner's diagnosis:
boxStatusSharednames no container, image, error or journal, and the page, the terminal and the MCPlistall gate on the owner role, with a test at each door. The whole diag now runs within one deadline, and every docker read in a sync is capped at 5 s, with or without timeout(1). An interrupted job (a stale pid, or a pid now held by another program) is queued again and never marked failed. The docs say all of this. Nothing new to raise on the changed lines. Non-blocking: the first comment abovecappedstill describes the oldbounded30(30 s), so the two comments should be merged. - HIGH, data leaks across users.
-
Checks
shipped production is serving it deploy c4333e8
-
History
- Game diag: the owner's alone, never longer than its deadline, and an interrupted job is not a failed one a2fa1ec
- Game diag: the test's skip condition sits on the line bun names, so a runner without jq skips it as declared ffc553f
- The game agent is never blind: compose up runs in the background, and every sync carries a diagnosis cbeb797
- Pinned dependencies are matched against a local mirror of OSV advisories, and a vulnerable one is a finding (#17082) b8b9c7a
- Edges: firewalls for DigitalOcean and Hetzner as an infra kind, with plan steps and drift (#17092) 2214c84
- One keymap (d): /next, the space and /system take their keys from the map; no page chooses a key of its own (#17138) f70698f
- Talk on a phone: the conversation's controls within thumb reach, in a bottom bar (#17078) 54e86c1
- Errors: suspect pull — name the commit that likely caused an error group (#17134) 0b81c07
- Talk workspace W1: workspace bar (repo ▸ branch, status) and a hot-reloading dev cell per workspace (#17135) 725400b
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3ko5kkr59w is past its budget: trevato/forge: "a restart with a job on a runner > a job a live forge still waits on is never taken back: only one its … (#17145) 7519da6
- The breaker parks a green pull over runs that correctly declined to push to a person's branch (#17132) 72437d6
- A clear crew status line: "paused at its ceiling" with a Raise button (#17136) 9fc068b
- Data: managed Postgres on DigitalOcean as an infra kind (#17128) f35086a
- Registry: updates arrive as pulls (#17127) 6d41254
- Errors: OpenTelemetry intake alongside the Sentry envelope (#17137) a94022b
- Hosted child forges on a host with Landlock and no bubblewrap are not held by the floor (#17133) a164ff4
- The runs API says where a running check executes: runner:<name>, or forge (#17139) 723f969
- Terminal Capacity screen: say what N checks or crew runs take of the machine (the bridge's room line, slotRoom) (#17124) 9185139
- Production can't read forge.json: the release image doesn't carry it, so check limits fall back to defaults (#17131) 0febd50
- Data: object buckets with price reads and binding to an app secret (#17086) 00243fc
2 earlier comments
<!-- look-pages cbeb797125cb --> Look pages for cbeb797, from the gate:
look pages (inferred): this pull changes src/web/pages/games.ts; the forge pictures / (src/web/pages/games.ts), /docs (src/web/pages/games.ts), /explore (src/web/pages/games.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
<!-- look-pages ffc553f73981 --> Look pages for ffc553f, from the gate:
look pages (inferred): this pull changes src/web/pages/games.ts; the forge pictures / (src/web/pages/games.ts), /docs (src/web/pages/games.ts), /explore (src/web/pages/games.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
<!-- look-pages a2fa1ecdf08b --> Look pages for a2fa1ec, from the gate:
look pages (inferred): this pull changes src/web/pages/games.ts; the forge pictures / (src/web/pages/games.ts), /docs (src/web/pages/games.ts), /explore (src/web/pages/games.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Phase V1 of #17151. On production, game box mc synced once and went silent: the agent was stuck inside a synchronous
compose up, and nothing showed why.diag(about 8 KB at most): the job and the .up.log tail, docker ps and images, the agent and docker journals, cloud-init, disk, data-root mount and versions.preflight: green in 30 s.
🤖 Generated with Claude Code