feat: surface runtime node faults on the node badge (I2C unACKed reads) - #94
Merged
Conversation
Adds a per-node runtime status channel (`Effects.node_diagnostics`), mirroring the ADR-0008/0009 pattern: a new `EffectsSink::report_diagnostic` hook, compile- forced in both hosts. Nodes raise/clear via `RuntimeContext::report_diagnostic`. First use: I2C reads that never ACK. The board streams an empty I2C_REPLY plus "I2C: Too few bytes received" when a device doesn't respond; the codec used to drop the empty reply (`len < 8`), hiding the fault. Now it parses zero-data replies (`len >= 7`) so the target node sees a short read, raises an error diagnostic (attributed by address, keeps its last good value), and clears on recovery — raised only on a transition so a per-poll NACK doesn't spam. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Consumes the new `node_diagnostics` effect on both hosts (browser reactor +
desktop `node-diagnostic` Tauri event) into a `useNodeDiagnosticsStore`, and
renders it through the existing `NodeContainer` error/warning badge — no new UI.
The I2C device node now shows a red error when its reads don't ACK ("No response
from 0x29: got 0 of 8 bytes. Check wiring…"), outranking the advisory shared-
address warning. The exhaustive `keyof Effects` guard in effects-sink forced the
new field to be handled; conformance test updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Surfaces runtime node faults on the node's UI badge — first user: I2C reads that never ACK (a NACKing sensor used to fail silently with the monitor stuck at 0).
The bug
When an I2C device doesn't respond, the board streams an empty
I2C_REPLY(F0 77 addr 00 regL regH F7) plus aSTRING_DATA"I2C: Too few bytes received". The codec dropped the empty reply (if len < 8), soon_i2c_replynever fired and the fault was invisible — the outbound arm was correct, the device just wasn't answering.Changes
firmata/mod.rs): parse zero-data replies (len >= 7) so the fault reaches the target node, routed by address+register.Effects.node_diagnostics→ compile-forcedEffectsSink::report_diagnostichook in both hosts (same ADR-0008/0009 pattern ascloud_requests). Nodes raise/clear viaRuntimeContext::report_diagnostic/clear_diagnostic.faultedtransition, so a per-poll NACK doesn't spam.NodeContainererror/warning badge (no new UI). The I2C node shows "No response from 0x29: got 0 of 8 bytes. Check wiring (SDA/SCL/power), the address, and pull-ups.", outranking the advisory shared-address warning. Identical on desktop (Taurinode-diagnostic) and in-browser (reactor).Verification
short_i2c_reply_raises_then_clears_node_diagnostic).-D warnings -W clippy::pedantic); wasm runtime compiles.tscclean; browser effects-sink conformance test updated (the exhaustivekeyof Effectsguard forced the new field to be handled) + passing.Note: browser needs a wasm rebuild to pick up the new
Effectsfield; desktop shows the badge on recompile.🤖 Generated with Claude Code