Skip to content

Add bus-fault reporting envelopes to cannet.v1 (ADR 0060 phase 3) - #545

Merged
thebhef merged 1 commit into
mainfrom
task163-proto
Oct 15, 2026
Merged

thebhef merged 1 commit into
mainfrom
task163-proto

Conversation

@thebhef

@thebhef thebhef commented Oct 6, 2026

Copy link
Copy Markdown
Owner

ADR 0060 names five wire additions to carry a bus fault as an episode
the sidecar reports, not a stream of error-frame rows. This phase adds
them to cannet.proto as additive cannet.v1 changes (ADR 0059), picking
up tags 14-16 on Envelope.body and new fields on two existing messages:

  • BusErrorEpisode (tag 14): one episode per interface, with
    ErrorKindCounts (ack/bit/form/stuff/crc/other/unknown), tx/rx split,
    TEC/REC and an open flag, per rule 1.
  • TxRefusals (tag 15): a refused-transmit summary with a
    TxRefusalReason enum and a flush count/time, per rules 4 and 7.
  • FramesDropped (tag 16): the data-lane eviction report, per rule 3.
  • InterfaceState.as_of_ns (tag 6): the heartbeat timestamp, per rule 5.
  • ConfigureBus.error_row_cap (tag 5, optional uint32): the per-interface
    error-row cap, per rule 2. Landed on ConfigureBus rather than
    Subscribe because ConfigureBus is already the client->server message
    carrying per-interface session configuration (speed, FD) that a
    client resends on change, for both virtual-bus and physical
    interfaces; Subscribe carries nothing but an interface id.

buf breaking against v0.10.0 passes clean. The python gencode is
regenerated via scripts/regen-proto-gencode.sh, with one round-trip
test per new message added to libs/cannet-python-wire in its existing
style. cannet-wire gets matching Rust round-trip tests plus a crate-doc
update listing the new variants.

cannet-client's and cannet-server's exhaustive matches over
Envelope::Body needed a new arm each to stay exhaustive: the BLF-replay
and virtual-bus servers (cannet-server) fold the three new
server-only-direction variants into their existing "flows the other
way" ignore group, and cannet-client's receive loop gets a dedicated
log-only arm (decoding them into per-interface state is a later
phase). The two existing ConfigureBus construction sites in
cannet-client pass error_row_cap: None (no behaviour change; nothing
sets a cap yet).

No behaviour change beyond compiling against the new types.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

This was referenced Oct 6, 2026

thebhef commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • Oct 14, 9:10 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 14, 11:59 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 15, 12:02 AM UTC: @thebhef merged this pull request with Graphite.

@thebhef
thebhef changed the base branch from task163-fault-model-adr to graphite-base/545 October 14, 2026 23:53
@thebhef
thebhef changed the base branch from graphite-base/545 to main October 14, 2026 23:57
ADR 0060 names five wire additions to carry a bus fault as an episode
the sidecar reports, not a stream of error-frame rows. This phase adds
them to cannet.proto as additive cannet.v1 changes (ADR 0059), picking
up tags 14-16 on Envelope.body and new fields on two existing messages:

- BusErrorEpisode (tag 14): one episode per interface, with
  ErrorKindCounts (ack/bit/form/stuff/crc/other/unknown), tx/rx split,
  TEC/REC and an open flag, per rule 1.
- TxRefusals (tag 15): a refused-transmit summary with a
  TxRefusalReason enum and a flush count/time, per rules 4 and 7.
- FramesDropped (tag 16): the data-lane eviction report, per rule 3.
- InterfaceState.as_of_ns (tag 6): the heartbeat timestamp, per rule 5.
- ConfigureBus.error_row_cap (tag 5, optional uint32): the per-interface
  error-row cap, per rule 2. Landed on ConfigureBus rather than
  Subscribe because ConfigureBus is already the client->server message
  carrying per-interface session configuration (speed, FD) that a
  client resends on change, for both virtual-bus and physical
  interfaces; Subscribe carries nothing but an interface id.

`buf breaking` against v0.10.0 passes clean. The python gencode is
regenerated via scripts/regen-proto-gencode.sh, with one round-trip
test per new message added to libs/cannet-python-wire in its existing
style. cannet-wire gets matching Rust round-trip tests plus a crate-doc
update listing the new variants.

cannet-client's and cannet-server's exhaustive matches over
Envelope::Body needed a new arm each to stay exhaustive: the BLF-replay
and virtual-bus servers (cannet-server) fold the three new
server-only-direction variants into their existing "flows the other
way" ignore group, and cannet-client's receive loop gets a dedicated
log-only arm (decoding them into per-interface state is a later
phase). The two existing ConfigureBus construction sites in
cannet-client pass error_row_cap: None (no behaviour change; nothing
sets a cap yet).

No behaviour change beyond compiling against the new types.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@thebhef
thebhef merged commit 2d74174 into main Oct 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant