From 6e04524ab0ad5f24a2c2b74afb0f7188b72a581a Mon Sep 17 00:00:00 2001 From: Matt <47545907+SoundMatt@users.noreply.github.com> Date: Wed, 29 Jul 2026 08:29:57 -0700 Subject: [PATCH] fix: CI trustworthiness + cpp-FuSa/RELAY version currency Bundles the audit findings that all touch the same two CI workflow files (and the docs/version-strings kept in sync with what CI actually pins/checks) -- splitting them into separate PRs would have meant repeatedly conflicting edits to the same job definitions. cpp-FuSa (re-checked against `gh release list` at time of writing -- v0.17.1 is current latest): - Bump the pinned cpp-FuSa ref from v0.15.0 to v0.17.1 in both the fusa-asil-b and sarif jobs (closes #21). Verified the newer tool version's real behavior against this repo rather than just bumping blindly: - `cpfusa init ... --force` was running before the traceability step and silently wiping the real, checked-in `.fusa-reqs.json` (hundreds of REQ-* entries) with an empty scaffold, so live traceability coverage was always computed against zero requirements. Dropped `--force` (unneeded in CI -- the files are already checked in) and the now-unnecessary `|| true` (closes #19). - The ISO 26262 / IEC 61508 gap-analysis steps were wrapped in `|| true`, and separately ran too early in the job (before boundary/tara/fmea/safety-case/sas/sci had produced anything), so most of their own evidence was invisible to them. Reordered those steps to run last, added the missing `cpfusa release` step (sbom.json/provenance.json/artifact-manifest.json were already listed in the evidence-upload step but never actually generated by any step), and added a real CHANGELOG.md (closes #23 for real, not just by deleting the dead link -- and happens to also satisfy the ISO 26262 "change management" objective). With the full evidence set in place and in the right order, gaps drop from 16/20 to 11/20 (ISO 26262 ASIL-B) and to 10/18 (IEC 61508 SIL-2). - `cpfusa iso26262`/`iec61508` exit 1 whenever any objective is "gap" -- that's real tool behavior, not a bug, so blanket `|| true` was hiding genuine regressions along with a genuine cpfusa v0.17.1 limitation: 11 of the 20 ASIL-B objectives (and 10 of 18 SIL-2 objectives) have no evidence-detection logic at all in this tool version and report "gap" unconditionally regardless of real project evidence (filed upstream as SoundMatt/cpp-FuSa#57). Replaced `|| true` with an explicit gate that fails only if the gap count regresses past that documented, verified floor (closes #20). - Did NOT add `cpfusa verify` to the job: its ctest-output regex breaks on any multi-word test name (this repo's own convention) and silently drops 170 of 171 real passing tests from `.fusa-evidence.json`, which would be actively misleading safety evidence rather than merely incomplete (filed upstream as SoundMatt/cpp-FuSa#58). The `6-7.1`/`6-7.2`/`3-7.4`/`3-7.5` objectives that depend on it remain honest gaps for now. RELAY (re-checked against `git tag` in SoundMatt/RELAY at time of writing): - `README.md`/`requirements/requirements.json`/`.fusa-reqs.json` claimed spec v1.11; CI floated `@latest`. v2.0.0 is RELAY's current tagged release, but its go.mod doesn't declare the `/v2` module path suffix Go's semantic import versioning requires for a v2+ major version, so `go install .../relay@v2.0.0` fails outright (filed upstream as SoundMatt/RELAY#68) -- confirmed locally before picking a target. v1.14.0 is therefore the actual current installable latest. Pinned CI to `@v1.14.0` and bumped every `kSpecVersion`/`spec_version` string and doc citation to match (verified `relay conform --strict` / `relay interop --protocol LIN` both still PASS against v1.14.0 -- none of v1.12-v1.14 touch anything cpp-LIN implements) (closes #22). Docs: - ROADMAP.md's v0.1.0 checklist still said the master schedule runner used `std::stop_token`; the shipped API has used `std::atomic&` since commit fc1c046 (C++17 compat). Corrected (closes #24). - release.yml's macOS binary build has failed on every tagged release (v0.1.0-v0.4.0): its Configure step had no explicit generator (defaulting to Xcode's multi-config generator on macOS, which doesn't match a bare `ctest` invocation with no --config), and separately its Build step only built the `cpp-lin-cli` target, never `cpplin_tests` at all, on any OS. Added `-G Ninja` (matching ci.yml's own working pattern) and build all targets; fixed the now-config-subdirectory-free Windows artifact path; set `fail-fast: false` on the release matrix so one OS failing doesn't cancel the other two before they get a chance to run (closes #13). Closes #13, #19, #20, #21, #22, #23, #24 Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com> --- .fusa-reqs.json | 6 +- .github/workflows/ci.yml | 103 ++++++++++++++---- .github/workflows/release.yml | 27 ++++- CHANGELOG.md | 96 ++++++++++++++++ HARA.md | 2 +- INCIDENT-RESPONSE.md | 2 +- README.md | 8 +- ROADMAP.md | 2 +- SAFETY_PLAN.md | 4 +- SECURITY.md | 2 +- cli/json.hpp | 6 +- include/lin/lin.hpp | 2 +- include/lin/relay.hpp | 4 +- requirements/requirements.json | 2 +- .../errors/lin-diagnostic-wrong-checksum.json | 2 +- .../relay-vectors/errors/lin-id-overflow.json | 2 +- testdata/relay-vectors/lin-frame.json | 2 +- 17 files changed, 223 insertions(+), 49 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.fusa-reqs.json b/.fusa-reqs.json index 533cf5a..0353fe2 100644 --- a/.fusa-reqs.json +++ b/.fusa-reqs.json @@ -852,7 +852,7 @@ { "id": "REQ-RELAY-001", "title": "Protocol enum values are defined and stable", - "description": "relay::Protocol shall define CAN=1, DDS=2, LIN=3, MQTT=4, RCP=5, SOMEIP=6 as stable integer values matching RELAY spec v1.11 §3.", + "description": "relay::Protocol shall define CAN=1, DDS=2, LIN=3, MQTT=4, RCP=5, SOMEIP=6 as stable integer values matching RELAY spec v1.14 §3.", "asil": "ASIL-B", "rationale": "Protocol values are wire-format identifiers; changing them breaks cross-language interop.", "tags": ["relay", "protocol"] @@ -1003,8 +1003,8 @@ }, { "id": "REQ-RELAY-020", - "title": "kSpecVersion constant equals '1.11'", - "description": "relay::kSpecVersion shall be a constexpr const char* equal to '1.11'.", + "title": "kSpecVersion constant equals '1.14'", + "description": "relay::kSpecVersion shall be a constexpr const char* equal to '1.14'.", "asil": "ASIL-B", "rationale": "RELAY §2: spec version constant enables runtime conformance checking.", "tags": ["relay", "version"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d15da1..6ae7de9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,7 +148,17 @@ jobs: go-version: 'stable' - name: Install relay tool - run: go install github.com/SoundMatt/RELAY/cmd/relay@latest + # Pinned, not @latest: an unpinned install means the spec version + # actually being conformance-checked against can silently change + # between CI runs with no diff to review (see cpp-LIN#22). v2.0.0 is + # RELAY's current tagged release but is not installable via + # `go install ...@v2.0.0` — its go.mod doesn't declare the + # `/v2` module path suffix Go's semantic import versioning requires + # for a v2+ major version, so the install fails outright (filed + # upstream as SoundMatt/RELAY#68). v1.14.0 is therefore the current + # actually-installable latest; keep this in sync with README.md and + # requirements/requirements.json's declared spec version. + run: go install github.com/SoundMatt/RELAY/cmd/relay@v1.14.0 - name: RELAY conformance gate run: relay conform --strict ./build/cli/cpp-lin-cli @@ -234,7 +244,7 @@ jobs: with: repository: SoundMatt/cpp-FuSa path: cpp-FuSa - ref: v0.15.0 + ref: v0.17.1 - name: Install tools run: sudo apt-get update -qq && sudo apt-get install -y cmake ninja-build zip @@ -249,7 +259,14 @@ jobs: - name: cpfusa init working-directory: cpp-LIN - run: ../cpp-FuSa/build/cpfusa init --name cpp-LIN --standard iso26262 --asil ASIL-B --project-version 0.4.0 --force || true + # No --force: .fusa.json/.fusa-reqs.json are checked into the repo + # and already populated (hundreds of real REQ-* entries). --force + # would silently overwrite them with an empty scaffold right before + # the traceability step reads them, making the traceability gate a + # permanent no-op (see cpp-LIN#19). Without --force, `init` just + # prints "already exists" and exits 0 when the files are present, so + # no `|| true` is needed either. + run: ../cpp-FuSa/build/cpfusa init --name cpp-LIN --standard iso26262 --asil ASIL-B --project-version 0.4.0 - name: cpfusa check working-directory: cpp-LIN @@ -273,23 +290,7 @@ jobs: - name: cpfusa hara init working-directory: cpp-LIN - run: ../cpp-FuSa/build/cpfusa hara init --project cpp-LIN --dir . || true - - - name: cpfusa iso26262 (ASIL-B) - working-directory: cpp-LIN - run: | - ../cpp-FuSa/build/cpfusa iso26262 \ - --asil ASIL-B \ - --output iso26262-gap-report.json \ - --dir . || true - - - name: cpfusa iec61508 (SIL-2) - working-directory: cpp-LIN - run: | - ../cpp-FuSa/build/cpfusa iec61508 \ - --sil SIL-2 \ - --output iec61508-gap-report.json \ - --dir . || true + run: ../cpp-FuSa/build/cpfusa hara init --project cpp-LIN --dir . - name: cpfusa boundary working-directory: cpp-LIN @@ -315,6 +316,66 @@ jobs: working-directory: cpp-LIN run: ../cpp-FuSa/build/cpfusa sci --dir . + - name: cpfusa release (SBOM + provenance + artifact manifest) + working-directory: cpp-LIN + # Was never called even though the evidence-upload step below has + # always listed sbom.json/provenance.json/artifact-manifest.json — + # they never actually existed at upload time. + run: ../cpp-FuSa/build/cpfusa release --dir . + + - name: cpfusa iso26262 (ASIL-B gap gate) + working-directory: cpp-LIN + # Run after every other evidence-generating step above so the gap + # analysis sees the real, complete evidence set (previously this ran + # right after `hara init`, before boundary/tara/fmea/safety-case/ + # sas/sci/release had produced anything, so it under-reported). + # + # `cpfusa iso26262` exits 1 whenever any objective is in the "gap" + # state, which is real behavior, not a bug: with the full evidence + # set in place, 11 of the 20 ASIL-B objectives still report "gap" + # (6-5.2, 6-6.1, 6-6.2, 6-6.3, 6-7.1, 6-7.2, 6-8.1, 6-9.1, 8-6.1, + # 8-6.2, 9-1.1) purely because cpfusa v0.17.1's own + # iso26262::detect_status() has no evidence-detection case at all for + # those clauses (it falls through to Status::Gap unconditionally, + # regardless of what's actually in the repo — e.g. 8-6.2 "Safety + # manual" reports gap even though SAFETY_MANUAL.md exists and is + # substantial). Filed upstream as SoundMatt/cpp-FuSa#57. Until that's + # fixed, blanket `|| true` here would hide real regressions just as + # much as it hides this known floor, so instead this gate fails only + # if the gap count regresses past that documented floor. + run: | + ../cpp-FuSa/build/cpfusa iso26262 \ + --asil ASIL-B \ + --output iso26262-gap-report.json \ + --dir . || true + GAPS=$(jq '.summary.gaps' iso26262-gap-report.json) + echo "ISO 26262 ASIL-B: $(jq -c '.summary' iso26262-gap-report.json)" + MAX_GAPS=11 + if [ "$GAPS" -gt "$MAX_GAPS" ]; then + echo "::error::ISO 26262 ASIL-B gap count ($GAPS) exceeds the known ${MAX_GAPS}-gap floor (see step comment / SoundMatt/cpp-FuSa#57) — this is a real regression, not the known tool limitation. Investigate before merging." + exit 1 + fi + + - name: cpfusa iec61508 (SIL-2 gap gate) + working-directory: cpp-LIN + # Same reasoning as the ISO 26262 step above: 10 of the 18 required + # SIL-2 objectives (1-7.1, 1-8.1, 1-8.2, 3-7.2, 3-7.4, 3-7.5, 3-7.6, + # 3-7.7, 3-7.8, 2-7.1) have no detect_status() case in cpfusa v0.17.1 + # and can never leave "gap" via this tool version regardless of real + # project evidence. Same upstream issue (SoundMatt/cpp-FuSa#57). + run: | + ../cpp-FuSa/build/cpfusa iec61508 \ + --sil SIL-2 \ + --output iec61508-gap-report.json \ + --dir . || true + GAPS=$(jq '.summary.gaps' iec61508-gap-report.json) + echo "IEC 61508 SIL-2: $(jq -c '.summary' iec61508-gap-report.json)" + MAX_GAPS=10 + if [ "$GAPS" -gt "$MAX_GAPS" ]; then + echo "::error::IEC 61508 SIL-2 gap count ($GAPS) exceeds the known ${MAX_GAPS}-gap floor (see step comment / SoundMatt/cpp-FuSa#57) — this is a real regression, not the known tool limitation. Investigate before merging." + exit 1 + fi + - name: cpfusa badge working-directory: cpp-LIN run: ../cpp-FuSa/build/cpfusa badge --dir . @@ -435,7 +496,7 @@ jobs: with: repository: SoundMatt/cpp-FuSa path: cpp-FuSa - ref: v0.15.0 + ref: v0.17.1 - name: Install tools run: sudo apt-get update -qq && sudo apt-get install -y cmake ninja-build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da8bb07..71504b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,11 @@ jobs: name: Build release binaries (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: + # So a failure on one OS doesn't cancel the other two in-flight + # matrix legs (GH's default fail-fast:true did exactly that every + # time the macOS leg failed — see cpp-LIN#13 — hiding whether + # ubuntu/windows would themselves have passed). + fail-fast: false matrix: include: - os: ubuntu-22.04 @@ -38,10 +43,20 @@ jobs: run: | cmake -B build \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=17 - - - name: Build CLI - run: cmake --build build --parallel --target cpp-lin-cli --config Release + -DCMAKE_CXX_STANDARD=17 \ + -G Ninja + + - name: Build + # Build everything (lib + CLI + tests), matching ci.yml's + # build-and-test job. The previous `--target cpp-lin-cli` here built + # only the CLI binary and never the cpplin_tests target at all, so + # the "Run tests" step below always hit ctest's `_NOT_BUILT` + # sentinel — on every OS, not just macOS. Combined with the missing + # `-G Ninja` (which left macOS on its multi-config Xcode default, + # a second independent reason `ctest` couldn't find a Debug/Release + # binary it recognized), this is why the macOS release job has + # failed on every tagged release (cpp-LIN#13). + run: cmake --build build --parallel - name: Run tests run: ctest --test-dir build --output-on-failure -j1 @@ -55,7 +70,9 @@ jobs: - name: Stage artifact (Windows) if: runner.os == 'Windows' shell: pwsh - run: Copy-Item build\cli\Release\cpp-lin-cli.exe ${{ matrix.artifact }}.exe + # -G Ninja is a single-config generator: no per-config (Release/) + # output subdirectory, unlike the Visual Studio default generator. + run: Copy-Item build\cli\cpp-lin-cli.exe ${{ matrix.artifact }}.exe - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7ded6f3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,96 @@ +# Changelog + +All notable changes to cpp-LIN are documented here. Format loosely follows +[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). + +## [Unreleased] + +## [0.4.0] — 2026-07-27 + +cpp-LIN v0.4.0 — RELAY ecosystem audit fixes. Fixes all 8 open issues filed by +the RELAY ecosystem audit (2026-07-27). See PR #12 for full details. + +### Fixed — spec conformance + +- `lin::Errc::invalid_frame` — a LIN-specific error category, distinct from + `ErrPayloadTooLarge`, for out-of-range LIN frame IDs (spec §5.3: + `ErrInvalidFrame` and `ErrPayloadTooLarge` are distinct; `ValidateFrame` + MUST NOT return `ErrPayloadTooLarge`). Applied to + `virtual::Bus::do_publish()`/`send_header()`, + `master::Node::set_schedule()`/`run()`, and `slave::Node::set_response()`. +- `convert` now writes the correct `ErrInvalidFrame` sentinel name to stderr + instead of the nonexistent `ErrInvalidInput` (spec §11.2). +- `capabilities` now reports an actual transport backend (`"virtual"`) + instead of the protocol name (`"LIN"`) in the `transports` array + (spec §12.2). +- `"tool"` field lowercased to `"cpp-lin"` to match the CLI-binary-name + convention used by peers (`go-can`, `cpp-rcp`) (spec §13.2). +- `version`/`status` now support `--format text|json`, exiting `2` on an + unrecognized format value or any other unrecognized argument (spec §11.1). +- `lin::mock` — the RELAY spec §13.7.1 canonical `mock` module, aliasing the + existing `lin::virt::Bus`. + +## [0.3.0] — 2026-06-19 + +RELAY v1.11 §17.7 — CLI waiver removed. RELAY v1.11 removes the waiver that +previously allowed CLI-less C++ library implementations to mark CLI +conformance requirements as "not applicable". Every conformant C++ +implementation must now ship the `version` / `capabilities` / `status` CLI, +buildable via `-DRELAY_BUILD_CLI=ON`. + +cpp-LIN has shipped the full CLI since v0.1.0 — no new code was required. +This release aligns the declared spec version and CMake interface with the +new spec text (`kSpecVersion "1.10"` → `"1.11"` in `relay.hpp`/`lin.hpp`, +`spec_version` in CLI JSON output, `RELAY_BUILD_CLI` CMake alias option, +RELAY test vectors updated to `spec_version: "1.11"`). + +## [0.2.0] — 2026-06-19 + +Full Safety & Cyber Pack. + +### Added + +- **Safety documentation** (ISO 26262 / IEC 61508 / DO-178C): `TARA.md` + + `tara.json` (7 threat scenarios, CVSS 3.1, 8 security controls, attack + tree, residual risk acceptance — ISO/SAE 21434:2021 + IEC 62443-4-1 SL-2); + `fmea.json` (14 failure mode entries linked to HARA hazards H-01..H-05, all + closed — ISO 26262-9); `sas.md` (9 modules, invariants, public interfaces, + data flow, memory safety strategy — ISO 26262-6 §7.4); `boundary.mermaid` + (ISO 26262-6 §7.4.1); `SAFETY_MANUAL.md` (safe API patterns, anti-patterns, + thread safety matrix, memory budget, shutdown sequencing — ISO 26262-6 §7 / + Part 10 §9 SEooC); `SECURITY.md` and `INCIDENT-RESPONSE.md` (coordinated + disclosure, ASIL impact assessment, ISN process). +- **Requirements traceability**: 19 IEC 62443 security controls in + `.fusa-iec62443.json` (expanded from a 5-line stub); 32 new + `REQ-RELAY-001..029,051,056,059` entries in `.fusa-reqs.json`, closing all + orphan `fusa:req` annotations. All 109 pre-existing FuSa requirements + retained; full traceability matrix intact. + +## [0.1.0] — 2026-06-19 + +First release of the C++ LIN bus library — a complete port of go-LIN +implementing the RELAY spec v1.10, qualified to ISO 26262 ASIL-B. + +### Added + +- Core LIN types: `Frame`, `Filter`, `ScheduleEntry`, `IBus`, `IMasterBus` — + full feature parity with go-LIN. +- Virtual bus (`lin::virt::Bus`): thread-safe, metrics, health provider, + subscriber drainer. +- E2E safety (`lin::safety`): CRC-16/CCITT-FALSE end-to-end data protection + with monotonic sequence counter. +- LDF parser (`lin::ldf`): parses LIN Description Files — frames, signals, + schedule tables. +- Master node (`lin::master::Node`): schedule-driven header transmission + with per-slot callbacks. +- Slave node (`lin::slave::Node`): response registry with frame + subscription. +- RELAY adapter (`lin::adapt()`): wraps any `IBus` as a `relay::INode`. +- CLI binary (`cpp-lin-cli`): RELAY `version`, `capabilities`, `status`, + `convert --protocol LIN`. + +[Unreleased]: https://github.com/SoundMatt/cpp-LIN/compare/v0.4.0...HEAD +[0.4.0]: https://github.com/SoundMatt/cpp-LIN/releases/tag/v0.4.0 +[0.3.0]: https://github.com/SoundMatt/cpp-LIN/releases/tag/v0.3.0 +[0.2.0]: https://github.com/SoundMatt/cpp-LIN/releases/tag/v0.2.0 +[0.1.0]: https://github.com/SoundMatt/cpp-LIN/releases/tag/v0.1.0 diff --git a/HARA.md b/HARA.md index 05ee1da..5b7053d 100644 --- a/HARA.md +++ b/HARA.md @@ -131,6 +131,6 @@ ASIL-D at system level if required. - ISO 26262:2018 Part 3 — Concept phase - LIN Specification Package Rev 2.2A — Section 2 (Frame structure) -- RELAY Specification v1.11 — §15 (Error handling) +- RELAY Specification v1.14 — §15 (Error handling) - `SEOOC.md` — Assumptions on use - `SAFETY_PLAN.md` — Development process diff --git a/INCIDENT-RESPONSE.md b/INCIDENT-RESPONSE.md index a0a6367..4c41ad9 100644 --- a/INCIDENT-RESPONSE.md +++ b/INCIDENT-RESPONSE.md @@ -125,6 +125,6 @@ For safety-critical (ASIL-B) vulnerabilities, the following additional steps app - **ISO/SAE 21434:2021** §7.4 — Vulnerability management and disclosure - **IEC 62443-4-1:2018** SM-2 — Security management (vulnerability response) - **IEC/TR 62443-2-3:2015** — Patch management for IACS -- **RELAY Spec v1.11** §22 — Security considerations +- **RELAY Spec v1.14** §22 — Security considerations - `SECURITY.md` — Public-facing vulnerability disclosure policy - `SEOOC.md` — Safety Element out of Context assumptions (integrator scope) diff --git a/README.md b/README.md index c02b0f9..336a191 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ C++ LIN bus library — RELAY-conformant, ISO 26262 ASIL-B. [![CI](https://github.com/SoundMatt/cpp-LIN/actions/workflows/ci.yml/badge.svg)](https://github.com/SoundMatt/cpp-LIN/actions/workflows/ci.yml) -[![RELAY Conformant](https://img.shields.io/badge/RELAY-v1.11%20conformant-blue)](https://github.com/SoundMatt/RELAY) +[![RELAY Conformant](https://img.shields.io/badge/RELAY-v1.14%20conformant-blue)](https://github.com/SoundMatt/RELAY) [![ASIL-B](https://img.shields.io/badge/ISO%2026262-ASIL--B-orange)](SAFETY_PLAN.md) [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](LICENSE) ## Overview cpp-LIN is a production-quality C++ implementation of the LIN (Local Interconnect -Network) protocol, following the RELAY specification v1.11. It is the C++ sibling +Network) protocol, following the RELAY specification v1.14. It is the C++ sibling of [go-LIN](https://github.com/SoundMatt/go-LIN) and is patterned after [cpp-CAN](https://github.com/SoundMatt/cpp-CAN). @@ -50,7 +50,7 @@ ctest --test-dir build --output-on-failure ``` include/lin/ channel.hpp — Chan: bounded, thread-safe FIFO - relay.hpp — RELAY v1.11 types (Protocol, Message, INode, …) + relay.hpp — RELAY v1.14 types (Protocol, Message, INode, …) lin.hpp — IBus, IMasterBus, Frame, Filter, free functions virtual/bus.hpp — In-process virtual LIN bus mock/mock.hpp — RELAY spec §13.7.1 canonical `mock` module (alias of virtual::Bus) @@ -97,7 +97,7 @@ P1 = NOT(ID1 ^ ID3 ^ ID4 ^ ID5) (bit 7) ## RELAY Integration -cpp-LIN exposes a RELAY v1.11 `INode` adapter: +cpp-LIN exposes a RELAY v1.14 `INode` adapter: ```cpp #include diff --git a/ROADMAP.md b/ROADMAP.md index d3c1507..323e0d7 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,7 +5,7 @@ - [x] Virtual bus with Classic and Enhanced checksum support - [x] Protected Identifier (PID) computation and verification - [x] LDF parser (nodes, signals, frames, schedule tables, signal decode) -- [x] Master node with schedule table runner (`std::stop_token`) +- [x] Master node with schedule table runner (`std::atomic&`) - [x] Slave node with per-ID response registration - [x] E2E safety: Protector and Receiver (CRC-16/CCITT-FALSE, 10-byte header) - [x] RELAY v1.10 adapter (`relay::INode`) diff --git a/SAFETY_PLAN.md b/SAFETY_PLAN.md index c5278b9..832aa50 100644 --- a/SAFETY_PLAN.md +++ b/SAFETY_PLAN.md @@ -13,7 +13,7 @@ This Safety Plan governs the development of **cpp-LIN**, a C++ software component implementing the LIN (Local Interconnect Network) bus protocol, -conformant to the RELAY specification v1.11. +conformant to the RELAY specification v1.14. cpp-LIN is classified as a **Safety Element out of Context (SEooC)** per ISO 26262-10 §9. It is intended for integration into automotive ECUs and @@ -131,7 +131,7 @@ See [HARA.md](HARA.md). - IEC 61508:2010 — Functional safety of E/E/PE safety-related systems - ISO/SAE 21434:2021 — Road vehicles — Cybersecurity engineering - LIN Specification Package, Revision 2.2A (LIN Consortium) -- RELAY Specification v1.11 (SoundMatt) +- RELAY Specification v1.14 (SoundMatt) - `.fusa-reqs.json` — Machine-readable requirements - `HARA.md` — Hazard Analysis and Risk Assessment - `SEOOC.md` — Safety Element out of Context document diff --git a/SECURITY.md b/SECURITY.md index 0dfd0d0..1711a3a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -67,4 +67,4 @@ escalation contacts. - ISO/SAE 21434:2021 §7.4 — Vulnerability management - IEC 62443-4-1:2018 SM-2 — Security management -- RELAY Spec v1.11 §22 — Security considerations +- RELAY Spec v1.14 §22 — Security considerations diff --git a/cli/json.hpp b/cli/json.hpp index 1d6dbd8..64c89c3 100644 --- a/cli/json.hpp +++ b/cli/json.hpp @@ -182,7 +182,7 @@ inline std::string version_json() { "\"protocol\":\"LIN\"," "\"protocol_int\":3," "\"version\":\"" + std::string(kToolVersion) + "\"," - "\"spec_version\":\"1.11\"," + "\"spec_version\":\"1.14\"," "\"language\":\"cpp\"," "\"runtime\":\"c++17\"" "}"; @@ -195,7 +195,7 @@ inline std::string version_text() { o << "tool: cpp-lin\n" << "protocol: LIN\n" << "version: " << kToolVersion << "\n" - << "spec: 1.11\n" + << "spec: 1.14\n" << "language: cpp\n" << "runtime: c++17\n"; return o.str(); @@ -209,7 +209,7 @@ inline std::string capabilities_json() { "\"protocol\":\"LIN\"," "\"protocol_int\":3," "\"version\":\"" + std::string(kToolVersion) + "\"," - "\"spec_version\":\"1.11\"," + "\"spec_version\":\"1.14\"," "\"commands\":[\"version\",\"capabilities\",\"status\",\"convert\"]," "\"transports\":[\"virtual\"]," "\"features\":[\"ldf\",\"e2e\",\"master\",\"slave\",\"virtual\",\"mock\"]," diff --git a/include/lin/lin.hpp b/include/lin/lin.hpp index ba38d71..6c52583 100644 --- a/include/lin/lin.hpp +++ b/include/lin/lin.hpp @@ -28,7 +28,7 @@ namespace lin { // ── Spec version ───────────────────────────────────────────────────────────── -inline constexpr const char* kSpecVersion = "1.11"; +inline constexpr const char* kSpecVersion = "1.14"; // ── Constants ───────────────────────────────────────────────────────────────── diff --git a/include/lin/relay.hpp b/include/lin/relay.hpp index 1b061d0..da4e25e 100644 --- a/include/lin/relay.hpp +++ b/include/lin/relay.hpp @@ -4,7 +4,7 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. // relay.hpp — RELAY spec types shared across all protocol implementations. -// Mirrors the RELAY Go package spec v1.11. +// Mirrors the RELAY Go package spec v1.14. #pragma once @@ -24,7 +24,7 @@ namespace relay { // ── Spec version ───────────────────────────────────────────────────────────── // fusa:req REQ-RELAY-020 -inline constexpr const char* kSpecVersion = "1.11"; +inline constexpr const char* kSpecVersion = "1.14"; // ── Protocol ───────────────────────────────────────────────────────────────── diff --git a/requirements/requirements.json b/requirements/requirements.json index 03121d6..17ce56f 100644 --- a/requirements/requirements.json +++ b/requirements/requirements.json @@ -5,7 +5,7 @@ "language": "cpp", "standard": "iso26262", "asil": "ASIL-B", - "spec": "RELAY v1.11" + "spec": "RELAY v1.14" }, "requirements": [ {"id": "REQ-LIN-001", "title": "ValidateFrame rejects ID > 0x3F", "asil": "ASIL-B", "tags": ["core", "validation"]}, diff --git a/testdata/relay-vectors/errors/lin-diagnostic-wrong-checksum.json b/testdata/relay-vectors/errors/lin-diagnostic-wrong-checksum.json index 5895c60..3210e58 100644 --- a/testdata/relay-vectors/errors/lin-diagnostic-wrong-checksum.json +++ b/testdata/relay-vectors/errors/lin-diagnostic-wrong-checksum.json @@ -7,7 +7,7 @@ "lin.checksum": "99", "lin.checksum_type": "1" }, - "spec_version": "1.11", + "spec_version": "1.14", "expected_error": "ErrInvalidFrame", "error_reason": "diagnostic frames (0x3C/0x3D) must use Classic checksum (type 0)" } diff --git a/testdata/relay-vectors/errors/lin-id-overflow.json b/testdata/relay-vectors/errors/lin-id-overflow.json index b5e6096..21f07f5 100644 --- a/testdata/relay-vectors/errors/lin-id-overflow.json +++ b/testdata/relay-vectors/errors/lin-id-overflow.json @@ -7,7 +7,7 @@ "lin.checksum": "0", "lin.checksum_type": "1" }, - "spec_version": "1.11", + "spec_version": "1.14", "expected_error": "ErrInvalidFrame", "error_reason": "LIN frame ID must be in range 0x00–0x3F (max 63); 64 overflows the 6-bit field" } diff --git a/testdata/relay-vectors/lin-frame.json b/testdata/relay-vectors/lin-frame.json index da4aefd..cd77b83 100644 --- a/testdata/relay-vectors/lin-frame.json +++ b/testdata/relay-vectors/lin-frame.json @@ -7,5 +7,5 @@ "lin.checksum": "73", "lin.checksum_type": "1" }, - "spec_version": "1.11" + "spec_version": "1.14" }