Public: anyone can read this; the crew can change it.
Games: the forge keeps a SQLite snapshot of what /forge answers alone, and the agent puts it on the proxy #18150
Merged 14h 51m ago, live in production
Part of #18028. Stacked on the instant-path pull: its commit is the first of two here.
-
Reviews
Changes requested — before the latest pushOne thing to fix first: the snapshot can outgrow what the agent accepts, and then the forge resends it on every poll.
- (medium, denial of service)
make()insrc/games/desk_snapshot.tsis capped by players (100) but not by bytes. The agent doeshead -c 2000000on the base64, so a longer file is cut,base64 -dor the SQLite file is bad, and.desk.vis never written. The agent then reports an oldvin every quick poll, anddeskAnswersends the whole multi-MB payload again each second. The forge pays for that on every box. Fix: cap the file on the forge side. Whenb64.lengthis over the agent's limit, drop players from the end until it fits, or return undefined and log it. Add a test that a large set of players never produces adbover the limit. Keep the limit in one shared constant that the agent comment points to. - (low) The plugin that reads
snapshot.dbis not in this repository. I searched forSnapshot.keyand for the table schema and found only the docs anddesk_snapshot.ts. The docs say the plugin answers from the file, and thekey()helper has to match the plugin's key function exactly. Say in the pull where the plugin lives and which commit has the reader. Add a test that pins the key rules: case, spaces, and a trailing?,!or.. - (low)
helpfor a guest-role player is built withhelpLines(role, true)and includes thestatusline, which is fine. But rows for a player whose role is revoked or who is deactivated stay valid for up to 60 s plus the 15 s remake interval. The docs say "decided when the file is made". Add the worst-case delay (about 75 s) to the docs so the claim is true.
Tested and fine: the sync is token-authenticated, each row is computed with that account's own rights, and
agent.shvalidatesvand writessnapshot.dbatomically. The docs are indocs/features/games.md, not the README. There is no new dependency.ApprovedApproved. The change does what #18028 asks. The forge makes a per-player SQLite file of the answers it gives without a model, the agent installs it atomically, and the plugin answers from it. Each row is computed with that account's own rights. The file is capped in bytes on the forge side (
packdrops players from the end), and the agent refuses one over the same limit while still recording its version, so it is not resent every poll. The sync stays token-authenticated,vis validated in the agent, and the docs are indocs/features/games.md, not the README. There is no new dependency. Tests cover the cap, the version, the key rules, the sync handing the snapshot out once per version, the agent installing it, and the over-limit case.Sentinel's three points are already handled in this head: the byte cap and its test, the key test, and the docs naming the plugin and its worst-case delay.
Two things I would do next:
- In
gameAgentSyncthe newvoid runChat(...)has no.catch.runLanecatches job errors, butfinishinside its catch could still throw, and that would be an unhandled rejection on the sync path. Give it.catchwith a log line, asquicklynow does. - In
snapshotFor, the 20 sPromise.racelets go ofmakingbut does not stop the slowmake. A second making can then run beside it, and the slow one can overwritemine.madelater with older content. Guard the write with a generation counter, or skip the write when a newer making has started.
There is no page or terminal screen in this change, so there is nothing for a keyboard, a phone or a screen reader to hit.
ApprovedApproved. There is no diff since a496f221db8f, and the earlier asks are met in that head. I opened the preview:
/answers 200 with a server-rendered page, the title and meta description in the head, and no layout problem in the served HTML. It took about 20 s on that first request, probably a cold start. This pull has no page of its own, since the change is the agent/forge sync, so there are no pictures to judge. I read the code and tests and did not run the suite.- Oversized file:
pack()drops players from the end until the base64 fitsSNAPSHOT_MAX_B64. That constant is shared with the agent'shead -climit. The agent records the version it was offered even when it cannot install the file, so it is not resent every poll. Tests cover the cap and the over-limit case. - The plugin's key:
snapshotKeyis pinned by a test, and the docs name trevato/forge-velocity (Snapshot.java) as the reader. - Revocation delay: the docs now state the worst case of about two minutes and a quarter, and that what an account may see is decided when the file is made.
- Both doors: the read paths use the same
readLinesandanswerTorights as the terminal and the page. The how-to is indocs/features/games.md, not the README. There is no new dependency.
Next, both non-blocking:
- Add a test that a snapshot for a player whose role was revoked drops the viewer rows on the next making.
- Count answers served from the file, since they are not in the command log, so you can see whether the snapshot pays off.
- (medium, denial of service)
-
Checks
shipped production is serving it deploy f698c54
-
History
- Merge commit '4fb324847239b05671c429dded1f655823f30522' into push-c a496f22
- Games survival step 4: admin mods (luckperms fabric, ledger with fabric-language-kotlin) (#18148) 4fb3248
- Merge branch 'main' of https://forge.open-platform.sh/trevato/forge into push-c 3292033
- Games: the snapshot never passes what the agent takes, and the agent refuses one that does fb1001a
- Merge branch 'push-b' into push-c 30815f3
- Games: a sync with no request is never held for a job, a failed run is logged, and the timing is documented 814454e
- Games: /forge reads are answered in the same sync, and the agent sends a request within a fifth of a second (#18149) e529fa8
- Traces 5a: compare two traces of one issue side by side, with the cost and time difference (#18164) e7394aa
- Access 3a: the /api/v1 repository routes ask may(), shadowed first, then their inline checks go (#18165) 7ba81ba
- Games: the snapshot is bounded, versioned by content, relative in time and private to the proxy's user d33353f
- Test: the agent's wait is bounded with a request waiting; a scratch file is removed f0368e6
- Spark's config is installed with the mod so a profile uploads to the forge and never elsewhere (#18173) 7de2fc0
- Games: the agent's quick poll never ends its wait early for a mark it cannot carry 6266558
- Games survival step 3b: a sleep (night-skip) mod in the quality set (#18172) 56e2b82
- tmp 69b07b7
- Automate a review finding as a lint or test: One high finding, then smaller ones, all for one round. (#18167) f6eb779
- A spark profile decodes to a summary: call tree, slowest ticks, per-mod time, GC and memory (#18144) e30e2b6
- Access 4b: the 'Who may do what' page, linked from settings, by person and by resource (#18131) 3ecccb5
- "asks ledger failed: database is locked" two minutes after a release (v0.7.733) (#18169) 009df15
- Traces 4: a Claude Code session file imports as a trace and is listed beside the others (#18129) 68f0754
Part of #18028. Stacked on the instant-path pull: its commit is the first of two here.
For each linked player on a server, the forge makes a small SQLite file of the words it answers without a model (help, status, servers, who is on, the address, why a join failed, what a server needs, whether it sleeps) with the very answer that account would get, each good for a minute. It is remade at most every 15 s and only while a linked player is on. An agent that says
desk: { v }in a quick poll is sentdesk: { v, db }(base64) when there is a newer one, and writes it whole to the proxy's plugin folder. The plugin (forge-velocity, separate jar) answers from it with no round trip.What an account may see is decided when the file is made. A command answered from the file is not in the forge's command log. Docs say so, and that player identity needs the proxy in online mode.
Not shown: red-first and a green run. The vxrail gate did not open, so the pull's check is the gate. New tests: test/game-door.test.ts (the snapshot's rows, once per version) and test/game-desk.test.ts (the agent puts it whole, refuses a bad one, wakes at once). tsc was not run.
🤖 Generated with Claude Code