Skip to content

fix: bump rsfusa to v0.3.14 and make the safety-analysis pipeline real - #23

Open
SoundMatt wants to merge 1 commit into
mainfrom
fix/rsfusa-v0314-safety-pipeline
Open

fix: bump rsfusa to v0.3.14 and make the safety-analysis pipeline real#23
SoundMatt wants to merge 1 commit into
mainfrom
fix/rsfusa-v0314-safety-pipeline

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

The rust-FuSa CLI (rsfusa) was pinned to stale v0.3.10 while the config schema, HARA schema, and content-quality rules it enforces moved on several releases. Every core safety command in CI was failing on a config parse error and being masked green by || true on every step. This PR bumps the pin to the current latest release (v0.3.14), fixes the repo's config/HARA/requirements content to satisfy the current schema, removes the masking now that the root cause is fixed, and adds real gating where the pipeline previously just logged warnings and exited 0.

  • Bump rsfusa pin to v0.3.14 in ci.yml and new release.yml (single, explicit, identical pin — no floating).
  • Fix .fusa.json to the current config schema (configVersion/project object/standard) — this was the actual root cause of every downstream parse failure.
  • Rewrite .fusa-hara.json to the current operationalSituations/hazards/safetyGoals schema. ASIL is now derived by the tool from S/E/C against the literal ISO 26262-3 Table 4 rather than hand-typed — several hazards' previously-claimed ASIL-B didn't actually match their own S/E/C under the real table (now correctly ASIL-A/QM as applicable; the ASIL-B hazards remain ASIL-B).
  • Add the 15 REQ-VIRT-013..019/REQ-MASTER-006..013 IDs that were tagged in code/tests but missing from .fusa-reqs.json and requirements.json.
  • Remove || true from every safety-job step now that the config parse failure is fixed — a real regression now fails CI instead of being silently swallowed.
  • Fix real check --strict findings the newer content-quality rules surface (rather than suppressing them): production-code .unwrap().expect("..."); test-code .unwrap().expect() with a rationale (rule LINT002's own remediation); reduce genuine nesting-depth hot spots (ANA002) by extracting helper functions; add #![forbid(unsafe_code)] (LINT006); annotate/fix truncating-cast sites (ANA005), including making LDF frame-ID parsing fail cleanly instead of silently truncating out-of-range IDs.
  • Add the missing rsfusa coupling step — required ISO 26262-6 §6.4.4 evidence the gap report expects but CI never generated.
  • Gate CI on rsfusa safety-case's missing-required-evidence warning and on rsfusa qualify's qualification badge; reorder the job so qualify/release run before safety-case/iso26262 (both check for qualify-report.json/sbom.json's presence).
  • Supply rsfusa qualify real qualification metadata (--qualification-method self --qualifier ... --record-uri ...) so the badge reflects the project's actual process instead of always reading unqualified regardless of pass rate.
  • Fix the coverage step's broken percentage extraction and turn the claimed "≥ 90%" comment into a real gate at the current ~85% baseline, to ratchet up over time.
  • Keep rsfusa verify non-blocking — it's a real upstream rust-FuSa bug (cargo test -- --test-output=immediate, a libtest flag that doesn't exist) — but make the skip loud via a ::warning:: annotation instead of a silent || true.
  • Fix a doc comment in integration_test.rs whose literal //fusa:test substring was being parsed by rsfusa trace as a malformed annotation.
  • Add release.yml: attach sbom.json/provenance.json/artifact-manifest.json to the GitHub Release on publish.
  • Update tool-qualification/rsfusa-tql2.md's version/qualification-method claims to match reality.

Closes #13, #14, #15, #16, #17, #18, #19, #21.

Test plan

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --locked (46 unit/integration + 2 doc tests)
  • cargo build --release --bin rust-lin --locked
  • Full local rehearsal of every safety-job rsfusa command in CI order, from a clean checkout: lint, analyze, check --strict (exit 0, 0 errors/0 warnings), check --format sarif, comp, trace, fmea, tara, cyber, coupling, boundary, hara show (0 findings), qualify (badge: self-qualified), release, safety-case (0 missing required evidence), iso26262 (13/13 objectives satisfied, 0 gaps), audit-pack — all genuinely pass, not masked.
  • CI (will poll after opening)

The rust-FuSa CLI (rsfusa) was pinned to a stale v0.3.10 while the config
schema, HARA schema, and stub-detection rules it enforces had moved on
several releases (v0.3.11-v0.3.14). Every core safety command in CI was
failing on a config parse error and being masked green by `|| true` on
every step, so the "ASIL-B safety (rust-FuSa)" job had been running none
of its actual workload for some time.

- Bump the rsfusa pin to v0.3.14 (current latest release) in both
  ci.yml and the new release.yml.
- Fix .fusa.json to the current config schema (configVersion/project
  object/standard) so rsfusa can parse it at all (#13, #19).
- Rewrite .fusa-hara.json to the current operationalSituations/hazards/
  safetyGoals schema, with ASIL letting the tool derive it from S/E/C
  against the literal ISO 26262-3 Table 4 rather than a hand-typed value
  (several hazards' previously-claimed ASIL-B did not actually match
  their own S/E/C under the real table) (#14).
- Add the 15 REQ-VIRT-013..019 / REQ-MASTER-006..013 requirement IDs
  that were tagged in code/tests but missing from .fusa-reqs.json and
  requirements.json (#18).
- Remove `|| true` from every safety-job step now that its root cause
  (the config parse failure) is fixed, so a real regression fails CI
  instead of being silently swallowed (#13).
- Fix real `check --strict` findings the newer rsfusa content-quality
  rules surface instead of suppressing them: replace production-code
  .unwrap() with .expect("..."), replace test-code .unwrap() with
  .expect() carrying a rationale (rule LINT002's own remediation),
  reduce several genuine nesting-depth hot spots (rule ANA002) by
  extracting helper functions, add `#![forbid(unsafe_code)]` (LINT006),
  and annotate/fix the truncating-cast sites the tool flags (ANA005) —
  including making an LDF frame-ID parse fail cleanly instead of
  silently truncating out-of-range IDs.
- Add the missing `rsfusa coupling` step (ISO 26262-6 §6.4.4 evidence
  the gap report requires but CI never generated).
- Gate CI on `rsfusa safety-case`'s missing-required-evidence warning
  and on `rsfusa qualify`'s qualification badge, and reorder the safety
  job so qualify/release run before safety-case/iso26262 (both check
  for qualify-report.json/sbom.json's presence) (#15).
- Supply `rsfusa qualify` real qualification metadata
  (--qualification-method self --qualifier ... --record-uri ...) so the
  badge reflects the project's actual self-qualification process
  instead of always reading "unqualified" regardless of pass rate (#15).
- Fix the coverage step's broken percentage extraction and turn the
  claimed "must be >= 90%" comment into a real gate at the current
  ~85% baseline, to be ratcheted up over time (#16).
- Keep `rsfusa verify` non-blocking (a real upstream rust-FuSa bug: it
  invokes `cargo test -- --test-output=immediate`, a libtest flag that
  does not exist) but make the skip loud via a `::warning::` annotation
  instead of a silent `|| true` (#13).
- Fix a doc comment in integration_test.rs whose literal `//fusa:test`
  substring was being parsed by `rsfusa trace` as a malformed
  annotation.
- Add release.yml: attach sbom.json/provenance.json/artifact-manifest.json
  to the GitHub Release on publish, so supply-chain evidence is
  discoverable per-release instead of only inside an ephemeral CI
  workflow-run artifact bundle (#17).
- Update tool-qualification/rsfusa-tql2.md's version/qualification-method
  claims to match reality.

Closes #13, #14, #15, #16, #17, #18, #19, #21.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
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.

ci: entire rsfusa safety-analysis pipeline fails on config parse error, masked green by || true on every step

1 participant