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

Migrated from github.com/Trevato/SO-ARM100

/status names who is driving, including the owner after a take-over #174

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

/status now includes driver: {id, name, owner} | null, taken from the current turn holder. The owner counts as driving after a take-over. The status pushed over /live carries the same field, since both go through statusOf in Software/so101/src/relay.ts.

Notes

shipped merged

opened this

/status now includes driver: {id, name, owner} | null, taken from the current turn holder. The owner counts as driving after a take-over. The status pushed over /live carries the same field, since both go through statusOf in Software/so101/src/relay.ts. The field is only added to successful status answers, so a 503 while the arm link is reconnecting has no driver.

I added a test in src/admin-relay.test.ts. driver is null at first, then alice while she holds the turn, then the owner after the owner takes control. The tests in admin-relay.test.ts, relay.test.ts and lobby.test.ts pass (47 tests). The type check didn't run: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". Nothing else was run, including the rest of bun --cwd Software/so101 test.

The branch smith/144-top-the-arm-moves-when-you-drive-it-the wasn't on the remote here, so I couldn't take #151's version and wrote this from scratch. I didn't touch forge.json.

Closes #160

1 earlier comment · 1 event
commented

/status now includes driver: {id, name, owner} | null, taken from the current turn holder. The owner counts as driving after a take-over. The status pushed over /live carries the same field, since both go through statusOf in Software/so101/src/relay.ts. The field is only added to successful status answers, so a 503 while the arm link is reconnecting has no driver.

I added a test in src/admin-relay.test.ts. driver is null at first, then alice while she holds the turn, then the owner after the owner takes control. The tests in admin-relay.test.ts, relay.test.ts and lobby.test.ts pass (47 tests). The type check didn't run: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". Nothing else was run, including the rest of bun --cwd Software/so101 test.

The branch smith/144-top-the-arm-moves-when-you-drive-it-the wasn't on the remote here, so I couldn't take #151's version and wrote this from scratch. I didn't touch forge.json.

Changes requested — before the latest push

The preview works: /status on #174 answers with driver: null and the code is small. Two misses on the list. First fix: add driver to the /status paragraph of Software/README.md (around line 228, where /status and the /live push are described). Say it is {id, name, owner} or null, that the owner shows as driving after a take-over, and that a 503 while the arm link is reconnecting has no driver. Second: the change claims the same field rides the /live status push, but nothing tests it. Add a test that connects to /live and checks the pushed status.driver changes after takeControl. I could not find /status in a tty path, so say in the pull whether the terminal shows the driver. If it has a status view, add it there too. Both doors should show the same thing.

commented

/status and the status pushed on /live now both carry driver: {id, name, owner} | null. It is the turn holder, and the owner shows as driving after a take-over. This push adds the README paragraph and the missing tests. The lobby, relay and admin-relay suites pass (48 tests). I didn't run tsc --noEmit, because it failed earlier in this sandbox with a read-only tempdir error.

  • README: Software/README.md now says what driver holds, that the owner shows as driving after a take-over, and that a 503 while the arm link is reconnecting has no driver.
  • /live test: a new test in lobby.test.ts has a watcher on /live see status.driver go null, then alice, then the owner after the owner takes control.
  • 503 test: the unreachable-from-the-start case in relay.test.ts now checks the 503 body has no driver.
  • Comments: the doc comment on statusOf in relay.ts now says it adds driver, and ownStatus has a comment of its own.
  • Terminal: src/tty.ts has no status view, so there is nothing to add there.

The reconnecting case needs a precise reading. The 503 has no driver, but once the link has a last known status, a reconnecting /status answers 200 with that stale pose and a live driver. I think that is right, because the turn is the relay's own state. The README wording covers only the 503.

Approved

Approved. /status and the /live push both go through statusOf, so they carry driver {id,name,owner}|null; the owner shows after a take-over. The preview answers /status with "driver":null. Tests cover the three states, the live push and the 503 having no driver. It adds no scope beyond the issue, and the terminal has no status view, so nothing is missing there. Next: (1) the README says only the 503 lacks driver, but a reconnecting 200 with a stale pose still carries a live driver, so say that in one sentence; (2) smith could not run tsc, so confirm the forge check passes the type check.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs