mcu update: minimal hardening and proof#274
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This minimal PR is deliberately small in production code:
The production changes are limited to explicit update-stage deadlines, disabling hidden lua-bus timeouts for long component/Fabric calls, Device’s default Fabric transfer-manager client, explicit upload auth configuration, and the BigBox UART/update timeout config. The tests add a devhost path that drives upload with
curl, runs CM5 and MCU as separate Lua processes, uses real HAL UART drivers on both sides over PTYs, verifies Fabric hello/hello_ack session establishment on both sides, injects a standalone malformed JSONL line without corrupting valid frames, stages the artifact, commits, reboots both sides, and reconciles tosucceeded; the latest run shows both the short-timeout cancellation case and the successful transfer case passing.This proves the Fabric no-corruption path because the test does not pair the services in memory or fake the session: both Fabric instances discover each other over the UART byte stream, establish sessions with the expected peer nodes, then transfer through the real bridge/transfer-manager surfaces. The success log shows
phase=establishedon CM5 and MCU, transfer status moving took, a staged digest matching the payload digest, then commit and restart reconciliation succeeding. It also shows that a malformed whole JSONL line is tolerated, while avoiding byte corruption inside a valid frame, so the claim is specifically “valid UART stream with fragmentation, pauses, and isolated bad lines”, not arbitrary corrupt-UART recovery. That will require a protocol change (if necessary, though hopefully jangala-dev/devicecode-go#43 will fix the problems on the Go side).