Skip to content

fix(review): gracefully invalidate contradictory polarity findings and eliminate escape sequence syntax warnings (#635) - #636

Merged
dan-petty merged 1 commit into
release/v0.2.23from
fix/635-polarity-validation-crash-escape-warning
Sep 27, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.23from
fix/635-polarity-validation-crash-escape-warning

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Fixes #635.

  • In Finding._validate_polarity, gracefully handle contradictory polarity findings (observed_value == expected_value) by marking them status="INVALIDATED", reportable=False, verified=False, and verified_by="deterministic:verdict_polarity" with descriptive invalidation_reason instead of raising ValueError.
  • Gracefully handle single-sided polarity assertions by clearing orphan polarity fields so findings can be evaluated on their general merits without failing schema validation.
  • In ReviewResult, add defensive mode="before" validator on findings to ensure items are dicts or Finding instances.
  • In _parse_stringified_collection, try json.loads first (RFC 8259 validly escapes forward slashes as \/) and catch SyntaxWarning when falling back to ast.literal_eval, eliminating <unknown>:1: SyntaxWarning: "\/" is an invalid escape sequence.
  • Comprehensive test coverage in tests/test_verdict_polarity.py validating graceful invalidation, orphan polarity cleanup, ReviewResult.model_validate deserialization across mixed findings, and escape sequence handling without warnings.
  • All 10 Gated CI quality gates passing locally (uv run devops ci).

…d eliminate escape sequence syntax warnings (#635)
@dan-petty
dan-petty marked this pull request as ready for review September 27, 2026 07:53
@dan-petty
dan-petty merged commit cf0b2ef into release/v0.2.23 Sep 27, 2026
8 checks passed
@dan-petty
dan-petty deleted the fix/635-polarity-validation-crash-escape-warning branch September 27, 2026 13:08
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.

1 participant