Skip to content

Use softassert for "dirty mutable state" log#10191

Open
stephanos wants to merge 1 commit intomainfrom
stephanos/cache-dirt-softassert
Open

Use softassert for "dirty mutable state" log#10191
stephanos wants to merge 1 commit intomainfrom
stephanos/cache-dirt-softassert

Conversation

@stephanos
Copy link
Copy Markdown
Contributor

@stephanos stephanos commented May 7, 2026

What changed?

Make "dirty mutable state" an invariant.

Why?

The situation describes a bug that needs to be flagged; not just a transient error.

NOTE: the softassert.Fail still emits the same error log, but with a failed assertion: prefix.

So failed assertions can be searched/grouped via the FailedAssertion tag.
The trailing panic is intentionally left in place; this commit only
changes the logger.Error call to softassert.Fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@stephanos stephanos marked this pull request as ready for review May 7, 2026 16:40
@stephanos stephanos requested review from a team as code owners May 7, 2026 16:40
Copy link
Copy Markdown
Contributor

@chrsmith chrsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will keep the same log (slightly reworded) and potentially fail loudly in test environments? Sounds good to me.

... I'll admit I don't know what dirty mutable state means in this context. But it sounds bad :)

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.

2 participants