Public: anyone can read this; the crew can change it.
An evicted check on a game box loses at most one shard, and a frozen job thaws if the player leaves soon #17615
Merged 20h 15m ago, live in production
An evicted check on a game box now keeps every shard that had already passed and queues only the one that was running. The existing freeze-and-thaw guard already covered the thaw item; I added tests for it. All tests I ran pass, bun x tsc --noEmit is clean and the gate is satisfied.
-
Reviews
ApprovedClean. Evicted jobs send only files of shards that printed
done (exit 0; the forge validates each name with safeFile, bounds the set, merges it across stops in one transaction under the claim token, and test-shards skips them. Both new test files pass here (17 tests). The thaw/window path was already on main and now has tests for thaw-within-window and requeue-past-window. Docs are in docs/features/game-box.md, README untouched. Note, not blocking: the kept names come from step output the job itself can print, but the job's author already controls its own tests and result, so this adds no new power. -
Checks
shipped production is serving it deploy 9d6fa9d
-
History
- Direction: an evicted check on a game box keeps every finished shard and requeues only the running one (#17579) 61e5a20
- A game box runs a claimed check in a cell with no reach to Docker, worlds or its token, and a join freezes it at once (#17607) 8b6ac90
- The game agent asks every running server: docker compose exec no longer takes the list of the loop (#17611) b1bd486
- Test: dev-cell's git fixture runs with a built environment, not the host's (#17608) c703fb8
- The gate-audit tests of shards-run start no browser: 15 s less on a Mac, 1.5 s on a runner (#17609) dec1f91
- Home: "All quiet." only when it is, and a waiting step's line no longer says its action twice (#17583) 9d86beb
- Talk: the Preview pane says what the runtime really runs, and after a direct edit it follows the draft (#17580) 1d116db
- Infrastructure: AWS list prices, with their source, age and what they leave out (#17604) 6e657ca
- A check's log says the type check's time: `tsc: took 13.2s`, beside the gate's and the tests' (#17606) befaa4d
- A merged pull of the forge says "production is serving it" before the running forge has it (#17603) db29859
- The crew counters of /metrics read two indexes, not all history: the series sampler holds the loop 50 ms, not 250 (#17605) d269148
- A game box owner can switch on "Run checks while servers sleep", and the forge sends it only trusted, fitting jobs (#17599) 9c89a64
- Migrations are read from their directory when the forge is bundled: two pulls that each add one merge in either order (#17213) 11c2487
- 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
- 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
An evicted check on a game box now keeps every shard that had already passed and queues only the one that was running. The existing freeze-and-thaw guard already covered the thaw item; I added tests for it. All tests I ran pass, bun x tsc --noEmit is clean and the gate is satisfied.
I did not run the whole suite. scripts/fast.ts reports the diff as too broad because scripts/test-shards.ts changed, so the forge's full check will cover the rest.
What changed
- Box agent (
src/games/agent.sh): when a job is stopped, the agent reads the step's output for shards that ended withexit 0and sends their test files along withinterrupted, askept. - Forge (
src/checks/runner_jobs.ts,src/http/api/runners.ts):interruptJobmergeskeptinto the job's own env asFORGE_CHECK_DONE. It is a bounded set, unsafe paths are dropped, and a second stop adds to the first. The next claim carries it. - Shard runner (
scripts/test-shards.ts): it drops the files named inFORGE_CHECK_DONEbefore slicing. If none remain it exits 0 with "nothing to run". The parsing helpers are insrc/checks/shard_event.ts. - Thaw: a frozen job thaws when the box has been quiet 90 s with memory above the floor. It is stopped and queued as interrupted past
FORGE_GAME_LEND_FROZEN_S(300 s default) or when memory is needed. The agent code for this was already on main. - Docs:
docs/features/game-box.mdnow describes both behaviours.
Tests
test/game-lend-box.test.ts:- An eviction keeps the green shard and names neither the red shard nor the one that was running.
- A job thaws and finishes within the window.
- A job frozen past the window is requeued as interrupted.
- An existing assertion changed from
["interrupted"]to["interrupted", "kept"], since the body now has two keys.
test/runner-interrupt-keeps.test.ts:- Kept files ride the requeued job.
- A second stop adds to the first.
- A stale token keeps nothing.
- The set is bounded and unsafe paths are dropped.
test-shards.tsskips finished files.
Left out
- CRIU checkpointing, as the issue says.
- Keeping the passed files of a half-finished shard. Only shards that printed a
done (exit 0line count. - A terminal or doc door. The new field belongs to the box agent, not a page or action, so the commit says
No door:.
Reused
safeFilefromsrc/checks/verify.tsfor path validation.- The
FORGE_CHECK_ONLYhandling intest-shards.tsas the pattern for the skip. - The existing
interruptJobandlend_givepaths, extended rather than replaced. - I did not run
bun scripts/similar.ts.
Try it: bun test test/runner-interrupt-keeps.test.ts test/game-lend-box.test.ts
🤖 Generated with Claude Code
An evicted check on a game box now keeps every shard that had already passed and queues only the one that was running. The existing freeze-and-thaw guard already covered the thaw item; I added tests for it. All tests I ran pass,
bun x tsc --noEmitis clean and the gate is satisfied.I did not run the whole suite.
scripts/fast.tsreports the diff as too broad becausescripts/test-shards.tschanged, so the forge's full check will cover the rest.What changed
src/games/agent.sh): when a job is stopped, the agent reads the step's output for shards that ended withexit 0and sends their test files along withinterrupted, askept.src/checks/runner_jobs.ts,src/http/api/runners.ts):interruptJobmergeskeptinto the job's own env asFORGE_CHECK_DONE. It is a bounded set, unsafe paths are dropped, and a second stop adds to the first. The next claim carries it.scripts/test-shards.ts): it drops the files named inFORGE_CHECK_DONEbefore slicing. If none remain it exits 0 with "nothing to run". The parsing helpers are insrc/checks/shard_event.ts.FORGE_GAME_LEND_FROZEN_S(300 s default) or when memory is needed. The agent code for this was already on main.docs/features/game-box.mdnow describes both behaviours.Tests
test/game-lend-box.test.ts:["interrupted"]to["interrupted", "kept"], since the body now has two keys.test/runner-interrupt-keeps.test.ts:test-shards.tsskips finished files.Left out
done (exit 0line count.No door:.Reused
safeFilefromsrc/checks/verify.tsfor path validation.FORGE_CHECK_ONLYhandling intest-shards.tsas the pattern for the skip.interruptJobandlend_givepaths, extended rather than replaced.bun scripts/similar.ts.Try it:
bun test test/runner-interrupt-keeps.test.ts test/game-lend-box.test.ts🤖 Generated with Claude Code
Closes #17579