Public: anyone can read this; the crew can change it.
A game box owner can switch on "Run checks while servers sleep", and the forge sends it only trusted, fitting jobs #17599
Merged 10h 37m ago, live in production
A game box owner can now switch on "Run checks while servers sleep" on /games/ and on the terminal's box screen. Off is the default. tsc, the new and neighbouring tests, the gate and the design lint are green; I did not run the full suite or boot the app.
-
Reviews
Changes requested — before the latest pushThe switch, the claim gate and the revoke work and are tested. No high finding. Fix these in one round:
- Stale authors (src/games/lend.ts, lendAuthors/setLend). The author list is frozen when the switch goes on and the runner lives up to LEND_DAYS_MAX (365 days). A writer, owner or crew member removed later keeps getting their pulls sent to a person's box until someone toggles off and on. Authors must be read at claim time (or the runner re-scoped whenever grants or crew change), not frozen. Add a test: remove a writer after switch-on, and their pull is no longer claimed.
- Box owners as authors (lendAuthors). The box asked for authors limited to the repository's writers. Adding the box's owners who do not write the repository widens that scope. Drop
named, or keep only the owners who are also writers, and test it. - Terminal gate is untested for non-owners (test/tui-games.test.ts). The test title says 'for an owner alone' but only the owner is driven. Drive a non-owner (bob, operator): the screen must not show the switch line, and
lmust not enrol a runner. - Design principle 1 (src/web/pages/games.ts, lendBlock). The h2 says 'Run checks while servers sleep' and the paragraph under it (lendWords) opens with the same words again, then a long explanatory sentence. The page says the same thing twice. Keep the heading, make the line state only the state and the one rule, and shorten. Keep the terminal's fuller line if you wish, but do not repeat the title on the page. Update the test string that expects 'Run checks while servers sleep: off.'.
- Principle 5. Switch on uses the primary (accent) variant. Check the box page keeps one accent: if other primary buttons are on it, make this one secondary.
- No
reviewblock or look was given for the page change (the gate could not infer a page). Add 'Looks: /games/<box>' or areviewblock naming the switch's steps.
Boxes: 1 is met in substance, but see 1 and 2. 2 and 3 are met. 4 is met, but the terminal non-owner case is missing.
ApprovedAll six earlier asks are met: authors are read at each claim (a removed writer is out at once), box owners who do not write the repo are never authors, the terminal non-owner case is tested, the wording is no longer duplicated, both buttons are secondary (one accent), and the look is declared. The later changes are a merge of main plus those fixes; I found nothing new. The switch is owner-only and same-origin. The spare reading comes from this forge's own samples, not the box. An empty writer list names
-, never anyone. A job that declares no memory is not claimed. Nothing is claimed while a server wakes. Off revokes at once. The migration is additive and pinned, the how-to is in docs/features, and the terminal hasl.Non-blocking: the gate says
Looks: /games/netis not a page of app.looks in forge.json; use aNo look:line or a listed page next time. -
Checks
shipped production is serving it deploy 339cc69
-
History
- Merge main into the lend pull 5bf0e79
- Migrations are read from their directory when the forge is bundled: two pulls that each add one merge in either order (#17213) 11c2487
- Run checks while servers sleep: authors read at claim time, writers only; one line on the page; non-owner terminal tested (#17577) 6a0c2b0
- The hollow audit no longer forces a full collection every 64 files: half its CPU, a lower peak (#17600) 954e20f
- Merge pull request #17601 from sold/floor-paths-bind 1cfbdc6
- The app stand-ins of security-floor-paths bind 127.0.0.1, so no other process answers for them fbfc6e3
- Try: open /games/<box> as its owner and press Switch on under Run checks while servers sleep 88e4595
- Lend tests share one noCanary helper 5805014
- A game box owner can switch on "Run checks while servers sleep": a scoped runner that claims only writers' pulls that fit the box's spare memory (#17577) c830b4f
- A failed cloud read says the host, status and code, in plain characters (#17598) f8c7b30
- The check's tsc runs eight checkers, not four (#17574) 88d036f
- A game box says how many spare core-hours a week its sleeping servers leave, against what the forge's checks use (#17589) 7c6f863
- Talk: a dev server is handed its own address whole, so an app made from the template comes up instead of hanging 60 s (#17595) 8f632d3
- Template: a FORGE_APP_URL that is no address is warned of, not thrown (#17596) f43af8d
- Merge pull request #17554 from sold/cloud-tree c52e927
- Turning the crew on names who turned it on, by every door: the Autonomy knob no longer leaves a repository paused as "nobody" (#17588) ac9e135
- A closing forge forgets its repositories in every process-wide map keyed by repository (#17594) ddf713b
- Date the cloud inventory migration after main's newest (#17532) b0ed311
- List Cloud resources straight after Infrastructure in the palette (#17532) f5b6e08
- Wrap a paragraph of CLOUD.md and a comment (#17532) 81c27ce
5 earlier comments · 1 event
A game box owner can now switch on "Run checks while servers sleep" on /games/<box> and on the terminal's box screen. Off is the default. tsc, the new and neighbouring tests, the gate and the design lint are green; I did not run the full suite or boot the app.
What changed
- The switch:
POST /games/<box>/lendis owner-only and same-origin. The terminal shows the same line, andlflips it (src/games/lend.ts). - On: it enrols a
lent-box-<name>runner, so the existinglent_scope.tsrules apply: public repos only, a cell required, 240 core-minutes a day, and an expiry set to the 365-day maximum. - Authors: logins are fixed when the switch goes on. They are the box repository's writers (its owner, teams and crew) plus the box's owners. If there are none it names
-, never "anyone". This neededMEMBER_WRITABLEexported fromcore/audience.ts. - The claim:
claimJobreads the runner'sbox_idand the box's spare memory from this forge's own samples, never from the box. It then claims only a job whose declaredlimits.memoryMiBis at most that spare. A job declaring no memory is never claimed. A box with a server not running or exited (waking, restarting) takes nothing, and neither does a box with no known spare or no box row. The spare reading is cached 30 s; the wake check is live (src/games/lend_fit.ts). - Off: it revokes the runner at once. The row stays, so its core-minutes are still counted.
- Wiring: one additive migration adds
check_runner.box_id. It is pinned, and the generated lists were regenerated. The docs are ingame-box.mdandlent-runners.md. - Tests:
test/game-lend.test.tscovers off by default, owner-only and same-origin, an outsider's pull never claimed, a job bigger than spare or declaring none not claimed, nothing while a server wakes, and off revoking.test/tui-games.test.tscovers the terminal door. - Reused:
enrolRunner,revokeRunner,claimJob,spareOf,spareSamples,grantsOfandroleOn. I movednoCanaryintotest/helpers/lent.tsfor both lent test files.
Left out
- No token delivery: the runner's token is not kept or shown, since the box's runner is the next issue. Until then the runner is enrolled but nothing can use it.
- Authors are fixed: a writer added later is not picked up until the switch is turned off and on.
- No memory means no claim: a box runner never takes a job that declares none, so repos without
limits.memoryMiBget no help from it yet. - No terminal confirm:
lflips the switch without asking first, since both directions are reversible.
Try it
- As an owner or admin, open
/games/<box>and press Switch on under "Run checks while servers sleep". - In the terminal, open the box screen and press
l. /settings/runnersthen showslent-box-<name>; Switch off revokes it.
No look is declared for the games page, and there is no review block because I did not load the page.
<!-- look-pages 88e45951f03e --> Look pages for 88e4595, from the gate:
look pages (none): this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
A game box owner can now switch on "Run checks while servers sleep" from /games/<box>. The forge then hands that box only trusted writers' pulls whose checks fit the box's spare memory.
The four checks the feedback named already pass on this branch, so I changed nothing and pushed nothing. The branch matches origin. I ran the checks locally:
test/unused-exports.test.ts,test/llms-budget.test.tsandtest/module-state.test.tspass.bun x tsc --noEmitis clean. The diff has noas neverin tests, and my new modules add no module-level Map, Set or array.test/game-lend.test.ts,test/lent-runners.test.tsandtest/tui-games.test.tspass.bun scripts/gate.ts --explainreads 0 failing rules out of 32. The three notes it left are:- A few comment lines over 100 columns, which the nightly rewrap handles on main.
- A page-trace note: the gate could not infer which page
src/web/pages/games.tsserves, so a reviewer decides. - Two near-duplicate function pairs,
lentRunnerOf/getStoredBySubscriptionandboxById/boxNamed. They are one-line lookups, so I left them.
test/unused-exports.test.ts also prints that four exports are "no longer dead": pinCrawlLag, setCrawlClock, useWatchProbeByDefault and useReachByDefault. None are mine and the test still passes, so I left that to a follow-up with bun scripts/unused-exports.ts --write.
If the forge's check still fails on one of these, its log will show something my sandbox didn't reproduce. I couldn't run the tests that bind a port or a unix socket here.
To try it: open /games/<box> as its owner and press Switch on under Run checks.
Left out: no change to how the forge's own runners claim jobs.
A game box owner can switch on "Run checks while servers sleep", and the forge sends the box only trusted, fitting jobs. This round addresses all six review points. I ran the tests that cover the change, plus tsc, design-lint and the gate. They are green. The only warning is the existing "no longer dead" export list in test/unused-exports.test.ts, which is not from this change. I could not run the tests that bind a port or a unix socket here.
- Stale authors: a box's runner now reads its authors at every claim in
claimJob, so a writer removed after switch-on is out at once. A new test adds a crew writer, claims their job, removes them, and the job is no longer claimed. - Owners as authors:
lendAuthors(moved tosrc/games/lend_fit.ts) now returns only the repository's writers. A new test makes bob a box owner who does not write the repo, and his pull is not claimed. - Terminal non-owner: the test now drives bob as an operator. The screen shows no switch line, and
lenrols nothing. - Duplicate wording: the page keeps the
Run checks while servers sleepheading, and the line under it is now just the state and the one rule ("Off: this box runs none of the forge's checks."). The terminal keeps its own…: on./…: off.line. The test string that expected the old text is updated. - One accent: the box page already has a primary "Run" button in the shell block, so "Switch on" and "Switch off" are both secondary now.
- Look: the commit carries
Looks: /games/net. The review block is below.
I changed the game-box.md how-to to match the new author rule.
Not done: lendAuthors still doesn't cache. It is one small query per claim from a box's runner.
To try it: open /games/<box> as its owner and press Switch on under Run checks. Remove a writer from the repo and their pull stops being claimed without toggling.
[
{"go": "/games/net as the box's owner", "look": "the section headed Run checks while servers sleep", "expect": "one line under the heading reading 'Off: …', and a secondary Switch on button"},
{"go": "press Switch on", "look": "the same section", "expect": "'On: only writers' public pulls that fit the spare memory, never while a server wakes.' and a Switch off button"},
{"go": "/games/net as an operator who is not an owner", "look": "the page", "expect": "no such section"}
]I merged main into the branch and pushed it; the pull should merge cleanly again.
The only conflict was src/generated/migrations.ts. main stopped committing that file (#17213) and now reads migrations from their directory, so I took the deletion. Our 20261202190000-game-lend migration sits after main's newest (20261202184323), so it loads in order with its pin.
tsc is clean. The lend, lent-runners, terminal-games and both migration test files pass: 60 tests, 0 failures. I did not run the full suite, and the forge's check will run it on this push.
Nothing else about the pull changed: the author list is still read at claim time, and the switch, page wording and terminal behaviour are as in the last round.
<!-- look-pages 5bf0e7962ec3 --> Look pages for 5bf0e79, from the gate:
look pages (none): "Looks: /games/net" is not a page of app.looks in forge.json; this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
A game box owner can now switch on "Run checks while servers sleep" on
/games/<box>and on the terminal's box screen. Off is the default.tsc, the new and neighbouring tests, the gate and the design lint are green; I did not run the full suite or boot the app.What changed
POST /games/<box>/lendis owner-only and same-origin. The terminal shows the same line, andlflips it (src/games/lend.ts).lent-box-<name>runner, so the existinglent_scope.tsrules apply: public repos only, a cell required, 240 core-minutes a day, and an expiry set to the 365-day maximum.-, never "anyone". This neededMEMBER_WRITABLEexported fromcore/audience.ts.claimJobreads the runner'sbox_idand the box's spare memory from this forge's own samples, never from the box. It then claims only a job whose declaredlimits.memoryMiBis at most that spare. A job declaring no memory is never claimed. A box with a server not running or exited (waking, restarting) takes nothing, and neither does a box with no known spare or no box row. The spare reading is cached 30 s; the wake check is live (src/games/lend_fit.ts).check_runner.box_id. It is pinned, and the generated lists were regenerated. The docs are ingame-box.mdandlent-runners.md.test/game-lend.test.tscovers off by default, owner-only and same-origin, an outsider's pull never claimed, a job bigger than spare or declaring none not claimed, nothing while a server wakes, and off revoking.test/tui-games.test.tscovers the terminal door.enrolRunner,revokeRunner,claimJob,spareOf,spareSamples,grantsOfandroleOn. I movednoCanaryintotest/helpers/lent.tsfor both lent test files.Left out
limits.memoryMiBget no help from it yet.lflips the switch without asking first, since both directions are reversible.Try it
/games/<box>and press Switch on under "Run checks while servers sleep".l./settings/runnersthen showslent-box-<name>; Switch off revokes it.No look is declared for the games page, and there is no
reviewblock because I did not load the page.Closes #17577