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

Migrated from github.com/Trevato/SO-ARM100

settings.servoGains lands from the reviewed branch: validated at PUT /settings, proved by the branch's own server, not the preview #549

Merged opened this

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

Merged

This brings in the reviewed #536 code with main merged. It adds one test that starts the branch's own arm server on a truly empty data dir. Nothing is written to a servo.

Notes

shipped merged

opened this

This brings in the reviewed #536 code with main merged. It adds one test that starts the branch's own arm server on a truly empty data dir. Nothing is written to a servo.

The preview's /settings is the Pi's arm server running main, so it won't show servoGains until the Pi is deployed. Judge this on the tests.

What's in it (from #536, e53e109):

  • src/servo-gains.ts and Settings.servoGains.
  • Strict PUT /settings validation: integers 0–254, joints 1–5. The gripper and unknown keys get a 400.
  • The README row.

What I added: the "servoGains on disk" test in src/server.test.ts now starts with an empty data dir and checks that GET /settings equals DEFAULT_SERVO_GAINS. The same test already covers the rest:

  • A partial PUT survives a restart.
  • A settings.json without servoGains loads the defaults.
  • A stored gripper entry is skipped and the defaults load.

Tests: I ran bun test src/servo-gains.test.ts src/server.test.ts in Software/so101 (70 tests across 2 files). 69 pass and 1 fails: "serves the model, its meshes and the vendored libraries, and nothing outside them", which gets a 404 at server.test.ts:620. That test fails the same way on main (5f2aecf), so this change didn't cause it. I didn't find out why. I haven't seen the forge's check run it.

I did not paste the output of that command. I also did not get a result from the full bun --cwd Software/so101 test run, which timed out in my shell, or from tsc --noEmit, which couldn't find the bun types. The forge's check will run both.

🤖 Generated with Claude Code

Closes #544

commented

This brings in the reviewed #536 code with main merged. It adds one test that starts the branch's own arm server on a truly empty data dir. Nothing is written to a servo.

The preview's /settings is the Pi's arm server running main, so it won't show servoGains until the Pi is deployed. Judge this on the tests.

What's in it (from #536, e53e109):

  • src/servo-gains.ts and Settings.servoGains.
  • Strict PUT /settings validation: integers 0–254, joints 1–5. The gripper and unknown keys get a 400.
  • The README row.

What I added: the "servoGains on disk" test in src/server.test.ts now starts with an empty data dir and checks that GET /settings equals DEFAULT_SERVO_GAINS. The same test already covers the rest:

  • A partial PUT survives a restart.
  • A settings.json without servoGains loads the defaults.
  • A stored gripper entry is skipped and the defaults load.

Tests: I ran bun test src/servo-gains.test.ts src/server.test.ts in Software/so101 (70 tests across 2 files). 69 pass and 1 fails: "serves the model, its meshes and the vendored libraries, and nothing outside them", which gets a 404 at server.test.ts:620. That test fails the same way on main (5f2aecf), so this change didn't cause it. I didn't find out why. I haven't seen the forge's check run it.

I did not paste the output of that command. I also did not get a result from the full bun --cwd Software/so101 test run, which timed out in my shell, or from tsc --noEmit, which couldn't find the bun types. The forge's check will run both.

🤖 Generated with Claude Code

Approved

Approved. servoGains is validated strictly at PUT /settings (integers 0-254, joints 1-5, gripper and unknown keys give a 400) and merged as a partial patch. A bad PUT changes nothing, and the defaults load from a missing or older settings.json. The change adds no dependency and writes nothing to a servo, which matches the README row. I ran src/server.test.ts here and all 65 tests passed, so the failing test smith reported did not fail for me. I did not run src/servo-gains.test.ts on its own: bun reported one file. The preview runs main on the Pi, so I could not check it there.

Two things to do next:

  1. Move the DEFAULT_SERVO_GAINS import in server.test.ts to sit with the other relative imports. It currently sits between node imports.
  2. When the write-to-servo step lands, the page and tty.ts will need a control for gains. The README says there is none on purpose for now.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs