Skip to content

test(count): -1 means unknown, and nothing was holding it there - #16

Merged
Disble merged 1 commit into
mainfrom
test/the-unreadable-count
Aug 30, 2026
Merged

Disble merged 1 commit into
mainfrom
test/the-unreadable-count

Conversation

@Disble

@Disble Disble commented Aug 30, 2026

Copy link
Copy Markdown
Owner

The gate found six survivors on the previous merge, all the same one:
return -1 in the three places that read the count through an optional
interface. Mutated to 0 or -2, every test still passed.

release.go:301:11 → Integer Decrement (1 → 0)
internal/gatedreporter/gatedreporter.go:79:11 → Integer Increment (1 → 2)
internal/verbosereporter/verbosereporter.go:40:11 → Integer Decrement (1 → 0)

It is not a cosmetic constant. Zero means the scope produced nothing to judge,
which RunChanged now treats as nothing to do — so a decorator answering 0
for "I could not tell" would turn every genuinely failing run behind it into a
silent success. That is the exact defect the empty-scope fix was written to
avoid, reintroduced one layer down.

Pinned in both places now: the release's own reader over a reporter that cannot
count, and each decorator over one. The negative sentinel is deliberate and the
tests say why — a count cannot be negative, so no real answer collides with it.

No production code changed.

The gate found six survivors, all the same one: `return -1` in the three places
that read the count through an optional interface. Mutated to 0 or -2, every
test still passed.

It is not a cosmetic constant. Zero means "the scope produced nothing to judge",
which RunChanged now treats as nothing to do -- so a decorator that answered 0
for "I could not tell" would turn every genuinely failing run behind it into a
silent success. That is the exact defect the empty-scope fix was written to
avoid, reintroduced one layer down.

Pinned in both places: the release's own reader over a reporter that cannot
count, and each decorator over one. The negative sentinel is deliberate and now
says so -- a count cannot be negative, so no real answer collides with it.
@Disble Disble added the bug Something isn't working label Aug 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

@Disble
Disble merged commit 23a0f5f into main Aug 30, 2026
8 checks passed
@Disble
Disble deleted the test/the-unreadable-count branch August 30, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant