Public: anyone can read this; the crew can change it.
A join that freezes a lent job is recorded with how long the freeze took #17956
Merged 21h 53m ago, live in production
A join that freezes a lent job is now recorded with how long the freeze took, and the check's log says it in plain words. It's pushed. The new tests (test/lent-pause.test.ts) and test/game-lend-box.test.ts pass, as do the dead-code, module-state, migration and own-source tests and the gate.
-
Reviews
Changes requested — before the latest pushTwo things to fix in one round; neither needs a redesign.
- Multi-job loss (fix first):
lend_freeze_allfreezes every job's cgroup but writes ONE.lend.joinfile, and the first guard to read it removes it. With more than one lent job running, only one job gets its pause recorded and the others get nothing. A later join before the guard polls overwrites an earlier one.lend_jobalso doesrm -f .lend.joinat start, which can erase a pending join that belongs to another running job. The issue asks for the pause 'with the job', so write one file per job (for example.lend.join.<id>, written for each cgroup actually frozen) and havelend_jobclear only its own. Add a box test with two jobs. - Unbounded growth from the report door: the key is (job_id, joined_ms), so a runner token can post any number of distinct
joinedMsvalues for one job. Each adds a row and a log line, andlentInscans the whole table on every Capacity/Runners render. Keep at most a few pauses per job (reject, not cap-and-govern: e.g. only accept a join later than the last kept for that job, and only while the job is claimed), or key on job_id alone and keep the latest/slowest. Add a test that a flood of distinct joins keeps a bounded number of rows and log lines.
Box 4 (production proof) depends on the tps issue and a deploy; it stays open.
Otherwise: validation, lent-only gating, the not-red/not-a-try behaviour, docs and migration pin are fine.
ApprovedBoth earlier asks are met. (1) Multi-job loss: lend_freeze_all now writes one .lend.join.<id> per frozen cgroup (id checked against SAFE), each guard reads and removes only its own, and lend_job clears only its own; the box test covers a second job. (2) Unbounded growth: lent_pause is one row per job, a repeat or older join is rejected, at most 5 are counted, and log lines are bounded the same way; both the direct and the over-the-door flood tests cover it. The write is gated on a lent job the token already owns, and inputs are validated (safe integers, delay 0..1h; the agent also checks digits before jq). The check stays green and no try is counted. Non-blocking: the new paragraph in docs/features/lent-runners.md has one very long line; rewrap it.
- Multi-job loss (fix first):
-
Checks
shipped production is serving it deploy a338207
-
History
- Lent pauses: one join file per job, one bounded row per job (#17950) de39f63
- Runners and Capacity, page and terminal, say how many joins froze a lent job (#17950) 641fa49
- Drop the unused pausesOf export; the test reads the table (#17950) 6f0402c
- Pin the lent_pause migration; rewrap comments (#17950) 07a21db
- A join that freezes a lent job is recorded with how long the freeze took (#17950) 755dd9e
- 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
4 earlier comments
A join that freezes a lent job is now recorded with how long the freeze took, and the check's log says it in plain words. It's pushed.
The new tests (test/lent-pause.test.ts) and test/game-lend-box.test.ts pass, as do the dead-code, module-state, migration and own-source tests and the gate. The lent-pause tests need the new module, so they can't pass without the change. I didn't run bun x tsc --noEmit clean after the last edit and I didn't run the full suite; the forge's check does that on push.
What changed
- Agent:
src/games/agent.shrecords the join time and the time the freeze finished when it freezes a job's cgroup. Its job guard then reports both, in milliseconds on the box's clock, as{paused: {joinedMs, frozenMs}}to the job's report door. That happens before any stop decision, so a job that is frozen and then handed back as interrupted still gets its pause reported. - Forge:
src/checks/lent_pause.tsvalidates the two instants (both integers, freeze not before the join, at most an hour apart). It keeps one row per job and join in the newlent_pausetable (migration20261203080000) and writesPaused for a player who joined; frozen 0.4 s after the joininto the check's run log once. It only does this for lent runners. The route change is insrc/http/api/runners.ts. - Not red, not a try: the report touches no claim count and settles nothing. The check in the test finishes
okwithattempt0. - Tests:
test/lent-pause.test.tsplays a made-up join during a running lent job over HTTP. It checks the stored row and the single log line, and that a repeated report, an impossible reading and a non-lent runner add nothing.test/game-lend-box.test.tsruns the real agent against a fake docker event and checks it reports the pause before the interrupt.
- Docs:
docs/features/lent-runners.mddescribes it. I usedNo door:because the line rides the run log the terminal already shows.
Choices and gaps
- Join source: the join time comes from the agent's own
docker eventsreader, not from the proxy. This repo has no other join event for the lent path, so that is what I used. - Pause and interrupt: a pause followed by an interrupt is two facts: the pause line, and the existing "stopped the job" line.
- No new view: I added no page, API shape or screen for pauses.
- Production proof: the fourth box (first real lent check in production showing the whole proof) depends on the tps issue and a deploy, so I haven't checked it.
- Gate note: it still flags
pausesOfas 0.82 similar toadoptableJobs. They read different tables, so I left both.
Try it: with a lent runner's job token, POST /api/v1/runner/jobs/<id> with {"paused":{"joinedMs":…,"frozenMs":…}} and read the check's run log for the Paused line.
🤖 Generated with Claude Code
The dead-code failure is fixed and pushed. pausesOf was only called from the test, and the test doesn't count as a caller, so I removed the export from src/checks/lent_pause.ts. test/lent-pause.test.ts now reads the lent_pause table with its own query.
test/lent-pause.test.ts and test/unused-exports.test.ts pass, 7 tests in all. bun x tsc --noEmit and the gate print no errors; the gate still prints the long-comment note for src/http/api/runners.ts and exits normally. I did not run the full suite, so the forge's check on this push is the full run.
The rest of the pull is unchanged:
- Recorded: a join that freezes a lent job is kept with the job, the join time, the freeze time and the seconds between them.
- Shown: the check's log says
Paused for a player who joined; frozen 0.4 s after the join. - Not a failure: the check stays green and the pause doesn't count as a try.
The join time comes from the box agent's own docker events reader, not the proxy. I added no page, API shape or terminal screen for pauses. I haven't checked the production proof, which needs the tps issue and a deploy.
🤖 Generated with Claude Code
The unread-table failure is fixed and pushed. The rule wanted code under src/ that reads lent_pause, so I made the forge show it.
lentIn in src/checks/runner_jobs.ts now counts the recorded pauses and finds the slowest freeze. lentLine in src/checks/lent_scope.ts adds this to the existing "Lent in" line: Paused for a player who joined 1 time; slowest freeze 0.4 s after the join. That line already appears on the Runners page, the Capacity page and the terminal Runners screen, so each of them now shows it.
test/lent-pause.test.ts now also checks that line after the join. It passes with test/unread-tables.test.ts, test/unused-exports.test.ts and test/lent-runners.test.ts, 25 tests in all. bun x tsc --noEmit and the gate print no errors; the gate still prints its long-comment note for src/http/api/runners.ts. I did not run the full suite, so the forge's check on this push is the full run.
Everything else in the pull is as before: the join and freeze times with the gap are kept per job, the check's log carries the Paused line, and the pause is neither red nor a try. I haven't checked the production proof, which needs the tps issue and a deploy.
🤖 Generated with Claude Code
Both of sentinel's points are fixed and pushed. tsc, test/lent-pause.test.ts, the box test, the schema-migrations test, test/deadends.test.ts and the gate pass. The deadends test skipped 2 tests. I did not run the full suite; the forge check does that.
Multi-job loss:
lend_freeze_allnow writes one.lend.join.<id>for each cgroup it actually froze, with the id taken from the unit name and checked againstSAFE.- Each job's guard reads and removes only its own file.
lend_jobclears only its own file at start, so it can no longer erase another job's pending join.- The box test now has a second job's cgroup on the box. It asserts that job's file is still there after the first job's guard reported and removed its own, and that no shared
.lend.joinis left.
Unbounded growth:
lent_pauseis now keyed onjob_id, so there is one row per job. It holds a count of joins, the latest join's time and the slowest freeze.keepPauserejects a join that is not later than the last one kept, and rejects any join once the job has 5 counted. A rejected join writes nothing and adds no log line. The claim is already checked at the door.lentInnow sums the count column over one row per job.- Two flood tests, both expecting at most 5 kept, one row and one log line each:
- Directly: 500 distinct joins for one job.
- Through the runner door: 40 distinct later joins, checked against the run log and the "joined 5 times" line.
Other changes:
- I changed the migration in place and regenerated its pin. The migration only exists in this pull, so nothing has applied it yet.
PAUSES_MAXis no longer exported, to stay clear of the dead-code rule. The test uses a literal 5.- I updated
docs/features/lent-runners.md. - Each commit's
No door:line says the pause rides the run log, which the terminal's run view already shows.
Box 4 (the production proof) stays open, as sentinel said.
No disagreements.
A join that freezes a lent job is now recorded with how long the freeze took, and the check's log says it in plain words. It's pushed.
The new tests (
test/lent-pause.test.ts) andtest/game-lend-box.test.tspass, as do the dead-code, module-state, migration and own-source tests and the gate. Thelent-pausetests need the new module, so they can't pass without the change. I didn't runbun x tsc --noEmitclean after the last edit and I didn't run the full suite; the forge's check does that on push.What changed
src/games/agent.shrecords the join time and the time the freeze finished when it freezes a job's cgroup. Its job guard then reports both, in milliseconds on the box's clock, as{paused: {joinedMs, frozenMs}}to the job's report door. That happens before any stop decision, so a job that is frozen and then handed back as interrupted still gets its pause reported.src/checks/lent_pause.tsvalidates the two instants (both integers, freeze not before the join, at most an hour apart). It keeps one row per job and join in the newlent_pausetable (migration20261203080000) and writesPaused for a player who joined; frozen 0.4 s after the joininto the check's run log once. It only does this for lent runners. The route change is insrc/http/api/runners.ts.okwithattempt0.test/lent-pause.test.tsplays a made-up join during a running lent job over HTTP. It checks the stored row and the single log line, and that a repeated report, an impossible reading and a non-lent runner add nothing.test/game-lend-box.test.tsruns the real agent against a fake docker event and checks it reports the pause before the interrupt.docs/features/lent-runners.mddescribes it. I usedNo door:because the line rides the run log the terminal already shows.Choices and gaps
docker eventsreader, not from the proxy. This repo has no other join event for the lent path, so that is what I used.pausesOfas 0.82 similar toadoptableJobs. They read different tables, so I left both.Try it: with a lent runner's job token,
POST /api/v1/runner/jobs/<id>with{"paused":{"joinedMs":…,"frozenMs":…}}and read the check's run log for the Paused line.🤖 Generated with Claude Code
Closes #17950