Skip to content

feat: v0.32.0 — HLR/LLR, tool qualification, MC/DC, V&V independence - #39

Merged
SoundMatt merged 3 commits into
mainfrom
feat/hlr-llr-qualify-mcdc-vv
Jul 26, 2026
Merged

feat: v0.32.0 — HLR/LLR, tool qualification, MC/DC, V&V independence#39
SoundMatt merged 3 commits into
mainfrom
feat/hlr-llr-qualify-mcdc-vv

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Implements 4 safety features as the canonical go-FuSa reference that sibling x-FuSa tools will follow.

  • Feature 1 — HLR/LLR hierarchical traceability (trace package): Requirement.ParentID field; HLRLLRSummary; ComputeHLRLLR(); engine rule TRACE008 (orphaned LLRs + uncovered HLRs); WARNING by default, ERROR at ASIL-D; --strict-hlr-llr CLI gate; text/json/md renderers updated.
  • Feature 2 — Tool qualification display (qualify package): QualificationMethod, QualificationRecordUri, QualifierIdentity fields; QualificationBadge() method; --qualification-method, --qualifier, --record-uri CLI flags; badge in output.
  • Feature 3 — MC/DC coverage measurement (coverage package): MCDCCondition/MCDCRecord/MCDCFunctionResult/MCDCReport types; ParseMCDC()/ParseMCDCFile() parse LLVM MC/DC JSON; --mcdc, --mcdc-file, --mcdc-threshold CLI flags; coverage gate.
  • Feature 4 — V&V independence declaration (qualify package): ImplementationAuthor, IndependentReviewer, IndependentTestExecutor, AchievableASIL fields; IndependenceStatus() method; matching CLI flags.

7 new requirements registered (REQ-TRACE008, REQ-QUALIFY007, REQ-QUALIFY008, REQ-COV001–003, REQ-COV015). Total: 190.

Test plan

  • All 42 packages pass go test -race -count=1 ./...
  • TRACE008 positive/negative qualification cases added to builtin suite
  • 8 TRACE008 unit tests across TestComputeHLRLLR_*, TestTRACE008_*, TestBuild_HLRLLR*, TestRenderText_HLRLLR*
  • 8 qualify unit tests for Features 2 and 4 (badge, independence status, JSON round-trip)
  • 8 MC/DC unit tests including covered/uncovered conditions, threshold gate, file I/O

…independence

Feature 1 (trace): Add Requirement.ParentID, HLRLLRSummary struct, ComputeHLRLLR()
function, and engine rule TRACE008. Detects orphaned LLRs (missing/invalid parentId)
and uncovered HLRs (no LLR children). WARNING severity by default, ERROR at ASIL-D.
New --strict-hlr-llr CLI flag gates on any violation. Text/JSON/markdown renderers
show HLR/LLR summary. Two TRACE008 qualify cases added.

Feature 2 (qualify): Report gains QualificationMethod, QualificationRecordUri,
QualifierIdentity fields and QualificationBadge() method. CLI flags
--qualification-method, --qualifier, --record-uri; badge shown in output.

Feature 3 (coverage): MCDCCondition, MCDCRecord, MCDCFunctionResult, MCDCReport types;
ParseMCDC() and ParseMCDCFile() parse LLVM MC/DC JSON exports. A condition is covered
when covered_true_count > 0 AND covered_false_count > 0. CLI flags --mcdc, --mcdc-file,
--mcdc-threshold added to gofusa coverage; gate fails below threshold.

Feature 4 (qualify): Report gains ImplementationAuthor, IndependentReviewer,
IndependentTestExecutor, AchievableASIL fields and IndependenceStatus() method.
CLI flags --implementation-author, --independent-reviewer, --independent-test-executor,
--achievable-asil; independence status shown in output.

Registry: 7 new requirements — REQ-TRACE008, REQ-QUALIFY007, REQ-QUALIFY008,
REQ-COV001, REQ-COV002, REQ-COV003, REQ-COV015. Total: 190.

All 42 packages pass go test -race -count=1 ./...

Signed-off-by: SoundMatt <SoundMatt@users.noreply.github.com>
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Comment thread coverage/coverage.go
// ParseMCDC parses LLVM MC/DC coverage JSON bytes and returns an MCDCReport.
//
//fusa:req REQ-COV015
func ParseMCDC(data []byte, dal DAL, sourceFile string, threshold int) (*MCDCReport, error) {
Comment thread coverage/coverage_test.go

//fusa:test REQ-COV015
func TestParseMCDCFile_NotFound(t *testing.T) {
_, err := coverage.ParseMCDCFile("/nonexistent/mcdc.json", coverage.DALA, 100)
Comment thread trace/trace.go
// It is a no-op (returns a zero-valued summary) when no requirements have Level set.
//
//fusa:req REQ-TRACE008
func ComputeHLRLLR(reqs []Requirement) *HLRLLRSummary {
Comment thread trace/trace.go
}

//fusa:req REQ-TRACE008
func (r *ruleHLRLLRDecomposition) Run(_ context.Context, projectRoot string, cfg *config.Config) ([]fusa.Finding, error) {
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Remove extra alignment spaces that gofmt does not preserve across
comment-separated declaration groups.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 9211521 into main Jul 26, 2026
16 checks passed
@SoundMatt
SoundMatt deleted the feat/hlr-llr-qualify-mcdc-vv branch July 26, 2026 14:56
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.

2 participants