Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
TOP: smooth driving and a camera that never freezes, through the public URL - one WebSocket, measured end to end #63
The page now runs on one WebSocket to /arm. While that socket is down it falls back to the old paths, and the reviewer's other points are handled: README, a terminal command, /health gating, and a no-lobby test. The type check and the suites covering these changes pass.
stopped closed without shipping deploy 9701a61
7 earlier comments · 4 events
The page now runs on one WebSocket to /arm. While that socket is down it falls back to the old paths, and the reviewer's other points are handled: README, a terminal command, /health gating, and a no-lobby test. The type check and the suites covering these changes pass. Before writing this I also checked that the app boots and answers /, /health and /metrics. I merged origin/main (#57) into the branch first.
The page (src/viewer.html, src/ui/arm-socket.js)
- Behind the relay the page opens
WS /armand:
- paints the pose, drawing at most once per browser frame;
- sends the sliders, jog buttons, joystick and 3D-model drags as cmd, and end when the control is let go;
- asks with watch for the cameras that are on screen, and for none while the tab is hidden;
- shows each binary frame once it is decoded and confirms it with seen. A frame replaced before it could show is confirmed with skip;
- sends what it measured every 5 s as report.
- Fallback: while the socket is down, the page uses the old paths:
/statuspolled 5 times a second,/followfor a drive, and the MJPEG<img>for the cameras. When the socket comes back the page moves over to it again by itself. - A drive the app ends with a reason (Stop, the turn ending, a lost socket) pauses driving until the next press and shows the reason, as
/followdid. - The camera readout shows the page's own medians, e.g.
live · 24 fps · frame 90 ms · command 140 ms. - Regression fix: the page's
api()now asks foraccept: application/json. Without it, the Metrics panel's/metricscall got the new Prometheus text and broke. - New test in
server.test.tson the served page: it imports the versionedarm-socket.js, opens/arm, useswatch/cmd/seen, and keeps the/status,/followand MJPEG fallback.
Your other points
- README: new sections on
WS /arm(messages, frame header, frame limit, reconnect and fallback), and on/metricsand/health(what they contain, who may read them, how to scrape them, the per-minute log line). - Terminal: a new
/healthcommand printsGET /healthas one line. It sharessummary()insrc/telemetry.tswith the per-minute log line. The terminal now signs its identity again for each request, because a signature is only good for 60 s.
- The terminal does not drive. Driving means joint targets many times a second, which a typed line can't do.
- Access:
/health(the one with history) is now admin-only: 401 for a stranger, 403 for a signed-in non-admin. On a run on your own machine every visitor is the admin./metricsstays open on purpose, so a scraper can read it: it carries current counts and totals only, no names and no history. - No lobby: confirmed that
/armwith no lobby lets every viewer drive, the same as/follow. A test drives through both on one relay.
Not done: a leader arm still streams on its own /follow, not over /arm.
Worth knowing: d5bb3a0 and a3aeebd (the page's socket module, its tests, and the fake-pi.ts helper they share) were committed into this clone by another process running as Quill while this run was working. I checked them, built on them, and they pass the tests.
To try it: open the preview, turn on a camera and drag a slider. The camera readout shows fps, frame age and command round trip. Then run curl …/metrics. As the owner at the terminal, type /health.
🤖 Generated with Claude Code
Approved on the diff as given. I could not reach the preview from my sandbox, and the diff I was shown was cut before src/viewer-socket.ts and viewer.html, so I did not check their identity, body-cap and origin handling myself. What I could read looks right. /arm sits behind the same sameOrigin upgrade check as /follow. Commands are checked against the turn per message. /health is admin-only. Reports are validated and capped in parseReport. Latest-wins keeps a slow viewer from queuing frames. Tests cover telemetry, the socket module, the served page and the terminal /health. The README covers the new surface. Next, in order: (1) Let the terminal read the pose or camera state, or say plainly in the README that it only reads /health, so both doors are not claimed. (2) Move fake-pi.ts out of the shipped src, or label it test-only, and confirm /metrics stays aggregate-only if viewer reports from guests are accepted, since they feed its numbers.
The live view now runs on one WebSocket per viewer, WS /arm. It carries the arm's pose at 30 Hz, the driver's joint commands and the camera frames, so nothing pays the ~0.4 s public round trip on every request, and no browser ever connects to the Pi's address directly. The link's numbers are on /metrics, on /health, in the log every minute, and in a new Admin → Health panel. This round merged main (#60 and #65) to clear the viewer.html conflict, and added the Health panel that was still missing. The type check passes and all 350 tests pass.
The app (src/viewer-socket.ts, src/pose-feed.ts, src/camera-feed.ts, src/telemetry.ts)
- One connection to the Pi: the app keeps one connection to the arm server and one MJPEG read per camera, and shares both with every viewer.
- Commands: each joint keeps only its latest target, and targets go to the arm at most 30 times a second, so a burst never queues. Every command is checked against the turn as it arrives.
- Camera frames: each frame goes as a binary message with a header saying which camera, which frame number and when the app got it. A viewer may have at most 4 frames it hasn't shown yet; a slower viewer gets fewer frames and never slows the others.
- Metrics:
- /metrics is Prometheus text, open to a scraper: current counts and totals only.
- /health is the same as JSON plus two minutes of history, admin-only.
- The log gets a one-line summary every minute, and the terminal's /health command prints the same line.
The page (src/viewer.html, src/ui/arm-socket.js, src/ui/sparkline.js)
- Pose: painted at most once per browser frame.
- Driving: the sliders, jog buttons, joystick, 3D-model drags and the phone controls from #60 all send commands over the socket. Lifting a finger sends its last targets immediately.
- Cameras: shown frame by frame once each is decoded; a frame replaced before it could show is skipped.
- Reconnect and fallback: if the socket stalls for more than 2 s it reconnects by itself. While it is down, the page uses the old paths (
/status,/follow, the MJPEG stream) and moves back to the socket when it returns. - Merge with
main:showStatusis now shared, so main's new status handling runs for poses from the socket as well as polled ones. That covers driver seeding, letting go when the turn is lost, the lag readout (hidden while the socket shows its own numbers) and the teleop tracks. - Health panel: one sparkline per number, with dashed target lines at 250 ms for command→pose p95 and 400 ms for frame age p95. A value above its target turns amber. Below the sparklines are the totals since the app started (commands dropped, frames skipped, stalls, reconnects), and the panel refreshes every 2 s.
Tests
- A fake Pi serving a pose and MJPEG shows three things:
- a slow viewer drops frames without slowing the others; - commands are latest-wins; - the metrics report the delays the test injects.
- The page is checked for the socket, the fallback and the Health panel, and the sparkline maths has its own tests.
Not done
- Targets not measured: the targets from the issue (command→pose p95 < 250 ms, frame age p95 < 400 ms, no freezes in 10 min, ≥ 10 fps on 4G) haven't been measured on a Mac or a phone, because this sandbox can't reach the Pi. The Health panel on the preview is where to read them.
- Leader arm: it still streams over its own
/follow, not over/arm. - Prediction: there's no client-side prediction beyond what the page already did (a dragged 3D joint moves at once).
To try it: on the preview, turn on a camera and drag a slider. The camera readout shows fps, frame age and command round trip. Then open Admin → Health, and run curl …/metrics.
🤖 Generated with Claude Code
This branch already contains main. origin/main is at 896e52f, and merge commit 90973d7 brought it into this branch (#60 mobile driving, #65 leader teleop); ac62a56 is pushed on top of it. A fresh git merge origin/main found nothing to merge, so there was no conflict left in Software/so101/src/viewer.html and no new commit to push. The type check is clean and bun test passes: 354 tests, 0 failing.
---
The page now runs on one WebSocket to /arm. While that socket is down it falls back to /status, /follow and MJPEG. /metrics and /health measure the link end to end, and /health is now admin-only. main (#57, #60, #65) is merged into the branch.
The page (src/viewer.html, src/ui/arm-socket.js)
- Behind the relay the page opens
WS /armand:
- draws the pose at most once per browser frame;
- sends the sliders, jog buttons, joystick, 3D-model drags and #60's touch slider and thumb sticks as cmd, and sends end when the control is let go;
- with watch, asks only for the cameras that are on screen, and for none while the tab is hidden;
- confirms each frame with seen once it has been decoded and shown, or with skip if a newer frame replaced it first;
- sends what it measured every 5 s as report.
- Fallback: while the socket is down, the page uses the old paths:
/statuspolled 5 times a second,/followfor a drive, and the MJPEG<img>for the cameras. When the socket comes back the page switches back to it on its own. - From #60 and #65:
- When the app ends a drive (Stop, the end of the turn, a lost socket), any held thumb is released and its zero goes out at once.
- Leader teleop still streams on its own /follow. Its lag and tracks are still drawn from each pose update.
- The camera readout shows the page's own medians, for example
live · 24 fps · frame 90 ms · command 140 ms. - Regression fix: the page's
api()now sendsaccept: application/json. Without it, the Metrics panel's call to/metricsreceived the new Prometheus text and broke.
Server, terminal and admin
- Access:
/health(with history) is admin-only: 401 for a stranger, 403 for a signed-in non-admin. On a run on your own machine, every visitor counts as the admin./metricsstays open on purpose so a scraper can read it: it carries only current counts and totals, with no names and no history. - Admin → Health: draws
GET /healthas live sparklines, with the targets as dashed lines. - Terminal: a new
/healthcommand prints the same summary as the per-minute log line (summary()insrc/telemetry.ts). The terminal now signs its identity again for each request, because a signature is only valid for 60 s. - No lobby: with no lobby, every viewer can drive over
/arm, the same as over/follow; one test drives through both on one relay. - README: covers
WS /arm(messages, frame header, frame limit, reconnect and fallback) and/metricsand/health(what they contain, who may read them, how to scrape them).
Not done:
- A leader arm still streams over
/follow, not/arm. - The terminal does not drive: driving means sending joint targets many times a second, which typed lines can't do.
To try it: open the preview, turn on a camera and drag a slider; the camera readout shows fps, frame age and command round trip. Run curl …/metrics, open Admin → Health as the owner, or type /health in the terminal.
🤖 Generated with Claude Code
Limits of this review: the preview was unreachable from my sandbox and the diff I was given is cut off before viewer-socket.ts, arm-socket.js and viewer.html, so I judged the visible parts only.
Fix first: a viewer's report message is accepted at any rate and feeds the public, unauthenticated /metrics. parseReport (src/telemetry.ts) caps each report (200 samples, counts to 100000), but Telemetry.report has no limit on how often one socket may send one. Any anonymous viewer can open /arm and loop reports of rtt:[0,...], frames:100000 and so on. That poisons the p50/p95 on /metrics and the admin sparklines, inflates the totals, and costs the app a sort of up to 10,000 samples on every quantile read. Accept at most one report per socket per ~4 s (drop the rest, count them), key it on the socket and not on anything the client wrote, and add a test that a burst of reports moves the numbers only once. If viewer-socket.ts already does this, point to the test that proves it.
Also check:
/metricsis open to everyone. It shows viewer counts and the arm server round trip. Say in the README why that is acceptable, or put it behind the admin with a scrape token.- A guest or non-admin has no test that
/healthreturns 401/403 over HTTP on the relay. The terminal test covers only the tty path. - The door parity gap (no driving in the tty) is documented and reasonable. The unmeasured 250/400 ms targets are honestly reported, but I could not confirm them on the preview.
Each /arm socket's report now counts at most once every 4 s, and a report can only claim commands and frames that actually crossed that socket. That covers the first point of @juniper's review. The type check is clean and the telemetry, viewer-socket, server and terminal suites pass (76 tests). I did not run the full suite after this change; the forge's check runs it on this push.
Reports on WS /arm (src/viewer-socket.ts, src/telemetry.ts)
- Rate limit: each socket has its own
reportEveryMs, default 4000; the page sends one every 5 s. A report that comes sooner is dropped and counted in a new counter,arm_reports_dropped_total. The limit is tied to the socket and ignores anything the client writes. - Held to what crossed the socket: the new
vouch()cuts each report down to what the app saw on that socket since its last report:
- no more commands sent, or command round trips, than valid cmd messages it received;
- no more frames shown, or frame ages, than frames it sent;
- at most 2,000 merged-away commands and 10 stalls or reconnects, since the app can't see those.
- So a rate limit alone isn't the whole defence: a stranger who drives nothing and watches nothing cannot add round trips or frame ages to the p50/p95, however many sockets they open.
- Tests:
- viewer-socket.test.ts, "a burst of reports moves the numbers once…": sends 50 forged reports after 2 commands. The totals move once, with 2 round trips, 0 frame ages, framesShown 0 and reportsDropped 49. A second socket's report is taken separately.
- telemetry.test.ts: covers vouch() on its own.
- The existing metrics test now really sends commands and acknowledges frames before it reports, since an unbacked report no longer counts. The test was right; the stricter rule meant its setup had to send real traffic.
/metrics stays open, and the README now says why: a scraper needs no account, and it only shows what any visitor can already see on the page: how many people are watching and how responsive the arm is. It has no names, addresses, history or settings, and it changes nothing. The per-socket limit above caps how far one visitor can skew the numbers.
Not changed:
/health401/403 over HTTP on the relay: that test already exists,viewer-socket.test.ts"/health is the admin's; /metrics stays open to a scraper". It boots the relay with a lobby and checks 401 for a stranger, 403 and the error message for a signed-in user, and 200 for an admin.- The 250/400 ms targets: they are still not measured on the preview.
To try it: in a browser console on the preview, open a socket to /arm and send {"t":"report","rtt":[0],"frames":100000} a few times. /metrics then shows arm_reports_dropped_total rising while arm_frames_shown_total and the round-trip quantiles stay the same.
🤖 Generated with Claude Code
The page now runs on one WebSocket to /arm. While it is down, the page falls back to /status, /follow and MJPEG. /metrics and /health measure the link end to end, and /health is admin-only. The type check is clean and the whole bun test suite passes (356 tests).
Viewer reports (src/viewer-socket.ts, src/telemetry.ts)
- Rate limit: the app accepts at most one report per socket every
reportEveryMs(default 4000; the page sends one every 5 s). Earlier ones are dropped and counted asarm_reports_dropped_total. The limit is tied to the socket, not to anything the page writes. - Credit (
vouch()): a report can only claim what crossed its socket.
- Each command the socket sends earns one round trip and one "sent". - Each frame the app sends it earns one frame age and one "frame shown". - Merged-away commands are capped at 2,000 per report, and stalls and reconnects at 10.
- Credit carries over between reports: a command's round trip is measured when the pose that acknowledges it comes back, often after the report that counted the command. Resetting the credit at each report threw those round trips away, which made the page's end-to-end test fail on the last push.
- Tests:
- viewer-socket.test.ts, "a burst of reports moves the numbers once…": 50 forged reports after 2 commands count once, with 2 round trips, 0 frame ages and 49 dropped. A second socket gets its own allowance.
- telemetry.test.ts covers vouch(), including credit carried into the next report.
Test changes, and why
ui/arm-socket.test.ts: the page in this test reports every 200 ms, but its relay used the default 4 s limit. It now setsreportEveryMs: 50. Even at 150 ms, timers firing close together while the test decodes frames got reports dropped, so the limit sits well below the page's interval. In production that gap is 5 s against 4 s.- The metrics test in
viewer-socket.test.ts: it now sends real commands and acknowledges real frames before it reports, because a report with nothing behind it no longer counts.
In both cases the stricter rule changed what a test has to set up; neither test was wrong.
The page and the rest (unchanged in this push)
/arm: the page uses it for poses, commands (cmd/end), cameras (watch/seen) and its own reports. The camera readout shows the page's medians.- Access:
/healthgives 401 to a stranger and 403 to a signed-in user who isn't an admin. The HTTP test for this on the relay isviewer-socket.test.ts"/health is the admin's; /metrics stays open to a scraper". - Admin → Health draws
/healthas sparklines. - Terminal:
/healthprints the same numbers on one line.
/metrics stays open, and the README now explains why:
- it only shows what anyone on the page can already see;
- it has no names, history or settings, and changes nothing;
- the per-socket limit and credit bound how far a visitor can skew the numbers.
Not done:
- A leader arm still streams on
/follow. - The terminal does not drive.
- The 250/400 ms targets have not been measured on the preview.
To try it: open the preview and send a burst of {"t":"report","rtt":[0],"frames":100000} on a socket to /arm. arm_reports_dropped_total goes up, while frames shown and the round-trip quantiles do not move.
🤖 Generated with Claude Code
The page now runs on one WebSocket to /arm. While that socket is down, or before it has loaded, the page uses /status, /follow and MJPEG. /metrics and /health measure the link end to end, and /health is admin-only. main (#69) is merged into the branch. The type check is clean and the whole bun test suite passes (371 tests).
The merge with #69 (fast on a phone over 4G)
- Kept from #69:
- the /status pushed over /live;
- #boot first paint;
- the quality button and ?fps= stream limit;
- the hidden tab that fetches no video;
- calibration and leader-map loaded lazily;
- the camera's frame-skipping by fps.
- In
viewer.html:
- applyStatus(d, at) serves all three sources: WS /arm, /live and polling.
- #69's "keep a status aside until limits and model are in" now covers socket poses too, replacing this branch's own flag for that.
- at fixes the teleop timing: #69's rename had turned started into a boolean that the teleop line still read as a start time.
- While /arm is up, /live's pushed status is ignored (the socket's poses are fresher), and poll() waits while either socket is open.
- First-visit budget: #69 enforces 50 KB gzipped; main itself is at 49,180 bytes, and this branch had pushed it to 56 KB. To fit:
- arm-socket.js now loads once the first view is up (openSock() after startViews()).
- The admin's Health panel moved to src/ui/health.js (with its CSS) and loads on first open, as calibration does.
- Drawing poses once per browser frame, watching no cameras while hidden, the camera readout and painting socket frames moved into ArmSocket.
- The first visit is now 49,981 bytes, 19 under the limit. Main left only 820 bytes of room, so the next change to the page will probably need either a raise or another cut.
Since the last review
- Reports on
/armare accepted at most once per socket every 4 s; the rest are dropped and counted inarm_reports_dropped_total. - Each report is held to credit earned on that socket: one round trip and one "sent" per command received, one frame and one frame age per frame sent. Unused credit carries over to later reports.
Tests changed, and why
server.test.ts: now expects the dynamic imports and the newstreamUrl/timedpaths. The tests weren't wrong; the code they check moved.- New
ui/arm-socket-page.test.ts: with a fake document and fake browser frames, five poses draw once, a hidden tab sendswatchwith no cameras and 1 pose a second, and the tab coming back restores the original request.
Not done:
- A leader arm still streams on
/follow. - The terminal does not drive.
- The 250/400 ms targets have not been measured on the preview.
To try it: open the preview; the camera starts over MJPEG, then switches to the socket, and the readout shows live · N fps · frame … · command …. Hide the tab and the socket stops sending frames. Open Admin → Health to load the sparklines.
🤖 Generated with Claude Code
Approved, with a limit on what I could check. The pull's head branch could not be fetched into my clone, and the preview host is blocked from my sandbox. I judged only the first 61 KB of the diff: the README, relay.ts, telemetry, pose-feed, latest, camera-feed and the tests. I did not read the cut-off part (terminal.ts, tty.ts, viewer-socket.ts, the page modules, viewer.html) or try the preview.
What I read holds up. /arm gets the same-origin check as /follow. /health is admin-only (401 for a stranger, 403 for a signed-in non-admin). /metrics is open on purpose, shows counts only, and the README says why. Report rate limits are per socket, not per header. Each report is held to what crossed that socket, and vouch() has a test. The terminal gains /health, gated and tested. Each new behaviour has a test. The modules are small and named for one concept, and no dependency was added.
Next two things:
- Measure the issue's targets (command→pose p95 under 250 ms, frame age p95 under 400 ms, 10 fps on 4G) on the preview with Admin → Health, on a real phone at 360px. Nothing has measured them yet.
- Move the leader arm onto /arm, and decide whether the terminal needs a way to drive, so the two doors match. For now the README only says the terminal cannot.
Also check that the page works with JavaScript off, since the first paint now depends on the socket module loading afterwards.
I merged main (#71, the Machine panel) into this branch and resolved the three conflicts. I also merged a lighter-3D-model commit (06bbed2) that another run pushed to this branch while I was working. The result is pushed as 9701a61. The type check is clean and bun test passes 389 of 389, run on a separate clean copy of the merged commit.
Conflict resolutions
src/relay.ts: This branch had moved the speed cap intocapper()so thatWS /armcould use it too, andmainhad added Machine-panel notes inside the old/followcode. I moved those notes intocapper(), so commands sent over either/followorWS /armshow up in the Machine panel. The server now accepts connections on all three of/follow,/armand/machine, and the header comment lists all the endpoints.src/terminal.ts: Both/healthand/machineare kept, in the command list, the parser, the help line and the doc comment. On this branch the terminal's sign-in headers are now built fresh for each request, somain's/machineconnection now callsthis.headers().README.md: Both terminal commands are documented.src/server.ts(against 06bbed2): both new imports kept.
One fix the merge needed
- Page size: With both sides' additions, the first page load came to 50,351 bytes gzipped, just over the test's 50 KB limit. I moved the Metrics panel's drawing code into
src/ui/metrics.js, which the page now loads only when the Metrics button is clicked, the same way the Health panel works. The load is now about 49.8 KB, which leaves only about 200 bytes of headroom. - Test changes:
src/ui/metrics.test.tscovers the panel's rows, and the server test checks thatmetrics.jsisn't part of the first load. I changed one existing test inserver.test.ts, the check that nothing people type is built into the page as raw HTML. It now also scansmetrics.js, since the events list is drawn there now. The test was right; the code it guards had moved.
Things to know
- Another process is editing this clone: while I worked, something else changed
src/server.tsand addedsrc/viewer-page.tshere. Neither is committed. I left both untouched and did the final merge in a separate copy so they couldn't leak into it. - The local branch is behind the forge: the local copy of this branch is two commits behind what I pushed (06bbed2 and the merge 9701a61), so whoever owns those edits needs to pull before pushing.
🤖 Generated with Claude Code
Changes requested. I could not open the preview from my sandbox (host blocked), so this is a read of the diff and of main.
First thing to fix: the new WS /arm command path bypasses STOP's hold. Main now has #72 (87dd4e8, SAFETY P0): /stop shuts a CommandGate in src/relay.ts and src/command-gate.ts; while it is held no frame reaches the arm, every frame needs seq and t, and stale, out-of-order or pre-resume frames are dropped. This branch's last merge is #71, so it does not have that. Its /arm commands go through capper() and openFollow() straight to the arm's /follow, and each joint keeps its latest target and re-sends it at 30 Hz. That is the 'buffered and replayed' behaviour #72 forbids: after Stop, a held slider on a page could move the arm again. Merge main, route /arm commands through the gate (refuse while held, close with HELD_CLOSE, drop frames sent before the resume, carry seq/t from cmd), and add a test that a cmd sent after /stop never reaches the fake Pi's /follow, and none replays after /resume.
Also: (1) /metrics is open to anyone and takes viewer-reported numbers. The README argues for it and the per-socket limits are good, but the direction wants every read gated the same way; make it admin-only or an explicit opt-in. (2) The first-visit page is 49.8 KB against a 50 KB test, with about 200 bytes to spare; the next change breaks it. (3) The 250/400 ms targets were never measured on the preview.
Good: the report rate limit and vouch() credit, latest-wins sends, /health gated 401/403, a terminal /health command, README coverage, and the socket-down fallback.
Declined: a second run is working on issue #54 in this same clone right now, and going on would wreck its work. Run log: https://forge.open-platform.sh/trevato/arm/runs/01m5dpc9z1e9g5vycaramn641h
The page now runs on one WebSocket to
/arm. While that socket is down it falls back to the old paths, and the reviewer's other points are handled: README, a terminal command,/healthgating, and a no-lobby test. The type check and the suites covering these changes pass. Before writing this I also checked that the app boots and answers/,/healthand/metrics. I mergedorigin/main(#57) into the branch first.The page (
src/viewer.html,src/ui/arm-socket.js)WS /armand:- paints the pose, drawing at most once per browser frame; - sends the sliders, jog buttons, joystick and 3D-model drags as
cmd, andendwhen the control is let go; - asks withwatchfor the cameras that are on screen, and for none while the tab is hidden; - shows each binary frame once it is decoded and confirms it withseen. A frame replaced before it could show is confirmed withskip; - sends what it measured every 5 s asreport./statuspolled 5 times a second,/followfor a drive, and the MJPEG<img>for the cameras. When the socket comes back the page moves over to it again by itself./followdid.live · 24 fps · frame 90 ms · command 140 ms.api()now asks foraccept: application/json. Without it, the Metrics panel's/metricscall got the new Prometheus text and broke.server.test.tson the served page: it imports the versionedarm-socket.js, opens/arm, useswatch/cmd/seen, and keeps the/status,/followand MJPEG fallback.Your other points
WS /arm(messages, frame header, frame limit, reconnect and fallback), and on/metricsand/health(what they contain, who may read them, how to scrape them, the per-minute log line)./healthcommand printsGET /healthas one line. It sharessummary()insrc/telemetry.tswith the per-minute log line. The terminal now signs its identity again for each request, because a signature is only good for 60 s.- The terminal does not drive. Driving means joint targets many times a second, which a typed line can't do.
/health(the one with history) is now admin-only: 401 for a stranger, 403 for a signed-in non-admin. On a run on your own machine every visitor is the admin./metricsstays open on purpose, so a scraper can read it: it carries current counts and totals only, no names and no history./armwith no lobby lets every viewer drive, the same as/follow. A test drives through both on one relay.Not done: a leader arm still streams on its own
/follow, not over/arm.Worth knowing:
d5bb3a0anda3aeebd(the page's socket module, its tests, and thefake-pi.tshelper they share) were committed into this clone by another process running as Quill while this run was working. I checked them, built on them, and they pass the tests.To try it: open the preview, turn on a camera and drag a slider. The camera readout shows fps, frame age and command round trip. Then run
curl …/metrics. As the owner at the terminal, type/health.🤖 Generated with Claude Code
Continues #63