test(errors): assert typed refusal variants, not Display - #114
Open
mfw78 wants to merge 2 commits into
Open
Conversation
AI Assistance: Claude (Fable 5) used for the Refusal variant matcher and the assertion migration.
AI Assistance: Claude (Opus 5) used for the red-team pass and the assertion strengthening.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces Display-substring assertions on typed refusals with a
Refusalvariant matcher acrossnexum-runtimeandnexum-sdktest suites, and strengthens the value-carrying cases to assert the underlying field rather than just the variant.Why
Closes #52
Matching on
err.to_string().contains("...")couples tests to user-facing wording (the house style is Oxford British, so copy churns) and lets a wrong variant that happens to share a substring pass. Matching the typed variant, and destructuring the field where a value matters, ties the assertion to behaviour instead of prose.Testing
cargo nextest run -p nexum-runtime -p nexum-sdk -p nexum-module-macros
AI Assistance
Implementation: Claude (Fable 5). Red-team: Claude (Opus 5). PR: Claude (Sonnet 5).