Public: anyone can read this; the crew can change it.
API routes the Apple app lacks: the arcade's games, an app's log, pausing a runner #18075
Merged 9h 28m ago, live in production
The three routes the Apple app asked for now exist, are in openapi.json and are tested. Typecheck, the gate and the targeted suites I ran (827 tests across the openapi, contract, feature-doc, boot-lazy and TUI-runners files) are green. I did not run the full suite; the forge runs it on this push.
-
Reviews
ApprovedClean on security: the log route checks the writer before reading, bounds the read by bytes and lines, and masks lines as the run log does. The pause route checks admin scope, refuses local, revoked and already-paused runners, and writes an event. The arcade list is public like the host and reads the display as a stranger. Preview answers /api/v1/arcade/games with {host:null,items:[],next_cursor:null}. Follow-ups, not blockers: the log test stubs envStatus, so the pump-to-run-log path is not proven end to end; the pause test's [403,404] assertion is loose; the arcade and app-log routes have no terminal screen, which the No door line covers.
-
Checks
shipped production is serving it deploy a338207
-
History
- Timing: name the arcade games route among the reads with no page to phase (#18038) d267589
- Budgets: list the app log route as one the fixture cannot fill (#18038) 4cc1b0c
- Contract: the app log's refusals as the route answers them, arcade under builds (#18038) 4befd95
- API: the arcade's games, an app's log, pausing a runner (#18038) d542b12
- Traces 1a: a trace index table, filled when a run or Talk turn ends and backfilled once off the serving thread (#18061) 35e4ee2
- Games: pin forge-velocity f7d5d4e72 (/forge words as you type, Yes and No to click, an answer shown once) (#18036) 0003ecb
- Merge pull request #18054 from sold/agent-rollback d6960b3
- Games: a new server's words are searched on Modrinth, not matched against five names (#18041) 31cdee4
- Lists answer next_cursor as a string, as openapi.json declares (full suite red, #18027) (#18040) ab67833
- Game box agent: put a container left as <12 hex>_<service> back to its service name (#18052) 99480aa
- Deploys never move a live name by surprise: DNS is asked before Build, a restore asks once more (#18030) 49e77a8
- Plugin config: a line too long to read stays as the file has it (#17782) 1c79353
- Games: a server the box no longer runs leaves its list (#18029) 492f6df
- A migration that makes a return to the image before unproven can be named (#17766) 63bef0b
- Game box: a new agent is on trial, and goes back to the one before if it does not check in baf09aa
- Talk API: pin a conversation, answer a held action yes or no, and redo a turn (#18012) 4513adb
- Asks: routes so a client can clear the whole queue (resume paused, snooze, group contents, dismiss all kinds) (#17966) 11275b0
- Merge pull request #18016 from sold/forge-fast b9491db
- Talk API: a person's sent files on each turn, and search inside turns (#18009) 0e5211b
- Merge commit '2b24ebd48bea0a43bd8236087ff986b3542c25d4' into HEAD cee6636
2 earlier comments
The three routes the Apple app asked for now exist, are in openapi.json and are tested. Typecheck, the gate and the targeted suites I ran (827 tests across the openapi, contract, feature-doc, boot-lazy and TUI-runners files) are green. I did not run the full suite; the forge runs it on this push.
What changed
GET /api/v1/arcade/gamesis public, like the arcade host.- It lists the same games and builds as the host's
games.json, plusplay_urlon each build (the host's address and the build'sfile). - The answer is
{ host, items, next_cursor: null }. With no Arcade display it is empty (andhostis null where apps don't run) instead of the host's 404. - The code is in
src/arcade/games_list.tsandsrc/http/api/arcade.ts. I addedarcadeunder thebuildstag insrc/contract/tags.tsand a mark filesrc/http/marks/api-v1-arcade.json.
- It lists the same games and builds as the host's
GET /api/v1/repos/{owner}/{name}/app/{env}/logis for people who may write the repository.- It answers the last 200 lines as
text/plain, withx-log-truncated: 1when earlier lines were cut. The lines are masked as the run log is. - It reads the deploy run that serves the environment (
src/actions/app_log.ts). An environment that never ran answers an empty body. - A reader gets 403, a signed-out caller 401, a bad environment name 422
no_such_env, and an unseen repository 404.
- It answers the last 200 lines as
POST /api/v1/admin/runners/{id}/pausesits beside resume and revoke.- The runner's
pausedtext readspaused by <admin>, and arunner.pausedevent is written. - It answers 422 for
local(the forge's ownlocal-N),revokedandpaused. - The terminal's Runners screen gets a
pkey that calls the same action.
- The runner's
What I chose not to do
- No per-app scale, and nothing built on
PUT /api/v1/admin/capacity/{key}. - No follow or SSE stream on the app log; a client asks again.
- No new terminal screens for the arcade list or the app log. The commit says
No door:with the reason: the Display screen already shows the shelf's Launch address, and the feed already tails run logs. Only pause was a missing action, so it got the key. bun scripts/gate.tsnotes thatpauseis 0.64 similar toresumeinsrc/actions/runners.ts. I kept them apart because their refusals differ.
Reused: readRunLogTail, requireWriter, shelfOf, arcadeHome and arcadeDisplay, and the runner's existing pauseRunner.
Try
curl $FORGE_URL/api/v1/arcade/gamescurl -H "authorization: Bearer <writer token>" $FORGE_URL/api/v1/repos/<owner>/<name>/app/production/logcurl -X POST -H "authorization: Bearer <admin token>" $FORGE_URL/api/v1/admin/runners/<id>/pause- In the terminal, open Runners, move to a runner, press
p, thenuto resume.
Tests and docs: test/app-log-api.test.ts covers the log and pause, test/arcade-host.test.ts covers the games list against games.json, and test/tui-runners.test.ts covers the p key. How-tos are added to docs/features/runners.md, arcade-carts.md and log-reader.md.
The failing check is fixed and pushed. I ran test/pages-budget.test.ts locally and it passes (4 tests). I did not run the full suite, tsc or the gate.
The new /api/v1/repos/:owner/:name/app/:env/log route has no page-budget fixture, and the budget test requires every such route to be listed in test/budgets/unfixtured/. I added api-v1-repos-owner-name-app-env-log.json there, copied from the existing entry for the sibling …/app/:env/open route. It gives the same reason: no fixture holds the id this route needs.
Nothing else changed. The commit carries No door: because it touches only a test file list.
The second check failure is fixed and pushed. I re-ran test/route-timing-coverage.test.ts locally and all 4 tests pass. I didn't run the full suite, tsc or the gate.
GET /api/v1/arcade/games answers 200 without a session phase. I added it to the UNTIMED allowlist in test/route-timing-coverage.test.ts, with the reason that it's a plain read with no page to phase. I chose the allowlist over adding timing phases to the route; that is the call to question if you'd rather the route report phases. The commit says No door: because only a test file changed.
The three routes the Apple app asked for now exist, are in
openapi.jsonand are tested. Typecheck, the gate and the targeted suites I ran (827 tests across the openapi, contract, feature-doc, boot-lazy and TUI-runners files) are green. I did not run the full suite; the forge runs it on this push.What changed
GET /api/v1/arcade/gamesis public, like the arcade host.games.json, plusplay_urlon each build (the host's address and the build'sfile).{ host, items, next_cursor: null }. With no Arcade display it is empty (andhostis null where apps don't run) instead of the host's 404.src/arcade/games_list.tsandsrc/http/api/arcade.ts. I addedarcadeunder thebuildstag insrc/contract/tags.tsand a mark filesrc/http/marks/api-v1-arcade.json.GET /api/v1/repos/{owner}/{name}/app/{env}/logis for people who may write the repository.text/plain, withx-log-truncated: 1when earlier lines were cut. The lines are masked as the run log is.src/actions/app_log.ts). An environment that never ran answers an empty body.no_such_env, and an unseen repository 404.POST /api/v1/admin/runners/{id}/pausesits beside resume and revoke.pausedtext readspaused by <admin>, and arunner.pausedevent is written.local(the forge's ownlocal-N),revokedandpaused.pkey that calls the same action.What I chose not to do
PUT /api/v1/admin/capacity/{key}.No door:with the reason: the Display screen already shows the shelf's Launch address, and the feed already tails run logs. Only pause was a missing action, so it got the key.bun scripts/gate.tsnotes thatpauseis 0.64 similar toresumeinsrc/actions/runners.ts. I kept them apart because their refusals differ.Reused:
readRunLogTail,requireWriter,shelfOf,arcadeHomeandarcadeDisplay, and the runner's existingpauseRunner.Try
curl $FORGE_URL/api/v1/arcade/gamescurl -H "authorization: Bearer <writer token>" $FORGE_URL/api/v1/repos/<owner>/<name>/app/production/logcurl -X POST -H "authorization: Bearer <admin token>" $FORGE_URL/api/v1/admin/runners/<id>/pausep, thenuto resume.Tests and docs:
test/app-log-api.test.tscovers the log and pause,test/arcade-host.test.tscovers the games list againstgames.json, andtest/tui-runners.test.tscovers thepkey. How-tos are added todocs/features/runners.md,arcade-carts.mdandlog-reader.md.Closes #18038