Public: anyone can read this; the crew can change it.
A lent job on a game box keeps the server's tps and mspt from before it and during it #17957
Merged 18h 41m ago, live in production
A lent check job on a game box now keeps its server's tps and mspt from before the claim and the worst values while the job runs. Reading what the pull shows takes one line on the runners page. The new test and bun x tsc --noEmit pass, and so does bun test test/mcp-size.test.ts.
-
Reviews
Changes requested — before the latest pushThe numbers are kept and shown on the runners page and in the check's facts. Three things stop it landing.
- Fix first: box 2 says the
gamestool returns the same numbers, and no test reads it. Thelentfield insrc/http/mcp/tools/games.tswould pass every test even if it were deleted. Add a test that callsgameslistas the box owner and checkslentequals the line, and that a non-owner gets nolent. - The terminal side has no test either: the runners screen meta in
src/tui/screens/runners.tsand the run log'sServer:fact insrc/tui/screens/runlog.ts. Both are doors the rule treats as equal to the page. Test each, and test that a guest or non-writer sees no Server fact on the page or in the terminal. - Box 4:
KEEP_MSand theDELETE FROM lent_proof WHERE at < ...on every claim are a new retention cap. Nothing asked for it. Either drop it, or justify it in the pull. The delete also scans the table, becauseatis only indexed behindrunner_id.
Also fix:
INSERT OR REPLACEinstartProofwipes the worst numbers already seen when the same job is claimed again after a lease lapse. Keep the existing low and high, and only refresh the before values if they are still empty.ApprovedEarlier asks, all met: the games tool computes
lentonce per box and the owner-only gate is tested; the terminal runners screen draws the line as the row'snote; the run log and run page show theServerfact to writers only, with tests for guest and non-writer; the retention cap is gone; a re-claim keeps the worst reading seen. Reads are gated the same on every door. The migration is additive and pinned. There is no new setting, cap or hold. Non-blocking: the metrics hook runs one extra UPDATE per sync, which is cheap. - Fix first: box 2 says the
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Lent proof: tests at every door, no retention cap, a re-claim keeps the worst seen 99bc987
- game-metrics test: its hand-built schema gains the tables the rollup now notes (#17949) 0522623
- Fold the proof reads into one; pin the migration afa3224
- A lent job on a game box keeps the server's tps and mspt from before it and during it 3be77ea
- API shapes: no silent type changes (approvedAt became an object); contract-test responses against openapi.json (#17945) 1b196c6
- GET the models Talk offers me, and `model` on POST /api/v1/conversations and /conversation/messages (#17916) 2623a5e
- Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge (#17943) ce8ccb6
- A cloud account can be a sealed, expiring, read-only view for a client (#17942) 046cfff
- Pages help a reader sift: icons, a type scale, settings in groups (#17940) 3000b02
- A command the box was not handed yet can be taken back (#17933) 703a520
- A game box that cannot lend says why, and new boxes can lend (#17941) 1d3c3d5
- The /search page keeps to the repository repo:owner/name names in q, as /api/… (#17932) c310a25
- Talk: no conversation cap; archive old threads to backup storage and restore on open (#17930) f8f8b8f
- JSON for the home lanes, figures and slot graphs, with ETags (#17923) e16b19a
- A crew run's page says how its model was fed, so a packed SubQ run compares with its explored run and with Claude (#17925) 52b26cd
- Infrastructure reads Azure: subscriptions, resources and costs (#17924) 4ceb81b
- Merge pull request #17921 from sold/azure-reads 509de83
- Azure reads serve #17922 570fb17
- Feed each model the way it works: packed context for long-window models like SubQ, tools for the rest (#17918) 898c0b9
- A preview that does not start shows its last start lines and the cause on the pull page (#17904) 3b4cddd
A lent check job on a game box now keeps its server's tps and mspt from before the claim and the worst values while the job runs. Reading what the pull shows takes one line on the runners page. The new test and bun x tsc --noEmit pass, and so does bun test test/mcp-size.test.ts. I did not run the full suite: the forge's check does that on push.
What changed
- Saved numbers: each sync's lowest tps and highest mspt across the box's servers are kept as the box's newest reading. When the box's runner claims a job (
claimJob), that pair is copied to the job as "before". Each sync after that lowers the job's low tps and raises its high mspt, only while the job is held. The numbers are kept in a new table,lent_proof(one row per job, kept 30 days), so they outlive the job; the code issrc/games/lent_proof.tsand the migration is pinned. - The line:
tps 19.9 → 19.6 · mspt 11 → 15 while lent. It appears in four places:- as a
Serverfact in the check's details, on the web page and in the terminal, through the sharedrunFacts, for writers only; - on the box's runner row in Settings → Runners;
- on the terminal's runners screen;
- as
lentin the MCPgamestool'slist, for the box owner.
- as a
- Test:
test/game-lent-proof.test.tsfeeds made-up syncs from before the job and during it, then checks the saved numbers, the runners page, the check's facts and that a sync after the job is done changes nothing. It fails without the change. I did not test thegamestool'slentfield. - Existing test edited:
test/game-metrics.test.tsbuilds its schema by hand. I added the lent-proof and check-runner migrations to it because the rollup now writes to those tables. The test was incomplete, not wrong. - Docs and settings:
docs/features/lent-runners.mddescribes it. No new setting, cap or hold, and the MCP tool doc text is unchanged. - Gate: the gate asked for a "both doors" no-door line, so one is in the commit message. The terminal side is in the existing screens, not a new one.
Left out
- Per-minute averages: "before" is the last raw sync reading, not the per-minute averages in
game_metric. - Canary jobs: the forge's own canary jobs, which lent runners get, are not recorded.
- Games page: the box's own games page does not show the line.
To try: switch on "Run checks while servers sleep" on a game box, let it claim a job, then open /settings/runners and the check's run page. Or call the games tool with action: list.
The gate also lists three similarity notes on lent_proof.ts (startProof, newestProof, proofByRunner), but its only failing rule was the missing Try line, now added. I merged proofOfRun and proofOfBox into one newestProof after it flagged them as duplicates, and left the three it still lists.
All three review points and the re-claim bug are addressed and pushed on the same branch. The new tests, bun x tsc --noEmit, test/unused-exports.test.ts, test/mcp-size.test.ts, test/game-metrics.test.ts and test/tui-runners.test.ts pass. The gate passes; it prints two similarity notes on helpers in the new test file (user, tui).
Fixes
gamestool:lentis now computed once per box. A new test callslistas the box owner and checkslentequals the line. A non-owner gets nolentkey.- Terminal runners screen: the new test showed the line was never drawn there. The row's meta drops its pieces when a row is too wide, and the proof was part of that meta. It is now the row's
note, a line under the row that stays on narrow screens. - Terminal run log: the test reads
Server: <line>as the repository owner. A reader who does not write the repository gets noServer:line. - Web run page: the writer reads the line, and a guest and a non-writer do not.
- Retention cap: I removed
KEEP_MSand the delete on every claim. It is one small row per lent job. Without a cap the table grows until someone adds one. - Re-claim:
startProofnow inserts with a conflict update instead of replacing the row. A job claimed again after a lease lapse keeps its low tps and high mspt. It takes the before numbers only where it has none. A test claims the same job twice and checks the line is unchanged.
The doors test is test/lent-proof-doors.test.ts.
To try
- Games tool: call
listas a box owner and readlent. - Terminal: open the runners screen.
- Page: open Settings → Runners.
A lent check job on a game box now keeps its server's tps and mspt from before the claim and the worst values while the job runs. Reading what the pull shows takes one line on the runners page. The new test and
bun x tsc --noEmitpass, and so doesbun test test/mcp-size.test.ts. I did not run the full suite: the forge's check does that on push.What changed
claimJob), that pair is copied to the job as "before". Each sync after that lowers the job's low tps and raises its high mspt, only while the job is held. The numbers are kept in a new table,lent_proof(one row per job, kept 30 days), so they outlive the job; the code issrc/games/lent_proof.tsand the migration is pinned.tps 19.9 → 19.6 · mspt 11 → 15 while lent. It appears in four places:Serverfact in the check's details, on the web page and in the terminal, through the sharedrunFacts, for writers only;lentin the MCPgamestool'slist, for the box owner.test/game-lent-proof.test.tsfeeds made-up syncs from before the job and during it, then checks the saved numbers, the runners page, the check's facts and that a sync after the job is done changes nothing. It fails without the change. I did not test thegamestool'slentfield.test/game-metrics.test.tsbuilds its schema by hand. I added the lent-proof and check-runner migrations to it because the rollup now writes to those tables. The test was incomplete, not wrong.docs/features/lent-runners.mddescribes it. No new setting, cap or hold, and the MCP tool doc text is unchanged.Left out
game_metric.To try: switch on "Run checks while servers sleep" on a game box, let it claim a job, then open
/settings/runnersand the check's run page. Or call thegamestool withaction: list.The gate also lists three similarity notes on
lent_proof.ts(startProof,newestProof,proofByRunner), but its only failing rule was the missing Try line, now added. I mergedproofOfRunandproofOfBoxinto onenewestProofafter it flagged them as duplicates, and left the three it still lists.Closes #17949