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

Migrated from github.com/Trevato/SO-ARM100

bench/launch-check.ts checks a deployed URL as an anonymous visitor and prints PASS/FAIL per item - against today's main #149

Merged opened this

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

Merged

I added Software/so101/bench/launch-check.ts. It checks a deployed URL as an anonymous visitor and prints one PASS/FAIL line per item. It exits 1 on any FAIL and 2 if the URL is missing or invalid.

Notes

shipped merged

opened this

I added Software/so101/bench/launch-check.ts. It checks a deployed URL as an anonymous visitor and prints one PASS/FAIL line per item. It exits 1 on any FAIL and 2 if the URL is missing or invalid.

I ran only bench/launch-check.test.ts (2 tests pass), not the full bun test, and I did not run the check against production or a preview. tsc --noEmit is not confirmed: the project config only covers src and bin, so it skips bench/. When I type-checked the bench files separately with the config ignored, the only errors were in src/leader-calibrations.ts and src/relay.ts, none in bench/.

The items it checks:

  • /: answers 200, has a title and body in the HTML, and sends Content-Security-Policy, X-Content-Type-Options and Referrer-Policy.
  • /status: passes on 200, or on 503 with an error reason.
  • /live: opens and pushes a status message within 2 s.
  • /move, /torque, /stop: an anonymous POST to each must come back 401 or 403.
  • Forged identity: a forged x-forge-identity POST to /move is refused, and /live opened with that header says you: null in its hello. This is the only check that sends a forged header.

bench/launch-check.test.ts starts a relay on the simulated arm with an identity key set and expects all 7 items to PASS. It also checks that a dead address fails every item. The key matters: without one the relay treats every visitor as the owner.

The README has a new "Launch check" section with the command for production and for a preview.

🤖 Generated with Claude Code

Closes #145

2 earlier comments
commented

I added Software/so101/bench/launch-check.ts. It checks a deployed URL as an anonymous visitor and prints one PASS/FAIL line per item. It exits 1 on any FAIL and 2 if the URL is missing or invalid.

I ran only bench/launch-check.test.ts (2 tests pass), not the full bun test, and I did not run the check against production or a preview. tsc --noEmit is not confirmed: the project config only covers src and bin, so it skips bench/. When I type-checked the bench files separately with the config ignored, the only errors were in src/leader-calibrations.ts and src/relay.ts, none in bench/.

The items it checks:

  • /: answers 200, has a title and body in the HTML, and sends Content-Security-Policy, X-Content-Type-Options and Referrer-Policy.
  • /status: passes on 200, or on 503 with an error reason.
  • /live: opens and pushes a status message within 2 s.
  • /move, /torque, /stop: an anonymous POST to each must come back 401 or 403.
  • Forged identity: a forged x-forge-identity POST to /move is refused, and /live opened with that header says you: null in its hello. This is the only check that sends a forged header.

bench/launch-check.test.ts starts a relay on the simulated arm with an identity key set and expects all 7 items to PASS. It also checks that a dead address fails every item. The key matters: without one the relay treats every visitor as the owner.

The README has a new "Launch check" section with the command for production and for a preview.

🤖 Generated with Claude Code

commented

I added the missing check.run to forge.json and pushed; I haven't seen the forge's verdict on it yet. forge.json declared check.limits but no check.run, and main has the same gap.

The command I added is bun install --cwd Software/so101 --frozen-lockfile && cd Software/so101 && bun x tsc --noEmit && bun test. It runs the type check and then the tests, which include the new launch-check tests.

I didn't run that command here, because bun x tsc hit a tempdir error in this sandbox. Earlier I ran bench/launch-check.test.ts on its own, and its 2 tests pass.

The pull also changes Software/so101/bench/launch-check.ts, its test, and the Software/README.md section on running the check against production and previews.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed. This clears the "does not merge into main: forge.json" failure; I haven't seen the forge's verdict on the new push yet.

Main's commit 1142ee6 removed the check block from forge.json. It did that because a check section needs check.run, and with only limits every arm check failed. My earlier check.run edit conflicted with that. I took main's forge.json unchanged, so the check.run I added is gone. The pull now touches only these three files:

  • Software/so101/bench/launch-check.ts
  • Software/so101/bench/launch-check.test.ts
  • Software/README.md

I re-ran bench/launch-check.test.ts after the merge and its 2 tests pass; I didn't run the full test suite.

launch-check.ts runs these checks as an anonymous visitor and prints one PASS/FAIL line each:

  • /: server-rendered, with the three security headers.
  • /status: answers 200, or 503 with a reason.
  • /live: pushes a status within 2 s.
  • Refused commands: anonymous POSTs to /move, /torque and /stop are refused.
  • Forged identity: a forged x-forge-identity header signs no one in.

It exits non-zero on any FAIL. The test runs it against a local relay on the simulated arm, and the README section says how to point it at production or a preview.

🤖 Generated with Claude Code

Approved

Does what #149 asked and nothing more: a zero-dependency script that checks a deployed URL as an anonymous visitor, prints PASS/FAIL per item and exits non-zero on any FAIL. The only mutations it sends are POSTs that must be refused. The README documents it. On the preview, / answers 200 and anonymous POST /move, /torque and /stop each return 401, matching what the script expects. I did not run the script itself: the checkout I reviewed from did not contain the bench files, so I judged them from the diff. Two things to do next:

  1. Add a negative test. The only failing case is a dead address, which fails everything. A relay with no identity key treats every visitor as owner, so a test that expects the forged-identity item to FAIL there would prove each check can actually fail.
  2. bench/ is outside tsconfig include (src, bin), so launch-check.ts is never type-checked, and the as never WebSocket header cast hides that. Cover bench in the type check, or note it in the README.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs