Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The queue order, the current driver with their turn end, and the hold state survive a restart, kept under FORGE_APP_DATA #249
Turns now keeps the queue order, the driver with their turn end, and the hold in a file, and restores them on start. The turns tests pass (19, including the new file ones). The full suite ran once before a last test fix, with 485 pass and 2 fail.
stopped parked by the crew deploy c6cbbcf
Turns now keeps the queue order, the driver with their turn end, and the hold in a file, and restores them on start. The turns tests pass (19, including the new file ones). The full suite ran once before a last test fix, with 485 pass and 2 fail. One failure is in src/server.test.ts, where the vendored three.js route returns 404, and I didn't touch that code. I didn't identify the other. I didn't re-run the full suite after the final test fix. The type check didn't run: bun x tsc errors here because bun can't write to its tempdir.
- What's kept:
src/turns.tstakes an optionalfileand writes the queue, the driver (id, name, start, turn end, bonus time) andpausedatomically on every emitted change.pausedis the only hold stateTurnshas; there is no separate E-stop state. A failed write is logged and doesn't break a turn. - Restoring: a turn that ended during the downtime is dropped, and the head of the queue then takes over unless the hold is on. The restored driver's idle clock restarts at load. Entries that aren't valid people are skipped. A missing or unreadable file starts empty with one logged line.
- Wiring:
Lobbyhas a newturnsFileoption, andbench/fake-serve.tspassesturns.jsonbesideadmin.jsonandchat.jsonunderFORGE_APP_DATA/so101.forge.jsonis untouched. - Tests:
src/turns.test.tsuses the injected clock to check three things. A newTurnson the same file has the same queue and driver. An expired turn is dropped and the line moves up. A corrupt or missing file starts empty. A fourth test checks that the hold and the line behind it come back. - Hold on restart:
LobbycallssetPausedfrom the admin settings right after it creates theTurns, so on a relay restart the adminpausedsetting decides the hold. That setting is already persisted.
Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again
Turnsnow keeps the queue order, the driver with their turn end, and the hold in a file, and restores them on start. The turns tests pass (19, including the new file ones). The full suite ran once before a last test fix, with 485 pass and 2 fail. One failure is insrc/server.test.ts, where the vendored three.js route returns 404, and I didn't touch that code. I didn't identify the other. I didn't re-run the full suite after the final test fix. The type check didn't run:bun x tscerrors here because bun can't write to its tempdir.src/turns.tstakes an optionalfileand writes the queue, the driver (id, name, start, turn end, bonus time) andpausedatomically on every emitted change.pausedis the only hold stateTurnshas; there is no separate E-stop state. A failed write is logged and doesn't break a turn.Lobbyhas a newturnsFileoption, andbench/fake-serve.tspassesturns.jsonbesideadmin.jsonandchat.jsonunderFORGE_APP_DATA/so101.forge.jsonis untouched.src/turns.test.tsuses the injected clock to check three things. A newTurnson the same file has the same queue and driver. An expired turn is dropped and the line moves up. A corrupt or missing file starts empty. A fourth test checks that the hold and the line behind it come back.LobbycallssetPausedfrom the admin settings right after it creates theTurns, so on a relay restart the adminpausedsetting decides the hold. That setting is already persisted.Closes #233