Skip to content

fix: hara risk.asil cross-validation + canonical standard id (v0.42.0) - #73

Merged
SoundMatt merged 1 commit into
mainfrom
fix/hara-asil-crosscheck-v3
Jul 28, 2026
Merged

fix: hara risk.asil cross-validation + canonical standard id (v0.42.0)#73
SoundMatt merged 1 commit into
mainfrom
fix/hara-asil-crosscheck-v3

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Rebase of #70 (closed — main moved to v0.41.0 after #69 merged, causing a version conflict). Same content as #70/originally #66, rebuilt via cherry-pick + squash onto current main, single properly-signed commit.

  • New engine rule HARA008 (+ exported hara.ValidateASIL, folded into hara.Validate so gofusa hara show's own gap list surfaces it) cross-checks every hazard's stored risk.asil against DetermineASIL(severity, exposure, controllability) per ISO 26262-3:2018 Table 4.
  • standard now uses the x-FuSa spec §2.4.1 canonical lowercase id (iso26262) instead of the display string "ISO 26262".

Closes #62, closes #61.

Test plan

  • go build ./...
  • go vet ./...
  • go test -race -count=1 ./...
  • golangci-lint run ./... (0 issues)

x-FuSa spec §1.2.5 requires risk.asil to be MUST-derived from S×E×C per
ISO 26262-3:2018 Table 4, but DetermineASIL was only ever applied as a
fallback for an *empty* value — an already-present risk.asil was accepted
verbatim, so a hand-edited or copy-pasted hazard could claim any ASIL
regardless of its own S/E/C inputs with zero findings from `hara show` or
`check` (go-FuSa#62). Add hara.ValidateASIL (wrapped by new engine rule
HARA008, and folded into hara.Validate so `hara show`'s own gap list
surfaces it too) to flag a stored risk.asil that disagrees with the
table, skipping hazards with an incomplete S/E/C rating (HARA002's job)
or no risk.asil set. Verified against this repo's own checked-in
.fusa-hara.json: all 5 hazards' declared ASILs already match their S/E/C.

Separately, x-FuSa spec §2.4.1 requires standard ids to use the
canonical lowercase form ("iso26262") everywhere, never a display string
("ISO 26262") — `hara init`'s default --standard flag value and the
repo's own checked-in .fusa-hara.json still used the legacy display form
(go-FuSa#61). Changed the default to "iso26262", normalised the checked-in
file, and added hara.Load normalisation of a legacy display-string value
for backward compatibility with hand-authored files predating this
convention (an unrecognised id is still passed through verbatim).

Signed-off-by: Matt Jones <matt@jellybaby.com>
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 47d13e3 into main Jul 28, 2026
16 checks passed
@SoundMatt
SoundMatt deleted the fix/hara-asil-crosscheck-v3 branch July 28, 2026 22:34
SoundMatt added a commit that referenced this pull request Jul 28, 2026
Resolves conflicts against main after #73 (hara, v0.42.0) merged on top of
#69 (tara enum vocabulary, v0.41.0). Bumped this branch's own release to
v0.43.0, reordered CHANGELOG.md entries to reflect actual merge order, and
regenerated fmea.json/fmea.csv/tara.json/tara.md with the fully-merged
binary so they reflect the path-relativization fix, the widened FMEA
templates, and the (already-merged) closed impact/risk enums together.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
SoundMatt added a commit that referenced this pull request Jul 28, 2026
…-forward-v2

Second round: main advanced to include #73 (hara, v0.42.0) since the
previous merge. This branch's own release was auto-merged to a stale
0.42.0 (textually identical to what main now already ships) with no
conflict — manually bumped it forward to v0.44.0 and reordered/deduped
the CHANGELOG.md entries to reflect the actual chronology.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Signed-off-by: Matt Jones <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

1 participant