feat: v0.5.47 — x-FuSa spec v1.15.0 adoption + deep-audit bug-fix sprint - #81
Merged
Conversation
Closes issues #73-80 filed by a deep-audit pass that ran c-FuSa against its own codebase and diffed real output against the x-FuSa master spec. - HARA006 check rule + hara --format json completeness.asilMismatches: risk.asil is now cross-checked against the ISO 26262-3 Table 4 S x E x C derivation as a gating Finding, not just a hara-show text warning (#74). - hara --format json is now a verbatim passthrough of hazards[].source/ situations/safetyGoals, safetyGoals[].hazards/safeState, and the document attestation (#73). - fmea/tara/sci file/location.file are project-relative (including subdirectory) instead of a bare basename or a leaked absolute path, regardless of whether --dir is given relative or absolute (#77). - fmea/tara content generators no longer pick up standard-library calls or string-literal text as project components/assets — 18% of this repo's own previously-committed fmea.json was stdlib noise (#78). - fmea/tara 'standard' now emits the canonical lowercase id (iso26262/ iso21434) instead of a citation string (#75). - tara impact.* uses the v1.14.1 closed enum (critical/major/moderate/ negligible); risk is derived from the spec's combination table instead of an ad hoc score (#76). - cfusa fmea --output <file> — previously undefined, so getopt_long's prefix matching silently treated it as an abbreviation of --output-dir (#79). - summary.coveragePct defensive clamp on fmea/tara, with regression tests using a non-trivial test-source tree (#80 point 3). - Shared cfusa_is_test_source_file()/cfusa_extract_call_name()/ cfusa_is_stdlib_call()/cfusa_relativize_path() utilities, replacing near-duplicate per-command scanners (#80 point 2's reuse guidance). - cfusa_walk_sources() now skips any build/build-*/build_* directory (matching this repo's own .gitignore), not just a fixed name enum — found while dogfooding the fmea/tara fix against this repo's own local build trees, which were being scanned as project source. Regenerated fmea.json/fmea.csv/tara.json/tara.md/safety-case.json/ safety-case.md against the fixes above. Attestation carry-forward (spec v1.15.0 point 1) was already conformant for fmea/tara/safety-case/sas before this PR; only hara's own JSON passthrough had a gap, closed above. Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
There was a problem hiding this comment.
cfusa found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This was referenced Jul 28, 2026
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.
Summary
Closes #73, #74, #75, #76, #77, #78, #79. Adopts the actionable parts of #80
(x-FuSa spec v1.15.0).
Fixes found and verified by running
cfusa fmea/cfusa tara/cfusa hara/cfusa sciagainst c-FuSa's own codebase and diffing real output againstdocs/x-fusa-spec.mdin FuSaOps (the master spec):hara --format jsonis now a verbatim passthrough ofhazards[].source/situations/safetyGoals,safetyGoals[].hazards/safeState,and the document
attestation— previously silently dropped.risk.asilis now cross-checked against the ISO 26262-3Table 4 S×E×C derivation both as a new gating
checkrule (HARA006) andin
hara --format json'scompleteness.asilMismatches— previously only ahara show(text) warning line with no effect on any exit code.fmea.json/tara.jsonstandardnow emits the canonical lowercaseid (
iso26262/iso21434) instead of a citation string.tara.jsonimpact.*now uses the v1.14.1 closed enum(
critical|major|moderate|negligible);riskis a literal lookup againstthe spec's combination table instead of an ad hoc score.
fmea/tara/scifile/location.fileare project-relative(including subdirectory) instead of a bare basename or a leaked absolute
path, regardless of whether
--diris relative or absolute.fmea/tarano longer pick up standard-library calls orstring-literal text as project components/assets — 18% of this repo's own
previously-committed
fmea.jsonwas stdlib noise (fprintf/snprintf/...),plus a string-literal misparse that produced a
"strcpy-prefixed asset name.cfusa fmea --output <file>— previously undefined, sogetopt_long's unambiguous-prefix matching silently treated it as anabbreviation of
--output-dir.summary.coveragePctdefensive clamp onfmea/tara,with regression tests using a non-trivial test-source tree fixture.
Point 2 (reuse test-tree/stdlib exclusion logic): new shared
cfusa_is_test_source_file()/cfusa_extract_call_name()/cfusa_is_stdlib_call()utilities replace three near-duplicate scanners.Point 1 (attestation carry-forward MUST): already conformant for
fmea/tara/safety-case/sasbefore this PR — onlyhara's own JSONpassthrough had a gap, closed by hara --format json is not a verbatim passthrough of .fusa-hara.json — drops cross-references and attestation #73 above.
Bonus fix found while dogfooding
cfusa_walk_sources()only skipped a fixed directory-name enum(
build/vendor/build-cov/node_modules). A local working tree with otherbuild-type variants side by side (
build-asan,build_fortify, ...) hadevery one of them scanned as project source too, picking up CMake's own
generated
CompilerIdCprobe as fake FMEA/TARA entries. Now skips anybuild/build-*/build_*directory, matching this repo's own.gitignore.Also fixed a real bug found while writing tests:
cfusa_relativize_path()deliberately does not call
realpath()— sincecfusa_walk_sources()always builds
pathby literally concatenating the given--dir, resolvingsymlinks first can silently break the prefix match (macOS aliases
/tmpto/private/tmp).Regenerated
fmea.json/fmea.csv/tara.json/tara.md/safety-case.json/safety-case.mdagainst the fixes above (dogfooding, same convention asv0.5.46).
Test plan
ctest --test-dir build --output-on-failure— 39/39 passing, including13 new regression tests in
tests/test_xfusa_v114.cand 2 newHARA006tests intests/test_safety_rules.ccfusa fmea --dir . --strict/cfusa tara --dir . --strictexit 0against this repo's own regenerated artifacts
cfusa trace --dir . --gapsshows the same 5 pre-existing gaps as themainbaseline (no new untested requirements)cfusa check --dir .shows the same 9 pre-existing errors as themainbaseline (no new findings introduced)cfusa coverage --lcov ... --threshold 80):91.4% line coverage, well above the CI gate
/tmpsymlink relativization case manually and viaa dedicated regression test