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

Migrated from github.com/Trevato/SO-ARM100

Data view: a session's joint traces (intent against actual) #524

Parked opened this
Closed without merging

This adds the arm-side half of #521: each drive session now keeps a trace of every joint and stores it with the session. There is no session dialog yet, because `/admin/data` and `facts.sqlite` don't exist on main. I stored the traces in `precision.sqlite` with the session row and wrote the chart as a pure module, so the dialog can use it when it lands.

stopped parked by the crew deploy bfff47a

opened this

This adds the arm-side half of #521: each drive session now keeps a trace of every joint and stores it with the session. There is no session dialog yet, because /admin/data and facts.sqlite don't exist on main. I stored the traces in precision.sqlite with the session row and wrote the chart as a pure module, so the dialog can use it when it lands.

I ran the new tests, the precision tests and the server and admin tests, and they pass, except one src/server.test.ts model-route test that already fails on main. I didn't get a type check: bun x tsc couldn't find the bun type definitions in this sandbox. design-lint wasn't run, since nothing in src/web/ changed.

  • Recording: Tracker (src/precision.ts) records, per joint, the driver's target and the arm's read-back at most every 200 ms (5 Hz), capped at 3000 points per joint. trace() also returns the release and snap-back marks (cause and joint), on the same millisecond axis from session start.
  • Storage: PrecisionHistory writes the trace into a new sessions.trace column. An existing database gets the column added on open. Only the newest 50 sessions keep their trace; older rows keep the summary card alone. Session rows from GET /precision now carry an id.
  • Serving: GET /precision/trace?id=N returns the traces and marks. It answers 400 for a bad id and 404 once the trace is gone.
  • Chart: src/trace-chart.ts has readTrace, which validates the network answer field by field, and traceSvg(trace, jointId). The SVG draws the target dashed against the read-back solid, with this joint's marks and the session-wide ones as vertical lines on the same axis. Output is escaped and has no script.

To look at: whether you want facts.sqlite introduced separately, since the traces are in precision.sqlite for now. Wiring traceSvg into the dialog is the remaining work, once the Data view exists.

🤖 Generated with Claude Code

Closes #521

commented

This adds the arm-side half of #521: each drive session now keeps a trace of every joint and stores it with the session. There is no session dialog yet, because /admin/data and facts.sqlite don't exist on main. I stored the traces in precision.sqlite with the session row and wrote the chart as a pure module, so the dialog can use it when it lands.

I ran the new tests, the precision tests and the server and admin tests, and they pass, except one src/server.test.ts model-route test that already fails on main. I didn't get a type check: bun x tsc couldn't find the bun type definitions in this sandbox. design-lint wasn't run, since nothing in src/web/ changed.

  • Recording: Tracker (src/precision.ts) records, per joint, the driver's target and the arm's read-back at most every 200 ms (5 Hz), capped at 3000 points per joint. trace() also returns the release and snap-back marks (cause and joint), on the same millisecond axis from session start.
  • Storage: PrecisionHistory writes the trace into a new sessions.trace column. An existing database gets the column added on open. Only the newest 50 sessions keep their trace; older rows keep the summary card alone. Session rows from GET /precision now carry an id.
  • Serving: GET /precision/trace?id=N returns the traces and marks. It answers 400 for a bad id and 404 once the trace is gone.
  • Chart: src/trace-chart.ts has readTrace, which validates the network answer field by field, and traceSvg(trace, jointId). The SVG draws the target dashed against the read-back solid, with this joint's marks and the session-wide ones as vertical lines on the same axis. Output is escaped and has no script.

To look at: whether you want facts.sqlite introduced separately, since the traces are in precision.sqlite for now. Wiring traceSvg into the dialog is the remaining work, once the Data view exists.

🤖 Generated with Claude Code

commented

Parked by the crew: the preview's deploy failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs