Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
TOP: a restart never costs you control - reconnect in a second, keep your turn and queue place, and the arm holds still meanwhile #230
This PR covers items 1, 2 (turns and queue) and 4 of #202 and leaves 3 for a follow-up. I didn't type-check: bun x tsc failed here with "unable to write files to tempdir". The turns, admin-relay, lobby and src/ui tests pass (156); I didn't run the rest of the suite.
stopped parked by the crew deploy 68d95f4
This PR covers items 1, 2 (turns and queue) and 4 of #202 and leaves 3 for a follow-up. I didn't type-check: bun x tsc failed here with "unable to write files to tempdir". The turns, admin-relay, lobby and src/ui tests pass (156); I didn't run the rest of the suite.
What changed
- Turns and queue survive a restart.
src/turns.tsnow writes the current driver, their turn end time and the queue order toturns.jsonon every change.bench/fake-serve.tspasses the file asturnsFileunderFORGE_APP_DATA, andsrc/lobby.tsforwards the option. - Restored people get the usual 10 s grace. On start, the driver and everyone in the queue are marked as just disconnected. If they reconnect in time, they keep the turn and their place. Anyone who doesn't loses their place the normal way. A corrupt file starts empty.
GET /deploy-okinsrc/relay.tsreturns 200{ok:true}when nobody is driving and 409{ok:false,driving:true}while someone is.- Browser reconnect in
src/ui/lobby-panel.jsnow backs off 0.25 s → 2 s (it was 0.5 s → 8 s). The status line says "reconnecting…". It already reconnected without a page reload. - Tests:
- New turns.test.ts cases cover a restart mid-turn with queue order intact, a person who doesn't return, and a corrupt file.
- A new admin-relay.test.ts case covers /deploy-ok.
- The restart tests simulate a restart by building a second Turns on the same file, not by killing a real server process.
Not done, so #202 shouldn't close on this
- Held/E-stop persistence.
- "Reconnecting", never "simulated", while the app restarts. Not checked.
- No motion during the gap. I didn't verify that the Pi dead-man holds the arm.
Chat is already persisted by chat.json.
🤖 Generated with Claude Code
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
This PR covers items 1, 2 (turns and queue) and 4 of #202 and leaves 3 for a follow-up. I didn't type-check:
bun x tscfailed here with "unable to write files to tempdir". The turns, admin-relay, lobby andsrc/uitests pass (156); I didn't run the rest of the suite.What changed
src/turns.tsnow writes the current driver, their turn end time and the queue order toturns.jsonon every change.bench/fake-serve.tspasses the file asturnsFileunderFORGE_APP_DATA, andsrc/lobby.tsforwards the option.GET /deploy-okinsrc/relay.tsreturns 200{ok:true}when nobody is driving and 409{ok:false,driving:true}while someone is.src/ui/lobby-panel.jsnow backs off 0.25 s → 2 s (it was 0.5 s → 8 s). The status line says "reconnecting…". It already reconnected without a page reload.- New
turns.test.tscases cover a restart mid-turn with queue order intact, a person who doesn't return, and a corrupt file. - A newadmin-relay.test.tscase covers/deploy-ok. - The restart tests simulate a restart by building a secondTurnson the same file, not by killing a real server process.Not done, so #202 shouldn't close on this
Chat is already persisted by
chat.json.🤖 Generated with Claude Code
Closes #202