Skip to content

fix: v0.4.1 — RELAY ecosystem audit fixes, pass 2 - #49

Merged
SoundMatt merged 1 commit into
mainfrom
fix/xnet-audit-20260730
Jul 30, 2026
Merged

fix: v0.4.1 — RELAY ecosystem audit fixes, pass 2#49
SoundMatt merged 1 commit into
mainfrom
fix/xnet-audit-20260730

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Second round of fixes from the SoundMatt x-Net ecosystem audit against cpp-LIN. Applies 15 of the 15 diffs marked "ready" in the audit register (cpp-LIN-N2-01, cpp-LIN-01/02/03/05/06/07/11/12/13/14/15/16/17/18), reviewed and cross-checked individually against the underlying findings before applying. Bumps to v0.4.1.

  • Add verify_checksum() to actually validate a received checksum against the locally-computed value (ISO 17987 frame reception). HARA SG-03 downgraded from "Implemented" to "Partial" — no real (non-virtual) bus backend calls the new function yet, and no dedicated unit test was included in the source diff, so the safety claim is intentionally left honest rather than "closed."
  • Replace the generic ErrTimeout returned by send_header on no slave response with a distinct lin::Errc::no_response sentinel that still compares equivalent to a timeout for existing callers. (The pre-existing dead lin::ErrNoResponse exception class and its false-coverage test are untouched — that cleanup is bundled with the still-open advisory cpp-LIN-08 test-gap item, out of scope here.)
  • from_message now rejects an unrecognized lin.checksum_type instead of silently defaulting to Classic.
  • Bump declared RELAY spec version 1.11 → 2.0 across headers, CLI JSON, README, HARA, and requirements (RELAY v2.0's breaking change is scoped to RCP and does not alter LIN's canonical types). Also fixed a stale v1.11 reference in HARA.md:134 that neither source diff touched.
  • Fix testdata/relay-vectors/lin-frame.json to encode checksum_type as "enhanced" instead of the bare numeral "1" — independently re-derived: vector checksum 73 matches the Enhanced algorithm for id=16, payload {0xAA,0xBB}, not Classic (153).
  • master::Node::set_schedule now accepts an empty schedule (spec §8.3), matching the virtual bus.
  • DropOldest back-pressure now counts an eviction as a drop instead of a delivery.
  • Frame::checksum_type now defaults to Classic (the enum zero value), matching the other language bindings.
  • capabilities no longer lists "virtual" in both features and transports.
  • E2E Receiver::unwrap no longer advances its sequence counter on a rejected frame, so a persistent shifted stream keeps being flagged instead of silently resyncing after one error.
  • Define the previously-dangling REQ-CLI-001..006 / REQ-SEC-013 requirements referenced by existing fusa:req tags; correct three requirement rationales that cited the wrong Safety Goal; fix HARA's error-handling citation (§15 → §5).
  • Add CHANGELOG.md.

Not included (advisory only, no diff provided — still open)

  • cpp-LIN-04: relay.hpp depends backwards on lin::Chan — needs an invasive namespace refactor (move Chan<T> into namespace relay); design decision, not attempted.
  • cpp-LIN-08: Tests hardcode inline JSON instead of loading testdata/relay-vectors/, and mirror the (now-fixed) ErrNoResponse bug instead of asserting the real sentinel — multi-concern test-suite rework, not attempted.
  • cpp-LIN-09: .fusa-reqs.json (145 reqs after this PR) vs requirements/requirements.json (100 reqs) disagree on population — canonical-file governance decision needed.
  • cpp-LIN-10: Structural frame-ID errors mapped to ErrPayloadTooLarge — contested sentinel mapping, needs a documented adapter policy decision.

Test plan

  • cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug configures cleanly
  • cmake --build build builds cleanly, no new warnings
  • ctest --test-dir build --output-on-failure — 171/171 pass (reproduced locally, not just trusting the audit register's self-report)
  • Spot-checked cpp-lin-cli version / capabilities output at runtime — reports 0.4.1 / spec_version: 2.0 / de-duplicated features

Second round of fixes from the SoundMatt x-Net ecosystem audit
(cpp-LIN-N2-01, cpp-LIN-01/02/03/05/06/07/11/12/13/14/15/16/17/18):

- Add verify_checksum() to actually validate a received checksum against
  the locally-computed value (ISO 17987 frame reception); HARA SG-03
  downgraded from "Implemented" to "Partial" since no real (non-virtual)
  bus backend calls it yet.
- Replace the generic ErrTimeout returned by send_header on no slave
  response with a distinct lin::Errc::no_response sentinel that still
  compares equivalent to a timeout for existing callers.
- from_message now rejects an unrecognized lin.checksum_type instead of
  silently defaulting to Classic.
- Bump declared RELAY spec version 1.11 -> 2.0 across headers, CLI JSON,
  README, HARA, and requirements (RELAY v2.0's breaking change is scoped
  to RCP and does not alter LIN's canonical types).
- Fix testdata/relay-vectors/lin-frame.json to encode checksum_type as
  "enhanced" instead of the bare numeral "1" (independently verified: the
  vector's checksum 73 matches the Enhanced algorithm for id=16,
  payload={0xAA,0xBB}, not Classic).
- master::Node::set_schedule now accepts an empty schedule (spec Sec 8.3),
  matching the virtual bus.
- DropOldest back-pressure now counts an eviction as a drop instead of a
  delivery.
- Frame::checksum_type now defaults to Classic (the enum zero value),
  matching the other language bindings' canonical default.
- capabilities no longer lists "virtual" in both features and transports.
- E2E Receiver::unwrap no longer advances its sequence counter on a
  rejected frame, so a persistent shifted stream keeps being flagged
  instead of silently resyncing after one error.
- Define the previously-dangling REQ-CLI-001..006 / REQ-SEC-013
  requirements referenced by existing fusa:req tags; correct three
  requirement rationales that cited the wrong Safety Goal; fix HARA's
  error-handling citation (Sec 15 -> Sec 5) and stale spec version.
- Add CHANGELOG.md.

Reproduced locally: cmake configure + build clean, ctest 171/171 pass.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 65d3618 into main Jul 30, 2026
15 checks passed
@SoundMatt
SoundMatt deleted the fix/xnet-audit-20260730 branch July 30, 2026 21:14
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