Skip to content

A Per-Severity Findings Line Is Read as Its First Number, Zeroing the Withheld-Finding Check #1699

Closed

Description

@ptr727

stated_total reads only the first number on a ccr-overview-v2 round's **Findings:** line, and that line states a count per severity rather than one total. The reading feeds unlisted_findings, whose whole purpose is to catch a finding a round states and opens no thread for, so the undercount zeroes that check in exactly the case it exists for.

The line's real shape

Measured on this repository's own corpus, badges collapsed to their severity:

1694 095da786   **Findings:** 2 [Medium] · 3 [Low]      marker: findings=5, section: Open (5)
1696 9ff38fe7   **Findings:** 1 [Low]                   marker: findings=1, section: Open (1)
1694 8783f4ef   **Findings:** None                      marker: findings=0

The first round states five findings as two numbers joined by a middle dot. CCR_FINDINGS is ^ {0,3}\*\*Findings:\*\*\s*(\d+|[Nn]one), anchored to the line start, so it captures 2 and never sees the 3. stated_total takes the maximum over the preamble's matches, which does not help: there is one match on that line.

Demonstrated against the function

case                                                       stated_total   true
single severity                                                       1      1
none                                                                  0      0
two severities, the shape 095da786 carried                            2      5   <-- undercount
two severities, low first                                             1      5   <-- undercount

Why it matters, rather than being cosmetic

unlisted_findings is max(0, stated - threads). A round stating 3 [Medium] · 2 [Low], five findings, that opens three threads and withholds two is read as stated=3, threads=3, so the shortfall is 0 and FINDINGS WITH NO THREAD never prints. That is the false green the field was added to prevent, and it fires on any round carrying more than one severity.

On 095da786 itself nothing was lost, since that round opened a thread for all five, so 2 - 5 floors to zero either way. The exposure is a multi-severity round that also withholds, which this corpus has not produced yet.

Shape of the work

  • Read every count badge pair on the line and sum them, rather than the first number alone. The severities observed are Medium and Low, and the separator observed is a middle dot, but the sum should come from counting the pairs rather than from splitting on a separator, since the separator is presentation.
  • Keep None as a stated zero, which it already is, and keep the preamble scoping and the largest-wins rule for a body stating more than one total.
  • A case per shape: one severity, two severities in each order, None, and a line whose number is followed by no badge at all.
  • Whether the marker's own findings=N should be preferred over the prose line where both are present is a separate question. On this corpus the marker agrees with the section count in every round that carries one, and the prose line is the only source when it does not.

Found while measuring #1692, which is about the same format's coverage statement rather than its finding total.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions