Skip to content

fix: standardize safety validation (Phase 2 audit remediation)#21

Merged
geoffmcc merged 1 commit into
mainfrom
fix/phase2-standardize-safety-validation
Jul 19, 2026
Merged

fix: standardize safety validation (Phase 2 audit remediation)#21
geoffmcc merged 1 commit into
mainfrom
fix/phase2-standardize-safety-validation

Conversation

@geoffmcc

Copy link
Copy Markdown
Owner

Summary

Adds file size validation in the parser and documents existing safety validation consistency.

Changes

  • src/alscan/parser.py: Added file size checks (rejects empty and too-small files before XML parsing)
  • src/alscan/services.py: Added docstring clarifying validate_output_dest() includes validate_parent()

Audit Findings Fixed

  • F7: Parser now validates file size before parsing ✅
  • F9: Already consistent — validate_output_dest() includes validate_parent() (documented) ✅
  • F14: Already fixed — validate_three_way() already checks file existence ✅

Testing

  • 765 tests passed
  • 2 pre-existing failures (unrelated script-as-module tests)

Phase 2 of 6

This is Phase 2 of the audit remediation roadmap.

- Add file size validation in parser.py (rejects empty/too-small files)
- Document that validate_output_dest includes validate_parent
- Verify F9 and F14 already addressed in existing code

Fixes F7, F9, F14 from audit intake.
@geoffmcc
geoffmcc merged commit 423ba5d into main Jul 19, 2026
5 checks passed
@geoffmcc
geoffmcc deleted the fix/phase2-standardize-safety-validation branch July 19, 2026 02:33
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