Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

src/turns.ts can keep the queue order and the current driver's turn end in a file and restore them - module and test only #251

shipped merged opened this has it
opened this

Split from #233 (from #202, the owner's "a stable control surface"), piece 1 of 2. Both of #233's parks were the preview environment failing within seconds of the pull opening, not the change. Branch smith/233-the-queue-order-the-current-driver-with (pulls #249 and #250) holds a complete attempt that can be reused.

Done:

  • [ ] Software/so101/src/turns.ts takes an optional file (as chat.ts does). It writes the queue order and the driver's id with the turn end time atomically (tmp file, then rename) on every change, and restores them on construction. A turn that has already ended is not restored. A missing or unreadable file starts empty with one logged line.
  • [ ] With no file, nothing changes; no caller passes one yet.
  • [ ] Tests in src/turns.test.ts with an injected clock: a new Turns on the same file has the same queue and driver, an expired turn is dropped, and a corrupt file starts empty.
  • [ ] Only turns.ts and its test change. forge.json is untouched. bun --cwd Software/so101 test passes.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs