feat: v0.32.0 — HLR/LLR, tool qualification, MC/DC, V&V independence - #39
Merged
Conversation
…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>
| // 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) { |
|
|
||
| //fusa:test REQ-COV015 | ||
| func TestParseMCDCFile_NotFound(t *testing.T) { | ||
| _, err := coverage.ParseMCDCFile("/nonexistent/mcdc.json", coverage.DALA, 100) |
| // 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 { |
| } | ||
|
|
||
| //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>
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
Implements 4 safety features as the canonical go-FuSa reference that sibling x-FuSa tools will follow.
tracepackage):Requirement.ParentIDfield;HLRLLRSummary;ComputeHLRLLR(); engine rule TRACE008 (orphaned LLRs + uncovered HLRs); WARNING by default, ERROR at ASIL-D;--strict-hlr-llrCLI gate; text/json/md renderers updated.qualifypackage):QualificationMethod,QualificationRecordUri,QualifierIdentityfields;QualificationBadge()method;--qualification-method,--qualifier,--record-uriCLI flags; badge in output.coveragepackage):MCDCCondition/MCDCRecord/MCDCFunctionResult/MCDCReporttypes;ParseMCDC()/ParseMCDCFile()parse LLVM MC/DC JSON;--mcdc,--mcdc-file,--mcdc-thresholdCLI flags; coverage gate.qualifypackage):ImplementationAuthor,IndependentReviewer,IndependentTestExecutor,AchievableASILfields;IndependenceStatus()method; matching CLI flags.7 new requirements registered (REQ-TRACE008, REQ-QUALIFY007, REQ-QUALIFY008, REQ-COV001–003, REQ-COV015). Total: 190.
Test plan
go test -race -count=1 ./...TestComputeHLRLLR_*,TestTRACE008_*,TestBuild_HLRLLR*,TestRenderText_HLRLLR*