Skip to content

rest: pin cacheControlWriter.FlushError errors.Is discriminator (#172)#182

Merged
SyniRon merged 2 commits into
developfrom
agent/issue-172
Jun 7, 2026
Merged

rest: pin cacheControlWriter.FlushError errors.Is discriminator (#172)#182
SyniRon merged 2 commits into
developfrom
agent/issue-172

Conversation

@SyniRon

@SyniRon SyniRon commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #172.

Test-only pin closing a surviving mutant in cacheControlWriter.FlushError: the stamp-rollback discriminator errors.Is(err, http.ErrNotSupported) had no test witnessing the genuine-error direction — broadening it to err != nil passed the whole suite. Two new subtests assert a genuine (plain and wrapped) flush error KEEPS the Cache-Control stamp and the commit latch holds against a later WriteHeader. Mirrors the #164 sentry pin, reuses its flushErrorWriter fake.

Second commit annotates the live-map observation exception (a delegate-intercepted flush reaches no recorder WriteHeader, so the live map is the only valid pre-404 read — rr.Result() would memoize and blind the latch check).

Reviewed (code/test/comment agents) + mutation-verified: the err != nil broadening dies at both assertion sites. Gate green (build/vet/test/-race).

Follow-up #178 filed for two adjacent unwitnessed mutants in the same rollback block.

🤖 Generated with Claude Code

SyniRon and others added 2 commits June 7, 2026 15:28
Mutation-surfaced gap (wave-1 review of #164/PR #169, sibling of the #163
rollback pin): broadening the rollback discriminator from
errors.Is(err, http.ErrNotSupported) to err != nil passed the entire
suite. The dangerous direction is a stamp rollback after a flush whose
commit really happened — a genuine I/O error returns only after net/http
has snapshotted the headers onto the wire, so the stamp and the latch
must KEEP.

Mirrors TestSentry_PanicAfterGenuineFlushErrorKeepsRepanicSemantics:
reuse flushErrorWriter (sentry_test.go, same package — reciprocal to
sentry_test.go's use of noFlushWriter) as the delegate, drive a plain
and a wrapped non-refusal flush error through the chain, assert the
stamp keeps on the live map and a trailing 404 cannot reopen the
latched commit decision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment-only. The file-header doctrine said stamp-presence reads
rr.Result().Header; the #172 battery necessarily violates it —
flushErrorWriter intercepts the flush before any WriteHeader reaches the
recorder, so no snapshot exists and rr.Result() memoization would blind
the post-404 cannot-reopen check. Document the exception at both the
doctrine and the assertion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@SyniRon
SyniRon merged commit 3bc9055 into develop Jun 7, 2026
3 checks passed
@SyniRon
SyniRon deleted the agent/issue-172 branch June 7, 2026 21:53
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.

rest: cacheControlWriter.FlushError errors.Is discriminator is unpinned

1 participant