Skip to content

fix: harden transaction numeric validation - #1

Open
cr-shah wants to merge 1 commit into
mainfrom
codex/harden-transaction-validation
Open

cr-shah wants to merge 1 commit into
mainfrom
codex/harden-transaction-validation

Conversation

@cr-shah

@cr-shah cr-shah commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Finding

Malformed numeric values in PaySim-compatible frames could escape the documented validation boundary as raw pandas exceptions. Fractional or out-of-range time steps were also accepted even though history features assume integer hours.

Fix

  • normalize numeric amount, step, and isFraud fields
  • reject non-finite, fractional, out-of-range, and non-binary values with DataValidationError
  • add regression coverage for malformed values and numeric CSV strings

Verification

  • tracked Python files: ruff check passed
  • full suite: 63 tests passed
  • focused validation suite: 20 tests passed
  • regenerated demo JSON, CSV, and PNG outputs match checked-in artifacts byte-for-byte

@cr-shah cr-shah added the bug Something isn't working label Sep 15, 2026

This branch has not been deployed

No deployments
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