Skip to content

fix: fusa-asil-b CI gate — pin cpp-FuSa v0.17.1, stop wiping requirements, enforce real gap thresholds - #30

Open
SoundMatt wants to merge 1 commit into
mainfrom
fix/fusa-asil-b-ci-gate
Open

fix: fusa-asil-b CI gate — pin cpp-FuSa v0.17.1, stop wiping requirements, enforce real gap thresholds#30
SoundMatt wants to merge 1 commit into
mainfrom
fix/fusa-asil-b-ci-gate

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Problem

Three compounding problems in the fusa-asil-b (and sarif) CI jobs:

  1. cpp-FuSa pinned to v0.15.0 — missing conformance fixes through
    v0.17.1 that affect this repo's own generated evidence (sbom.json
    component hashes, safety-case completeness).
  2. cpfusa init --force ran first, before the traceability step,
    unconditionally overwriting the real, populated .fusa-reqs.json
    (50+ KB of hand-maintained REQ-* entries) with an empty scaffold —
    CI traceability coverage was always computed against zero
    requirements.
  3. ISO 26262 / IEC 61508 gap-analysis steps wrapped in || true
    could never fail the build regardless of gap count (15/20 and 12/18
    gaps at last real measurement), while README.md displayed a flat
    "ASIL-B" badge alongside.

Fix

  1. Pinned cpp-FuSa to v0.17.1 (current latest) in both jobs.
  2. Removed the cpfusa init step entirely from both jobs —
    .fusa.json/.fusa-reqs.json are already checked in and match what
    init would generate; the step is only needed for first-time local
    setup.
  3. Reordered the job so boundary/tara/fmea/safety-case/sas/
    sci run before the gap analyses (cpfusa grades some objectives
    on whether those artifacts already exist — this alone closed 2
    gaps), and replaced || true with an explicit gate: fail if the gap
    count regresses past a documented baseline (13 ISO 26262, 11 IEC
    61508). A "0 gaps" target isn't reachable with cpfusa v0.17.1 at
    all — several objectives have no evidence-detection logic in the
    tool and report Gap unconditionally — so the gate enforces
    non-regression rather than an unreachable absolute.

Found while investigating (2)

cpp-FuSa v0.17.0 started actually enforcing sourceDirs (previously
silently ignored per its own CHANGELOG). .fusa.json's sourceDirs
omitted tests and cli, so every fusa:test/fusa:req annotation
in those directories stopped being seen the moment the pin bumped —
test-coverage traceability would have silently dropped from 93.5% to
0%. Added both directories to sourceDirs, and registered 6 real,
already-annotated CLI requirements (REQ-CLI-001..006) that this
surfaced as dangling references.

README

Reworded the ASIL-B badge/description to "ASIL-B target (SEooC)" with
a pointer to the real gap-report artifacts, matching this repo's own
SAFETY_PLAN.md framing — the prior flat "ISO 26262 ASIL-B" claim
overstated completeness relative to the tool's own (now enforced) gap
reports.

Testing

Verified locally end-to-end against a clean checkout with a freshly
built cpfusa v0.17.1 (isolated clone, not the CI-cached one):
check/lint/trace/cyber/qualify/boundary/tara/fmea/
safety-case/sas/sci/badge/vuln/metrics/report all exit 0.
trace reports 135/144 (93.8%) annotated and tested with zero
dangling references. iso26262 gate passes at 13 gaps (at baseline).
iec61508 gate passes at 10 gaps (under the 11 baseline). Also ran a
full local build + ctest (171/171 passing) to confirm the non-CI
changes (.fusa.json, requirements JSON, README) don't affect the
library build.

Closes #19, #20, #21

…ents, enforce real gap thresholds

Three compounding problems in the fusa-asil-b (and sarif) CI jobs:

1. cpp-FuSa was pinned to v0.15.0, missing conformance fixes through
   v0.17.1 that affect this repo's own generated evidence (sbom.json
   component hashes, safety-case completeness — see cpp-FuSa's
   CHANGELOG v0.17.0 entry). Both jobs now pin v0.17.1.

2. `cpfusa init --force` ran as the first step in both jobs, before the
   traceability step, unconditionally overwriting the real, populated
   `.fusa-reqs.json` (50+ KB of hand-maintained REQ-* entries) with an
   empty scaffold. CI traceability coverage was always computed against
   zero requirements regardless of the repo's actual state. Removed the
   step entirely — `.fusa.json`/`.fusa-reqs.json` are already checked
   in and match what `init` would have generated; the step is only
   needed for first-time local setup.

3. The ISO 26262 / IEC 61508 gap-analysis steps were wrapped in
   `|| true`, so they could never fail the build regardless of gap
   count (15/20 and 12/18 gaps at last real measurement). Two changes:

   - Reordered the job so boundary/tara/fmea/safety-case/sas/sci run
     BEFORE the gap analyses: cpfusa grades several objectives (e.g.
     §9-2.1 Safety case, §10.4 SCI) on whether safety-case.json/
     sci.json already exist, so gap-checking first was undercounting
     what the repo actually addresses. This alone closed 2 gaps.
   - Replaced `|| true` with an explicit, intentional gate: fail the
     build if the gap count regresses past the current, documented
     baseline (13 for ISO 26262, 11 for IEC 61508). A "0 gaps" target
     is not reachable with cpfusa v0.17.1 regardless of this repo's
     actual documentation completeness — several objectives (e.g. §6.1
     Software architectural design, §8-6.2 Safety manual) have no
     evidence-detection logic implemented in the tool at all and report
     Gap unconditionally (cpp-FuSa src/iso26262/iso26262.cpp's
     detect_status()). The gate at least makes future regressions
     visible instead of being structurally unable to fail.

Also fixed independently while investigating (2), a real bug the fix
exposed: cpp-FuSa v0.17.0 started actually enforcing `sourceDirs`
(previously ignored per its own CHANGELOG), and `.fusa.json`'s
sourceDirs (["src", "include"]) omitted "tests" and "cli" — so every
`fusa:test`/`fusa:req` annotation in those directories silently stopped
being seen by `trace`, dropping real test-coverage traceability from
93.5% to 0% the moment the pin bumped. Added both directories to
sourceDirs, and registered 6 real, already-annotated CLI requirements
(REQ-CLI-001..006, both impl- and test-annotated in cli/ and
tests/test_cli.cpp already) that this surfaced as dangling references
in requirements/requirements.json and .fusa-reqs.json.

README's ASIL-B badge/description is reworded to "ASIL-B target
(SEooC)" with a pointer to the real gap-report artifacts, per this
repo's own SAFETY_PLAN.md framing — the prior flat "ISO 26262 ASIL-B"
claim overstated completeness relative to the tool's own (now
enforced) gap reports.

Verified locally end-to-end against a clean checkout with a freshly
built cpfusa v0.17.1: check/lint/trace/cyber/qualify/boundary/tara/
fmea/safety-case/sas/sci/badge/vuln/metrics/report all exit 0; trace
reports 135/144 (93.8%) annotated and tested with zero dangling
references; iso26262 gate passes at 13 gaps (baseline); iec61508 gate
passes at 10 gaps (under the 11 baseline).

Closes #19, #20, #21

Signed-off-by: Matt <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

Development

Successfully merging this pull request may close these issues.

fusa-asil-b CI job's cpfusa init --force wipes the real .fusa-reqs.json before traceability runs, so coverage is always reported as 0%

1 participant