Repository navigation
feat: attestation, FUSA-STUB001/002 detection, and coverage-gate wiring - #85
Merged
Merged
Conversation
…e-gate wiring (x-FuSa spec §1.6.1/§1.6.2)
Closes out the enforcement mechanism from spec v1.14.0 against
FuSaOps' own artifacts, on top of the schema conformance work in
v1.140.0.
- New root-package Attestation type + AttestationValid/ContentHash
helpers -- a DCO-style provenance record reusing the vv package's
independence concept (independent reviewer distinct from
implementation author, hash-pinned to the exact content reviewed).
- New qualitybar package implementing both section 1.6.1 detection
rules: DetectPlaceholder (FUSA-STUB001, always ERROR,
disposition-suppressible only) and DetectBlankFallback
(FUSA-STUB002, a distinct-value-ratio WARNING, advisory by default,
suppressible only by a valid attestation).
- fmea/tara/safetycase/sas/hara each gain an Attestation field (nil
by default -- no fabricated reviews) and an AttestationContentHash
function.
- cmd_{fmea,tara,safety_case,sas,hara}.go run both detection rules,
gate the exit code (FUSA-STUB002 only under the new
--require-attestation/--strict flags), and carry a prior run's
attestation forward across regeneration since Build always
assembles a fresh document. Staleness is automatic via hash
mismatch.
- fmea/tara Summary gains coveragePct + a stated denominator
methodology, plus --min-coverage N.
- Regenerated fmea.json/tara.json/safety-case.json.
- 11 new requirements registered.
Signed-off-by: SoundMatt <SoundMatt@users.noreply.github.com>
Signed-off-by: SoundMatt <SoundMatt@users.noreply.github.com>
| Value string | ||
| } | ||
|
|
||
| var placeholderBracketRE = regexp.MustCompile(`\[[A-Za-z ][^\]]*\]`) |
| var placeholderBracketRE = regexp.MustCompile(`\[[A-Za-z ][^\]]*\]`) | ||
|
|
||
| // placeholderSubstrings mirrors the x-FuSa spec §1.6.1 Rule A deny-list. | ||
| var placeholderSubstrings = []string{ |
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
Follow-on to v1.140.0 (schema conformance). That PR brought FuSaOps' own hara/fmea/tara/safetycase/sas/sci into x-FuSa spec conformance; this one implements the actual enforcement mechanism the spec defines (§1.6.1 detection heuristics, §1.6.2 attestation) and wires it into the CLI.
New root-package
Attestationtype (attestation.go) — a DCO-style provenance record:status/implementationAuthor/independentReviewer/reviewedAt/contentHash.AttestationValidchecks non-staleness (hash match) and genuine independence (reviewer ≠ author), reusing the exact independence concept already in thevvpackage.New
qualitybarpackage implementing both §1.6.1 rules:DetectPlaceholder—FUSA-STUB001, deny-list scan for literal template text, alwaysERROR, disposition-suppressible only (no attestation can make placeholder text real).DetectBlankFallback—FUSA-STUB002, distinct-value-ratio <0.1 across ≥10 entries, aWARNINGby default, not gating — deliberately advisory since a similarity heuristic can misread genuinely repetitive-but-real content as templated.Both reuse
fusaops.Finding/fusaops.ComputeFingerprint— no new finding shape, no new suppression mechanism for Rule A (uses the existing disposition path).Wired into all 5 relevant commands (
fmea/tara/safety-case/sas/hara):--require-attestation/--strictflags — a valid attestation suppressesFUSA-STUB002; without the flag it stays advisory (the "DCO checkbox" pattern: nothing blocks by default, opt into a hard gate, satisfied by an honest attestation not by gaming the heuristic).Buildalways assembles a fresh document, a hand-added attestation would otherwise be silently discarded every run. Each command now loads any prior saved report, carries itsAttestationforward onto the freshly-built struct, and staleness is automatic — if the regenerated content's hash no longer matches,AttestationValidcorrectly returns false.Coverage metrics —
fmea/taraSummarygainscoveragePctagainst a stated, honest denominator (componentsInProject/assetsInProject+ a*InventoryMethodstring documenting how it was counted) and--min-coverage N. FMEA is 19.5% (8 of 41 tracked FuSaOps packages); TARA is 80% (8 of its own 10 known evidence artefacts) — reported plainly, not inflated.FuSaOps' own artifacts never carry a fabricated
"reviewed"attestation (they're 100% auto-generated) —Attestationstaysnil/omitted throughout.Test plan
go build ./.../go vet ./.../gofmt -l .— cleango test ./...— all packages pass, zero regressionsqualitybarpackage: 100% coverage--min-coveragegating and--require-attestation/--strictflag parsingfmea.json/tara.json/safety-case.jsonand inspected output