Skip to content

do178: text-mode summary line prints negative GAP count (-1 GAP) on DAL-B report #86

Closed

Description

@SoundMatt

What's wrong

`gofusa do178` (v0.47.0, and reproduced back to at least v0.36.0) prints a nonsensical negative GAP count in its text-mode summary line for a DAL-B report:

```
DO-178C Gap Report
Project: go-LIN DAL: DAL-B Generated: 2026-07-29

Summary: 39 objectives 30 PASS -1 GAP 9 MANUAL 1 N/A 0 FAIL
```

Counting the actually-printed per-objective lines in that same report: 30 PASS, 7 MANUAL (not 9), 1 N/A, 0 FAIL — 30+7+1 = 38, leaving 1 real GAP, not -1. The header's own arithmetic (39 total - 30 PASS - 9 MANUAL - 1 N/A - 0 FAIL = -1) doesn't match what's actually enumerated below it; the "9 MANUAL" figure in the header appears to be counting something extra that isn't reflected in the individual ? [...] MANUAL lines.

Evidence it's the text renderer, not the underlying data

The same report via -format json has an internally consistent summary block with no negative values:

```
$ gofusa do178 -format json | jq .summary
{
"total": 37,
"satisfied": 23,
"partial": 7,
"gaps": 7
}
```

(Note even the total differs between text mode, 39, and json mode, 37 — the two renderers appear to be counting objectives differently, not just formatting the same numbers differently.)

Repro

Against github.com/SoundMatt/go-LIN main:

```
go install github.com/SoundMatt/go-FuSa/cmd/gofusa@v0.47.0
git clone https://github.com/SoundMatt/go-LIN
cd go-LIN
gofusa do178 # text summary shows "-1 GAP"
gofusa do178 -format json | jq .summary # internally consistent, no negatives
```

Why it matters

A negative count of unmet objectives in a DO-178C compliance report is nonsensical on its face and undermines confidence in the DO-178C evidence bundle specifically for anyone reading the text-mode report (which is what a human auditor is most likely to look at). It isn't currently caught by any go-FuSa self-check, and gofusa do178's own exit code doesn't reflect it either (exits 0 regardless).

Suggested fix

  • Reconcile the text-mode summary-line counters with the same counting logic already used for the -format json summary (or however the JSON summary's satisfied/partial/gaps/total map onto the text mode's PASS/GAP/MANUAL/N/A/FAIL categories) so both renderers agree, and neither can go negative.
  • Consider a self-test that asserts gofusa do178 -format text|json on the go-FuSa module's own project (dogfooding) produces non-negative summary counts, so this class of regression is caught in go-FuSa's own CI.

Found while doing a scheduled go-FuSa version-currency bump on github.com/SoundMatt/go-LIN (v0.36.0 → v0.47.0); see SoundMatt/go-LIN#53.

Activity

  1. SoundMatt commented on Jul 29, 2026

    @SoundMatt
    OwnerAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions