mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-12-05 04:57:32 +01:00
A completed self-test's per-step lines only reached the volatile app-log ring buffer, so by the time a rider sent a diagnostic bundle they were gone and the per-gear plateau numbers could not be reviewed. SelfTestResult now carries an optional stepLog (capped to the last 200 lines on serialize, backward-compatible on read for results stored before it existed). SelfTestEngine funnels every diagnostic line through a new _record() that both accumulates into the step log and mirrors to the harness, then hands a copy to the result in _buildResult (the trailing verdict line is recorded afterwards, so it stays out of the persisted log). describeProxyDevice prints the captured log as its own indented 'Self-test log:' block under the proxy entry, keeping the inline selfTest= summary field. Test-driven (RED to GREEN): added round-trip, backward-compat and 200-entry-cap tests to self_test_result_test; capture and harness-prefix tests to self_test_engine_test; and log-block present/absent tests to trainer_transport_labels_test. All were watched failing before the implementation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>